Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/typingturtle.py
diff options
context:
space:
mode:
Diffstat (limited to 'typingturtle.py')
-rwxr-xr-xtypingturtle.py50
1 files changed, 35 insertions, 15 deletions
diff --git a/typingturtle.py b/typingturtle.py
index 1cf9231..5bfa31f 100755
--- a/typingturtle.py
+++ b/typingturtle.py
@@ -84,23 +84,43 @@ class TypingTurtle(sugar.activity.activity.Activity):
self.show_all()
- # Hide the sharing button from the activity toolbar since we don't support sharing.
- activity_toolbar = self.tbox.get_activity_toolbar()
- activity_toolbar.share.props.visible = False
-
- self.editorbtn = sugar.graphics.toolbutton.ToolButton('format-justify-left')
- self.editorbtn.set_tooltip(_("Edit Lessons"))
- self.editorbtn.connect('clicked', self.editor_clicked_cb)
-
- share_idx = activity_toolbar.get_item_index(activity_toolbar.share)
- activity_toolbar.insert(self.editorbtn, share_idx)
- self.editorbtn.show_all()
def build_toolbox(self):
- self.tbox = sugar.activity.activity.ActivityToolbox(self)
- self.tbox.show_all()
-
- self.set_toolbox(self.tbox)
+ try:
+ from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton
+ from sugar.activity.widgets import ActivityToolbarButton, StopButton
+ from mybutton import MyActivityToolbarButton
+
+ toolbar_box = ToolbarBox()
+ activity_button = MyActivityToolbarButton(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()
+
+ editorbtn = sugar.graphics.toolbutton.ToolButton('format-justify-left')
+ editorbtn.set_tooltip(_("Edit Lessons"))
+ editorbtn.connect('clicked', self.editor_clicked_cb)
+ toolbar_box.toolbar.insert(editorbtn, -2)
+ editorbtn.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:
+ self.tbox = sugar.activity.activity.ActivityToolbox(self)
+ self.tbox.show_all()
+
+ self.set_toolbox(self.tbox)
def editor_clicked_cb(self, btn):
self.push_screen(editlessonlistscreen.EditLessonListScreen(self, self.mainscreen.lessons))