summaryrefslogtreecommitdiff
path: root/portato/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui/windows')
-rw-r--r--portato/gui/windows/__init__.py2
-rw-r--r--portato/gui/windows/about.py2
-rw-r--r--portato/gui/windows/basic.py5
-rw-r--r--portato/gui/windows/mailinfo.py2
-rw-r--r--portato/gui/windows/main.py150
-rw-r--r--portato/gui/windows/plugin.py2
-rw-r--r--portato/gui/windows/preference.py2
-rw-r--r--portato/gui/windows/search.py2
-rw-r--r--portato/gui/windows/splash.py2
-rw-r--r--portato/gui/windows/update.py2
10 files changed, 88 insertions, 83 deletions
diff --git a/portato/gui/windows/__init__.py b/portato/gui/windows/__init__.py
index 394e84e..6a4ac82 100644
--- a/portato/gui/windows/__init__.py
+++ b/portato/gui/windows/__init__.py
@@ -3,7 +3,7 @@
# File: portato/gui/gtk/__init__.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
diff --git a/portato/gui/windows/about.py b/portato/gui/windows/about.py
index 21608c0..937ed8b 100644
--- a/portato/gui/windows/about.py
+++ b/portato/gui/windows/about.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/about.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
diff --git a/portato/gui/windows/basic.py b/portato/gui/windows/basic.py
index 635083a..1117e5e 100644
--- a/portato/gui/windows/basic.py
+++ b/portato/gui/windows/basic.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/basic.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
@@ -20,7 +20,7 @@ import gobject
from functools import wraps
import os.path
-from ...constants import TEMPLATE_DIR, APP_ICON, APP, LOCALE_DIR
+from ...constants import TEMPLATE_DIR, APP, LOCALE_DIR
from ...helper import error
gtk.glade.bindtextdomain (APP, LOCALE_DIR)
@@ -59,7 +59,6 @@ class Window (object):
self.tree = self.get_tree(self.__tree__)
self.tree.signal_autoconnect(self)
self.window = self.tree.get_widget(self.__window__)
- self.window.set_icon_from_file(APP_ICON)
@staticmethod
def watch_cursor (func):
diff --git a/portato/gui/windows/mailinfo.py b/portato/gui/windows/mailinfo.py
index bbcbf1f..0cc79f2 100644
--- a/portato/gui/windows/mailinfo.py
+++ b/portato/gui/windows/mailinfo.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/mailinfo.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 9f3c123..8d5e5ae 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -164,7 +164,7 @@ class PackageTable:
self.linkBox.remove(c)
text = pkg.get_package_settings("HOMEPAGE")
- texts = text.split(" ")
+ texts = text.split()
ftexts = []
for count, t in enumerate(texts):
@@ -440,6 +440,10 @@ class MainWindow (Window):
self.window.set_title(self.main_title)
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())
+
# booleans
self.doUpdate = False
self.showAll = True # show only installed or all packages?
@@ -1049,73 +1053,19 @@ class MainWindow (Window):
# SELECTION
def load_pkg_selection (name):
pos = "0"
- col = 1
- model = self.pkgList.get_model()
-
- if name:
- if oldVersion > 1: # newer one
- name, pos = name.split("@")
-
- if model[pos][col] != name: # need to search :(
- debug("Pkg path does not match. Searching...")
- for cname, path in ((x[col], x.path) for x in model):
- if cname == name:
- pos = path
- break
+ if name and oldVersion > 1: # newer one
+ name, pos = name.split("@")
- debug("Selecting pkg path '%s'. Value: '%s'", pos, model[pos][col])
- self.pkgList.get_selection().select_path(pos)
- self.pkgList.scroll_to_cell(pos)
+ self.jump_to_pkg(name, pos)
def load_cat_selection (name):
pos = "0"
- col = 0
- model = self.catList.get_model()
-
- if name:
- if oldVersion > 1: # newer one
- name, pos = name.split("@")
-
- if self.cfg.get_boolean("collapseCats", "GUI"):
- try:
- sname = name.split("-", 1)
- except ValueError: # nothing to split
- sname = None
- else:
- sname = None
-
- if sname is None and model[pos][col] != name: # need to search in normal list
- debug("Cat path does not match. Searching...")
- for cname, path in ((x[col], x.path) for x in model):
- if cname == name:
- pos = path
- break
-
- elif sname: # the collapse case
- row = model[pos.split(":")[0]]
- no_match = False
- if row[col] != sname[0]: # first part does not match :(
- debug("First part of cat path does not match. Searching...")
- no_match = True
- for r in model:
- if r[col] == sname[0]:
- row = r
- break
-
- if no_match or model[pos][col] != sname[1]:
- debug("Second part of cat path does not match. Searching...")
- for cname, path in ((x[col], x.path) for x in row.iterchildren()):
- if cname == sname[1]: # found second
- pos = ":".join(map(str,path))
- break
-
- self.catList.expand_to_path(pos)
+ if name and oldVersion > 1: # newer one
+ name, pos = name.split("@")
- debug("Selecting cat path '%s'. Value: '%s'", pos, model[pos][col])
- self.catList.get_selection().select_path(pos)
- self.catList.scroll_to_cell(pos)
+ self.jump_to_cat(name, pos)
def save_pkg_selection ():
store, iter = self.pkgList.get_selection().get_selected()
@@ -1235,17 +1185,76 @@ class MainWindow (Window):
cat, pkg = cp.split("/")
- for list, idx, what, expr in ((self.catList, 0, "categories", cat), (self.pkgList, 1, "packages", pkg)):
- pathes = [row.path for row in list.get_model() if row[idx] == expr]
+ self.jump_to_cat(cat)
+ self.jump_to_pkg(pkg)
+
+ self.show_package(cp = cp, version = version, queue = self.queue)
+
+ def jump_to_pkg (self, name = None, pos = "0"):
+ if isinstance(pos, int):
+ pos = str(pos)
+
+ col = 1
+ model = self.pkgList.get_model()
+
+ if name:
+ if model[pos][col] != name: # need to search :(
+ debug("Pkg path does not match. Searching...")
+ for cname, path in ((x[col], x.path) for x in model):
+ if cname == name:
+ pos = path
+ break
+
+ debug("Selecting pkg path '%s'. Value: '%s'", pos, model[pos][col])
+ self.pkgList.get_selection().select_path(pos)
+ self.pkgList.scroll_to_cell(pos)
- if len(pathes) == 1:
- list.get_selection().select_path(pathes[0])
- list.scroll_to_cell(pathes[0])
+ def jump_to_cat (self, name = None, pos = "0"):
+ if isinstance(pos, int):
+ pos = str(pos)
+
+ col = 0
+ model = self.catList.get_model()
+
+ if name:
+ if self.cfg.get_boolean("collapseCats", "GUI"):
+ try:
+ sname = name.split("-", 1)
+ except ValueError: # nothing to split
+ sname = None
else:
- debug("Unexpected number of %s returned after search: %d", what, len(pathes))
- break
+ sname = None
+
+ if sname is None and model[pos][col] != name: # need to search in normal list
+ debug("Cat path does not match. Searching...")
+ for cname, path in ((x[col], x.path) for x in model):
+ if cname == name:
+ pos = path
+ break
+
+ elif sname: # the collapse case
+ row = model[pos.split(":")[0]]
+ no_match = False
+ if row[col] != sname[0]: # first part does not match :(
+ debug("First part of cat path does not match. Searching...")
+ no_match = True
+ for r in model:
+ if r[col] == sname[0]:
+ row = r
+ break
- self.show_package(cp = cp, version = version, queue = self.queue)
+ if no_match or model[pos][col] != sname[1]:
+ debug("Second part of cat path does not match. Searching...")
+ for cname, path in ((x[col], x.path) for x in row.iterchildren()):
+ if cname == sname[1]: # found second
+ pos = ":".join(map(str,path))
+ break
+
+ self.catList.expand_to_path(pos)
+
+ debug("Selecting cat path '%s'. Value: '%s'", pos, model[pos][col])
+ self.catList.get_selection().select_path(pos)
+ self.catList.scroll_to_cell(pos)
def set_uri_hook (self, browser):
"""
@@ -1624,9 +1633,6 @@ class MainWindow (Window):
"""Do a search."""
text = entry.get_text()
if text != "":
- if "/" not in text:
- text = "/.*"+text # only look for package names
-
packages = system.find_packages(text, with_version = False)
if packages == []:
diff --git a/portato/gui/windows/plugin.py b/portato/gui/windows/plugin.py
index eccf302..755ad58 100644
--- a/portato/gui/windows/plugin.py
+++ b/portato/gui/windows/plugin.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/plugin.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py
index 87a1860..df18e88 100644
--- a/portato/gui/windows/preference.py
+++ b/portato/gui/windows/preference.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/preference.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
diff --git a/portato/gui/windows/search.py b/portato/gui/windows/search.py
index 415cbfe..c531507 100644
--- a/portato/gui/windows/search.py
+++ b/portato/gui/windows/search.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/search.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
diff --git a/portato/gui/windows/splash.py b/portato/gui/windows/splash.py
index c27f74f..39ba00d 100644
--- a/portato/gui/windows/splash.py
+++ b/portato/gui/windows/splash.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/splash.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2007-2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
diff --git a/portato/gui/windows/update.py b/portato/gui/windows/update.py
index 297f666..8e32dd9 100644
--- a/portato/gui/windows/update.py
+++ b/portato/gui/windows/update.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/update.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2008 René 'Necoro' Neumann
+# Copyright (C) 2006-2009 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.