comparison src/browser/libervia_main.py @ 636:86ae737da6f3 frontends_multi_profiles

browser side (widgets management): removed getWidgetsPanel: we use directly getParent which do the same thing + displayWidget now detect hidden widgets (widgets without parent WidgetsPanel)
author Goffi <goffi@goffi.org>
date Mon, 23 Feb 2015 18:44:58 +0100
parents e287a4b431c1
children 7113d40533d6
comparison
equal deleted inserted replaced
635:40c3c6aaafaa 636:86ae737da6f3
618 try: 618 try:
619 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs) 619 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs)
620 except quick_widgets.WidgetAlreadyExistsError: 620 except quick_widgets.WidgetAlreadyExistsError:
621 kwargs['on_existing_widget'] = C.WIDGET_KEEP 621 kwargs['on_existing_widget'] = C.WIDGET_KEEP
622 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs) 622 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs)
623 if wid.getWidgetsPanel() != self.tab_panel.getCurrentPanel(): 623 widgets_panel = wid.getParent(base_widget.WidgetsPanel, expect=False)
624 if widgets_panel is None:
625 # The widget exists but is hidden
626 self.addWidget(wid)
627 elif widgets_panel != self.tab_panel.getCurrentPanel():
628 # the widget is on an other tab, so we add a new one here
624 kwargs['on_existing_widget'] = C.WIDGET_RECREATE 629 kwargs['on_existing_widget'] = C.WIDGET_RECREATE
625 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs) 630 wid = self.widgets.getOrCreateWidget(class_, target, *args, **kwargs)
626 self.addWidget(wid) 631 self.addWidget(wid)
627 self.setSelected(wid) 632 self.setSelected(wid)
628 return wid 633 return wid