Add debug commandline options
To easier simulate connectivity loss
This commit is contained in:
parent
8b7aae564b
commit
e664185845
|
@ -138,6 +138,21 @@ class GajimApplication(Gtk.Application):
|
||||||
GLib.OptionArg.NONE,
|
GLib.OptionArg.NONE,
|
||||||
_('Start a new chat'))
|
_('Start a new chat'))
|
||||||
|
|
||||||
|
self.add_main_option(
|
||||||
|
'simulate-network-lost',
|
||||||
|
0,
|
||||||
|
GLib.OptionFlags.NONE,
|
||||||
|
GLib.OptionArg.NONE,
|
||||||
|
_('Simulate loss of connectivity'))
|
||||||
|
|
||||||
|
self.add_main_option(
|
||||||
|
'simulate-network-connected',
|
||||||
|
0,
|
||||||
|
GLib.OptionFlags.NONE,
|
||||||
|
GLib.OptionArg.NONE,
|
||||||
|
_('Simulate regaining connectivity'))
|
||||||
|
|
||||||
|
|
||||||
self.add_main_option_entries(self._get_remaining_entry())
|
self.add_main_option_entries(self._get_remaining_entry())
|
||||||
|
|
||||||
self.connect('handle-local-options', self._handle_local_options)
|
self.connect('handle-local-options', self._handle_local_options)
|
||||||
|
@ -255,7 +270,8 @@ class GajimApplication(Gtk.Application):
|
||||||
# Parse all options that should be executed on a remote instance
|
# Parse all options that should be executed on a remote instance
|
||||||
options = command_line.get_options_dict()
|
options = command_line.get_options_dict()
|
||||||
|
|
||||||
remote_commands = ['ipython',
|
remote_commands = [
|
||||||
|
'ipython',
|
||||||
'show-next-pending-event',
|
'show-next-pending-event',
|
||||||
'start-chat',
|
'start-chat',
|
||||||
]
|
]
|
||||||
|
@ -268,6 +284,14 @@ class GajimApplication(Gtk.Application):
|
||||||
self.activate_action(cmd)
|
self.activate_action(cmd)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if options.contains('simulate-network-lost'):
|
||||||
|
app.interface.network_status_changed(None, False)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if options.contains('simulate-network-connected'):
|
||||||
|
app.interface.network_status_changed(None, True)
|
||||||
|
return 0
|
||||||
|
|
||||||
if remaining is not None:
|
if remaining is not None:
|
||||||
self._open_uris(remaining.unpack())
|
self._open_uris(remaining.unpack())
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in New Issue