Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activities/web/toolbar.py
diff options
context:
space:
mode:
Diffstat (limited to 'activities/web/toolbar.py')
-rw-r--r--activities/web/toolbar.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/activities/web/toolbar.py b/activities/web/toolbar.py
index a820b8f..a191143 100644
--- a/activities/web/toolbar.py
+++ b/activities/web/toolbar.py
@@ -43,6 +43,18 @@ class Toolbar(gtk.Toolbar):
self.insert(address_item, -1)
address_item.show()
+ separator = gtk.SeparatorToolItem()
+ separator.set_draw(False)
+ self.insert(separator, -1)
+ separator.show()
+
+ self._post = gtk.ToolButton()
+ self._post.props.sensitive = False
+ self._post.set_icon_name('stock-add')
+ self._post.connect("clicked", self._post_cb)
+ self.insert(self._post, -1)
+ self._post.show()
+
self._insert_spring()
self._embed = embed
@@ -53,6 +65,10 @@ class Toolbar(gtk.Toolbar):
self._embed.connect("notify::can-go-forward",
self._can_go_forward_changed_cb)
+ def set_links_controller(self, links_controller):
+ self._links_controller = links_controller
+ self._post.props.sensitive = False
+
def _progress_changed_cb(self, embed, spec):
self._entry.props.progress = embed.props.progress
@@ -74,6 +90,11 @@ class Toolbar(gtk.Toolbar):
def _go_forward_cb(self, button):
self._embed.go_forward()
+ def _post_cb(self, button):
+ title = self._embed.get_title()
+ address = self._embed.get_location()
+ self._links_controller.post_link(title, address)
+
def _insert_spring(self):
separator = gtk.SeparatorToolItem()
separator.set_draw(False)