commit
0abda2edef
@ -642,7 +642,9 @@ void msgBox(
|
|||||||
}
|
}
|
||||||
dialogManager.show((setState, close) => CustomAlertDialog(
|
dialogManager.show((setState, close) => CustomAlertDialog(
|
||||||
title: _msgBoxTitle(title),
|
title: _msgBoxTitle(title),
|
||||||
content: Text(translate(text), style: const TextStyle(fontSize: 15)),
|
content: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(maxWidth: 500),
|
||||||
|
child: Text(translate(text), style: const TextStyle(fontSize: 15))),
|
||||||
actions: buttons,
|
actions: buttons,
|
||||||
onSubmit: hasOk ? submit : null,
|
onSubmit: hasOk ? submit : null,
|
||||||
onCancel: hasCancel == true ? cancel : null,
|
onCancel: hasCancel == true ? cancel : null,
|
||||||
|
@ -161,6 +161,20 @@ void enterPasswordDialog(String id, OverlayDialogManager dialogManager) async {
|
|||||||
var remember = await bind.sessionGetRemember(id: id) ?? false;
|
var remember = await bind.sessionGetRemember(id: id) ?? false;
|
||||||
dialogManager.dismissAll();
|
dialogManager.dismissAll();
|
||||||
dialogManager.show((setState, close) {
|
dialogManager.show((setState, close) {
|
||||||
|
cancel() {
|
||||||
|
close();
|
||||||
|
closeConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
submit() {
|
||||||
|
var text = controller.text.trim();
|
||||||
|
if (text == '') return;
|
||||||
|
gFFI.login(id, text, remember);
|
||||||
|
close();
|
||||||
|
dialogManager.showLoading(translate('Logging in...'),
|
||||||
|
onCancel: closeConnection);
|
||||||
|
}
|
||||||
|
|
||||||
return CustomAlertDialog(
|
return CustomAlertDialog(
|
||||||
title: Text(translate('Password Required')),
|
title: Text(translate('Password Required')),
|
||||||
content: Column(mainAxisSize: MainAxisSize.min, children: [
|
content: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||||
@ -183,25 +197,17 @@ void enterPasswordDialog(String id, OverlayDialogManager dialogManager) async {
|
|||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
style: flatButtonStyle,
|
style: flatButtonStyle,
|
||||||
onPressed: () {
|
onPressed: cancel,
|
||||||
close();
|
|
||||||
closeConnection();
|
|
||||||
},
|
|
||||||
child: Text(translate('Cancel')),
|
child: Text(translate('Cancel')),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
style: flatButtonStyle,
|
style: flatButtonStyle,
|
||||||
onPressed: () {
|
onPressed: submit,
|
||||||
var text = controller.text.trim();
|
|
||||||
if (text == '') return;
|
|
||||||
gFFI.login(id, text, remember);
|
|
||||||
close();
|
|
||||||
dialogManager.showLoading(translate('Logging in...'),
|
|
||||||
onCancel: closeConnection);
|
|
||||||
},
|
|
||||||
child: Text(translate('OK')),
|
child: Text(translate('OK')),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
onSubmit: submit,
|
||||||
|
onCancel: cancel,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user