diff --git a/Mailnag/configuration/configwindow.py b/Mailnag/configuration/configwindow.py
index d9413bf..ac1b13d 100644
--- a/Mailnag/configuration/configwindow.py
+++ b/Mailnag/configuration/configwindow.py
@@ -28,7 +28,7 @@ from gi.repository import GLib, GdkPixbuf, Gdk, Gtk, GObject
from common.dist_cfg import PACKAGE_NAME, APP_VERSION
from common.i18n import _
-from common.utils import get_data_file
+from common.utils import get_data_file, get_data_paths
from common.config import read_cfg, write_cfg
from common.accounts import Account, AccountList
from common.plugins import Plugin
@@ -54,9 +54,16 @@ class ConfigWindow:
"treeview_plugins_row_activated" : self._on_treeview_plugins_row_activated, \
"treeview_plugins_cursor_changed" : self._on_treeview_plugins_cursor_changed, \
})
+
+ # Add icons in alternative data paths (e.g. ./data/icons)
+ # to the icon search path in case Mailnag is launched
+ # from a local directory (without installing).
+ icon_theme = Gtk.IconTheme.get_default()
+ for path in get_data_paths():
+ icon_theme.append_search_path(os.path.join(path, "icons"))
self._window = builder.get_object("config_window")
- self._window.set_icon(GdkPixbuf.Pixbuf.new_from_file_at_size(get_data_file("mailnag.svg"), 48, 48));
+ self._window.set_icon_name("mailnag")
self._load_stylesheet('config_window.css')
self._cfg = read_cfg()
@@ -71,10 +78,11 @@ class ConfigWindow:
#
# general page
- #
- self._image_logo = builder.get_object("image_logo")
- pb = GdkPixbuf.Pixbuf.new_from_file_at_size(get_data_file("mailnag.svg"), 180, 180)
+ #
+ # The dimension of the png is expected to be 180x180 px
+ pb = GdkPixbuf.Pixbuf.new_from_file(get_data_file("mailnag.png"))
pb = pb.new_subpixbuf(0, 10, 180, 146) # crop whitespace at the bottom
+ self._image_logo = builder.get_object("image_logo")
self._image_logo.set_from_pixbuf(pb)
self._label_app_desc = builder.get_object("label_app_desc")
self._label_app_desc.set_markup("Mailnag\nVersion %s" % str(APP_VERSION))
diff --git a/data/icons/hicolor/128x128/apps/mailnag.png b/data/icons/hicolor/128x128/apps/mailnag.png
new file mode 100644
index 0000000..80d1a8b
Binary files /dev/null and b/data/icons/hicolor/128x128/apps/mailnag.png differ
diff --git a/data/icons/hicolor/16x16/apps/mailnag.png b/data/icons/hicolor/16x16/apps/mailnag.png
new file mode 100644
index 0000000..770138d
Binary files /dev/null and b/data/icons/hicolor/16x16/apps/mailnag.png differ
diff --git a/data/icons/hicolor/22x22/apps/mailnag.png b/data/icons/hicolor/22x22/apps/mailnag.png
new file mode 100644
index 0000000..626fc93
Binary files /dev/null and b/data/icons/hicolor/22x22/apps/mailnag.png differ
diff --git a/data/icons/hicolor/24x24/apps/mailnag.png b/data/icons/hicolor/24x24/apps/mailnag.png
new file mode 100644
index 0000000..1ac793b
Binary files /dev/null and b/data/icons/hicolor/24x24/apps/mailnag.png differ
diff --git a/data/icons/hicolor/256x256/apps/mailnag.png b/data/icons/hicolor/256x256/apps/mailnag.png
new file mode 100644
index 0000000..f68de7f
Binary files /dev/null and b/data/icons/hicolor/256x256/apps/mailnag.png differ
diff --git a/data/icons/hicolor/32x32/apps/mailnag.png b/data/icons/hicolor/32x32/apps/mailnag.png
new file mode 100644
index 0000000..d73f03f
Binary files /dev/null and b/data/icons/hicolor/32x32/apps/mailnag.png differ
diff --git a/data/icons/hicolor/48x48/apps/mailnag.png b/data/icons/hicolor/48x48/apps/mailnag.png
new file mode 100644
index 0000000..80f8f32
Binary files /dev/null and b/data/icons/hicolor/48x48/apps/mailnag.png differ
diff --git a/data/icons/hicolor/96x96/apps/mailnag.png b/data/icons/hicolor/96x96/apps/mailnag.png
new file mode 100644
index 0000000..d189915
Binary files /dev/null and b/data/icons/hicolor/96x96/apps/mailnag.png differ
diff --git a/data/mailnag-config.desktop b/data/mailnag-config.desktop
index 7feaebf..1eccc73 100644
--- a/data/mailnag-config.desktop
+++ b/data/mailnag-config.desktop
@@ -1,12 +1,12 @@
[Desktop Entry]
Name=Mailnag Configuration
-Name[de]=Mailnag Configuration
+Name[de]=Mailnag-Konfiguration
Comment=An extendable mail notification daemon
-Comment[de]=Ein erweiterbarar Mail Benachrichtigungs-Dämon
+Comment[de]=Ein erweiterbarar Mail-Benachrichtigungs-Dämon
Keywords=mail;notify;notification;config;settings;preferences;
Exec=/usr/bin/mailnag-config
-Icon=/usr/share/mailnag/mailnag.svg
+Icon=mailnag
Terminal=false
Type=Application
Categories=Network;
diff --git a/data/mailnag.png b/data/mailnag.png
new file mode 100644
index 0000000..3d64908
Binary files /dev/null and b/data/mailnag.png differ
diff --git a/data/mailnag.svg b/data/mailnag.svg
deleted file mode 100644
index 37898e5..0000000
--- a/data/mailnag.svg
+++ /dev/null
@@ -1,276 +0,0 @@
-
-
-
diff --git a/setup.py b/setup.py
index e730c3c..47257bd 100755
--- a/setup.py
+++ b/setup.py
@@ -77,6 +77,7 @@ class BuildData(build):
class InstallData(install_data):
def run (self):
self._add_locale_data()
+ self._add_icon_data()
install_data.run (self)
@@ -86,6 +87,13 @@ class InstallData(install_data):
src_path = os.path.join(root, file)
dst_path = os.path.join('share/locale', os.path.dirname(src_path[len(BUILD_LOCALE_DIR)+1:]))
self.data_files.append((dst_path, [src_path]))
+
+ def _add_icon_data(self):
+ for root, dirs, files in os.walk('data/icons'):
+ for file in files:
+ src_path = os.path.join(root, file)
+ dst_path = os.path.join('share/icons', os.path.dirname(src_path[len('data/icons')+1:]))
+ self.data_files.append((dst_path, [src_path]))
class Uninstall(Command):
@@ -100,14 +108,14 @@ setup(name=PACKAGE_NAME,
author='Patrick Ulbrich',
author_email='zulu99@gmx.net',
url='https://github.com/pulb/mailnag',
- license='GNU GPL3',
+ license='GNU GPL2',
package_dir = {'Mailnag.common' : os.path.join(BUILD_PATCH_DIR, 'common')},
packages=['Mailnag', 'Mailnag.common', 'Mailnag.configuration', 'Mailnag.daemon', 'Mailnag.plugins'],
scripts=[os.path.join(BUILD_PATCH_DIR, 'mailnagd'), os.path.join(BUILD_PATCH_DIR, 'mailnag-config')],
data_files=[('share/mailnag', glob.glob('data/*.ui')),
('share/mailnag', ['data/config_window.css']),
('share/mailnag', ['data/mailnag.ogg']),
- ('share/mailnag', ['data/mailnag.svg']),
+ ('share/mailnag', ['data/mailnag.png']),
('share/applications', [os.path.join(BUILD_PATCH_DIR, 'mailnag-config.desktop')])],
cmdclass={'build': BuildData,
'install_data': InstallData,