Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/terminal.py
diff options
context:
space:
mode:
authorPhil Bordelon <phil@thenexusproject.org>2008-01-12 06:28:56 (GMT)
committer Michael Stone <michael@laptop.org>2008-01-12 06:54:01 (GMT)
commit49b4b00c266ba285656a39b748e90c7f904ab340 (patch)
tree63eb5ceac81d4ec2edf6e97e9c48cf461ec0793d /terminal.py
parentc9c870860aed795f9a7001c8239b4d6401ea4e15 (diff)
Add become_root material: a new icon and some code to add a button.
Signed-off-by: Michael Stone <michael@laptop.org>
Diffstat (limited to 'terminal.py')
-rw-r--r--terminal.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/terminal.py b/terminal.py
index 39e9148..967122f 100644
--- a/terminal.py
+++ b/terminal.py
@@ -58,6 +58,14 @@ class TerminalActivity(activity.Activity):
activity_toolbar.share.props.visible = False
activity_toolbar.keep.props.visible = False
+ # Add a button that will be used to become root easily.
+ activity_toolbar.become_root = ToolButton('activity-become-root')
+ activity_toolbar.become_root.set_tooltip(_('Become root'))
+ activity_toolbar.become_root.connect('clicked',
+ self._become_root_cb)
+ activity_toolbar.insert(activity_toolbar.become_root, 2)
+ activity_toolbar.become_root.show()
+
self.set_toolbox(toolbox)
toolbox.show()
@@ -84,6 +92,11 @@ class TerminalActivity(activity.Activity):
def _paste_cb(self, button):
self._vte.paste_clipboard()
+ def _become_root_cb(self, button):
+
+ # The become_root script is part of olpc-utils.
+ self._vte.feed_child("become_root\n")
+
def __key_press_cb(self, window, event):
if event.state & gtk.gdk.CONTROL_MASK and event.state & gtk.gdk.SHIFT_MASK: