diff --git a/createicons.sh b/createicons.sh
new file mode 100755
index 000000000..114a822c5
--- /dev/null
+++ b/createicons.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+for size in 16 22 24 32 36 48 64 72 96 128 192 256; do mkdir -p deluge/data/\
+icons/hicolor/${size}x${size}/apps; rsvg-convert -w ${size} -h ${size} \
+-o deluge/data/icons/hicolor/${size}x${size}/apps/deluge.png deluge/data/pixmaps\
+/deluge.svg; mkdir -p deluge/data/icons/scalable/apps/; cp deluge/data/pixmaps/\
+deluge.svg deluge/data/icons/scalable/apps/deluge.svg; done
diff --git a/deluge.desktop b/deluge.desktop
new file mode 100644
index 000000000..85cd5ea1b
--- /dev/null
+++ b/deluge.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+Name=Deluge BitTorrent Client
+Comment=Bittorrent client written in PyGTK
+Exec=deluge
+Icon=deluge.png
+Terminal=false
+Type=Application
+Categories=Application;Network
+StartupNotify=true
+MimeType=application/x-bittorrent;
diff --git a/deluge/common.py b/deluge/common.py
index 1ccb241dd..ff7ca0937 100644
--- a/deluge/common.py
+++ b/deluge/common.py
@@ -115,3 +115,25 @@ def ftime(seconds):
if weeks < 10:
return '%dw %dd' % (weeks, days)
return 'unknown'
+
+def windows_check():
+ import platform
+ if platform.system() in ('Windows', 'Microsoft'):
+ return True
+ else:
+ return False
+
+def get_pixmap(fname):
+ import pkg_resources
+ from os import path
+ return pkg_resources.resource_filename("deluge", path.join("data", \
+ "pixmaps", fname))
+
+def get_logo(size):
+ import gtk
+ if windows_check():
+ return gtk.gdk.pixbuf_new_from_file_at_size(get_pixmap("deluge.png"), \
+ size, size)
+ else:
+ return gtk.gdk.pixbuf_new_from_file_at_size(get_pixmap("deluge.svg"), \
+ size, size)
diff --git a/deluge/data/icons/hicolor/128x128/apps/deluge.png b/deluge/data/icons/hicolor/128x128/apps/deluge.png
new file mode 100644
index 000000000..85e21fafd
Binary files /dev/null and b/deluge/data/icons/hicolor/128x128/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/16x16/apps/deluge.png b/deluge/data/icons/hicolor/16x16/apps/deluge.png
new file mode 100644
index 000000000..e39cd0c7e
Binary files /dev/null and b/deluge/data/icons/hicolor/16x16/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/192x192/apps/deluge.png b/deluge/data/icons/hicolor/192x192/apps/deluge.png
new file mode 100644
index 000000000..ead465c7d
Binary files /dev/null and b/deluge/data/icons/hicolor/192x192/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/22x22/apps/deluge.png b/deluge/data/icons/hicolor/22x22/apps/deluge.png
new file mode 100644
index 000000000..de0fdea7b
Binary files /dev/null and b/deluge/data/icons/hicolor/22x22/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/24x24/apps/deluge.png b/deluge/data/icons/hicolor/24x24/apps/deluge.png
new file mode 100644
index 000000000..faad5cc25
Binary files /dev/null and b/deluge/data/icons/hicolor/24x24/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/256x256/apps/deluge.png b/deluge/data/icons/hicolor/256x256/apps/deluge.png
new file mode 100644
index 000000000..8819b5436
Binary files /dev/null and b/deluge/data/icons/hicolor/256x256/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/32x32/apps/deluge.png b/deluge/data/icons/hicolor/32x32/apps/deluge.png
new file mode 100644
index 000000000..2d272f2ea
Binary files /dev/null and b/deluge/data/icons/hicolor/32x32/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/36x36/apps/deluge.png b/deluge/data/icons/hicolor/36x36/apps/deluge.png
new file mode 100644
index 000000000..56c9c98a8
Binary files /dev/null and b/deluge/data/icons/hicolor/36x36/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/48x48/apps/deluge.png b/deluge/data/icons/hicolor/48x48/apps/deluge.png
new file mode 100644
index 000000000..37fcf8e45
Binary files /dev/null and b/deluge/data/icons/hicolor/48x48/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/64x64/apps/deluge.png b/deluge/data/icons/hicolor/64x64/apps/deluge.png
new file mode 100644
index 000000000..ca004d0ca
Binary files /dev/null and b/deluge/data/icons/hicolor/64x64/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/72x72/apps/deluge.png b/deluge/data/icons/hicolor/72x72/apps/deluge.png
new file mode 100644
index 000000000..22e2a0185
Binary files /dev/null and b/deluge/data/icons/hicolor/72x72/apps/deluge.png differ
diff --git a/deluge/data/icons/hicolor/96x96/apps/deluge.png b/deluge/data/icons/hicolor/96x96/apps/deluge.png
new file mode 100644
index 000000000..6b182a48d
Binary files /dev/null and b/deluge/data/icons/hicolor/96x96/apps/deluge.png differ
diff --git a/deluge/data/icons/scalable/apps/deluge.svg b/deluge/data/icons/scalable/apps/deluge.svg
new file mode 100644
index 000000000..69e59776d
--- /dev/null
+++ b/deluge/data/icons/scalable/apps/deluge.svg
@@ -0,0 +1,402 @@
+
+
+
diff --git a/deluge/data/pixmaps/deluge.png b/deluge/data/pixmaps/deluge.png
new file mode 100644
index 000000000..3cc443361
Binary files /dev/null and b/deluge/data/pixmaps/deluge.png differ
diff --git a/deluge/data/pixmaps/deluge.svg b/deluge/data/pixmaps/deluge.svg
new file mode 100644
index 000000000..69e59776d
--- /dev/null
+++ b/deluge/data/pixmaps/deluge.svg
@@ -0,0 +1,402 @@
+
+
+
diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py
index a67847a92..6150c7764 100644
--- a/deluge/ui/gtkui/mainwindow.py
+++ b/deluge/ui/gtkui/mainwindow.py
@@ -42,6 +42,7 @@ from toolbar import ToolBar
from torrentview import TorrentView
from torrentdetails import TorrentDetails
from preferences import Preferences
+from deluge.common import get_logo
from deluge.log import LOG as log
@@ -53,6 +54,7 @@ class MainWindow:
"glade/main_window.glade"))
self.window = self.main_glade.get_widget("main_window")
+ self.window.set_icon(get_logo(32))
# Initialize various components of the gtkui
self.menubar = MenuBar(self)
diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index 3f1d0af5d..8252456e2 100644
--- a/deluge/ui/gtkui/preferences.py
+++ b/deluge/ui/gtkui/preferences.py
@@ -38,6 +38,7 @@ import pkg_resources
from deluge.log import LOG as log
import deluge.ui.functions as functions
+from deluge.common import get_logo
class Preferences:
def __init__(self, window):
@@ -46,6 +47,7 @@ class Preferences:
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(get_logo(32))
self.treeview = self.glade.get_widget("treeview")
self.notebook = self.glade.get_widget("notebook")
self.core = functions.get_core()
diff --git a/setup.py b/setup.py
index 950c8d4be..a6fe39b5c 100644
--- a/setup.py
+++ b/setup.py
@@ -38,6 +38,7 @@ from distutils.command.install import install as _install
from distutils.command.install_data import install_data as _install_data
import msgfmt
+
import platform
import glob
import os
@@ -142,7 +143,7 @@ for path in glob.glob('deluge/plugins/*'):
os.system("cd " + path + "&& python setup.py bdist_egg -d ..")
# Main setup
-
+
setup(
name = "deluge",
fullname = "Deluge Bittorent Client",
@@ -155,10 +156,37 @@ setup(
include_package_data = True,
package_data = {"deluge": ["ui/gtkui/glade/*.glade",
"data/pixmaps/*.png",
+ "data/pixmaps/logo.svg",
"plugins/*.egg",
"i18n/*.pot",
- "i18n/*/LC_MESSAGES/*.mo"
- ]},
+ "i18n/*/LC_MESSAGES/*.mo"]},
+ data_files = [('/usr/share/deluge/icons/scalable/apps', [
+ 'deluge/data/icons/scalable/apps/deluge.svg']),
+ ('/usr/share/deluge/icons/hicolor/128x128/apps', [
+ 'deluge/data/icons/hicolor/128x128/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/16x16/apps', [
+ 'deluge/data/icons/hicolor/16x16/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/192x192/apps', [
+ 'deluge/data/icons/hicolor/192x192/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/22x22/apps', [
+ 'deluge/data/icons/hicolor/22x22/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/24x24/apps', [
+ 'deluge/data/icons/hicolor/24x24/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/256x256/apps', [
+ 'deluge/data/icons/hicolor/256x256/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/32x32/apps', [
+ 'deluge/data/icons/hicolor/32x32/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/36x36/apps', [
+ 'deluge/data/icons/hicolor/36x36/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/48x48/apps', [
+ 'deluge/data/icons/hicolor/48x48/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/64x64/apps', [
+ 'deluge/data/icons/hicolor/64x64/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/72x72/apps', [
+ 'deluge/data/icons/hicolor/72x72/apps/deluge.png']),
+ ('/usr/share/deluge/icons/hicolor/96x96/apps', [
+ 'deluge/data/icons/hicolor/96x96/apps/deluge.png']),
+ ('/usr/share/applications', ['deluge.desktop'])],
ext_package = "deluge",
ext_modules = [libtorrent],
packages = find_packages(exclude=["plugins"]),