Add support for searching in other thread (#51)

This commit is contained in:
Rafał Mikrut 2020-10-07 22:22:39 +02:00 committed by GitHub
parent 22cc0ed592
commit be30afdac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 507 additions and 448 deletions

View File

@ -125,6 +125,10 @@ impl DuplicateFinder {
self.debug_print();
}
pub fn get_check_method(&self) -> &CheckingMethod {
&self.check_method
}
pub fn get_files_sorted_by_size(&self) -> &BTreeMap<u64, Vec<FileEntry>> {
&self.files_with_identical_size
}

View File

@ -1,6 +1,7 @@
use czkawka_core::common_messages::Messages;
use gtk::prelude::*;
use gtk::TreeViewColumn;
use std::collections::HashMap;
pub enum ColumnsDuplicates {
// Columns for duplicate treeview
@ -299,3 +300,28 @@ pub fn select_function_3column(_tree_selection: &gtk::TreeSelection, tree_model:
true
}
pub fn set_buttons(hashmap: &mut HashMap<String, bool>, buttons_array: &[gtk::Button], button_names: &[&str]) {
for (index, button) in buttons_array.iter().enumerate() {
if *hashmap.get_mut(button_names[index]).unwrap() {
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: &[&str]) {
for (index, button) in buttons_array.iter().enumerate() {
if except_name == button_names[index] {
button.show();
} else {
button.hide();
}
}
}

File diff suppressed because it is too large Load Diff