diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2011-06-08 20:09:14 (GMT) |
---|---|---|
committer | Sascha Silbe <silbe@activitycentral.com> | 2011-06-18 11:31:31 (GMT) |
commit | 7072ec5913ff6e1447666adf825c46edb0074a93 (patch) | |
tree | 6aa6354b7bbf1cb095072d12e7a15b233a26af17 /browser.py | |
parent | b102e4c61d753c219a7d03c3c5255c1da1f3100a (diff) |
Set and restore index in the history (OLPC #10779 / SL #2499)
Restoring the history index instead of (re)loading the active URL will
"distribute" the history over the Back and Forward buttons exactly the same
as before Stop + Resume instead of putting it all on the Back button.
[tweaked description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
Diffstat (limited to 'browser.py')
-rw-r--r-- | browser.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -287,7 +287,6 @@ class Browser(WebView): def do_setup(self): WebView.do_setup(self) - listener = xpcom.server.WrapObject(ContentInvoker(self), interfaces.nsIDOMEventListener) self.window_root.addEventListener('click', listener, False) @@ -357,6 +356,12 @@ class Browser(WebView): interfaces.nsIMarkupDocumentViewer) markupDocumentViewer.fullZoom -= _ZOOM_AMOUNT + def get_history_index(self): + return self.web_navigation.sessionHistory.index + + def set_history_index(self, index): + self.web_navigation.gotoIndex(index) + class PopupDialog(gtk.Window): def __init__(self): |