summaryrefslogtreecommitdiff
path: root/geneticone/gui/windows.py
diff options
context:
space:
mode:
authornecoro <>2006-10-12 20:22:45 +0000
committernecoro <>2006-10-12 20:22:45 +0000
commit4c00d71ed816dbe04218db898d8e50864e7cd2b4 (patch)
tree9ff452099c3ab93ece8d6d509c01f0b375115359 /geneticone/gui/windows.py
parent4265c3fb0bf47f9460482ed46184cf1ef725ec59 (diff)
downloadportato-4c00d71ed816dbe04218db898d8e50864e7cd2b4.tar.gz
portato-4c00d71ed816dbe04218db898d8e50864e7cd2b4.tar.bz2
portato-4c00d71ed816dbe04218db898d8e50864e7cd2b4.zip
Enabled oneshot
Diffstat (limited to 'geneticone/gui/windows.py')
-rw-r--r--geneticone/gui/windows.py22
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()