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
This commit is contained in:
Goffi 2015-08-25 14:41:42 +02:00
commit dd8462f07a

View file

@ -167,11 +167,13 @@ class ProfileManager(QuickProfileManager, urwid.WidgetWrap):
if not selected: # profile was just unselected
return
focused.setState(False, invisible=True) # we don't want the widget to be selected until we are sure we can access it
def authenticate_cb(callback_id, data, profile):
if C.bool(data['validated']):
def authenticate_cb(data, cb_id, profile):
if C.bool(data.pop('validated', C.BOOL_FALSE)):
self.current.profile = profile
focused.setState(True, invisible=True)
self.getConnectionParams(profile)
self.host.redraw()
self.host.actionManager(data, callback=authenticate_cb, profile=profile)
self.host.launchAction(C.AUTHENTICATE_PROFILE_ID, callback=authenticate_cb, profile=focused.text)