# HG changeset patch # User Goffi # Date 1424712004 -3600 # Node ID e287a4b431c1609d2f64f675cf9e665ee425deda # Parent 71abccd8d22897e0767ffb485e8afc9bcfaefc6a browser side (libervia main): implemented visible_widgets property diff -r 71abccd8d228 -r e287a4b431c1 src/browser/libervia_main.py --- a/src/browser/libervia_main.py Mon Feb 23 18:16:07 2015 +0100 +++ b/src/browser/libervia_main.py Mon Feb 23 18:20:04 2015 +0100 @@ -26,7 +26,7 @@ ### from sat_frontends.quick_frontend.quick_app import QuickApp -from sat_frontends.quick_frontend.quick_widgets import WidgetAlreadyExistsError +from sat_frontends.quick_frontend import quick_widgets from sat_frontends.tools.misc import InputHistory from sat_frontends.tools import strings @@ -113,6 +113,11 @@ return self.contact_lists[C.PROF_KEY_NONE] @property + def visible_widgets(self): + widgets_panel = self.tab_panel.getCurrentPanel() + return [wid for wid in widgets_panel.widgets if isinstance(wid, quick_widgets.QuickWidget)] + + @property def base_location(self): """Return absolute base url of this Libervia instance""" url = Window.getLocation().getHref() @@ -584,8 +589,8 @@ something, a new widget is always created, otherwise we look for an existing widget and re-use it if it's in the current tab. - @arg class_(class): see sat_frontends.quick_frontend.quick_widgets.getOrCreateWidget - @arg target: see sat_frontends.quick_frontend.quick_widgets.getOrCreateWidget + @arg class_(class): see quick_widgets.getOrCreateWidget + @arg target: see quick_widgets.getOrCreateWidget @arg dropped(bool): if True, assume the widget has been dropped @arg new_tab(unicode): if not None, it holds the name of a new tab to open for the widget. If None, use the default behavior. @@ -612,7 +617,7 @@ kwargs['on_existing_widget'] = C.WIDGET_RAISE try: wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs) - except WidgetAlreadyExistsError: + except quick_widgets.WidgetAlreadyExistsError: kwargs['on_existing_widget'] = C.WIDGET_KEEP wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs) if wid.getWidgetsPanel() != self.tab_panel.getCurrentPanel():