Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TamTamJam.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2011-08-01 12:43:18 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2011-08-01 12:43:24 (GMT)
commita89a915761942812fa54dbe6e5a330c4d23a63c3 (patch)
tree1a2abc3f46ac8f933e2c1187460ea7f5e2bcf4ef /TamTamJam.py
parent73829f7e63a548920d58ed78d5b3aabfdde81883 (diff)
Polish new toolbars related code; use only one bar for Mini since there is plenty of space; update TODO
Diffstat (limited to 'TamTamJam.py')
-rw-r--r--TamTamJam.py34
1 files changed, 12 insertions, 22 deletions
diff --git a/TamTamJam.py b/TamTamJam.py
index f727414..e419aa6 100644
--- a/TamTamJam.py
+++ b/TamTamJam.py
@@ -45,7 +45,7 @@ from sugar.activity import activity
if Config.HAVE_TOOLBOX:
from sugar.graphics.toolbarbox import ToolbarBox
- from sugar.activity.widgets import ActivityToolbarButton, StopButton
+ from sugar.activity import widgets
class TamTamJam(activity.Activity):
@@ -78,14 +78,8 @@ class TamTamJam(activity.Activity):
#load the sugar toolbar
if Config.HAVE_TOOLBOX:
self.toolbox = ToolbarBox()
- activity_button = ActivityToolbarButton(self)
- self.toolbox.toolbar.insert(activity_button, 0)
- activity_button.show()
- separator = gtk.SeparatorToolItem()
- separator.props.draw = True
- separator.set_expand(False)
- self.toolbox.toolbar.insert(separator, -1)
- separator.show()
+ self.toolbox.toolbar.insert(widgets.ActivityToolbarButton(self), -1)
+ self.toolbox.toolbar.insert(gtk.SeparatorToolItem(), -1)
else:
self.toolbox = activity.ActivityToolbox(self)
self.set_toolbox(self.toolbox)
@@ -101,6 +95,15 @@ class TamTamJam(activity.Activity):
self.set_canvas(self.jam)
self.jam.onActivate(arg=None)
+
+ if Config.HAVE_TOOLBOX:
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = False
+ separator.set_expand(True)
+ self.toolbox.toolbar.insert(separator, -1)
+ self.toolbox.toolbar.insert(widgets.StopButton(self), -1)
+ self.toolbox.toolbar.show_all()
+
self.show()
def onPreloadTimeout(self):
@@ -163,16 +166,3 @@ class TamTamJam(activity.Activity):
def write_file(self, file_path):
self.jam.handleJournalSave(file_path)
-
- def add_stop_button(self):
- ''' Add a stop button if using the new toolbars '''
- if Config.HAVE_TOOLBOX:
- separator = gtk.SeparatorToolItem()
- separator.props.draw = False
- separator.set_expand(True)
- self.toolbox.toolbar.insert(separator, -1)
- separator.show()
- stop_button = StopButton(self)
- stop_button.props.accelerator = '<Ctrl>q'
- self.toolbox.toolbar.insert(stop_button, -1)
- stop_button.show()