Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webactivity.py4
-rw-r--r--webtoolbar.py13
2 files changed, 17 insertions, 0 deletions
diff --git a/webactivity.py b/webactivity.py
index 39bb67e..ec010b0 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -220,6 +220,7 @@ class WebActivity(activity.Activity):
self._browser.history.connect('session-link-changed',
self._session_history_changed_cb)
self._web_toolbar.connect('add-link', self._link_add_button_cb)
+ self._web_toolbar.connect('go-home', self._go_home_button_cb)
self._browser.connect("notify::title", self._title_changed_cb)
@@ -443,6 +444,9 @@ class WebActivity(activity.Activity):
def _link_add_button_cb(self, button):
_logger.debug('button: Add link: %s.' % self.current)
self._add_link()
+
+ def _go_home_button_cb(self, button):
+ self._load_homepage()
def _key_press_cb(self, widget, event):
if event.state & gtk.gdk.CONTROL_MASK:
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)