From 91c5028701754f4e421918679b1897aebc06dbe0 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 30 Jul 2009 23:41:27 +0000 Subject: [PATCH] use the icon theme's icon where available --- deluge/ui/gtkui/connectionmanager.py | 11 ++++++++++- deluge/ui/gtkui/edittrackersdialog.py | 9 ++++++++- deluge/ui/gtkui/preferences.py | 9 ++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/deluge/ui/gtkui/connectionmanager.py b/deluge/ui/gtkui/connectionmanager.py index d73474281..7f3ff6f9f 100644 --- a/deluge/ui/gtkui/connectionmanager.py +++ b/deluge/ui/gtkui/connectionmanager.py @@ -122,7 +122,16 @@ class ConnectionManager(component.Component): # Setup the ConnectionManager dialog self.connection_manager = self.glade.get_widget("connection_manager") self.connection_manager.set_transient_for(self.window.window) - self.connection_manager.set_icon(common.get_logo(32)) + + if deluge.common.windows_check(): + self.connection_manager.set_icon(common.get_logo(32)) + else: + try: + icon_theme = gtk.icon_theme_get_default() + self.connection_manager.set_icon(icon_theme.load_icon("deluge", 32, 0)) + except: + self.connection_manager.set_icon(common.get_logo(32)) + self.glade.get_widget("image1").set_from_pixbuf(common.get_logo(32)) self.hostlist = self.glade.get_widget("hostlist") diff --git a/deluge/ui/gtkui/edittrackersdialog.py b/deluge/ui/gtkui/edittrackersdialog.py index cdc2f7391..798549b9c 100644 --- a/deluge/ui/gtkui/edittrackersdialog.py +++ b/deluge/ui/gtkui/edittrackersdialog.py @@ -57,7 +57,14 @@ class EditTrackersDialog: self.edit_tracker_entry = self.glade.get_widget("edit_tracker_entry") self.edit_tracker_entry.set_transient_for(self.dialog) - self.dialog.set_icon(common.get_logo(32)) + if deluge.common.windows_check(): + self.dialog.set_icon(common.get_logo(32)) + else: + try: + icon_theme = gtk.icon_theme_get_default() + self.dialog.set_icon(icon_theme.load_icon("deluge", 32, 0)) + except: + self.dialog.set_icon(common.get_logo(32)) if parent != None: self.dialog.set_transient_for(parent) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index e841c682d..f287aed54 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -56,7 +56,14 @@ class Preferences(component.Component): pkg_resources.resource_filename("deluge.ui.gtkui", "glade/preferences_dialog.glade")) self.pref_dialog = self.glade.get_widget("pref_dialog") - self.pref_dialog.set_icon(common.get_logo(32)) + if deluge.common.windows_check(): + self.pref_dialog.set_icon(common.get_logo(32)) + else: + try: + icon_theme = gtk.icon_theme_get_default() + self.pref_dialog.set_icon(icon_theme.load_icon("deluge", 32, 0)) + except: + self.pref_dialog.set_icon(common.get_logo(32)) self.treeview = self.glade.get_widget("treeview") self.notebook = self.glade.get_widget("notebook") self.gtkui_config = ConfigManager("gtkui.conf")