Remove advanced commandline handling
Its enough to connect to the handle-local-options signal for what we currently want to do.
This commit is contained in:
		
							parent
							
								
									0b21c12c41
								
							
						
					
					
						commit
						417464d9c5
					
				
					 1 changed files with 5 additions and 9 deletions
				
			
		| 
						 | 
					@ -60,8 +60,7 @@ class GajimApplication(Gtk.Application):
 | 
				
			||||||
    '''Main class handling activation and command line.'''
 | 
					    '''Main class handling activation and command line.'''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self):
 | 
					    def __init__(self):
 | 
				
			||||||
        Gtk.Application.__init__(self, application_id='org.gajim.Gajim',
 | 
					        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,
 | 
					        self.add_main_option('version', ord('V'), GLib.OptionFlags.NONE,
 | 
				
			||||||
                             GLib.OptionArg.NONE,
 | 
					                             GLib.OptionArg.NONE,
 | 
				
			||||||
| 
						 | 
					@ -94,6 +93,8 @@ class GajimApplication(Gtk.Application):
 | 
				
			||||||
                             GLib.OptionArg.STRING_ARRAY,
 | 
					                             GLib.OptionArg.STRING_ARRAY,
 | 
				
			||||||
                             "")
 | 
					                             "")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        self.connect('handle-local-options', self._handle_local_options)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.profile = ''
 | 
					        self.profile = ''
 | 
				
			||||||
        self.config_path = None
 | 
					        self.config_path = None
 | 
				
			||||||
        self.profile_separation = False
 | 
					        self.profile_separation = False
 | 
				
			||||||
| 
						 | 
					@ -243,7 +244,8 @@ class GajimApplication(Gtk.Application):
 | 
				
			||||||
        from gajim.common import app
 | 
					        from gajim.common import app
 | 
				
			||||||
        app.logger.commit()
 | 
					        app.logger.commit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def do_handle_local_options(self, options: GLib.VariantDict) -> int:
 | 
					    def _handle_local_options(self, application,
 | 
				
			||||||
 | 
					                              options: GLib.VariantDict) -> int:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        logging_helpers.init()
 | 
					        logging_helpers.init()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -277,12 +279,6 @@ class GajimApplication(Gtk.Application):
 | 
				
			||||||
            return 0
 | 
					            return 0
 | 
				
			||||||
        return -1
 | 
					        return -1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def do_command_line(self, command_line: Gio.ApplicationCommandLine) -> int:
 | 
					 | 
				
			||||||
        Gtk.Application.do_command_line(self, command_line)
 | 
					 | 
				
			||||||
        if not command_line.get_is_remote():
 | 
					 | 
				
			||||||
            self.activate()
 | 
					 | 
				
			||||||
        return 0
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def show_warnings(self):
 | 
					    def show_warnings(self):
 | 
				
			||||||
        import traceback
 | 
					        import traceback
 | 
				
			||||||
        import warnings
 | 
					        import warnings
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue