[Sugar-devel] [PATCH] Browse: Add support for creating multiple tabs

Sascha Silbe sascha-ml-ui-sugar-devel at silbe.org
Wed Jun 30 09:03:27 EDT 2010


Excerpts from anishmangal2002's message of Tue Jun 29 20:58:35 +0000 2010:

>  icons/add-tab.svg |   86 +++++++++++++++++++++++++++++++++++++++++++++++++++++
Please clean up the icon as explained by Walter.

[webactivity.py]
> @@ -443,6 +444,16 @@ class WebActivity(activity.Activity):
>                  _logger.debug('keyboard: Zoom in')
>                  self._tabbed_view.props.current_browser.zoom_in()
>                  return True
> +            elif gtk.gdk.keyval_name(event.keyval) == "t":
> +                browser = Browser()
> +                self._tabbed_view._append_tab(browser)
> +                if os.path.isfile(_LIBRARY_PATH):
> +                    browser.load_uri('file://' + _LIBRARY_PATH)
> +                else:
> +                    default_page = os.path.join(activity.get_bundle_path(),
> +                                            "data/index.html")
> +                    browser.load_uri(default_page)

Please call _load_homepage() instead of duplicating it. If necessary add a parameter to specify the tab to load the home page in.
Also factor out this code so it can be used by ways (key press, icon) to invoke the feature.

Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100630/9fbc0872/attachment.pgp 


More information about the Sugar-devel mailing list