Commit e30527f8 authored by Philipp Hörist's avatar Philipp Hörist

Move Gajim startup code into do_startup

parent 819bee12
......@@ -44,6 +44,7 @@ class GajimApplication(Gtk.Application):
def __init__(self):
Gtk.Application.__init__(self, application_id='org.gajim.Gajim',
flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE)
self.add_main_option('version', ord('V'), GLib.OptionFlags.NONE,
GLib.OptionArg.NONE,
_('Show the application\'s version'))
......@@ -85,15 +86,6 @@ class GajimApplication(Gtk.Application):
def do_startup(self):
Gtk.Application.do_startup(self)
def do_activate(self):
# If a second instance starts do_activate() is called
# We bringt the Roster window to the front, GTK exits afterwards.
if self.interface:
self.interface.roster.window.present()
return
Gtk.Application.do_activate(self)
import gtkexcepthook
gtkexcepthook.init()
......@@ -205,6 +197,14 @@ class GajimApplication(Gtk.Application):
self.interface = Interface()
self.interface.run(self)
def do_activate(self):
Gtk.Application.do_activate(self)
# If a second instance starts do_activate() is called
# We bringt the Roster window to the front, GTK exits afterwards.
if self.interface:
self.interface.roster.window.present()
return
def do_shutdown(self, *args):
Gtk.Application.do_shutdown(self)
# Save the entropy from OpenSSL PRNG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment