]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: install progress: use ok/cancel as button text for installer prompt
authorChristoph Heiss <c.heiss@proxmox.com>
Fri, 17 Nov 2023 13:45:27 +0000 (14:45 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 17 Nov 2023 16:08:29 +0000 (17:08 +0100)
The GTK installer/UI module in the low-level installer does the same.
Messages used with this are worded for this, using yes/no instead can be
quite confusing (e.g.
Proxmox::Install::ask_existing_vg_rename_or_abort())

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
proxmox-tui-installer/src/main.rs
proxmox-tui-installer/src/views/install_progress.rs

index e1411c6140cabd602f6d3b0506696745a6116ddb..4c1448248575facea743bd8725e76f69277501da 100644 (file)
@@ -285,21 +285,23 @@ fn switch_to_prev_screen(siv: &mut Cursive) {
     siv.set_screen(id);
 }
 
-fn yes_no_dialog(
+fn prompt_dialog(
     siv: &mut Cursive,
     title: &str,
     text: &str,
+    yes_text: &str,
     callback_yes: Box<dyn Fn(&mut Cursive)>,
+    no_text: &str,
     callback_no: Box<dyn Fn(&mut Cursive)>,
 ) {
     siv.add_layer(
         Dialog::around(TextView::new(text))
             .title(title)
-            .button("No", move |siv| {
+            .button(no_text, move |siv| {
                 siv.pop_layer();
                 callback_no(siv);
             })
-            .button("Yes", move |siv| {
+            .button(yes_text, move |siv| {
                 siv.pop_layer();
                 callback_yes(siv);
             }),
@@ -311,11 +313,13 @@ fn trigger_abort_install_dialog(siv: &mut Cursive) {
     siv.quit();
 
     #[cfg(not(debug_assertions))]
-    yes_no_dialog(
+    prompt_dialog(
         siv,
         "Abort installation?",
         "Are you sure you want to abort the installation?",
+        "Yes",
         Box::new(Cursive::quit),
+        "No",
         Box::new(|_| {}),
     )
 }
index 76dd518502a283f4d0e4c2b84764843a6afc7548..01c994157282c39847e3e6433d95dcd8095311c5 100644 (file)
@@ -13,7 +13,7 @@ use cursive::{
     CbSink, Cursive,
 };
 
-use crate::{abort_install_button, setup::InstallConfig, yes_no_dialog, InstallerState};
+use crate::{abort_install_button, prompt_dialog, setup::InstallConfig, InstallerState};
 use proxmox_installer_common::setup::spawn_low_level_installer;
 
 pub struct InstallProgressView {
@@ -189,10 +189,11 @@ impl InstallProgressView {
     }
 
     fn show_prompt<W: Write + 'static>(siv: &mut Cursive, text: &str, writer: Arc<Mutex<W>>) {
-        yes_no_dialog(
+        prompt_dialog(
             siv,
             "Prompt",
             text,
+            "OK",
             Box::new({
                 let writer = writer.clone();
                 move |_| {
@@ -201,6 +202,7 @@ impl InstallProgressView {
                     }
                 }
             }),
+            "Cancel",
             Box::new(move |_| {
                 if let Ok(mut writer) = writer.lock() {
                     let _ = writeln!(writer);