diff --git a/czkawka_gui/czkawka.glade b/czkawka_gui/czkawka.glade index b14bb26..79813f4 100644 --- a/czkawka_gui/czkawka.glade +++ b/czkawka_gui/czkawka.glade @@ -1700,153 +1700,6 @@ Author: RafaƂ Mikrut 0 - - - True - True - True - - - True - False - - - True - False - 2 - - - True - False - application-exit - - - False - True - 0 - - - - - True - False - Stop - - - False - True - 1 - - - - - - - - - False - True - 1 - - - - - True - True - True - - - True - False - - - True - False - 2 - - - True - False - media-playback-pause - - - False - True - 0 - - - - - True - False - Pause - - - False - True - 1 - - - - - - - - - False - True - 2 - - - - - True - True - True - - - True - False - - - True - False - 2 - - - True - False - media-playback-start - - - False - True - 0 - - - - - True - False - Resume - - - False - True - 1 - - - - - - - - - False - True - 3 - - False diff --git a/czkawka_gui/src/connect_button_search.rs b/czkawka_gui/src/connect_button_search.rs index c946c7f..d3140e3 100644 --- a/czkawka_gui/src/connect_button_search.rs +++ b/czkawka_gui/src/connect_button_search.rs @@ -81,7 +81,7 @@ pub fn connect_button_search( let excluded_items = entry_excluded_items.get_text().as_str().to_string(); let allowed_extensions = entry_allowed_extensions.get_text().as_str().to_string(); - hide_all_buttons_except("stop", &buttons_array, &buttons_names); + hide_all_buttons(&buttons_array); // Disable main notebook from any iteration until search will end notebook_main.set_sensitive(false); diff --git a/czkawka_gui/src/connect_button_stop.rs b/czkawka_gui/src/connect_button_stop.rs index 7fbdae0..eed5f88 100644 --- a/czkawka_gui/src/connect_button_stop.rs +++ b/czkawka_gui/src/connect_button_stop.rs @@ -3,15 +3,6 @@ use crate::gui_data::GuiData; use gtk::prelude::*; pub fn connect_button_stop(gui_data: &GuiData) { - // TODO remove it when it will not be used - { - let buttons_stop = gui_data.buttons_stop.clone(); - let stop_sender = gui_data.stop_sender.clone(); - buttons_stop.connect_clicked(move |_| { - stop_sender.send(()).unwrap(); - }); - } - let button_stop_in_dialog = gui_data.button_stop_in_dialog.clone(); let stop_sender = gui_data.stop_sender.clone(); button_stop_in_dialog.connect_clicked(move |_| { diff --git a/czkawka_gui/src/connect_compute_results.rs b/czkawka_gui/src/connect_compute_results.rs index f2b3685..b3f01b5 100644 --- a/czkawka_gui/src/connect_compute_results.rs +++ b/czkawka_gui/src/connect_compute_results.rs @@ -11,7 +11,6 @@ use gtk::prelude::*; pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver) { let buttons_search = gui_data.buttons_search.clone(); - let buttons_stop = gui_data.buttons_stop.clone(); let notebook_main = gui_data.notebook_main.clone(); let entry_info = gui_data.entry_info.clone(); let scrolled_window_main_empty_folder_finder = gui_data.scrolled_window_main_empty_folder_finder.clone(); @@ -38,7 +37,6 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver< glib_stop_receiver.attach(None, move |msg| { buttons_search.show(); - buttons_stop.hide(); dialog_progress.hide(); diff --git a/czkawka_gui/src/gui_data.rs b/czkawka_gui/src/gui_data.rs index 6636a74..7e11fb7 100644 --- a/czkawka_gui/src/gui_data.rs +++ b/czkawka_gui/src/gui_data.rs @@ -27,7 +27,7 @@ pub struct GuiData { // States pub main_notebooks_labels: [String; 8], pub upper_notebooks_labels: [String; 4], - pub buttons_labels: [String; 7], + pub buttons_labels: [String; 4], // Buttons state pub shared_buttons: Rc>>>, @@ -57,14 +57,11 @@ pub struct GuiData { //// GUI Buttons pub buttons_search: gtk::Button, - pub buttons_stop: gtk::Button, - pub buttons_resume: gtk::Button, - pub buttons_pause: gtk::Button, pub buttons_select: gtk::Button, pub buttons_delete: gtk::Button, pub buttons_save: gtk::Button, - pub buttons_names: [String; 7], - pub buttons_array: [Button; 7], + pub buttons_names: [String; 4], + pub buttons_array: [Button; 4], pub buttons_add_included_directory: gtk::Button, pub buttons_remove_included_directory: gtk::Button, pub buttons_add_excluded_directory: gtk::Button, @@ -184,7 +181,7 @@ impl GuiData { "excluded_items".to_string(), "allowed_extensions".to_string(), ]; - let buttons_labels = ["search".to_string(), "stop".to_string(), "resume".to_string(), "pause".to_string(), "select".to_string(), "delete".to_string(), "save".to_string()]; + let buttons_labels = ["search".to_string(), "select".to_string(), "delete".to_string(), "save".to_string()]; // Buttons State - to remember existence of different buttons on pages @@ -244,23 +241,12 @@ impl GuiData { //// GUI Buttons let buttons_search: gtk::Button = builder.get_object("buttons_search").unwrap(); - let buttons_stop: gtk::Button = builder.get_object("buttons_stop").unwrap(); - let buttons_resume: gtk::Button = builder.get_object("buttons_resume").unwrap(); - let buttons_pause: gtk::Button = builder.get_object("buttons_pause").unwrap(); let buttons_select: gtk::Button = builder.get_object("buttons_select").unwrap(); let buttons_delete: gtk::Button = builder.get_object("buttons_delete").unwrap(); let buttons_save: gtk::Button = builder.get_object("buttons_save").unwrap(); - let buttons_names = ["search".to_string(), "stop".to_string(), "resume".to_string(), "pause".to_string(), "select".to_string(), "delete".to_string(), "save".to_string()]; - let buttons_array = [ - buttons_search.clone(), - buttons_stop.clone(), - buttons_resume.clone(), - buttons_pause.clone(), - buttons_select.clone(), - buttons_delete.clone(), - buttons_save.clone(), - ]; + let buttons_names = ["search".to_string(), "select".to_string(), "delete".to_string(), "save".to_string()]; + let buttons_array = [buttons_search.clone(), buttons_select.clone(), buttons_delete.clone(), buttons_save.clone()]; let buttons_add_included_directory: gtk::Button = builder.get_object("buttons_add_included_directory").unwrap(); let buttons_remove_included_directory: gtk::Button = builder.get_object("buttons_remove_included_directory").unwrap(); @@ -382,9 +368,6 @@ impl GuiData { entry_big_files_number, entry_same_music_minimal_size, buttons_search, - buttons_stop, - buttons_resume, - buttons_pause, buttons_select, buttons_delete, buttons_save, diff --git a/czkawka_gui/src/help_functions.rs b/czkawka_gui/src/help_functions.rs index b73a9dc..8ff787f 100644 --- a/czkawka_gui/src/help_functions.rs +++ b/czkawka_gui/src/help_functions.rs @@ -202,22 +202,22 @@ pub fn set_buttons(hashmap: &mut HashMap, buttons_array: &[gtk::Bu } } } -// pub fn hide_all_buttons(buttons_array: &[gtk::Button]) { -// for button in buttons_array { -// button.hide(); -// } -// } - -pub fn hide_all_buttons_except(except_name: &str, buttons_array: &[gtk::Button], button_names: &[String]) { - for (index, button) in buttons_array.iter().enumerate() { - if except_name == button_names[index] { - button.show(); - } else { - button.hide(); - } +pub fn hide_all_buttons(buttons_array: &[gtk::Button]) { + for button in buttons_array { + button.hide(); } } +// pub fn hide_all_buttons_except(except_name: &str, buttons_array: &[gtk::Button], button_names: &[String]) { +// for (index, button) in buttons_array.iter().enumerate() { +// if except_name == button_names[index] { +// button.show(); +// } else { +// button.hide(); +// } +// } +// } + pub fn get_text_from_similarity(similarity: &Similarity) -> &str { match similarity { Similarity::None => "Original", diff --git a/czkawka_gui/src/startup_configuration.rs b/czkawka_gui/src/startup_configuration.rs index 088834e..0302426 100644 --- a/czkawka_gui/src/startup_configuration.rs +++ b/czkawka_gui/src/startup_configuration.rs @@ -13,9 +13,6 @@ pub fn startup_configuration(gui_data: &GuiData) { let buttons_search = gui_data.buttons_search.clone(); let buttons_save = gui_data.buttons_save.clone(); let buttons_delete = gui_data.buttons_delete.clone(); - let buttons_stop = gui_data.buttons_stop.clone(); - let buttons_resume = gui_data.buttons_resume.clone(); - let buttons_pause = gui_data.buttons_pause.clone(); let buttons_select = gui_data.buttons_select.clone(); let scrolled_window_duplicate_finder = gui_data.scrolled_window_duplicate_finder.clone(); let scrolled_window_main_empty_folder_finder = gui_data.scrolled_window_main_empty_folder_finder.clone(); @@ -35,9 +32,6 @@ pub fn startup_configuration(gui_data: &GuiData) { buttons_search.show(); buttons_save.hide(); buttons_delete.hide(); - buttons_stop.hide(); - buttons_resume.hide(); - buttons_pause.hide(); buttons_select.hide(); // Set Main Scrolled Window Treeviews