summaryrefslogtreecommitdiff
path: root/portato/gui/qt/__init__.py
blob: 3f83aebf300016c6e995ee9e0237bdb3bef0f54a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
#
# File: portato/gui/qt/__init__.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
# Copyright (C) 2007 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.
#
# 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, EbuildDialog, SearchDialog

def run():
	app = QApplication([])
	m = MainWindow()
	app.exec_()

def show_ebuild (pkg):
	plugin.load_plugins("qt")	
	app = QApplication([])
	
	def _show (pkg):
		pkg = system.new_package(pkg)
		hook = plugin.hook("open_ebuild", pkg, None)
		
		ew = hook(EbuildDialog)(None, pkg)
		ew.setWindowTitle("Portato Ebuild Viewer - %s" % pkg.get_cpv())
		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_()