This change was discussed with Manuq and Gary.<div>I can't find the discussion now.</div><div>CC both</div><div><br></div><div>Gonzalo<br><br><div class="gmail_quote">On Thu, Sep 27, 2012 at 11:25 AM, Martin Langhoff <span dir="ltr"><<a href="mailto:martin.langhoff@gmail.com" target="_blank">martin.langhoff@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is this really an improvement in behaviour?<br>
<br>
 - The tabs are often too small to show the title.<br>
 - The title is more important for the user than the URL. No?<br>
<br>
cheers,<br>
<br>
<br>
m<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Sep 24, 2012 at 5:09 PM, Manuel Kaufmann <<a href="mailto:humitos@gmail.com">humitos@gmail.com</a>> wrote:<br>
> The Title of the current page is no longer shown in the URL<br>
> entry. Now, it's only shown in the tab and the current URL is visible<br>
> all the time in the URL entry.<br>
><br>
> Signed-off-by: Manuel Kaufmann <<a href="mailto:humitos@gmail.com">humitos@gmail.com</a>><br>
> ---<br>
>  browser.py    | 13 +++++++++++++<br>
>  webtoolbar.py | 53 +++++------------------------------------------------<br>
>  2 files changed, 18 insertions(+), 48 deletions(-)<br>
><br>
> diff --git a/browser.py b/browser.py<br>
> index de546f2..1c67beb 100644<br>
> --- a/browser.py<br>
> +++ b/browser.py<br>
> @@ -453,6 +453,10 @@ class Browser(WebKit.WebView):<br>
>          # Scale text and graphics:<br>
>          self.set_full_content_zoom(True)<br>
><br>
> +        # This property is used to set the title immediatly the user<br>
> +        # presses Enter on the URL Entry<br>
> +        self._loading_uri = None<br>
> +<br>
>          # Reference to the global history and callbacks to handle it:<br>
>          self._global_history = globalhistory.get_global_history()<br>
>          self.connect('notify::load-status', self.__load_status_changed_cb)<br>
> @@ -542,6 +546,15 @@ class Browser(WebKit.WebView):<br>
>      def open_new_tab(self, url):<br>
>          self.emit('new-tab', url)<br>
><br>
> +    def _set_loading_uri(self, uri):<br>
> +        self._loading_uri = uri<br>
> +<br>
> +    def _get_loading_uri(self):<br>
> +        return self._loading_uri<br>
> +<br>
> +    loading_uri = GObject.property(type=str, setter=_set_loading_uri,<br>
> +                                   getter=_get_loading_uri)<br>
> +<br>
>      def __run_file_chooser(self, browser, request):<br>
>          picker = FilePicker(self)<br>
>          chosen = picker.run()<br>
> diff --git a/webtoolbar.py b/webtoolbar.py<br>
> index 28bc015..1d531bc 100644<br>
> --- a/webtoolbar.py<br>
> +++ b/webtoolbar.py<br>
> @@ -47,7 +47,6 @@ class WebEntry(iconentry.IconEntry):<br>
>          GObject.GObject.__init__(self)<br>
><br>
>          self._address = None<br>
> -        self._title = None<br>
>          self._search_view = self._search_create_view()<br>
><br>
>          self._search_window = Gtk.Window(type=Gtk.WindowType.POPUP)<br>
> @@ -57,8 +56,6 @@ class WebEntry(iconentry.IconEntry):<br>
>          self.connect('focus-in-event', self.__focus_in_event_cb)<br>
>          self.connect('populate-popup', self.__populate_popup_cb)<br>
>          self.connect('key-press-event', self.__key_press_event_cb)<br>
> -        self.connect('enter-notify-event', self.__enter_notify_event_cb)<br>
> -        self.connect('leave-notify-event', self.__leave_notify_event_cb)<br>
>          self._focus_out_hid = self.connect(<br>
>                      'focus-out-event', self.__focus_out_event_cb)<br>
>          self._change_hid = self.connect('changed', self.__changed_cb)<br>
> @@ -79,18 +76,11 @@ class WebEntry(iconentry.IconEntry):<br>
><br>
>      def _set_address(self, address):<br>
>          self._address = address<br>
> -        if address is not None and self.props.has_focus:<br>
> +        if address is not None:<br>
>              self._set_text(address)<br>
><br>
>      address = GObject.property(type=str, setter=_set_address)<br>
><br>
> -    def _set_title(self, title):<br>
> -        self._title = title<br>
> -        if title is not None and not self.props.has_focus:<br>
> -            self._set_text(title)<br>
> -<br>
> -    title = GObject.property(type=str, setter=_set_title)<br>
> -<br>
>      def _search_create_view(self):<br>
>          view = Gtk.TreeView()<br>
>          view.props.headers_visible = False<br>
> @@ -146,21 +136,11 @@ class WebEntry(iconentry.IconEntry):<br>
>          self._search_window.hide()<br>
><br>
>      def __focus_in_event_cb(self, entry, event):<br>
> -        self._set_text(self._address)<br>
>          self._search_popdown()<br>
><br>
>      def __focus_out_event_cb(self, entry, event):<br>
> -        self._set_text(self._title)<br>
>          self._search_popdown()<br>
><br>
> -    def __enter_notify_event_cb(self, entry, event):<br>
> -        if not entry.props.has_focus:<br>
> -            self._set_text(self._address)<br>
> -<br>
> -    def __leave_notify_event_cb(self, entry, event):<br>
> -        if not entry.props.has_focus:<br>
> -            self._set_text(self._title)<br>
> -<br>
>      def __view_button_press_event_cb(self, view, event):<br>
>          model = view.get_model()<br>
><br>
> @@ -241,7 +221,6 @@ class PrimaryToolbar(ToolbarBase):<br>
>          self._tabbed_view = tabbed_view<br>
><br>
>          self._loading = False<br>
> -        self._title = _('Untitled')<br>
><br>
>          toolbar = self.toolbar<br>
>          activity_button = ActivityToolbarButton(self._activity)<br>
> @@ -310,7 +289,6 @@ class PrimaryToolbar(ToolbarBase):<br>
>          self._loading_changed_hid = None<br>
>          self._progress_changed_hid = None<br>
>          self._session_history_changed_hid = None<br>
> -        self._title_changed_hid = None<br>
>          self._uri_changed_hid = None<br>
><br>
>          if tabbed_view.get_n_pages():<br>
> @@ -324,25 +302,19 @@ class PrimaryToolbar(ToolbarBase):<br>
><br>
>      def _connect_to_browser(self, browser):<br>
>          if self._browser is not None:<br>
> -            self._browser.disconnect(self._title_changed_hid)<br>
>              self._browser.disconnect(self._uri_changed_hid)<br>
>              self._browser.disconnect(self._progress_changed_hid)<br>
>              self._browser.disconnect(self._loading_changed_hid)<br>
><br>
>          self._browser = browser<br>
> -        if self._browser.props.title:<br>
> -            self._set_title(self._browser.props.title)<br>
> -        else:<br>
> -            self._set_title(_('Untitled'))<br>
> -        self._set_address(self._browser.props.uri)<br>
> +        address = self._browser.props.uri or self._browser.props.loading_uri<br>
> +        self._set_address(address)<br>
>          self._set_progress(self._browser.props.progress)<br>
>          self._set_status(self._browser.props.load_status)<br>
><br>
>          is_webkit_browser = isinstance(self._browser, Browser)<br>
>          self.entry.props.editable = is_webkit_browser<br>
><br>
> -        self._title_changed_hid = self._browser.connect(<br>
> -                'notify::title', self._title_changed_cb)<br>
>          self._uri_changed_hid = self._browser.connect(<br>
>                  'notify::uri', self.__uri_changed_cb)<br>
>          self._progress_changed_hid = self._browser.connect(<br>
> @@ -353,16 +325,6 @@ class PrimaryToolbar(ToolbarBase):<br>
>          self._update_navigation_buttons()<br>
><br>
>      def __loading_changed_cb(self, widget, param):<br>
> -        status = widget.get_load_status()<br>
> -        if status == WebKit.LoadStatus.FAILED:<br>
> -            self.entry._set_title(self._title)<br>
> -        elif WebKit.LoadStatus.PROVISIONAL <= status \<br>
> -                < WebKit.LoadStatus.FINISHED:<br>
> -            self.entry._set_title(_('Loading...'))<br>
> -        elif status == WebKit.LoadStatus.FINISHED:<br>
> -            if widget.props.title == None:<br>
> -                self.entry._set_title(_('Untitled'))<br>
> -                self._title = _('Untitled')<br>
>          self._set_status(widget.get_load_status())<br>
><br>
>      def __progress_changed_cb(self, widget, param):<br>
> @@ -383,10 +345,6 @@ class PrimaryToolbar(ToolbarBase):<br>
>          else:<br>
>              self.entry.props.address = uri<br>
><br>
> -    def _set_title(self, title):<br>
> -        self.entry.props.title = title<br>
> -        self._title = title<br>
> -<br>
>      def _show_stop_icon(self):<br>
>          self.entry.set_icon_from_name(iconentry.ICON_ENTRY_SECONDARY,<br>
>                                        'browse-dialog-cancel')<br>
> @@ -412,6 +370,8 @@ class PrimaryToolbar(ToolbarBase):<br>
>          url = entry.props.text<br>
>          effective_url = self._tabbed_view.normalize_or_autosearch_url(url)<br>
>          self._browser.load_uri(effective_url)<br>
> +        self._browser.props.loading_uri = effective_url<br>
> +        self.entry.props.address = effective_url<br>
>          self._browser.grab_focus()<br>
><br>
>      def _go_home_cb(self, button):<br>
> @@ -423,9 +383,6 @@ class PrimaryToolbar(ToolbarBase):<br>
>      def _go_forward_cb(self, button):<br>
>          self._browser.go_forward()<br>
><br>
> -    def _title_changed_cb(self, widget, param):<br>
> -        self._set_title(widget.get_title())<br>
> -<br>
>      def __uri_changed_cb(self, widget, param):<br>
>          self._set_address(widget.get_uri())<br>
>          self._update_navigation_buttons()<br>
> --<br>
> 1.7.11.4<br>
><br>
> _______________________________________________<br>
> Sugar-devel mailing list<br>
> <a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
> <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
 <a href="mailto:martin.langhoff@gmail.com">martin.langhoff@gmail.com</a><br>
 <a href="mailto:martin@laptop.org">martin@laptop.org</a> -- Software Architect - OLPC<br>
 - ask interesting questions<br>
 - don't get distracted with shiny stuff  - working code first<br>
 - <a href="http://wiki.laptop.org/go/User:Martinlanghoff" target="_blank">http://wiki.laptop.org/go/User:Martinlanghoff</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</div></div></blockquote></div><br></div>