Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-03-06 00:37:29 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-03-06 00:37:29 (GMT)
commitf776df52b821369f0bfd4c3686d686f061c309f6 (patch)
tree55d166570238bd5aca49ae692c579c8be3d813b2 /activity.py
parent898df2195b101f247236f044513eaf7785fbaae1 (diff)
New toolbar + stop button
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py36
1 files changed, 31 insertions, 5 deletions
diff --git a/activity.py b/activity.py
index 055d074..355f2b1 100644
--- a/activity.py
+++ b/activity.py
@@ -90,12 +90,38 @@ class AcousticMeasureActivity(Activity):
self._logger.error("setlocale failed")
# top toolbar with share and close buttons:
- toolbox = ActivityToolbox(self)
- self.set_toolbox(toolbox)
- toolbox.show()
- self._t_h_bar = atm_toolbars.TempToolbar()
- toolbox.add_toolbar(gettext("Atmosphere"), self._t_h_bar)
+ try:
+ from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton
+ from sugar.activity.widgets import ActivityToolbarButton, StopButton
+
+ toolbar_box = ToolbarBox()
+ activity_button = ActivityToolbarButton(self)
+ toolbar_box.toolbar.insert(activity_button, 0)
+ activity_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()
+ toolbar=toolbar_box.toolbar
+ except ImportError: ##Fix me add atmosphere toolbar##
+
+ toolbox = ActivityToolbox(self)
+ self.set_toolbox(toolbox)
+ toolbox.show()
+
+ self._t_h_bar = atm_toolbars.TempToolbar()
+ toolbox.add_toolbar(gettext("Atmosphere"), self._t_h_bar)
if not self.powerd_running():
try: