Remove duplicate code.
This commit is contained in:
parent
8942e68be5
commit
678cab6a91
|
@ -192,7 +192,7 @@
|
|||
<accel-groups>
|
||||
<group name="accelgroup1"/>
|
||||
</accel-groups>
|
||||
<signal name="destroy" handler="on_quit" swapped="no"/>
|
||||
<signal name="destroy" handler="quit" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox" id="box1">
|
||||
<property name="visible">True</property>
|
||||
|
@ -290,7 +290,7 @@
|
|||
<property name="use_stock">True</property>
|
||||
<property name="accel_group">accelgroup1</property>
|
||||
<accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
|
||||
<signal name="activate" handler="on_quit" swapped="no"/>
|
||||
<signal name="activate" handler="quit" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
10
ladi-player
10
ladi-player
|
@ -52,15 +52,12 @@ class LadiPlayer(LadiManagerGtk, LadiApp):
|
|||
def on_about(self, *args):
|
||||
LadiManagerGtk.on_about(self, parent=self.window_main, version=get_version_string())
|
||||
|
||||
def quit(self, *args):
|
||||
def quit(self, *args, **kwargs):
|
||||
self.global_config.set_config_section (self.appname,
|
||||
self.config_dict)
|
||||
self.global_config.save()
|
||||
Gtk.main_quit()
|
||||
|
||||
def on_quit(self, *args, **kwargs):
|
||||
self.quit()
|
||||
|
||||
def _run_select_studio_dialog(self, title, *args):
|
||||
studio_list = self.get_ladish_controller().studio_list()
|
||||
if not studio_list:
|
||||
|
@ -370,11 +367,12 @@ if __name__ == "__main__":
|
|||
'monitor JACK, as well as start some JACK related applications'),
|
||||
epilog=_('This program is part of the LADITools suite.'))
|
||||
parser.add_argument('--version', action='version', version="%(prog)s " + get_version_string())
|
||||
|
||||
parser.parse_args()
|
||||
GObject.threads_init()
|
||||
|
||||
GObject.threads_init()
|
||||
Gtk.init(None)
|
||||
|
||||
LadiPlayer().run()
|
||||
Gtk.main()
|
||||
|
||||
sys.exit(0)
|
||||
|
|
|
@ -28,5 +28,5 @@ class LadiApp(object):
|
|||
@property
|
||||
def appid(self): return self._appid
|
||||
|
||||
def activate(self): raise NotImplementedError
|
||||
def run(self): raise NotImplementedError
|
||||
def quit(self): raise NotImplementedError
|
||||
|
|
Loading…
Reference in New Issue