Skip to content
Snippets Groups Projects

WIP: (conditional) addition of SSD installation page, some code-reorganizations, fix of stack sidebar tabbing, exit directly without cleanup script

Open plom requested to merge plom_experiments into main
Files
2
+ 2
17
@@ -69,7 +69,6 @@ input * {
}
"#;
const PATH_SKEL_WAYFIRE_INI: &str = "/etc/skel/.config/wayfire.ini";
const PATH_CLEANUP_SCRIPTS: &str = "/usr/share/reform-setup-wizard/cleanup.d";
// see also:
// - https://martinber.github.io/gtk-rs.github.io/docs-src/tutorial/closures
@@ -218,16 +217,6 @@ fn run_command(description: &str, executable: &str, params: Vec<&str>) -> Result
};
}
fn run_cleanup_scripts_and_close_or_error(window: &ApplicationWindow, error_label: &Label) -> () {
let cleanup_scripts = format!("for script in `ls -1 {}`; do \"{}/$script\"; done", PATH_CLEANUP_SCRIPTS, PATH_CLEANUP_SCRIPTS);
match run_command("run cleanup scripts", "sh", ["-c", &cleanup_scripts].to_vec()) {
Ok(_) => window.close(),
Err(e) => {
error_label.set_label(&e)
}
};
}
fn set_password(description: &str, pw: &str, username: &str) -> Result<(), String> {
let digest = match bcrypt::hash(&pw) {
Ok(v) => v.to_string(),
@@ -761,7 +750,7 @@ fn build_account_page(stack: &Stack, desktop_index: Rc<RefCell<usize>>, window:
if send_to_encrypt_tab {
stack.set_visible_child_full("encrypt", gtk::StackTransitionType::SlideLeft)
} else {
run_cleanup_scripts_and_close_or_error(&window, &error_label);
window.close();
}
})
);
@@ -901,11 +890,7 @@ fn build_encrypt_page(stack: &Stack, window: &ApplicationWindow) -> StackPage {
})
);
button_finish.connect_clicked(
clone!(@weak window, @weak error_label => move |_| {
run_cleanup_scripts_and_close_or_error(&window, &error_label);
})
);
button_finish.connect_clicked(clone!(@weak window => move |_| window.close() ));
let shell_buf = shell_win.buffer();
glib::idle_add_local(move || {
Loading