Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
14bad789
Commit
14bad789
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Add debug commandline options
To easier simulate connectivity loss
parent
65f74e3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/application.py
+28
-4
28 additions, 4 deletions
gajim/application.py
with
28 additions
and
4 deletions
gajim/application.py
+
28
−
4
View file @
14bad789
...
...
@@ -138,6 +138,21 @@ class GajimApplication(Gtk.Application):
GLib
.
OptionArg
.
NONE
,
_
(
'
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
.
connect
(
'
handle-local-options
'
,
self
.
_handle_local_options
)
...
...
@@ -255,10 +270,11 @@ class GajimApplication(Gtk.Application):
# Parse all options that should be executed on a remote instance
options
=
command_line
.
get_options_dict
()
remote_commands
=
[
'
ipython
'
,
'
show-next-pending-event
'
,
'
start-chat
'
,
]
remote_commands
=
[
'
ipython
'
,
'
show-next-pending-event
'
,
'
start-chat
'
,
]
remaining
=
options
.
lookup_value
(
GLib
.
OPTION_REMAINING
,
GLib
.
VariantType
.
new
(
'
as
'
))
...
...
@@ -268,6 +284,14 @@ class GajimApplication(Gtk.Application):
self
.
activate_action
(
cmd
)
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
:
self
.
_open_uris
(
remaining
.
unpack
())
return
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment