better install prompt

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-03-08 11:14:29 +08:00
parent c0257bff52
commit ad32eec879
34 changed files with 106 additions and 41 deletions

View File

@@ -65,7 +65,7 @@ class _InstallPageBodyState extends State<_InstallPageBody>
late final TextEditingController controller;
final RxBool startmenu = true.obs;
final RxBool desktopicon = true.obs;
final RxBool driverCert = false.obs;
final RxBool driverCert = true.obs;
final RxBool showProgress = false.obs;
final RxBool btnEnabled = true.obs;
@@ -242,13 +242,47 @@ class _InstallPageBodyState extends State<_InstallPageBody>
}
void install() {
btnEnabled.value = false;
showProgress.value = true;
String args = '';
if (startmenu.value) args += ' startmenu';
if (desktopicon.value) args += ' desktopicon';
if (driverCert.value) args += ' driverCert';
bind.installInstallMe(options: args, path: controller.text);
do_install() {
btnEnabled.value = false;
showProgress.value = true;
String args = '';
if (startmenu.value) args += ' startmenu';
if (desktopicon.value) args += ' desktopicon';
if (driverCert.value) args += ' driverCert';
bind.installInstallMe(options: args, path: controller.text);
}
if (driverCert.isTrue) {
final tag = 'install-info-install-cert-confirm';
final btns = [
dialogButton(
'Cancel',
onPressed: () => gFFI.dialogManager.dismissByTag(tag),
isOutline: true,
),
dialogButton(
'OK',
onPressed: () {
gFFI.dialogManager.dismissByTag(tag);
do_install();
},
isOutline: false,
),
];
gFFI.dialogManager.show(
(setState, close) => CustomAlertDialog(
title: null,
content: SelectionArea(
child: msgboxContent(
'info', '', 'Continue with installing cert is checked.')),
actions: btns,
onCancel: close,
),
tag: tag,
);
} else {
do_install();
}
}
void selectInstallPath() async {