Mercurial > libervia-backend
comparison frontends/src/primitivus/profile_manager.py @ 1489:039d96e131be
frontends: callback are now always used in QuickApp launchAction (before it was only used if validated is present):
- actionManager is used by default (no callback provided)
- in XMLUI, the dialog is closed before calling actionManager
- if keys are not managed in resuling data, an exceptions is raised
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 25 Aug 2015 14:41:42 +0200 |
parents | 66d01f29f886 |
children | 66f0e877625b |
comparison
equal
deleted
inserted
replaced
1488:66d01f29f886 | 1489:039d96e131be |
---|---|
165 focused = list_wid.focus | 165 focused = list_wid.focus |
166 selected = focused.getState() if focused is not None else False | 166 selected = focused.getState() if focused is not None else False |
167 if not selected: # profile was just unselected | 167 if not selected: # profile was just unselected |
168 return | 168 return |
169 focused.setState(False, invisible=True) # we don't want the widget to be selected until we are sure we can access it | 169 focused.setState(False, invisible=True) # we don't want the widget to be selected until we are sure we can access it |
170 def authenticate_cb(callback_id, data, profile): | 170 def authenticate_cb(data, cb_id, profile): |
171 if C.bool(data['validated']): | 171 if C.bool(data.pop('validated', C.BOOL_FALSE)): |
172 self.current.profile = profile | 172 self.current.profile = profile |
173 focused.setState(True, invisible=True) | 173 focused.setState(True, invisible=True) |
174 self.getConnectionParams(profile) | 174 self.getConnectionParams(profile) |
175 self.host.redraw() | 175 self.host.redraw() |
176 self.host.actionManager(data, callback=authenticate_cb, profile=profile) | |
177 | |
176 self.host.launchAction(C.AUTHENTICATE_PROFILE_ID, callback=authenticate_cb, profile=focused.text) | 178 self.host.launchAction(C.AUTHENTICATE_PROFILE_ID, callback=authenticate_cb, profile=focused.text) |
177 | 179 |