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

@ -946,7 +946,6 @@ Widget msgboxContent(String type, String title, String text) {
void msgBoxCommon(OverlayDialogManager dialogManager, String title, void msgBoxCommon(OverlayDialogManager dialogManager, String title,
Widget content, List<Widget> buttons, Widget content, List<Widget> buttons,
{bool hasCancel = true}) { {bool hasCancel = true}) {
dialogManager.dismissAll();
dialogManager.show((setState, close) => CustomAlertDialog( dialogManager.show((setState, close) => CustomAlertDialog(
title: Text( title: Text(
translate(title), translate(title),

View File

@ -65,7 +65,7 @@ class _InstallPageBodyState extends State<_InstallPageBody>
late final TextEditingController controller; late final TextEditingController controller;
final RxBool startmenu = true.obs; final RxBool startmenu = true.obs;
final RxBool desktopicon = true.obs; final RxBool desktopicon = true.obs;
final RxBool driverCert = false.obs; final RxBool driverCert = true.obs;
final RxBool showProgress = false.obs; final RxBool showProgress = false.obs;
final RxBool btnEnabled = true.obs; final RxBool btnEnabled = true.obs;
@ -242,13 +242,47 @@ class _InstallPageBodyState extends State<_InstallPageBody>
} }
void install() { void install() {
btnEnabled.value = false; do_install() {
showProgress.value = true; btnEnabled.value = false;
String args = ''; showProgress.value = true;
if (startmenu.value) args += ' startmenu'; String args = '';
if (desktopicon.value) args += ' desktopicon'; if (startmenu.value) args += ' startmenu';
if (driverCert.value) args += ' driverCert'; if (desktopicon.value) args += ' desktopicon';
bind.installInstallMe(options: args, path: controller.text); 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 { void selectInstallPath() async {

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", "安装驱动证书(测试证书)"), ("Install driver cert(test cert)", "安装驱动证书(测试证书)"),
("Virtual display requirement", "虚拟显示器需要") ("Virtual display requirement", "虚拟显示器需"),
("Continue with installing cert is checked.", "安装证书已选择,是否继续")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Keine Übertragungen im Gange"), ("No transfers in progress", "Keine Übertragungen im Gange"),
("Set one-time password length", "Länge des Einmalpassworts festlegen"), ("Set one-time password length", "Länge des Einmalpassworts festlegen"),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "No hay transferencias en curso"), ("No transfers in progress", "No hay transferencias en curso"),
("Set one-time password length", "Establecer contraseña de un solo uso"), ("Set one-time password length", "Establecer contraseña de un solo uso"),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "هیچ انتقالی در حال انجام نیست"), ("No transfers in progress", "هیچ انتقالی در حال انجام نیست"),
("Set one-time password length", "طول رمز یکبار مصرف را تعیین کنید"), ("Set one-time password length", "طول رمز یکبار مصرف را تعیین کنید"),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Nessun trasferimento in corso"), ("No transfers in progress", "Nessun trasferimento in corso"),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Geen overdrachten in uitvoering"), ("No transfers in progress", "Geen overdrachten in uitvoering"),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Brak transferów w toku"), ("No transfers in progress", "Brak transferów w toku"),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Передача не осуществляется"), ("No transfers in progress", "Передача не осуществляется"),
("Set one-time password length", "Установить длину одноразового пароля"), ("Set one-time password length", "Установить длину одноразового пароля"),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -462,6 +462,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""), ("No transfers in progress", ""),
("Set one-time password length", ""), ("Set one-time password length", ""),
("Install driver cert(test cert)", ""), ("Install driver cert(test cert)", ""),
("Virtual display requirement", "") ("Virtual display requirement", ""),
("Continue with installing cert is checked.", "")
].iter().cloned().collect(); ].iter().cloned().collect();
} }