aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Harvey <chris@basementcode.com>2010-06-02 06:52:03 -0400
committerChristopher Harvey <chris@basementcode.com>2010-06-02 06:52:03 -0400
commit7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f (patch)
tree3b12ac4e1a64959ee35d37db3a8a011f8ab03a1c
parentAdded the option to display the RcUpdate window. (added a button) (diff)
downloadventoo-7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f.tar.gz
ventoo-7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f.tar.bz2
ventoo-7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f.zip
rc-update window now applies changes.
-rw-r--r--src/frontend/RcUpdateWindow.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/frontend/RcUpdateWindow.py b/src/frontend/RcUpdateWindow.py
index a9653e1..29533f7 100644
--- a/src/frontend/RcUpdateWindow.py
+++ b/src/frontend/RcUpdateWindow.py
@@ -55,7 +55,7 @@ class RcUpdateWindow(gtk.Window):
for level in self.runlevels:
renderer = gtk.CellRendererToggle()
renderer.set_property("activatable", True)
- renderer.connect("toggled", self.entry_toggled)
+ renderer.connect("toggled", self.entry_toggled, i)
column = gtk.TreeViewColumn(level)
column.pack_start(renderer, False)
column.add_attribute(renderer, 'active', i)
@@ -101,9 +101,22 @@ class RcUpdateWindow(gtk.Window):
else:
pass #say something about having to be a root user to rc-update
- def entry_toggled(self, cell, path):
- #column = int(path)
- #self.tv_store[path][0] = not self.tv_store[path][0]
+ def entry_toggled(self, cell, path, column):
+ add = not self.tv_store[path][column]
+ scriptName = self.tv_store[path][0]
+ call = ["rc-update"]
+ if add:
+ call.append("add")
+ else:
+ call.append("del")
+ call.append(scriptName)
+ level = self.runlevels[column-1]
+ call.append(level)
+ retcode = subprocess.call(call)
+ if retcode == 0:
+ self.tv_store[path][column] = not self.tv_store[path][column]
+ else:
+ print "Call to rc-update failed." #TODO: print nice error.
#self.emit("entry-toggled", path)
pass