From 255e23062788fda92e57855ce216bd0d38a9d958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 6 Mar 2010 13:27:14 +0100 Subject: improved image handling --- portato/gui/windows/about.py | 7 ++----- portato/gui/windows/main.py | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'portato/gui') diff --git a/portato/gui/windows/about.py b/portato/gui/windows/about.py index 937ed8b..1b8a981 100644 --- a/portato/gui/windows/about.py +++ b/portato/gui/windows/about.py @@ -15,7 +15,7 @@ from __future__ import absolute_import import gtk from .basic import AbstractDialog -from ...constants import VERSION, APP_ICON +from ...constants import VERSION class AboutWindow (AbstractDialog): """A window showing the "about"-informations.""" @@ -24,11 +24,8 @@ class AboutWindow (AbstractDialog): AbstractDialog.__init__(self, parent) - img = gtk.Image() - img.set_from_file(APP_ICON) - self.window.set_version(VERSION) - self.window.set_logo(img.get_pixbuf()) + self.window.set_logo(None) self.window.show_all() diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 1b67747..0b0c48d 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -434,8 +434,7 @@ class MainWindow (Window): self.window.set_geometry_hints (self.window, max_height = gtk.gdk.screen_height(), max_width = gtk.gdk.screen_width()) # app icon - self.window.set_icon_from_file(APP_ICON) - gtk.window_set_default_icon(self.window.get_icon()) + gtk.window_set_default_icon_from_file(APP_ICON) # booleans self.doUpdate = False -- cgit v1.2.3 From bd02c66863a03025cac97f453d59d7a158134aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 6 Mar 2010 13:39:08 +0100 Subject: Show icon to signal the best package version --- portato/gui/windows/main.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'portato/gui') diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 0b0c48d..e00e9e4 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -29,7 +29,7 @@ from ... import get_listener from ...helper import debug, warning, error, info from ...session import Session from ...db import Database -from ...constants import CONFIG_LOCATION, VERSION, APP_ICON +from ...constants import CONFIG_LOCATION, VERSION, APP_ICON, ICON_DIR from ...backend.exceptions import PackageNotFoundException, BlockedException, VersionsNotFoundException # plugin stuff @@ -441,10 +441,20 @@ class MainWindow (Window): self.showAll = True # show only installed or all packages? self.__searchChanged = False + # our own icon factory + fac = gtk.IconFactory() + iSet = gtk.IconSet() + iSource = gtk.IconSource() + iSource.set_filename(os.path.abspath(os.path.join(ICON_DIR, "better-package.svg"))) + iSet.add_source(iSource) + fac.add("portato-better-pkg", iSet) + fac.add_default() + # icons self.icons = {} self.icons["installed"] = self.window.render_icon(gtk.STOCK_YES, gtk.ICON_SIZE_MENU) self.icons["or"] = self.window.render_icon(gtk.STOCK_MEDIA_PAUSE, gtk.ICON_SIZE_MENU) + self.icons["better"] = self.window.render_icon("portato-better-pkg", gtk.ICON_SIZE_MENU) # get the logging window as soon as possible self.logView = LogView(self.tree.get_widget("logView")) @@ -781,10 +791,14 @@ class MainWindow (Window): if not packages: raise VersionsNotFoundException(cp) + best = system.find_best([x.get_cpv() for x in packages]).get_version() + # append versions for vers, inst, slot in ((x.get_version(), x.is_installed(), get_slot(x)) for x in packages): if inst: icon = self.icons["installed"] + elif vers == best: + icon = self.icons["better"] else: icon = None -- cgit v1.2.3 From 03b70f264123e9afc8202e29b884c42584108e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 6 Mar 2010 13:59:33 +0100 Subject: Only show best_icon, if the package can be installed w/o unmasking --- portato/gui/windows/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'portato/gui') diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index e00e9e4..29eb728 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -791,13 +791,13 @@ class MainWindow (Window): if not packages: raise VersionsNotFoundException(cp) - best = system.find_best([x.get_cpv() for x in packages]).get_version() + best = system.find_best_match(cp) # append versions for vers, inst, slot in ((x.get_version(), x.is_installed(), get_slot(x)) for x in packages): if inst: icon = self.icons["installed"] - elif vers == best: + elif best is not None and vers == best.get_version(): icon = self.icons["better"] else: icon = None -- cgit v1.2.3