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
Weblate
gajim
Commits
97bd4d51
Commit
97bd4d51
authored
12 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
[Knuckles] shown Gajim when we try to run it while it is already running. Fixes #7274
parent
c5e6c6a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gajim.py
+18
-0
18 additions, 0 deletions
src/gajim.py
src/remote_control.py
+13
-0
13 additions, 0 deletions
src/remote_control.py
with
31 additions
and
0 deletions
src/gajim.py
+
18
−
0
View file @
97bd4d51
...
...
@@ -359,7 +359,25 @@ def pid_alive():
# Assume Gajim is running.
return
True
def
show_remote_gajim_roster
():
try
:
import
dbus
OBJ_PATH
=
'
/org/gajim/dbus/RemoteObject
'
INTERFACE
=
'
org.gajim.dbus.RemoteInterface
'
SERVICE
=
'
org.gajim.dbus
'
# Attempt to call show_roster
dbus
.
Interface
(
dbus
.
SessionBus
().
get_object
(
SERVICE
,
OBJ_PATH
),
INTERFACE
).
__getattr__
(
"
show_roster
"
)()
return
True
except
Exception
:
return
False
if
pid_alive
():
if
(
show_remote_gajim_roster
()):
print
(
"
Gajim is already running, bringing the roster to front...
"
)
sys
.
exit
(
0
)
pix
=
gtkgui_helpers
.
get_icon_pixmap
(
'
gajim
'
,
48
)
gtk
.
window_set_default_icon
(
pix
)
# set the icon to all newly opened wind
pritext
=
_
(
'
Gajim is already running
'
)
...
...
This diff is collapsed.
Click to expand it.
src/remote_control.py
+
13
−
0
View file @
97bd4d51
...
...
@@ -696,6 +696,19 @@ class SignalObject(dbus.service.Object):
else
:
win
.
window
.
focus
(
long
(
time
()))
@dbus.service.method
(
INTERFACE
,
in_signature
=
''
,
out_signature
=
''
)
def
show_roster
(
self
):
"""
Show the roster window
"""
win
=
gajim
.
interface
.
roster
.
window
win
.
present
()
# preserve the 'steal focus preservation'
if
self
.
_is_first
():
win
.
window
.
focus
(
gtk
.
get_current_event_time
())
else
:
win
.
window
.
focus
(
long
(
time
()))
@dbus.service.method
(
INTERFACE
,
in_signature
=
''
,
out_signature
=
''
)
def
toggle_ipython
(
self
):
"""
...
...
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