From c1249a2f3a1d64319f2da73ccdb94d9caaba722f Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sat, 12 Nov 2016 20:53:24 +0000 Subject: [PATCH] [GTKUI] Switch to non-deprecated GTK methods --- deluge/ui/gtkui/aboutdialog.py | 9 +++++++-- deluge/ui/gtkui/dialogs.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/deluge/ui/gtkui/aboutdialog.py b/deluge/ui/gtkui/aboutdialog.py index c733b7678..9fb9de23b 100644 --- a/deluge/ui/gtkui/aboutdialog.py +++ b/deluge/ui/gtkui/aboutdialog.py @@ -10,7 +10,7 @@ import gtk import deluge.component as component -from deluge.common import get_version +from deluge.common import get_version, open_url_in_browser, windows_check from deluge.ui.client import client from deluge.ui.gtkui.common import get_deluge_icon, get_pixbuf @@ -20,8 +20,13 @@ class AboutDialog(object): self.about = gtk.AboutDialog() self.about.set_transient_for(component.get('MainWindow').get_window()) self.about.set_position(gtk.WIN_POS_CENTER) - self.about.set_name('Deluge') self.about.set_program_name(_('Deluge')) + if windows_check: + def url_hook(dialog, url): + """Url hook for Windows OS which has no default browser.""" + open_url_in_browser(url) + return True + self.about.connect('activate-link', url_hook) version = get_version() diff --git a/deluge/ui/gtkui/dialogs.py b/deluge/ui/gtkui/dialogs.py index 641cb0c17..b556d1f2b 100644 --- a/deluge/ui/gtkui/dialogs.py +++ b/deluge/ui/gtkui/dialogs.py @@ -268,7 +268,7 @@ class AccountDialog(BaseDialog): self.authlevel_label.set_alignment(1.0, 0.5) self.authlevel_label.set_padding(5, 5) - self.authlevel_combo = gtk.combo_box_new_text() + self.authlevel_combo = gtk.ComboBoxText() active_idx = None for idx, level in enumerate(levels_mapping.keys()): self.authlevel_combo.append_text(level)