diff options
author | 0x1c0de4f00d <julian.goldstein0@gmail.com> | 2013-07-17 23:58:53 (GMT) |
---|---|---|
committer | 0x1c0de4f00d <julian.goldstein0@gmail.com> | 2013-07-17 23:58:53 (GMT) |
commit | 2fc6a11ba94fc33913e224f21dd775edcebebd64 (patch) | |
tree | ca20de87497c34f0da70ae377fd86042fb20e7c1 | |
parent | 57981b5df002c754822b35433f818d4f95ba98f0 (diff) |
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | gametoolbar.py | 19 |
2 files changed, 18 insertions, 4 deletions
@@ -2,6 +2,5 @@ - Support spectators - Add a pretty panel to display who's turn it is, and who is spectating - Add Atari Go mode. - - Add a 'Help' button that will take you to the PlayGo wiki page. - - Add different types of Ko and different rulesets. + - Add different types of Ko and different rulesets. - Support removing dead stones at the end of the game diff --git a/gametoolbar.py b/gametoolbar.py index b21deca..ae35b75 100644 --- a/gametoolbar.py +++ b/gametoolbar.py @@ -19,7 +19,7 @@ import gtk from os.path import join, dirname - +from os import system from gettext import gettext as _ from sugar.graphics.toolbutton import ToolButton from sugar.graphics.toolcombobox import ToolComboBox @@ -87,6 +87,21 @@ class GameToolbar(gtk.Toolbar): self.insert(self._ai_button, -1) self._ai_button.show() + #Separator + separator = gtk.SeparatorToolItem() + separator.set_draw(True) + self.insert(separator, -1) + + #Help Button + self.help_button = gtk.ToggleToolButton() + self.help_button.connect('toggled', self._help_toggled_cb) + self.help_button.set_label(_('Need Some Help?')) + self.insert(self.help_button, -1) + self.help_button.show() + + def _help_toggled_cb(self, widget): + wiki_url = "http://wiki.laptop.org/go/PlayGo" + system("sensible-browser " + wiki_url) def _add_widget(self, widget, expand=False): tool_item = gtk.ToolItem() tool_item.set_expand(expand) @@ -121,7 +136,7 @@ class GameToolbar(gtk.Toolbar): self.emit('ai-activated') else: self.emit('ai-deactivated') - + def grey_out_ai(self): self._ai_button.set_sensitive(False) |