From ca6b1c7bd30cfefb008fcbf4b053e8092d3f9005 Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Thu, 03 Jan 2013 18:52:12 +0000 Subject: Persist zoom level of tabs between sessions - SL #4368 - Read the zoom level using Dictionary.get() to make it backwards compatible. - Add getter and setter to DummyBrowser for the duck typing. Initial patch from Ariel Calzada Signed-off-by: Ariel Calzada Signed-off-by: Manuel QuiƱones --- (limited to 'webactivity.py') diff --git a/webactivity.py b/webactivity.py index 3c0d337..ecf84b6 100644 --- a/webactivity.py +++ b/webactivity.py @@ -411,9 +411,13 @@ class WebActivity(activity.Activity): for number, tab in enumerate(self.model.data['currents']): tab_page = self._tabbed_view.get_nth_page(number) tab_page.browser.set_history_index(tab['history_index']) + zoom_level = tab.get('zoom_level') + if zoom_level is not None: + tab_page.browser.set_zoom_level(zoom_level) tab_page.browser.grab_focus() 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) uris = mime.split_uri_list(data) @@ -453,7 +457,8 @@ class WebActivity(activity.Activity): uri = n_browser.get_uri() history_index = n_browser.get_history_index() info = {'title': n_browser.props.title, 'url': uri, - 'history_index': history_index} + 'history_index': history_index, + 'zoom_level': n_browser.get_zoom_level()} self.model.data['currents'].append(info) -- cgit v0.9.1