Ticket #3537: 0001-Keep-the-typed-URL-after-switching-between-tabs-SL-3.patch

File 0001-Keep-the-typed-URL-after-switching-between-tabs-SL-3.patch, 1.4 KB (added by humitos, 12 years ago)
  • webtoolbar.py

    From 4c0f8921e1bc35aa652fb16b4c6c11dd4faf6f59 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Fri, 12 Oct 2012 09:20:19 -0300
    Subject: [PATCH Browse] Keep the typed URL after switching between tabs SL
     #3537
    
    This patch allows the user to start typing an URL and
    switch to another tag. Then go back to the previous
    tab and keep typing the same URL.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     webtoolbar.py | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/webtoolbar.py b/webtoolbar.py
    index 6350dfb..29c036b 100644
    a b class PrimaryToolbar(ToolbarBase): 
    239239        self.entry.connect('activate', self._entry_activate_cb)
    240240        self.entry.connect('focus-in-event', self.__focus_in_event_cb)
    241241        self.entry.connect('focus-out-event', self.__focus_out_event_cb)
     242        self.entry.connect('key-press-event', self.__key_press_event_cb)
    242243
    243244        entry_item = Gtk.ToolItem()
    244245        entry_item.set_expand(True)
    class PrimaryToolbar(ToolbarBase): 
    298299
    299300        tabbed_view.connect_after('switch-page', self.__switch_page_cb)
    300301
     302    def __key_press_event_cb(self, entry, event):
     303        self._tabbed_view.current_browser.loading_uri = entry.props.text
     304
    301305    def __switch_page_cb(self, tabbed_view, page, page_num):
    302306        if tabbed_view.get_n_pages():
    303307            self._connect_to_browser(tabbed_view.props.current_browser)