From ae7f2d4cc94dcbc2c0d19dfb4d0154589e117cd5 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Mon, 18 Jun 2007 15:32:23 +0000 Subject: added updated list to Qt --- portato/gui/qt/windows.py | 47 +++++++++++++++- portato/gui/templates/ui/MainWindow.ui | 8 ++- portato/gui/templates/ui/UpdateDialog.ui | 93 ++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 portato/gui/templates/ui/UpdateDialog.ui (limited to 'portato/gui') diff --git a/portato/gui/qt/windows.py b/portato/gui/qt/windows.py index 9f91109..3996563 100644 --- a/portato/gui/qt/windows.py +++ b/portato/gui/qt/windows.py @@ -140,6 +140,45 @@ class SearchDialog (Window): self.done(0) self.jumpTo(s) +class UpdateDialog (Window): + """Dialog showing updateble packages.""" + __metaclass__ = WindowMeta + + def __init__ (self, parent, packages, queue, jump_to): + Window.__init__(self, parent) + + self.queue = queue + self.jump = jump_to + + self.packages = system.sort_package_list(packages) + for p in self.packages: + Qt.QListWidgetItem(p.get_cpv(), self.packageList) + + self.adjustSize() + + @Qt.pyqtSignature("QListWidgetItem*, QListWidgetItem*") + def on_packageList_currentItemChanged (self, index, prev): + cpv = str(index.text()) + pkg = system.new_package(cpv) + self.jump(pkg.get_cp(), pkg.get_version()) + + @Qt.pyqtSignature("") + def on_installAllBtn_clicked (self): + world = [x.get_cp() for x in system.find_all_world_packages()] + for p in self.packages: + not_in_world = p.get_cp() not in world + try: + try: + self.queue.append(p.get_cpv(), unmerge = False, oneshot = not_in_world) + except PackageNotFoundException, e: + if unmask_dialog(self, e[0]) == Qt.QMessageBox.Yes : + self.queue.append(p.get_cpv(), unmerge = False, unmask = True, oneshot = not_in_world) + + except BlockedException, e: + blocked_dialog(self, e[0], e[1]) + + self.accept() + class EbuildDialog (Window): """Window showing an ebuild.""" __metaclass__ = WindowMeta @@ -691,9 +730,9 @@ class MainWindow (Window): self.tabWidget.setTabText(self.CONSOLE_PAGE, title) - def jump_to (self, cp): + def jump_to (self, cp, version = None): """Is called when we want to jump to a specific package.""" - self.pkgDetails.update(cp, self.queue) + self.pkgDetails.update(cp, self.queue, version = version) def fill_pkg_list (self, cat): use_icons = self.cfg.get_boolean("pkgIcons", section = "QT") @@ -786,6 +825,10 @@ class MainWindow (Window): else: self.queue.sync() + @Qt.pyqtSignature("") + def on_updateListAction_triggered (self): + Window.watch_cursor(UpdateDialog)(self, system.get_updated_packages(), self.queue, self.jump_to).exec_() + @Qt.pyqtSignature("") def on_oneshotAction_triggered (self): current = self.queueList.currentItem() diff --git a/portato/gui/templates/ui/MainWindow.ui b/portato/gui/templates/ui/MainWindow.ui index cd7b40c..e2eb0dc 100644 --- a/portato/gui/templates/ui/MainWindow.ui +++ b/portato/gui/templates/ui/MainWindow.ui @@ -416,7 +416,7 @@ p, li { white-space: pre-wrap; } 0 0 466 - 27 + 31 @@ -441,6 +441,7 @@ p, li { white-space: pre-wrap; } + @@ -534,6 +535,11 @@ p, li { white-space: pre-wrap; } Sort by Name + + + Show &new packages + + diff --git a/portato/gui/templates/ui/UpdateDialog.ui b/portato/gui/templates/ui/UpdateDialog.ui new file mode 100644 index 0000000..b783182 --- /dev/null +++ b/portato/gui/templates/ui/UpdateDialog.ui @@ -0,0 +1,93 @@ + + UpdateDialog + + + + 0 + 0 + 400 + 372 + + + + Update List + + + + 9 + + + 6 + + + + + true + + + QAbstractItemView::ScrollPerPixel + + + + + + + 0 + + + 6 + + + + + + 1 + 0 + 0 + 0 + + + + Close + + + + + + + + 1 + 0 + 0 + 0 + + + + Install all + + + + + + + + + + + closeBtn + clicked() + UpdateDialog + reject() + + + 117 + 352 + + + 140 + 368 + + + + + -- cgit v1.2.3-54-g00ecf