Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/browser.py
diff options
context:
space:
mode:
authorLucian 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)
commit978cc1edf77fc88c6c80c75694f96e2848c02ef1 (patch)
treeae542566d767eb02a3658dd792d31a148d2ffb43 /browser.py
parente8130523d74e24be64362c723a9ebed1087fc521 (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.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/browser.py b/browser.py
index ece81d1..8e1dab5 100644
--- a/browser.py
+++ b/browser.py
@@ -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)