diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-09-03 14:27:44 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-09-03 14:27:44 (GMT) |
commit | e8549d91315dc9dbdc84c750d39bcc4a477c893e (patch) | |
tree | e1d35ba6c6474a654f4bd9e62a054d4499739d41 | |
parent | 08d650a1b46df5002cc8eb71d0cb3a6d47a87960 (diff) |
Unescape the address bar URI
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | progresslistener.py | 4 | ||||
-rwxr-xr-x | webtoolbar.py | 8 |
3 files changed, 10 insertions, 4 deletions
@@ -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() |