diff options
Diffstat (limited to 'geneticone/gui/windows.py')
-rw-r--r-- | geneticone/gui/windows.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/geneticone/gui/windows.py b/geneticone/gui/windows.py index 009e2f3..1b16598 100644 --- a/geneticone/gui/windows.py +++ b/geneticone/gui/windows.py @@ -567,11 +567,13 @@ class MainWindow: queueScroll = gtk.ScrolledWindow() queueScroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - emergeStore = gtk.TreeStore(str) + emergeStore = gtk.TreeStore(str,str) self.emergeView = gtk.TreeView(emergeStore) cell = gtk.CellRendererText() col = gtk.TreeViewColumn("Queue", cell, text = 0) self.emergeView.append_column(col) + col = gtk.TreeViewColumn("Options", cell, markup = 1) + self.emergeView.append_column(col) self.emergeView.connect("row-activated", self.cb_row_activated, emergeStore) self.emergeView.connect("button-press-event", self.cb_queue_right_click) self.emergeView.set_headers_visible(False) @@ -660,8 +662,8 @@ class MainWindow: um.insert_action_group(group,0) group = gtk.ActionGroup("PopupActions") - group.add_toggle_actions([ - ("Oneshot", None, "Oneshot")]) + group.add_actions([ + ("Oneshot", None, "Oneshot", None, None, self.cb_oneshot_clicked)]) um.insert_action_group(group, 1) @@ -808,6 +810,20 @@ class MainWindow: else: return False + def cb_oneshot_clicked (self, action): + sel = self.emergeView.get_selection() + store, it = sel.get_selected() + if it: + package = store.get_value(it, 0) + if not self.cfg.get_local(package, self.cfg.const["oneshot_opt"]): + set = True + else: + set = False + + self.cfg.set_local(package, self.cfg.const["oneshot_opt"], set) + self.queue.append(package, update = True, oneshot = set, forceUpdate = True) + + def main (self): """Main.""" gobject.threads_init() |