diff options
author | necoro <> | 2006-10-27 13:58:52 +0000 |
---|---|---|
committer | necoro <> | 2006-10-27 13:58:52 +0000 |
commit | 3384091af579dbafdc366753cf846e3e63c61f7b (patch) | |
tree | 680428f2043735763f51c38f4e891ae79301b2ea /geneticone/gui | |
parent | f8bcb199cd5569dba9039c0286456a2d651a22a8 (diff) | |
download | portato-3384091af579dbafdc366753cf846e3e63c61f7b.tar.gz portato-3384091af579dbafdc366753cf846e3e63c61f7b.tar.bz2 portato-3384091af579dbafdc366753cf846e3e63c61f7b.zip |
Moved gtk-specific stuff to an extra subdir to make it more flexible for qt
Diffstat (limited to '')
-rw-r--r-- | geneticone/gui/__init__.py | 4 | ||||
-rw-r--r-- | geneticone/gui/gtk/__init__.py | 13 | ||||
-rw-r--r-- | geneticone/gui/gtk/dialogs.py (renamed from geneticone/gui/dialogs.py) | 1 | ||||
-rw-r--r-- | geneticone/gui/gtk/windows.py (renamed from geneticone/gui/windows.py) | 35 | ||||
-rw-r--r-- | geneticone/gui/gui_helper.py | 54 |
5 files changed, 63 insertions, 44 deletions
diff --git a/geneticone/gui/__init__.py b/geneticone/gui/__init__.py index d5e75c3..25123c8 100644 --- a/geneticone/gui/__init__.py +++ b/geneticone/gui/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # File: geneticone/gui/__init__.py # This file is part of the Genetic/One-Project, a graphical portage-frontend. @@ -9,4 +10,5 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from windows import * +import gtk +from gtk import * diff --git a/geneticone/gui/gtk/__init__.py b/geneticone/gui/gtk/__init__.py new file mode 100644 index 0000000..e58319a --- /dev/null +++ b/geneticone/gui/gtk/__init__.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# +# File: geneticone/gui/__init__.py +# This file is part of the Genetic/One-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 windows import MainWindow diff --git a/geneticone/gui/dialogs.py b/geneticone/gui/gtk/dialogs.py index 4de66f1..92b3c7f 100644 --- a/geneticone/gui/dialogs.py +++ b/geneticone/gui/gtk/dialogs.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # File: geneticone/gui/dialogs.py # This file is part of the Genetic/One-Project, a graphical portage-frontend. diff --git a/geneticone/gui/windows.py b/geneticone/gui/gtk/windows.py index 3daab81..0277e51 100644 --- a/geneticone/gui/windows.py +++ b/geneticone/gui/gtk/windows.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # File: geneticone/gui/windows.py # This file is part of the Genetic/One-Project, a graphical portage-frontend. @@ -22,9 +23,10 @@ import gobject from geneticone.helper import * from geneticone import backend from geneticone.backend import flags +from geneticone.backend.exceptions import * # more GUI stuff -from gui_helper import Database, Config, EmergeQueue +from geneticone.gui.gui_helper import Database, Config, EmergeQueue from dialogs import * # for the terminal @@ -531,10 +533,14 @@ class PackageWindow (AbstractDialog): elif self.flagChanged: if self.queue: try: - self.queue.append(self.actual_package().get_cpv(), update = True) - except backend.PackageNotFoundException, e: - if unmask_dialog(e[0]) == gtk.RESPONSE_YES: - self.queue.append(self.actual_package().get_cpv(), update = True, unmask = True) + try: + self.queue.append(self.actual_package().get_cpv(), update = True) + except backend.PackageNotFoundException, e: + if unmask_dialog(e[0]) == gtk.RESPONSE_YES: + self.queue.append(self.actual_package().get_cpv(), update = True, unmask = True) + except backend.BlockedException, e: + blocked_dialog(e[0], e[1]) + self.window.destroy() return True @@ -544,12 +550,15 @@ class PackageWindow (AbstractDialog): not_root_dialog() else: try: - self.queue.append(self.actual_package().get_cpv(), unmerge = False) - self.window.destroy() - except backend.PackageNotFoundException, e: - if unmask_dialog(e[0]) == gtk.RESPONSE_YES: - self.queue.append(self.actual_package().get_cpv(), unmerge = False, unmask = True) + try: + self.queue.append(self.actual_package().get_cpv(), unmerge = False) self.window.destroy() + except backend.PackageNotFoundException, e: + if unmask_dialog(e[0]) == gtk.RESPONSE_YES: + self.queue.append(self.actual_package().get_cpv(), unmerge = False, unmask = True) + self.window.destroy() + except BlockedException, e: + blocked_dialog(e[0], e[1]) return True def cb_unmerge_clicked (self, button, data = None): @@ -953,9 +962,11 @@ class MainWindow: updating = backend.update_world(newuse = self.cfg.get_boolean(self.cfg.const["newuse_opt"]), deep = self.cfg.get_boolean(self.cfg.const["deep_opt"])) debug("updating list:", [(x.get_cpv(), y.get_cpv()) for x,y in updating]) - for pkg, old_pkg in updating: + try: + for pkg, old_pkg in updating: self.queue.append(pkg.get_cpv()) - + except BlockedException, e: + blocked_dialog(e[0], e[1]) if len(updating): self.doUpdate = True return True diff --git a/geneticone/gui/gui_helper.py b/geneticone/gui/gui_helper.py index 1c0ae90..2f758b2 100644 --- a/geneticone/gui/gui_helper.py +++ b/geneticone/gui/gui_helper.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # File: geneticone/gui/gui_helper.py # This file is part of the Genetic/One-Project, a graphical portage-frontend. @@ -14,9 +15,6 @@ from geneticone import backend from geneticone.backend import flags from geneticone.helper import * -# our dialogs -import dialogs - # some stuff needed from subprocess import Popen, PIPE, STDOUT from threading import Thread @@ -356,35 +354,29 @@ class EmergeQueue: @raises geneticone.backend.PackageNotFoundException: if trying to add a package which does not exist""" if not unmerge: # emerge - try: - # insert dependencies - pkg = self._get_pkg_from_cpv(cpv, unmask) - deps = pkg.get_dep_packages() - - if update: - if not forceUpdate and deps == self.deps[cpv]: - return # nothing changed - return - else: - hasBeenInQueue = (cpv in self.mergequeue or cpv in self.oneshotmerge) - parentIt = self.tree.iter_parent(self.iters[cpv]) - - # delete it out of the tree - but NOT the changed flags - self.remove_with_children(self.iters[cpv], removeNewFlags = False) - - if hasBeenInQueue: # package has been in queue before - options += self._queue_append(cpv, oneshot) - - self.update_tree(parentIt, cpv, unmask, options = options) - else: # not update - options += self._queue_append(cpv, oneshot) - if self.emergeIt: - self.update_tree(self.emergeIt, cpv, unmask, options) + # insert dependencies + pkg = self._get_pkg_from_cpv(cpv, unmask) + deps = pkg.get_dep_packages() + + if update: + if not forceUpdate and deps == self.deps[cpv]: + return # nothing changed - return + else: + hasBeenInQueue = (cpv in self.mergequeue or cpv in self.oneshotmerge) + parentIt = self.tree.iter_parent(self.iters[cpv]) + + # delete it out of the tree - but NOT the changed flags + self.remove_with_children(self.iters[cpv], removeNewFlags = False) + + if hasBeenInQueue: # package has been in queue before + options += self._queue_append(cpv, oneshot) + + self.update_tree(parentIt, cpv, unmask, options = options) + else: # not update + options += self._queue_append(cpv, oneshot) + if self.emergeIt: + self.update_tree(self.emergeIt, cpv, unmask, options) - except backend.BlockedException, e : # there is sth blocked --> call blocked_dialog - blocks = e[0] - dialogs.blocked_dialog(cpv, blocks) - return - else: # unmerge self.unmergequeue.append(cpv) if self.unmergeIt: # update tree |