closeAllSubWindow before install

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-11-07 09:09:05 +08:00
parent c69f4ba4a2
commit 6a0db02230

View File

@ -336,11 +336,17 @@ class _DesktopHomePageState extends State<DesktopHomePage>
}
if (Platform.isWindows) {
if (!bind.mainIsInstalled()) {
return buildInstallCard(
"", "install_tip", "Install", bind.mainGotoInstall);
return buildInstallCard("", "install_tip", "Install", () async {
await rustDeskWinManager.closeAllSubWindows();
bind.mainGotoInstall();
});
} else if (bind.mainIsInstalledLowerVersion()) {
return buildInstallCard("Status", "Your installation is lower version.",
"Click to upgrade", bind.mainUpdateMe);
return buildInstallCard(
"Status", "Your installation is lower version.", "Click to upgrade",
() async {
await rustDeskWinManager.closeAllSubWindows();
bind.mainUpdateMe();
});
}
} else if (Platform.isMacOS) {
if (!bind.mainIsCanScreenRecording(prompt: false)) {
@ -384,7 +390,10 @@ class _DesktopHomePageState extends State<DesktopHomePage>
final keyShowSelinuxHelpTip = "show-selinux-help-tip";
if (bind.mainGetLocalOption(key: keyShowSelinuxHelpTip) != 'N') {
LinuxCards.add(buildInstallCard(
"Warning", "selinux_tip", "", () async {},
"Warning",
"selinux_tip",
"",
() async {},
marginTop: LinuxCards.isEmpty ? 20.0 : 5.0,
help: 'Help',
link:
@ -418,7 +427,11 @@ class _DesktopHomePageState extends State<DesktopHomePage>
Widget buildInstallCard(String title, String content, String btnText,
GestureTapCallback onPressed,
{double marginTop = 20.0, String? help, String? link, bool? closeButton, String? closeOption}) {
{double marginTop = 20.0,
String? help,
String? link,
bool? closeButton,
String? closeOption}) {
void closeCard() async {
if (closeOption != null) {
await bind.mainSetLocalOption(key: closeOption, value: 'N');
@ -502,7 +515,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
child: Text(
translate(help),
style: TextStyle(
decoration: TextDecoration.underline,
decoration:
TextDecoration.underline,
color: Colors.white,
fontSize: 12),
)).marginOnly(top: 6)),