diff options
author | Manuel Quiñones <manuq@laptop.org> | 2011-12-20 13:43:28 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2011-12-20 13:43:28 (GMT) |
commit | 14102bcd65f015dcbf12d1406df8ef7ffb64d13d (patch) | |
tree | ad2dd6965ecc6eb1054959ffad21525243b55896 /webactivity.py | |
parent | c6cb9713466d7fc9fb81cd2c6102bd97e89089b5 (diff) |
Store and restore session for each tab
For going to a specific item in the history, it uses go_back() method
of WebKit.WebView. I tried also with WebKit.WebHistoryItem go_back(),
seemed the proper solution, but the page wouldn't update.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Diffstat (limited to 'webactivity.py')
-rw-r--r-- | webactivity.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/webactivity.py b/webactivity.py index 0e03fb2..9ccbe4c 100644 --- a/webactivity.py +++ b/webactivity.py @@ -401,7 +401,8 @@ class WebActivity(activity.Activity): logging.debug('########## reading %s', data) self._tabbed_view.set_session(self.model.data['history']) for number, tab in enumerate(self.model.data['currents']): - browser = self._tabbed_view.get_nth_page(number) + scrolled_window = self._tabbed_view.get_nth_page(number) + browser = scrolled_window.get_child() browser.set_history_index(tab['history_index']) self._tabbed_view.set_current_page(self.model.data['current_tab']) @@ -430,22 +431,18 @@ class WebActivity(activity.Activity): else: self.metadata['title'] = browser.props.title - # FIXME - # self.model.data['history'] = self._tabbed_view.get_session() - self.model.data['history'] = [] + self.model.data['history'] = self._tabbed_view.get_session() current_tab = self._tabbed_view.get_current_page() self.model.data['current_tab'] = current_tab self.model.data['currents'] = [] for n in range(0, self._tabbed_view.get_n_pages()): - # FIXME - continue - n_browser = self._tabbed_view.get_nth_page(n) + scrolled_window = self._tabbed_view.get_nth_page(n) + n_browser = scrolled_window.get_child() if n_browser != None: - nsiuri = n_browser.progress.location - ui_uri = n_browser.get_url_from_nsiuri(nsiuri) + uri = n_browser.get_uri() history_index = n_browser.get_history_index() - info = {'title': n_browser.props.title, 'url': ui_uri, + info = {'title': n_browser.props.title, 'url': uri, 'history_index': history_index} self.model.data['currents'].append(info) |