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
c2d69774
Commit
c2d69774
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Use custom link handler in AboutDialog
Fixes #9525
parent
3bd5843f
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/gtk/about.py
+24
-0
24 additions, 0 deletions
gajim/gtk/about.py
with
24 additions
and
0 deletions
gajim/gtk/about.py
+
24
−
0
View file @
c2d69774
...
...
@@ -14,10 +14,12 @@
import
nbxmpp
from
gi.repository
import
Gdk
from
gi.repository
import
Gtk
from
gi.repository
import
GObject
from
gajim.common
import
app
from
gajim.common.helpers
import
launch_browser_mailer
from
gajim.common.i18n
import
_
from
gajim.common.const
import
DEVS_CURRENT
from
gajim.common.const
import
DEVS_PAST
...
...
@@ -65,3 +67,25 @@ class AboutDialog(Gtk.AboutDialog):
'
response
'
,
lambda
dialog
,
*
args
:
Gtk
.
AboutDialog
.
do_close
(
dialog
))
self
.
show
()
self
.
connect
(
'
activate-link
'
,
self
.
_on_activate_link
)
# See https://gitlab.gnome.org/GNOME/gtk/issues/1561
self
.
_connect_link_handler
(
self
)
@staticmethod
def
_on_activate_link
(
_label
,
uri
):
# We have to use this, because the default GTK handler
# is not cross-platform compatible
launch_browser_mailer
(
None
,
uri
)
return
Gdk
.
EVENT_STOP
def
_connect_link_handler
(
self
,
parent
):
def
_find_child
(
parent_
):
if
not
hasattr
(
parent_
,
'
get_children
'
):
return
for
child
in
parent_
.
get_children
():
if
isinstance
(
child
,
Gtk
.
Label
):
if
'
href
'
in
child
.
get_label
():
child
.
connect
(
'
activate-link
'
,
self
.
_on_activate_link
)
_find_child
(
child
)
_find_child
(
parent
)
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