summaryrefslogtreecommitdiff
path: root/portato/gui/gtk/__init__.py
blob: ba496528f0ba61c4ae10865b9c8e4d8908ff9fcf (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
#
# File: portato/gui/gtk/__init__.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
# Copyright (C) 2006 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 gettext import lgettext as _

from portato import listener
from exception_handling import register_ex_handler

def run ():
	from splash import SplashScreen
	try:
		s = SplashScreen(_("Loading Portage"))
		register_ex_handler()
		s.show()
		from windows import MainWindow
		m = MainWindow(s)
		s.hide()
		m.main()
	except KeyboardInterrupt:
		pass

	listener.close()

def show_ebuild (pkg):	
	import gtk
	from portato import plugin
	from portato.backend import system
	from windows import SearchWindow, EbuildWindow

	plugin.load_plugins("gtk")
	register_ex_handler()

	def _show (pkg):
		gtk.main_quit()

		pkg = system.new_package(pkg)
		hook = plugin.hook("open_ebuild", pkg, None)
		
		ew = hook(EbuildWindow)(None, pkg)
		ew.window.connect("destroy", lambda *x: gtk.main_quit())
		ew.window.set_title("Portato Ebuild Viewer - %s" % pkg.get_cpv())
		
		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()
ref='/others/cgit.git/commit/ui-view.c?h=v0.8.3.3&id=06fe0c2f47eaf467db8ab1443e61dfa1c280f30a&follow=1'>Add display of tree content w/ui-tree.cLars Hjemli9-8/+113 2006-12-12cache_lock: do xstrdup/free on lockfileLars Hjemli1-1/+2 2006-12-11Don't truncate valid cachefilesLars Hjemli3-4/+16 2006-12-11Move global variables + callback functions into shared.cLars Hjemli4-82/+86 2006-12-11Move functions for generic object output into ui-view.cLars Hjemli4-34/+43 2006-12-11Move log-functions into ui-log.cLars Hjemli5-111/+121 2006-12-11Move repo summary functions into ui-summary.cLars Hjemli4-47/+59 2006-12-11Move functions for repolist output into ui-repolist.cLars Hjemli5-70/+90 2006-12-11Move common output-functions into ui-shared.cLars Hjemli4-82/+99 2006-12-11Rename config.c to parsing.c + move cgit_parse_query from cgit.c to parsing.cLars Hjemli4-28/+29 2006-12-11Avoid infinite loops in caching layerLars Hjemli3-14/+31 2006-12-11Let 'make install' clear all cachefilesLars Hjemli1-0/+2 2006-12-11Fix cache algorithm loopholeLars Hjemli3-11/+16 2006-12-10Add version identifier in generated filesLars Hjemli2-9/+14 2006-12-10Add license file and copyright noticesLars Hjemli5-0/+372 2006-12-10Add caching infrastructureLars Hjemli9-28/+353