Philipp Hörist pushed to branch master at gajim / gajim
Commits: abe3fa1f by lovetox at 2020-10-16T21:28:16+02:00 Application: Better handle URIs passed via command line
- Don’t execut any startup logic in ::activate - HANDLES_OPEN does nothing when HANDLES_COMMAND_LINE is used
- - - - -
1 changed file:
- gajim/application.py
Changes:
===================================== gajim/application.py ===================================== @@ -66,7 +66,6 @@ class GajimApplication(Gtk.Application):
def __init__(self): flags = (Gio.ApplicationFlags.HANDLES_COMMAND_LINE | - Gio.ApplicationFlags.HANDLES_OPEN | Gio.ApplicationFlags.CAN_OVERRIDE_APP_ID) Gtk.Application.__init__(self, application_id='org.gajim.Gajim', @@ -158,7 +157,7 @@ class GajimApplication(Gtk.Application): self.add_main_option_entries(self._get_remaining_entry())
self.connect('handle-local-options', self._handle_local_options) - self.connect('command-line', self._handle_remote_options) + self.connect('command-line', self._command_line) self.connect('startup', self._startup) self.connect('activate', self._activate)
@@ -180,7 +179,6 @@ class GajimApplication(Gtk.Application): return [option]
def _startup(self, _application): - # Create and initialize Application Paths & Databases app.print_version() app.detect_dependencies() @@ -226,11 +224,6 @@ class GajimApplication(Gtk.Application): menubar = builder.get_object("menubar") self.set_menubar(menubar)
- def _activate(self, _application): - if self.interface is not None: - self.interface.roster.window.present() - return - from gajim.gui_interface import Interface self.interface = Interface() self.interface.run(self) @@ -244,6 +237,9 @@ class GajimApplication(Gtk.Application): ged.CORE, self._on_feature_discovered)
+ def _activate(self, _application): + self.interface.roster.window.present() + def _open_uris(self, uris): accounts = list(app.connections.keys()) if not accounts: @@ -310,8 +306,7 @@ class GajimApplication(Gtk.Application): app.storage.cache.shutdown() app.storage.archive.shutdown()
- def _handle_remote_options(self, _application, command_line): - # Parse all options that should be executed on a remote instance + def _command_line(self, _application, command_line): options = command_line.get_options_dict()
remote_commands = [
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/abe3fa1fe5618f08ab88408e0b8ca94bb...