Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webtoolbar.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@sugarlabs.org>2010-10-19 13:18:28 (GMT)
committer Gonzalo Odiard <godiard@sugarlabs.org>2010-10-22 13:21:08 (GMT)
commitaf73ecd8e496a34af78f7061f8f54738c823e788 (patch)
tree1948ca2852290400daf313369827e9a6db8d4f3f /webtoolbar.py
parent6631c276ff0965aaacea6bae1d35c0027383a976 (diff)
implement OLPC #10364 - Home Button in Browse
Add a button in the webtoolbar to go to the home page. I have added a new signal to the toolbar to notify to the activity.
Diffstat (limited to 'webtoolbar.py')
-rw-r--r--webtoolbar.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/webtoolbar.py b/webtoolbar.py
index d87dbd8..227e4ef 100644
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -217,6 +217,9 @@ class WebToolbar(gtk.Toolbar):
__gsignals__ = {
'add-link': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
+ ([])),
+ 'go-home': (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE,
([]))
}
@@ -241,6 +244,12 @@ class WebToolbar(gtk.Toolbar):
self.insert(self._forward, -1)
self._forward.show()
+ self._go_home = ToolButton('go-home')
+ self._go_home.set_tooltip(_('Home page'))
+ self._go_home.connect('clicked', self._go_home_cb)
+ self.insert(self._go_home, -1)
+ self._go_home.show()
+
self._stop_and_reload = ToolButton('media-playback-stop')
self._stop_and_reload.connect('clicked', self._stop_and_reload_cb)
self.insert(self._stop_and_reload, -1)
@@ -329,6 +338,10 @@ class WebToolbar(gtk.Toolbar):
def _go_forward_cb(self, button):
self._browser.web_navigation.goForward()
+ def _go_home_cb(self, button):
+ self.emit('go-home')
+ self._activity.load_homepage()
+
def _title_changed_cb(self, embed, spec):
self._set_title(embed.props.title)