From d59de05688787f7214a7bf05299b5163764e0d21 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 28 Jul 2008 21:22:42 +0200 Subject: First support for the new emerge options --- portato/gui/templates/MainWindow.glade | 225 +++++++++++++++++++-------------- portato/gui/windows/main.py | 35 ++--- 2 files changed, 147 insertions(+), 113 deletions(-) (limited to 'portato/gui') diff --git a/portato/gui/templates/MainWindow.glade b/portato/gui/templates/MainWindow.glade index 171545e..5823bcc 100644 --- a/portato/gui/templates/MainWindow.glade +++ b/portato/gui/templates/MainWindow.glade @@ -1,6 +1,6 @@ - + 2 @@ -46,8 +46,8 @@ Re_load Portage True - + True @@ -616,271 +616,271 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 0 - use flags - PANGO_ELLIPSIZE_END + label True 1 2 - 4 - 5 + 3 + 4 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True 0 - <b>Use Flags:</b> + <b>License:</b> True True - 4 - 5 + 3 + 4 GTK_FILL 5 - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - Testing - 0 - 0 - True - + <b>Installed, but not in portage anymore</b> + True - 7 - 8 - GTK_FILL + 2 + 5 + 6 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 + True + <span foreground='red'><b>MISSING KEYWORD</b></span> + True - 1 2 - 8 - 9 + 5 + 6 - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - Masked - 0 - 0 - True - + 5 + + + - 8 - 9 - GTK_FILL + 1 + 2 + 2 + 3 - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - Installed 0 - 0 - True - + <b>Description:</b> + True + True - 6 - 7 GTK_FILL + 5 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True 0 - <b>Homepage:</b> + <b>Overlay:</b> True True - 2 - 3 + 1 + 2 GTK_FILL 5 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True 0 label - True + True 1 2 - 1 - 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True 0 label - True + True 1 2 + 1 + 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True 0 - <b>Overlay:</b> + <b>Homepage:</b> True True - 1 - 2 + 2 + 3 GTK_FILL 5 - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + Installed 0 - <b>Description:</b> - True - True + 0 + True + + 6 + 7 GTK_FILL - 5 - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - + True + Masked + 0 + 0 + True + - 1 - 2 - 2 - 3 + 8 + 9 + GTK_FILL - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - <span foreground='red'><b>MISSING KEYWORD</b></span> - True + 0 + 1 2 - 5 - 6 + 8 + 9 - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - <b>Installed, but not in portage anymore</b> - True + Testing + 0 + 0 + True + - 2 - 5 - 6 + 7 + 8 + GTK_FILL - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True 0 - <b>License:</b> + <b>Use Flags:</b> True True - 3 - 4 + 4 + 5 GTK_FILL 5 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 0 - label + use flags + PANGO_ELLIPSIZE_END True 1 2 - 3 - 4 + 4 + 5 @@ -1140,6 +1140,35 @@ False + + + True + True + + + True + True + --oneshot + 0 + True + + + + 5 + + + + + + + + + + + False + 1 + + True @@ -1159,7 +1188,7 @@ - 1 + 2 diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 06ec9ea..1b1ddac 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -641,6 +641,7 @@ class MainWindow (Window): self.searchEntry = self.tree.get_widget("searchEntry") # queue list + self.queueOneshot = self.tree.get_widget("oneshotCB") self.queueList = self.tree.get_widget("queueList") self.build_queue_list() @@ -766,6 +767,8 @@ class MainWindow (Window): col = gtk.TreeViewColumn(_("Options"), cell, markup = 1) self.queueList.append_column(col) + self.queueList.get_selection().connect("changed", self.cb_queue_list_selection) + def build_cat_list (self): """ Builds the category list. @@ -1267,6 +1270,17 @@ class MainWindow (Window): return True + def cb_queue_list_selection (self, selection): + store, it = selection.get_selected() + if it: + if self.queueTree.is_in_emerge(it) and self.queueTree.iter_has_parent(it): + package = store.get_value(it, 0) + self.queueOneshot.set_active(package in self.queue.oneshotmerge) + return True + + self.queueOneshot.set_active(False) + return True + def cb_queue_row_activated (self, view, path, *args): """Callback for an activated row in the emergeQueue. Opens a package window.""" store = self.queueTree @@ -1617,17 +1631,7 @@ class MainWindow (Window): y = int(event.y) time = event.time - if object == self.queueList: - pthinfo = object.get_path_at_pos(x, y) - if pthinfo is not None: - path, col, cellx, celly = pthinfo - it = self.queueList.get_model().get_iter(path) - if self.queueTree.is_in_emerge(it) and self.queueTree.iter_has_parent(it): - object.grab_focus() - object.set_cursor(path, col, 0) - self.queuePopup.popup(None, None, None, event.button, time) - return True - elif object == self.console: + if object == self.console: self.consolePopup.popup(None, None, None, event.button, time) else: return False @@ -1641,10 +1645,11 @@ class MainWindow (Window): sel = self.queueList.get_selection() store, it = sel.get_selected() if it: - package = store.get_value(it, 0) - set = (package not in self.queue.oneshotmerge) - - self.queue.append(package, update = True, oneshot = set, forceUpdate = True) + if self.queueTree.is_in_emerge(it) and self.queueTree.iter_has_parent(it): + package = store.get_value(it, 0) + set = (package not in self.queue.oneshotmerge) + + self.queue.append(package, update = True, oneshot = set, forceUpdate = True) def cb_pause_emerge (self, curr): """ -- cgit v1.2.3-54-g00ecf