feat: show progress in install button#179
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the installer launch flow to provide user-visible progress feedback via the “install” button label while pre-flight ISO checks run and while the installer is being started.
Changes:
- Updates the install button label to “Checking...” before running ISO checks.
- Restores the original localized label when checks fail or after the installer exits.
- Updates the install button label to “Launching installer...” when starting the installer process.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let install_btn: gtk::Button = builder.object("install").unwrap(); | ||
| install_btn.set_sensitive(false); | ||
| install_btn.set_label("Checking..."); |
There was a problem hiding this comment.
These set_label(...) calls happen inside a std::thread::spawn worker thread. GTK widgets are not thread-safe; updating the button label from a non-main thread can cause crashes or undefined behavior. Route UI updates back to the main loop (e.g., via glib::MainContext/channel, glib::idle_add_local, or glib::timeout_add_local) and only mutate GTK widgets there.
| install_btn.set_label("Checking..."); | ||
|
|
||
| let ui_comp = crate::gui::GUI::new(window_ref.clone()); | ||
| let checks = [connectivity_check, edition_compat_check, outdated_version_check]; | ||
| if !checks.iter().all(|x| x(&ui_comp, message.clone())) { | ||
| // if any check failed, return | ||
| info!("Some ISO check failed!"); | ||
| install_btn.set_sensitive(true); | ||
| install_btn.set_label(&fl!("button-installer-label")); | ||
| return; | ||
| } | ||
|
|
||
| // Spawning child process | ||
| info!("ISO checks passed! Starting Installer.."); | ||
| install_btn.set_label("Launching installer..."); | ||
| let mut child = Exec::cmd("/usr/local/bin/calamares-online.sh") |
There was a problem hiding this comment.
The new button status texts are hard-coded English strings ("Checking...", "Launching installer...") while the default installer label uses fl!(...). To keep the UI fully localizable, add new Fluent keys for these states and use fl!() here as well.
No description provided.