Removed unused stop, resume and pause buttons (#107)
This commit is contained in:
parent
7ac4a26229
commit
6d5ab1d98c
|
@ -1700,153 +1700,6 @@ Author: Rafał Mikrut
|
|||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="buttons_stop">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<child>
|
||||
<object class="GtkAlignment">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">application-exit</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Stop</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="buttons_pause">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<child>
|
||||
<object class="GtkAlignment">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">media-playback-pause</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Pause</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="buttons_resume">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<child>
|
||||
<object class="GtkAlignment">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">media-playback-start</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Resume</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 |_| {
|
||||
|
|
|
@ -11,7 +11,6 @@ use gtk::prelude::*;
|
|||
|
||||
pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<Message>) {
|
||||
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();
|
||||
|
||||
|
|
|
@ -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<RefCell<HashMap<String, HashMap<String, bool>>>>,
|
||||
|
||||
|
@ -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,
|
||||
|
|
|
@ -202,22 +202,22 @@ pub fn set_buttons(hashmap: &mut HashMap<String, bool>, 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",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue