Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-07-25 18:39:03 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-07-25 18:39:03 (GMT)
commitda089f3200a0fc390046af4e7f29b57d356051f7 (patch)
tree2970428a140aa7f27041e2d86df413c801ac84a9
parent25ea29ca0a94e16522fba88d4b10d0306b11a98a (diff)
adpating to if have toolbar (only for versions after 0.84)
-rwxr-xr-xterminal.py123
1 files changed, 62 insertions, 61 deletions
diff --git a/terminal.py b/terminal.py
index ad8e2ed..27616cd 100755
--- a/terminal.py
+++ b/terminal.py
@@ -61,70 +61,71 @@ class TerminalActivity(activity.Activity):
self.max_participants = 1
- toolbar_box = ToolbarBox()
-
- activity_button = ActivityToolbarButton(self)
- toolbar_box.toolbar.insert(activity_button, 0)
- activity_button.page.keep.props.accelerator = '<Ctrl><Shift>S'
- activity_button.show()
-
- edit_toolbar = self._create_edit_toolbar()
- edit_toolbar_button = ToolbarButton(
- page=edit_toolbar,
- icon_name='toolbar-edit')
- edit_toolbar.show()
- toolbar_box.toolbar.insert(edit_toolbar_button, -1)
- edit_toolbar_button.show()
-
- view_toolbar = self._create_view_toolbar()
- view_toolbar_button = ToolbarButton(
+ if _HAVE_TOOLBOX:
+ toolbar_box = ToolbarBox()
+
+ activity_button = ActivityToolbarButton(self)
+ toolbar_box.toolbar.insert(activity_button, 0)
+ activity_button.page.keep.props.accelerator = '<Ctrl><Shift>S'
+ activity_button.show()
+
+ edit_toolbar = self._create_edit_toolbar()
+ edit_toolbar_button = ToolbarButton(
+ page=edit_toolbar,
+ icon_name='toolbar-edit')
+ edit_toolbar.show()
+ toolbar_box.toolbar.insert(edit_toolbar_button, -1)
+ edit_toolbar_button.show()
+
+ view_toolbar = self._create_view_toolbar()
+ view_toolbar_button = ToolbarButton(
page=view_toolbar,
- icon_name='toolbar-view')
- view_toolbar.show()
- toolbar_box.toolbar.insert(view_toolbar_button, -1)
- view_toolbar_button.show()
-
- self._delete_tab_toolbar = None
- self._previous_tab_toolbar = None
- self._next_tab_toolbar = None
- tab_toolbar = self._create_tab_toolbar()
- tab_toolbar_button = ToolbarButton(
- page=tab_toolbar,
- icon_name='toolbar-tab')
- tab_toolbar.show()
- toolbar_box.toolbar.insert(tab_toolbar_button, -1)
- tab_toolbar_button.show()
+ icon_name='toolbar-view')
+ view_toolbar.show()
+ toolbar_box.toolbar.insert(view_toolbar_button, -1)
+ view_toolbar_button.show()
+
+ self._delete_tab_toolbar = None
+ self._previous_tab_toolbar = None
+ self._next_tab_toolbar = None
+ tab_toolbar = self._create_tab_toolbar()
+ tab_toolbar_button = ToolbarButton(
+ page=tab_toolbar,
+ icon_name='toolbar-tab')
+ tab_toolbar.show()
+ toolbar_box.toolbar.insert(tab_toolbar_button, -1)
+ tab_toolbar_button.show()
# Add a button that will be used to become root easily.
- root_button = ToolButton('activity-become-root')
- root_button.set_tooltip(_('Become root'))
- root_button.connect('clicked', self.__become_root_cb)
- toolbar_box.toolbar.insert(root_button, -1)
- root_button.show()
-
- separator = gtk.SeparatorToolItem()
- separator.props.draw = False
- separator.set_expand(True)
- toolbar_box.toolbar.insert(separator, -1)
- separator.show()
-
- stop_button = StopButton(self)
- stop_button.props.accelerator = '<Ctrl><Shift>Q'
- toolbar_box.toolbar.insert(stop_button, -1)
- stop_button.show()
-
- self.set_toolbar_box(toolbar_box)
- toolbar_box.show()
- self._update_accelerators(toolbar_box)
-
- self._notebook = Notebook()
- self._notebook.set_property("tab-pos", gtk.POS_TOP)
- self._notebook.set_scrollable(True)
- self._notebook.show()
-
- self.set_canvas(self._notebook)
-
- self._create_tab(None)
+ root_button = ToolButton('activity-become-root')
+ root_button.set_tooltip(_('Become root'))
+ root_button.connect('clicked', self.__become_root_cb)
+ toolbar_box.toolbar.insert(root_button, -1)
+ root_button.show()
+
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = False
+ separator.set_expand(True)
+ toolbar_box.toolbar.insert(separator, -1)
+ separator.show()
+
+ stop_button = StopButton(self)
+ stop_button.props.accelerator = '<Ctrl><Shift>Q'
+ toolbar_box.toolbar.insert(stop_button, -1)
+ stop_button.show()
+
+ self.set_toolbar_box(toolbar_box)
+ toolbar_box.show()
+ self._update_accelerators(toolbar_box)
+
+ self._notebook = Notebook()
+ self._notebook.set_property("tab-pos", gtk.POS_TOP)
+ self._notebook.set_scrollable(True)
+ self._notebook.show()
+
+ self.set_canvas(self._notebook)
+
+ self._create_tab(None)
def _update_accelerators(self, container):
for child in container.get_children():