mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-10-15 00:09:39 +08:00
[fix] restore automatic update dialog on startup
This commit is contained in:
@@ -171,7 +171,7 @@ sudo apt install "./crossdesk-virtual-desktop-xfce-linux-amd64-<version>.deb"
|
||||
|
||||
### 检查更新
|
||||
|
||||
客户端启动后会在后台检查版本。发现新版本时,主窗口菜单入口会显示更新提示;打开 **☰ → 关于** 可查看版本,也可点击 **检查更新** 手动检查。发现更新后可查看更新说明并前往下载页面。
|
||||
客户端启动后会在后台检查版本,发现新版本时自动弹出更新提示,可查看更新说明并前往下载页面。关闭提示后,本次运行中的后台检查不会再次弹窗,主窗口菜单入口仍会显示更新提示;重新启动客户端后,如仍有新版本则再次提示。打开 **☰ → 关于** 可查看版本和更新说明,也可点击 **检查更新** 手动检查。
|
||||
|
||||
<p align="center">
|
||||
<img src="docs/images/desktop-about-zh.png" width="720" alt="关于窗口与检查更新按钮,版本号和检查结果为演示数据" />
|
||||
|
||||
+1
-1
@@ -171,7 +171,7 @@ Open **☰ → Settings** in the top-right corner and click **OK** to save. Conf
|
||||
|
||||
### Check for updates
|
||||
|
||||
The client checks for updates in the background after launch. A new version adds an update indicator to the main window menu. Open **☰ → About** to view the version or click **Check for updates** to check manually. When an update is available, you can view its release notes and open the download page.
|
||||
The client checks for updates in the background after launch and automatically opens the update dialog when a new version is found, showing release notes and a link to the download page. After you dismiss the dialog, background checks will not reopen it during the current run, while the main window menu keeps its update indicator. Restarting the client shows the dialog again if an update is still available. Open **☰ → About** to view the version and release notes or click **Check for updates** to check manually.
|
||||
|
||||
<p align="center">
|
||||
<img src="docs/images/desktop-about-en.png" width="720" alt="About dialog with the Check for updates button; version and check result are demonstration data" />
|
||||
|
||||
@@ -423,7 +423,9 @@ export component MainWindow inherits Window {
|
||||
if !root.self-host-settings-open { root.self-host-settings-error = ""; }
|
||||
}
|
||||
in-out property <bool> about-open: false;
|
||||
in-out property <bool> update-open: false;
|
||||
// Follow the first available update. Dismissing the dialog replaces this
|
||||
// binding, so background checks do not reopen it during this launch.
|
||||
in-out property <bool> update-open: root.update-available;
|
||||
in-out property <bool> reset-password-open: false;
|
||||
in-out property <bool> reset-password-invalid: false;
|
||||
in-out property <string> new-password-input: "";
|
||||
|
||||
@@ -495,9 +495,20 @@ int main() {
|
||||
window->set_about_open(true);
|
||||
assert(window->get_settings_open());
|
||||
assert(window->get_about_open());
|
||||
window->set_update_available(true);
|
||||
if (window->get_update_open()) {
|
||||
std::cerr << "Automatic update checks must not open the update dialog\n";
|
||||
std::cerr << "The update dialog must stay closed before an update is found\n";
|
||||
return 8;
|
||||
}
|
||||
window->set_update_available(true);
|
||||
if (!window->get_update_open()) {
|
||||
std::cerr << "Finding an update must automatically open the update dialog\n";
|
||||
return 8;
|
||||
}
|
||||
// The Later button closes the dialog by assigning update-open = false.
|
||||
window->set_update_open(false);
|
||||
window->set_update_available(true);
|
||||
if (window->get_update_open() || !window->get_update_available()) {
|
||||
std::cerr << "Repeated checks must preserve dismissal and the update badge\n";
|
||||
return 8;
|
||||
}
|
||||
bool update_check_requested = false;
|
||||
@@ -512,6 +523,26 @@ int main() {
|
||||
return 8;
|
||||
}
|
||||
window->set_update_available(false);
|
||||
window->set_update_available(true);
|
||||
if (window->get_update_open()) {
|
||||
std::cerr << "A dismissed update dialog must stay closed during this launch\n";
|
||||
return 8;
|
||||
}
|
||||
window->set_update_open(true);
|
||||
if (!window->get_update_open()) {
|
||||
std::cerr << "Update details must still be available after dismissal\n";
|
||||
return 8;
|
||||
}
|
||||
window->set_update_open(false);
|
||||
{
|
||||
auto next_launch = crossdesk::ui::MainWindow::create();
|
||||
next_launch->set_update_available(true);
|
||||
if (!next_launch->get_update_open()) {
|
||||
std::cerr << "A new launch must show the available update again\n";
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
window->set_update_available(false);
|
||||
window->set_update_check_status(crossdesk::ui::UpdateCheckStatus::Idle);
|
||||
if (const char *snapshot_path =
|
||||
std::getenv("CROSSDESK_SETTINGS_UI_SNAPSHOT")) {
|
||||
|
||||
Reference in New Issue
Block a user