Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian <icarito@sugarlabs.org>2011-03-20 18:33:28 (GMT)
committer Sebastian <icarito@sugarlabs.org>2011-03-20 18:33:28 (GMT)
commit27a4b6235ab4c174f424d4256c999c346908efc5 (patch)
tree023e34107489288460057d0344ce25b7bd563585
parentf776df52b821369f0bfd4c3686d686f061c309f6 (diff)
Fixed Atmosphere toolbar and error on exit.HEADmaster
-rw-r--r--activity.py69
-rw-r--r--atm_toolbars.py13
2 files changed, 51 insertions, 31 deletions
diff --git a/activity.py b/activity.py
index 355f2b1..3b01cf0 100644
--- a/activity.py
+++ b/activity.py
@@ -90,31 +90,52 @@ class AcousticMeasureActivity(Activity):
self._logger.error("setlocale failed")
# top toolbar with share and close buttons:
-
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##
+ from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton
+ from sugar.activity.widgets import ShareButton, StopButton, \
+ ActivityButton, TitleEntry
+ from sugar.graphics.toolbutton import ToolButton
+ toolbar_box = ToolbarBox()
+ activity_button = ActivityButton(self)
+ toolbar_box.toolbar.insert(activity_button, 0)
+ activity_button.show()
+
+ self._t_h_bar = atm_toolbars.TempToolbar()
+ tb = gtk.HBox()
+ self._t_h_bar.bigbox.reparent(tb)
+ self._t_h_bar.bigbox.show_all()
+ adj_button = ToolbarButton(page=tb,
+ icon_name='preferences-system')
+ toolbar_box.toolbar.insert(adj_button, -1)
+ adj_button.show()
+
+ separator = gtk.SeparatorToolItem()
+ toolbar_box.toolbar.insert(separator, -1)
+ separator.show()
+
+ title_entry = TitleEntry(self)
+ toolbar_box.toolbar.insert(title_entry, -1)
+ title_entry.show()
+
+ share_button = ShareButton(self)
+ toolbar_box.toolbar.insert(share_button, -1)
+ share_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:
toolbox = ActivityToolbox(self)
self.set_toolbox(toolbox)
diff --git a/atm_toolbars.py b/atm_toolbars.py
index 169e3ee..221b8ae 100644
--- a/atm_toolbars.py
+++ b/atm_toolbars.py
@@ -15,7 +15,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import gtk
-import gtk.gdk
import gobject
import arange
import locale
@@ -32,7 +31,7 @@ class TempToolbar(gtk.Toolbar):
self._temp_field.set_max_length(6)
self._temp_field.set_width_chars(6)
self._temp_field.connect("changed", self._update_cb)
-
+
temp_group = gtk.HBox()
temp_group.pack_start(temp_label, expand=False, fill=False)
temp_group.pack_end(self._temp_field, expand=False,fill=False)
@@ -54,18 +53,18 @@ class TempToolbar(gtk.Toolbar):
result_group.pack_start(result_label, expand=False, fill=False)
result_group.pack_end(self._result, expand=False, fill=False)
- bigbox = gtk.HBox()
+ self.bigbox = gtk.HBox()
- bigbox.pack_start(temp_group, expand=False, fill=False)
- bigbox.pack_start(humid_group, expand=True, fill=False)
- bigbox.pack_end(result_group, expand=False, fill=False)
+ self.bigbox.pack_start(temp_group, expand=False, fill=False)
+ self.bigbox.pack_start(humid_group, expand=True, fill=False)
+ self.bigbox.pack_end(result_group, expand=False, fill=False)
self.set_temp(25)
self.set_humid(60)
self.update_speed()
tool_item = gtk.ToolItem()
- tool_item.add(bigbox)
+ tool_item.add(self.bigbox)
tool_item.set_expand(True)
self.insert(tool_item, 0)
tool_item.show()