From 8527940d8c083f21debfaa76aa983e20ff93968b Mon Sep 17 00:00:00 2001 From: Rafael Ortiz Date: Wed, 15 Jun 2011 16:08:08 +0000 Subject: Revert "set/restore index patch" This reverts commit a6c6230437430ecd364c46b4d583be890054d8e1. --- diff --git a/browser.py b/browser.py index 733b12c..649a71e 100644 --- a/browser.py +++ b/browser.py @@ -357,12 +357,6 @@ class Browser(WebView): interfaces.nsIMarkupDocumentViewer) markupDocumentViewer.fullZoom -= _ZOOM_AMOUNT - def get_history_index(self): - return self.web_navigation.sessionHistory.index - - def set_history_index(self, index): - self.web_navigation.gotoIndex(index) - class PopupDialog(gtk.Window): def __init__(self): diff --git a/webactivity.py b/webactivity.py index 7d7fd4a..fc9e913 100644 --- a/webactivity.py +++ b/webactivity.py @@ -219,8 +219,7 @@ class WebActivity(activity.Activity): # if we come across cairo versions >= 1.08.10 # More information can be found here: # http://lists.sugarlabs.org/archive/sugar-devel/2010-July/025187.html - self._disable_multiple_tabs = cairo.cairo_version() >= 10810 \ - and cairo.cairo_version() < 11002 + self._disable_multiple_tabs = cairo.cairo_version() >= 10810 if self._disable_multiple_tabs: logging.warning('Not enabling the multiple tabs feature due' ' to a bug in cairo/mozilla') @@ -460,12 +459,6 @@ class WebActivity(activity.Activity): link['owner'], -1, link['hash']) logging.debug('########## reading %s', data) self._tabbed_view.set_session(self.model.data['history']) - tab_number = 0 - for current in self.model.data['currents']: - browser = self._tabbed_view.get_nth_page(tab_number) - browser.set_history_index(current['index']) - tab_number = tab_number + 1 - self._tabbed_view.set_current_page(self.model.data['current_tab']) elif self.metadata['mime_type'] == 'text/uri-list': data = self._get_data_from_file_path(file_path) @@ -477,6 +470,19 @@ class WebActivity(activity.Activity): 'list of multiple uris by now.') else: self._tabbed_view.props.current_browser.load_uri(file_path) + self._load_urls() + + def _load_urls(self): + if self.model.data['currents'] != None: + first = True + for current_tab in self.model.data['currents']: + if first: + browser = self._tabbed_view.current_browser + first = False + else: + browser = Browser() + self._tabbed_view._append_tab(browser) + browser.load_uri(current_tab['url']) def write_file(self, file_path): if not self.metadata['mime_type']: @@ -500,10 +506,7 @@ class WebActivity(activity.Activity): if n_browser != None: nsiuri = browser.progress.location ui_uri = browser.get_url_from_nsiuri(nsiuri) - index = browser.get_history_index() - info = {'title': browser.props.title, 'url': ui_uri, - 'index': index} - + info = {'title': browser.props.title, 'url': ui_uri} self.model.data['currents'].append(info) f = open(file_path, 'w') -- cgit v0.9.1