[Sugar-devel] [PATCH 2/4] Restore navigation back-forward in toolbar buttons

Manuel Quiñones manuq at laptop.org
Tue Nov 29 23:41:41 EST 2011


Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
 webtoolbar.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/webtoolbar.py b/webtoolbar.py
index c9b85f2..a9b4c7d 100644
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -334,6 +334,8 @@ class PrimaryToolbar(ToolbarBase):
         self._loading_changed_hid = self._browser.connect(
                 'notify::load-status', self.__loading_changed_cb)
 
+        self._update_navigation_buttons()
+
     def _session_history_changed_cb(self, session_history, current_page_index):
         # We have to wait until the history info is updated.
         GObject.idle_add(self._reload_session_history, current_page_index)
@@ -376,10 +378,10 @@ class PrimaryToolbar(ToolbarBase):
     def _update_navigation_buttons(self):
         browser = self._tabbed_view.props.current_browser
 
-        can_go_back = browser.web_navigation.canGoBack
+        can_go_back = browser.can_go_back()
         self._back.props.sensitive = can_go_back
 
-        can_go_forward = browser.web_navigation.canGoForward
+        can_go_forward = browser.can_go_forward()
         self._forward.props.sensitive = can_go_forward
 
     def _entry_activate_cb(self, entry):
@@ -392,11 +394,11 @@ class PrimaryToolbar(ToolbarBase):
 
     def _go_back_cb(self, button):
         browser = self._tabbed_view.props.current_browser
-        browser.web_navigation.goBack()
+        browser.go_back()
 
     def _go_forward_cb(self, button):
         browser = self._tabbed_view.props.current_browser
-        browser.web_navigation.goForward()
+        browser.go_forward()
 
     def _title_changed_cb(self, widget, param):
         self._set_title(widget.get_title())
-- 
1.7.7.3



More information about the Sugar-devel mailing list