summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icons/better-package.svg146
-rw-r--r--portato/gui/windows/about.py7
-rw-r--r--portato/gui/windows/main.py19
3 files changed, 164 insertions, 8 deletions
diff --git a/icons/better-package.svg b/icons/better-package.svg
new file mode 100644
index 0000000..30e4e5f
--- /dev/null
+++ b/icons/better-package.svg
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ version="1.0"
+ sodipodi:docname="better-package.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient2786">
+ <stop
+ style="stop-color:#fcce4f;stop-opacity:1;"
+ offset="0"
+ id="stop2788" />
+ <stop
+ style="stop-color:#fce94f;stop-opacity:0;"
+ offset="1"
+ id="stop2790" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2786"
+ id="radialGradient2792"
+ cx="25"
+ cy="22"
+ fx="25"
+ fy="22"
+ r="17"
+ gradientTransform="matrix(1.30147,0,0,1.224913,-7.536765,-3.448096)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2786"
+ id="radialGradient3621"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.5698522,0,0,1.5190305,-15.058824,-10.043684)"
+ cx="25"
+ cy="22"
+ fx="25"
+ fy="22"
+ r="17" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="8"
+ inkscape:cx="21.225364"
+ inkscape:cy="14.98821"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ width="48px"
+ height="48px"
+ inkscape:showpageshadow="false"
+ showgrid="false"
+ inkscape:window-width="1249"
+ inkscape:window-height="823"
+ inkscape:window-x="10"
+ inkscape:window-y="65"
+ showborder="false"
+ inkscape:window-maximized="0">
+ <inkscape:grid
+ id="GridFromPre046Settings"
+ type="xygrid"
+ originx="0px"
+ originy="0px"
+ spacingx="0.5px"
+ spacingy="0.5px"
+ color="#0000ff"
+ empcolor="#0000ff"
+ opacity="0.2"
+ empopacity="0.4"
+ empspacing="2" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Lapo Calamandrei</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/Reproduction" />
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/Distribution" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/Notice" />
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/ShareAlike" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/SourceCode" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Livello 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ sodipodi:type="star"
+ style="fill:#fce54f;fill-opacity:1;stroke:#000000;stroke-width:1.39475423;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path1869"
+ sodipodi:sides="5"
+ sodipodi:cx="11"
+ sodipodi:cy="8.125"
+ sodipodi:r1="15.377032"
+ sodipodi:r2="8.9001045"
+ sodipodi:arg1="-1.5707963"
+ sodipodi:arg2="-0.9424778"
+ inkscape:flatsided="false"
+ inkscape:rounded="0.18352206"
+ inkscape:randomized="0"
+ d="m 11,-7.2520323 c 1.781445,0 3.790132,7.12958977 5.23135,8.17669647 1.441219,1.04710673 8.84258,0.75431763 9.393077,2.44857193 0.550496,1.6942542 -5.609428,5.8077933 -6.159925,7.5020479 -0.550496,1.694254 2.015109,8.64289 0.57389,9.689997 C 18.597174,21.612387 12.781444,17.025105 11,17.025105 9.2185557,17.025104 3.4028256,21.612387 1.9616069,20.56528 0.52038819,19.518174 3.0859941,12.569538 2.5354976,10.875284 1.9850011,9.1810293 -4.1749232,5.0674896 -3.6244266,3.3732353 -3.0739301,1.6789811 4.3274311,1.9717708 5.7686498,0.92466421 7.2098686,-0.12244246 9.2185561,-7.2520323 11,-7.2520323 z"
+ transform="matrix(1.120396,0,0,1.105138,11.863144,13.932639)" />
+ </g>
+</svg>
diff --git a/portato/gui/windows/about.py b/portato/gui/windows/about.py
index 6d3dcbb..a15fd24 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, REVISION, APP_ICON
+from ...constants import VERSION, REVISION
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)
if REVISION:
gitlabel = self.tree.get_widget("gitLabel")
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index f10216a..a06756d 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -30,7 +30,7 @@ from ...helper import debug, warning, error, info
from ...session import Session
from ...db import Database
from ...db.database import UnsupportedSearchTypeError
-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
@@ -435,18 +435,27 @@ 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
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"))
@@ -787,10 +796,14 @@ class MainWindow (Window):
if not packages:
raise VersionsNotFoundException(cp)
+ 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 best is not None and vers == best.get_version():
+ icon = self.icons["better"]
else:
icon = None