From e8549d91315dc9dbdc84c750d39bcc4a477c893e Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 03 Sep 2007 14:27:44 +0000 Subject: Unescape the address bar URI --- diff --git a/NEWS b/NEWS index c4c1121..3db5efa 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* #2327 Unescape the URI to display it in the address bar (marco) + 45 * use json for storing the history and the shared diff --git a/progresslistener.py b/progresslistener.py index 087a891..86a6452 100644 --- a/progresslistener.py +++ b/progresslistener.py @@ -24,7 +24,7 @@ class ProgressListener(gobject.GObject): __gsignals__ = { 'location-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, - ([str])), + ([object])), 'loading-start': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])), 'loading-stop': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, @@ -51,7 +51,7 @@ class ProgressListener(gobject.GObject): self.completed_requests = 0 def onLocationChange(self, webProgress, request, location): - self.emit('location-changed', location.spec) + self.emit('location-changed', location) def onProgressChange(self, webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress): diff --git a/webtoolbar.py b/webtoolbar.py index 6735a9c..3623808 100755 --- a/webtoolbar.py +++ b/webtoolbar.py @@ -21,8 +21,8 @@ from gettext import gettext as _ import gobject import gtk -import xpcom from xpcom.components import interfaces +from xpcom import components from sugar.graphics.toolbutton import ToolButton from sugar._sugaruiext import AddressEntry @@ -88,7 +88,11 @@ class WebToolbar(gtk.Toolbar): gobject.idle_add(self._reload_session_history, current_page_index) def _location_changed_cb(self, progress_listener, uri): - self._set_address(uri) + cls = components.classes['@mozilla.org/intl/texttosuburi;1'] + texttosuburi = cls.getService(interfaces.nsITextToSubURI) + ui_uri = texttosuburi.unEscapeURIForUI(uri.originCharset, uri.spec) + + self._set_address(ui_uri) self._update_navigation_buttons() filepicker.cleanup_temp_files() -- cgit v0.9.1