diff options
author | Christopher Harvey <chris@basementcode.com> | 2010-06-02 06:52:03 -0400 |
---|---|---|
committer | Christopher Harvey <chris@basementcode.com> | 2010-06-02 06:52:03 -0400 |
commit | 7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f (patch) | |
tree | 3b12ac4e1a64959ee35d37db3a8a011f8ab03a1c /src | |
parent | Added the option to display the RcUpdate window. (added a button) (diff) | |
download | ventoo-7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f.tar.gz ventoo-7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f.tar.bz2 ventoo-7a0907a6e301aa54ab4a14330a3e2dafa0f0b09f.zip |
rc-update window now applies changes.
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/RcUpdateWindow.py | 21 |
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 |