Start Interface after remote cmdline handling

Because otherwise we would lose log information
from Interface, because logging levels are set after
startup
This commit is contained in:
Philipp Hörist 2017-02-11 23:31:06 +01:00
parent 271af70885
commit 5789c8a870
1 changed files with 7 additions and 12 deletions

View File

@ -230,20 +230,14 @@ class GajimApplication(Gtk.Application):
signal.signal(signal.SIGINT, sigint_cb)
signal.signal(signal.SIGTERM, sigint_cb)
log.info("Encodings: d:%s, fs:%s, p:%s", sys.getdefaultencoding(),
sys.getfilesystemencoding(), locale.getpreferredencoding())
from gui_interface import Interface
self.interface = Interface()
self.interface.run(self)
print("Encodings: d:{}, fs:{}, p:{}".format(sys.getdefaultencoding(),
sys.getfilesystemencoding(), locale.getpreferredencoding()))
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
from gui_interface import Interface
self.interface = Interface()
self.interface.run(self)
def do_shutdown(self, *args):
Gtk.Application.do_shutdown(self)
@ -285,6 +279,7 @@ class GajimApplication(Gtk.Application):
if options.contains('loglevel'):
string = options.lookup_value('loglevel').get_string()
logging_helpers.set_loglevels(string)
if not command_line.get_is_remote():
self.activate()
return 0