summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui')
-rw-r--r--portato/gui/gtk/__init__.py25
-rw-r--r--portato/gui/qt/__init__.py21
-rw-r--r--portato/gui/qt/windows.py3
3 files changed, 46 insertions, 3 deletions
diff --git a/portato/gui/gtk/__init__.py b/portato/gui/gtk/__init__.py
index 5e164db..db9e6e1 100644
--- a/portato/gui/gtk/__init__.py
+++ b/portato/gui/gtk/__init__.py
@@ -10,8 +10,31 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
-from windows import MainWindow
+import gtk
+from portato import plugin
+from portato.backend import system
+from windows import MainWindow, SearchWindow, EbuildWindow
def run ():
m = MainWindow()
m.main()
+
+def show_ebuild (pkg):
+ plugin.load_plugins("gtk")
+
+ def _show (pkg):
+ gtk.main_quit()
+
+ hook = plugin.hook("open_ebuild", pkg, None)
+
+ ew = hook(EbuildWindow)(None, system.new_package(pkg))
+ ew.window.connect("destroy", lambda *x: gtk.main_quit())
+ ew.window.set_title("Portato Ebuild Viewer - %s" % pkg)
+
+ gtk.main()
+
+ s = SearchWindow(None, [x.get_cpv() for x in system.sort_package_list(system.find_all_packages(pkg, True))], _show)
+ s.window.set_title("Portato Ebuild Viewer - Search")
+ s.window.connect("destroy", lambda *x: gtk.main_quit())
+
+ gtk.main()
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."""
a>René 'Necoro' Neumann10-424/+549 2008-03-12Moved get_dependencies to top package classRené 'Necoro' Neumann4-50/+85 2008-03-11improved performance by caching the use_expand queriesRené 'Necoro' Neumann1-5/+14 2008-03-11use catapult varsRené 'Necoro' Neumann2-4/+6 2008-03-11Updated catapult stuffRené 'Necoro' Neumann5-56/+108 2008-03-10Generate correct KeyNotFoundExceptionRené 'Necoro' Neumann1-2/+2 2008-03-09Small changesRené 'Necoro' Neumann3-1/+4 2008-03-07Better session handlingRené 'Necoro' Neumann1-5/+54 2008-03-07Small changesRené 'Necoro' Neumann1-1/+4 2008-03-07Updated shm module to 1.2René 'Necoro' Neumann1-8/+21 2008-03-07Update TODORené 'Necoro' Neumann1-3/+1 2008-03-07hmm ... yesRené 'Necoro' Neumann1-1/+1 2008-03-06Used better exceptions for configuration parserRené 'Necoro' Neumann1-26/+114 2008-03-06Update translationRené 'Necoro' Neumann2-349/+393 2008-03-06Update createpot.shRené 'Necoro' Neumann1-3/+2 2008-03-06Use 'nofork' instead of 'nolistener'René 'Necoro' Neumann1-3/+3 2008-03-05Install glade files into template dir and not data dirRené 'Necoro' Neumann2-2/+1 2008-03-05Added dependency listRené 'Necoro' Neumann3-117/+237