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

View file

@ -230,20 +230,14 @@ class GajimApplication(Gtk.Application):
signal.signal(signal.SIGINT, sigint_cb) signal.signal(signal.SIGINT, sigint_cb)
signal.signal(signal.SIGTERM, sigint_cb) signal.signal(signal.SIGTERM, sigint_cb)
log.info("Encodings: d:%s, fs:%s, p:%s", sys.getdefaultencoding(), print("Encodings: d:{}, fs:{}, p:{}".format(sys.getdefaultencoding(),
sys.getfilesystemencoding(), locale.getpreferredencoding()) sys.getfilesystemencoding(), locale.getpreferredencoding()))
from gui_interface import Interface
self.interface = Interface()
self.interface.run(self)
def do_activate(self): def do_activate(self):
Gtk.Application.do_activate(self) Gtk.Application.do_activate(self)
# If a second instance starts do_activate() is called from gui_interface import Interface
# We bringt the Roster window to the front, GTK exits afterwards. self.interface = Interface()
if self.interface: self.interface.run(self)
self.interface.roster.window.present()
return
def do_shutdown(self, *args): def do_shutdown(self, *args):
Gtk.Application.do_shutdown(self) Gtk.Application.do_shutdown(self)
@ -285,7 +279,8 @@ class GajimApplication(Gtk.Application):
if options.contains('loglevel'): if options.contains('loglevel'):
string = options.lookup_value('loglevel').get_string() string = options.lookup_value('loglevel').get_string()
logging_helpers.set_loglevels(string) logging_helpers.set_loglevels(string)
self.activate() if not command_line.get_is_remote():
self.activate()
return 0 return 0
def frozen_logging(self, path): def frozen_logging(self, path):