Add some checks for OSX since it doesn't support SVG icons

This commit is contained in:
Andrew Resch 2009-11-29 00:52:00 +00:00
parent cffce4a706
commit 3136e5490f
3 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ import deluge.common
def get_logo(size):
"""Returns a deluge logo pixbuf based on the size parameter."""
if deluge.common.windows_check():
if deluge.common.windows_check() or deluge.common.osx_check():
return gtk.gdk.pixbuf_new_from_file_at_size(deluge.common.get_pixmap("deluge.png"), \
size, size)
else:
@ -162,7 +162,7 @@ def show_other_dialog(header, type_str, image_stockid=None, image_filename=None,
glade.get_widget("image").set_from_stock(image_stockid, gtk.ICON_SIZE_LARGE_TOOLBAR)
if image_filename:
# Hack for Windows since it doesn't support svg
if os.path.splitext(image_filename)[1] == ".svg" and deluge.common.windows_check():
if os.path.splitext(image_filename)[1] == ".svg" and (deluge.common.windows_check() or deluge.common.osx_check()):
image_filename = os.path.splitext(image_filename)[0] + "16.png"
pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(
deluge.common.get_pixmap(image_filename), 32, 32)

View File

@ -47,7 +47,7 @@ class NewReleaseDialog:
glade = component.get("MainWindow").main_glade
self.dialog = glade.get_widget("new_release_dialog")
# Set the version labels
if deluge.common.windows_check():
if deluge.common.windows_check() or deluge.common.osx_check():
glade.get_widget("image_new_release").set_from_file(
deluge.common.get_pixmap("deluge16.png"))
else:

View File

@ -82,7 +82,7 @@ class SystemTray(component.Component):
pkg_resources.resource_filename("deluge.ui.gtkui",
"glade/tray_menu.glade"))
if deluge.common.windows_check():
if deluge.common.windows_check() or deluge.common.osx_check():
self.tray = gtk.status_icon_new_from_pixbuf(
common.get_logo(32))
else: