Mercurial > libervia-desktop-kivy
comparison src/cagou/core/cagou_main.py @ 34:02acbb297a61
handler, widget: deleteWidget is now properly called when a QuickWidget is deleted
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 22 Aug 2016 20:58:12 +0200 |
parents | c21d1be2e54c |
children | 9f45098289cc |
comparison
equal
deleted
inserted
replaced
33:c21d1be2e54c | 34:02acbb297a61 |
---|---|
23 logging_setter.set_logging() | 23 logging_setter.set_logging() |
24 from constants import Const as C | 24 from constants import Const as C |
25 from sat.core import log as logging | 25 from sat.core import log as logging |
26 log = logging.getLogger(__name__) | 26 log = logging.getLogger(__name__) |
27 from sat_frontends.quick_frontend.quick_app import QuickApp | 27 from sat_frontends.quick_frontend.quick_app import QuickApp |
28 from sat_frontends.quick_frontend import quick_widgets | |
28 from sat_frontends.bridge.DBus import DBusBridgeFrontend | 29 from sat_frontends.bridge.DBus import DBusBridgeFrontend |
29 import kivy | 30 import kivy |
30 kivy.require('1.9.1') | 31 kivy.require('1.9.1') |
31 import kivy.support | 32 import kivy.support |
32 kivy.support.install_gobject_iteration() | 33 kivy.support.install_gobject_iteration() |
324 log.error(u"no CagouWidget found when trying to switch widget") | 325 log.error(u"no CagouWidget found when trying to switch widget") |
325 else: | 326 else: |
326 parent = to_change.parent | 327 parent = to_change.parent |
327 idx = parent.children.index(to_change) | 328 idx = parent.children.index(to_change) |
328 parent.remove_widget(to_change) | 329 parent.remove_widget(to_change) |
330 if isinstance(to_change, quick_widgets.QuickWidget): | |
331 self.widgets.deleteWidget(to_change) | |
329 parent.add_widget(new, index=idx) | 332 parent.add_widget(new, index=idx) |
330 | 333 |
331 ## misc ## | 334 ## misc ## |
332 | 335 |
333 def plugging_profiles(self): | 336 def plugging_profiles(self): |