diff options
author | necoro <> | 2007-04-07 22:20:25 +0000 |
---|---|---|
committer | necoro <> | 2007-04-07 22:20:25 +0000 |
commit | f6b57b91d9af93a463b9549a6977feb48169c765 (patch) | |
tree | 6ae0881f73fd970f1387515527f122de2aedfb92 /portato/gui/gtk | |
parent | 6fdf641424e50fb7515b843612b0625e31c4cf02 (diff) | |
download | portato-f6b57b91d9af93a463b9549a6977feb48169c765.tar.gz portato-f6b57b91d9af93a463b9549a6977feb48169c765.tar.bz2 portato-f6b57b91d9af93a463b9549a6977feb48169c765.zip |
Some more functionality for the Qt-Frontend
Diffstat (limited to '')
-rw-r--r-- | portato/gui/gtk/dialogs.py | 2 | ||||
-rw-r--r-- | portato/gui/gtk/windows.py | 8 | ||||
-rw-r--r-- | portato/gui/gtk/wrapper.py | 32 |
3 files changed, 10 insertions, 32 deletions
diff --git a/portato/gui/gtk/dialogs.py b/portato/gui/gtk/dialogs.py index 68cd629..f6573ef 100644 --- a/portato/gui/gtk/dialogs.py +++ b/portato/gui/gtk/dialogs.py @@ -35,7 +35,7 @@ def not_root_dialog (): return ret def unmask_dialog (cpv): - dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, cpv+" seems to be masked.\nDo you want to unmask it and its dependencies?.\n") + dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, cpv+" seems to be masked.\nDo you want to unmask it and its dependencies?") ret = dialog.run() dialog.destroy() return ret diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py index 5b89aba..3fa39a8 100644 --- a/portato/gui/gtk/windows.py +++ b/portato/gui/gtk/windows.py @@ -32,9 +32,6 @@ from dialogs import * from wrapper import GtkTree, GtkConsole from usetips import UseTips -# for the terminal -import vte - # other import types @@ -712,7 +709,6 @@ class MainWindow (Window): # booleans self.doUpdate = False - self.packageInit = True # installed pixbuf self.instPixbuf = self.window.render_icon(gtk.STOCK_YES, gtk.ICON_SIZE_MENU) @@ -758,7 +754,7 @@ class MainWindow (Window): self.build_queue_list() # the terminal - self.console = vte.Terminal() + self.console = GtkConsole() self.termHB = self.tree.get_widget("termHB") self.build_terminal() @@ -776,7 +772,7 @@ class MainWindow (Window): # set emerge queue self.queueTree = GtkTree(self.queueList.get_model()) - self.queue = EmergeQueue(console = GtkConsole(self.console), tree = self.queueTree, db = self.db, title_update = self.title_update) + self.queue = EmergeQueue(console = self.console, tree = self.queueTree, db = self.db, title_update = self.title_update) def show_package (self, *args, **kwargs): self.packageTable.update(*args, **kwargs) diff --git a/portato/gui/gtk/wrapper.py b/portato/gui/gtk/wrapper.py index 95d8afa..bce4e07 100644 --- a/portato/gui/gtk/wrapper.py +++ b/portato/gui/gtk/wrapper.py @@ -11,6 +11,7 @@ # Written by René 'Necoro' Neumann <necoro@necoro.net> from portato.gui.wrapper import Tree, Console +import vte class GtkTree (Tree): """The implementation of the abstract tree.""" @@ -37,7 +38,7 @@ class GtkTree (Tree): if update: string += "<i>updating</i>" - if version != None: + if version is not None: string += "<i> from version %s</i>" % version return [cpv, string] @@ -49,10 +50,10 @@ class GtkTree (Tree): return self.unmergeIt def is_in_emerge (self, it): - return self.get_path_from_iter(it).split(":")[0] == self.get_path_from_iter(self.emergeIt) + return self.tree.get_string_from_iter(it).split(":")[0] == self.tree.get_string_from_iter(self.emergeIt) def is_in_unmerge (self, it): - return self.get_path_from_iter(it).split(":")[0] == self.get_path_from_iter(self.unmergeIt) + return self.tree.get_string_from_iter(it).split(":")[0] == self.tree.get_string_from_iter(self.unmergeIt) def iter_has_parent (self, it): return (self.tree.iter_parent(it) != None) @@ -72,14 +73,11 @@ class GtkTree (Tree): def get_value (self, it, column): return self.tree.get_value(it, column) - def get_path_from_iter (self, it): - return self.tree.get_string_from_iter(it) - def append (self, parent = None, values = None): return self.tree.append(parent, values) def remove (self, it): - return self.tree.remove(it) + self.tree.remove(it) def get_original (self): return self.tree @@ -87,22 +85,6 @@ class GtkTree (Tree): def get_cpv_column (self): return self.cpv_col -class GtkConsole (Console): +class GtkConsole (vte.Terminal, Console): """The implementation of the abstract Console for GTK.""" - - def __init__ (self, console): - """Constructor. - - @param console: the original console - @type console: vte.Terminal""" - - self.console = console - - def get_window_title(self): - return self.console.get_window_title() - - def set_pty (self, pty): - self.console.set_pty(pty) - - def get_original (self): - return self.console + pass |