diff options
Diffstat (limited to '')
-rw-r--r-- | portato/gui/qt/__init__.py | 21 | ||||
-rw-r--r-- | portato/gui/qt/windows.py | 3 |
2 files changed, 22 insertions, 2 deletions
diff --git a/portato/gui/qt/__init__.py b/portato/gui/qt/__init__.py index df49473..4882a73 100644 --- a/portato/gui/qt/__init__.py +++ b/portato/gui/qt/__init__.py @@ -10,10 +10,29 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> +from portato import plugin +from portato.backend import system + from PyQt4.Qt import QApplication -from windows import MainWindow +from windows import MainWindow, EbuildDialog, SearchDialog def run(): app = QApplication([]) m = MainWindow() app.exec_() + +def show_ebuild (pkg): + plugin.load_plugins("qt") + app = QApplication([]) + + def _show (pkg): + hook = plugin.hook("open_ebuild", pkg, None) + + ew = hook(EbuildDialog)(None, system.new_package(pkg)) + ew.setWindowTitle("Portato Ebuild Viewer - %s" % pkg) + ew.exec_() + + s = SearchDialog(None, [x.get_cpv() for x in system.sort_package_list(system.find_all_packages(pkg, True))], _show) + s.setWindowTitle("Portato Ebuild Viewer - Search") + s.show() + app.exec_() diff --git a/portato/gui/qt/windows.py b/portato/gui/qt/windows.py index 16daa5e..d701893 100644 --- a/portato/gui/qt/windows.py +++ b/portato/gui/qt/windows.py @@ -411,7 +411,8 @@ class PackageDetails: return self.packages[self.window.versCombo.currentIndex()] def cb_ebuild_clicked (self): - EbuildDialog(self.window, self.actual_package()).exec_() + hook = plugin.hook("open_ebuild", self.actual_package(), self.window) + hook(EbuildDialog)(self.window, self.actual_package()).exec_() def cb_emerge_clicked (self): """Callback for pressed emerge-button. Adds the package to the EmergeQueue.""" |