diff options
author | Lucian Branescu Mihaila <lucian.branescu@gmail.com> | 2010-10-06 13:22:48 (GMT) |
---|---|---|
committer | Lucian Branescu Mihaila <lucian.branescu@gmail.com> | 2010-10-06 13:22:48 (GMT) |
commit | 978cc1edf77fc88c6c80c75694f96e2848c02ef1 (patch) | |
tree | ae542566d767eb02a3658dd792d31a148d2ffb43 /browser.py | |
parent | e8130523d74e24be64362c723a9ebed1087fc521 (diff) |
Fix history on resume. The code is a bit hacky because of xulrunner limitations. I plan to make this code nicer when we move to webkit.
Diffstat (limited to 'browser.py')
-rw-r--r-- | browser.py | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -252,12 +252,7 @@ class TabLabel(gtk.HBox): browser.connect('notify::title', self.__title_changed_cb) def __location_changed_cb(self, progress_listener, pspec): - uri = progress_listener.location - cls = components.classes['@mozilla.org/intl/texttosuburi;1'] - texttosuburi = cls.getService(interfaces.nsITextToSubURI) - ui_uri = texttosuburi.unEscapeURIForUI(uri.originCharset, uri.spec) - - self._label.set_text(ui_uri) + self._label.set_text(self._browser.get_url_from_nsiuri(progress_listener.location)) def __title_changed_cb(self, browser, pspec): self._label.set_text(browser.props.title) @@ -300,6 +295,15 @@ class Browser(WebView): self.emit('is-setup') + + def get_url_from_nsiuri(self, uri): + """ + get a nsIURI object and return a string with the url + """ + cls = components.classes['@mozilla.org/intl/texttosuburi;1'] + texttosuburi = cls.getService(interfaces.nsITextToSubURI) + return texttosuburi.unEscapeURIForUI(uri.originCharset, uri.spec) + def get_session(self): return sessionstore.get_session(self) |