-
Notifications
You must be signed in to change notification settings - Fork 68
feat: show progress in install button #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ use std::path::Path; | |
|
|
||
| use gtk::prelude::{BuilderExtManual, WidgetExt}; | ||
|
|
||
| use gtk::traits::ButtonExt; | ||
| use serde::Deserialize; | ||
| use subprocess::{Exec, Redirection}; | ||
| use tracing::{error, info}; | ||
|
|
@@ -133,18 +134,21 @@ pub fn launch_installer(message: String) { | |
|
|
||
| let install_btn: gtk::Button = builder.object("install").unwrap(); | ||
| install_btn.set_sensitive(false); | ||
| install_btn.set_label("Checking..."); | ||
|
Comment on lines
135
to
+137
|
||
|
|
||
| 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") | ||
|
Comment on lines
+137
to
152
|
||
| .stdout(Redirection::Pipe) | ||
| .stderr(Redirection::Merge) | ||
|
|
@@ -166,6 +170,7 @@ pub fn launch_installer(message: String) { | |
| info!("Installer finished with status: {:?}", status); | ||
|
|
||
| install_btn.set_sensitive(true); | ||
| install_btn.set_label(&fl!("button-installer-label")); | ||
| }); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.