diff options
author | Bobby Powers <bobby@laptop.org> | 2009-03-04 05:14:42 (GMT) |
---|---|---|
committer | Bobby Powers <bobby@laptop.org> | 2009-03-04 05:14:59 (GMT) |
commit | d7caceb22935a6efc44517f1d15f692eb9688135 (patch) | |
tree | 08d2b332fb20c31de4c241d054af52263d05d60e | |
parent | f7ac37d849de074e0622dc1e2936e4ab005878a6 (diff) |
(re)implemented zoom and reload
-rw-r--r-- | NOTES | 4 | ||||
-rw-r--r-- | browser.py | 16 | ||||
-rw-r--r-- | webtoolbar.py | 11 |
3 files changed, 6 insertions, 25 deletions
@@ -1,7 +1,7 @@ work on a WebKit based browser for the XO -requires pywebkitgtk and WebKit-gtk: -sudo yum install pywebkitgtk WebKit-gtk +requires pywebkitgtk, gnome-python2-gconf and WebKit-gtk: +sudo yum install pywebkitgtk WebKit-gtk gnome-python2-gconf (maybe I can wrap this into the ./setup.py dist_xo packaging step.) The code for downloading just got merged into webkit (r41401), probably @@ -170,22 +170,6 @@ class Browser(WebView): uri = self.web_navigation.currentURI persist.saveURI(uri, self.doc_shell, None, None, None, local_file) - def zoom_in(self): - contentViewer = self.doc_shell.queryInterface( \ - interfaces.nsIDocShell).contentViewer - if contentViewer is not None: - markupDocumentViewer = contentViewer.queryInterface( \ - interfaces.nsIMarkupDocumentViewer) - markupDocumentViewer.fullZoom += _ZOOM_AMOUNT - - def zoom_out(self): - contentViewer = self.doc_shell.queryInterface( \ - interfaces.nsIDocShell).contentViewer - if contentViewer is not None: - markupDocumentViewer = contentViewer.queryInterface( \ - interfaces.nsIMarkupDocumentViewer) - markupDocumentViewer.fullZoom -= _ZOOM_AMOUNT - class PopupDialog(gtk.Window): def __init__(self): gtk.Window.__init__(self) diff --git a/webtoolbar.py b/webtoolbar.py index 4b1dee2..72cf8ab 100644 --- a/webtoolbar.py +++ b/webtoolbar.py @@ -334,13 +334,10 @@ class WebToolbar(gtk.Toolbar): self._set_title(embed.props.title) def _stop_and_reload_cb(self, button): - #if self._loading: - # self._browser.web_navigation.stop( \ - # interfaces.nsIWebNavigation.STOP_ALL) - #else: - # flags = interfaces.nsIWebNavigation.LOAD_FLAGS_NONE - # self._browser.web_navigation.reload(flags) - pass + if self._loading: + self._browser.stop_loading() + else: + self._browser.reload() def _set_loading(self, loading): self._loading = loading |