diff options
Diffstat (limited to 'portato/gui')
-rw-r--r-- | portato/gui/dialogs.py | 7 | ||||
-rw-r--r-- | portato/gui/windows/main.py | 24 |
2 files changed, 27 insertions, 4 deletions
diff --git a/portato/gui/dialogs.py b/portato/gui/dialogs.py index edf34b7..8931535 100644 --- a/portato/gui/dialogs.py +++ b/portato/gui/dialogs.py @@ -113,3 +113,10 @@ def prereq_error_dialog (e): ret = dialog.run() dialog.destroy() return ret + +def no_versions_dialog (cp): + dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, _("No versions of package '%s' found!") % cp) + ret = dialog.run() + dialog.destroy() + return ret + diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index e51897f..472ddf0 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -28,7 +28,7 @@ from ...helper import debug, warning, error, info, unique_array from ...session import Session from ...db import Database from ...constants import CONFIG_LOCATION, VERSION, APP_ICON, ICON_DIR -from ...backend.exceptions import PackageNotFoundException, BlockedException +from ...backend.exceptions import PackageNotFoundException, BlockedException, VersionsNotFoundException # more GUI stuff from ..utils import Config, GtkThread, get_color @@ -38,7 +38,8 @@ from ..wrapper import GtkTree, GtkConsole from ..views import LogView, HighlightView, InstalledOnlyView, LazyStoreView from ..dialogs import (blocked_dialog, changed_flags_dialog, io_ex_dialog, nothing_found_dialog, queue_not_empty_dialog, remove_deps_dialog, - remove_queue_dialog, remove_updates_dialog, unmask_dialog) + remove_queue_dialog, remove_updates_dialog, unmask_dialog, + no_versions_dialog) from ..exceptions import PreReqError # even more GUI stuff @@ -745,7 +746,11 @@ class MainWindow (Window): store.clear() if name: - for cat, pkg, is_inst in self.db.get_cat(name, self.sortPkgListByName): + for cat, pkg, is_inst, disabled in self.db.get_cat(name, self.sortPkgListByName): + if disabled: + warning(_("Package '%s/%s' is disabled."), cat, pkg) + continue + if is_inst: icon = self.icons["installed"] elif not self.showAll: @@ -806,6 +811,8 @@ class MainWindow (Window): self.slotcol.set_visible(False) packages = system.sort_package_list(system.find_packages(cp, masked=True)) + if not packages: + raise VersionsNotFoundException(cp) # append versions for vers, inst, slot in ((x.get_version(), x.is_installed(), get_slot(x)) for x in packages): @@ -1336,8 +1343,17 @@ class MainWindow (Window): """ store, it = selection.get_selected() if it: + oldcp = self.selCP + self.selCP = "%s/%s" % (store.get_value(it, 2), store.get_value(it, 1)) - self.fill_version_list(self.selCP) + try: + self.fill_version_list(self.selCP) + except VersionsNotFoundException, e: + warning(_("No versions of package '%s' found!.") % self.selCP) + no_versions_dialog(self.selCP) + self.db.disable(self.selCP) + self.selCP = oldcp + return True def cb_pkg_list_header_clicked(self, col): |