Ticket #10510: 0001-Add-support-for-tabbed-Browse-108.patch

File 0001-Add-support-for-tabbed-Browse-108.patch, 1.9 kB (added by martin.langhoff, 4 years ago)
  • activity.py

    From 3237551427a44e7894dd3366c520e752ca04c770 Mon Sep 17 00:00:00 2001
    From: Martin Langhoff <martin@laptop.org>
    Date: Wed, 2 Feb 2011 12:10:50 -0500
    Subject: [PATCH] Add support for tabbed Browse (>108)
    
    Untested as other aspects of integration are broken.
    ---
     activity.py      |   10 +++++++++-
     searchtoolbar.py |    7 +++----
     2 files changed, 12 insertions(+), 5 deletions(-)
    
    diff --git a/activity.py b/activity.py
    index 924ff86..0814af6 100644
    a b  
    6969        self.toolbox.add_toolbar('Buscar', self.searchtoolbar) 
    7070        self.searchtoolbar.show() 
    7171 
     72    def _get_browser(self): 
     73        if hasattr(self, _browser) and callable(self._browser): 
     74            # Browse < 109 
     75            return self._browser 
     76        else: 
     77            return self._tabbed_view._current_browser 
     78 
    7279    def _load_homepage(self): 
    7380        home_url = 'http://localhost:%s%s' % (self.HTTP_PORT, HOME_PAGE) 
    74         self._browser.load_uri(home_url) 
     81        browser = self._get_browser() 
     82        browser.load_uri(home_uri) 
  • searchtoolbar.py

    diff --git a/searchtoolbar.py b/searchtoolbar.py
    index 16c9c99..9f5a6b6 100644
    a b  
    2929 
    3030        self._activity = activity         
    3131 
    32         self._browser = self._activity._browser 
    33  
    3432        self._providercombo = ToolComboBox() 
    3533 
    3634        self.insert(self._providercombo, -1) 
     
    6260        k = self._providercombo.combo.get_active_item()[0] 
    6361        p = self._providers[k] 
    6462         
    65         self._browser.load_uri(p['url'] % entry.props.text) 
    66         self._browser.grab_focus() 
     63        browser = self._activity._get_browser() 
     64        browser.load_uri(p['url'] % entry.props.text) 
     65        browser.grab_focus() 
    6766         
    6867        self._activity.toolbox.current_toolbar = 1 
    6968