1
0
Fork 0
mirror of synced 2024-06-02 10:35:02 +12:00

Exclude in FS

This commit is contained in:
Rafał Mikrut 2022-07-13 20:35:13 +02:00
parent 630402482d
commit 355761e8a4
20 changed files with 108 additions and 44 deletions

44
Cargo.lock generated
View file

@ -284,9 +284,9 @@ checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
[[package]]
name = "cfb"
version = "0.7.2"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19ff6ea9647f5b4fb422a553d5b6fe1b398986a6e4f458d1219eb77e0e6e0606"
checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f"
dependencies = [
"byteorder",
"fnv",
@ -341,9 +341,9 @@ dependencies = [
[[package]]
name = "clap"
version = "3.2.8"
version = "3.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83"
checksum = "d646c7ade5eb07c4aa20e907a922750df0c448892513714fd3e4acbc7130829f"
dependencies = [
"atty",
"bitflags",
@ -455,9 +455,9 @@ dependencies = [
[[package]]
name = "crypto-common"
version = "0.1.4"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5999502d32b9c48d492abe66392408144895020ec4709e549e840799f3bb74c0"
checksum = "2ccfd8c0ee4cce11e45b3fd6f9d5e69e0cc62912aa6a0cb1bf4617b0eba5a12f"
dependencies = [
"generic-array",
"typenum",
@ -1217,9 +1217,9 @@ checksum = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1"
[[package]]
name = "hashbrown"
version = "0.12.1"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3"
checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022"
[[package]]
name = "heck"
@ -1570,9 +1570,9 @@ dependencies = [
[[package]]
name = "lofty"
version = "0.7.0"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f4e4309226629ef3486925c6a1b346241abeb30758e307b3ca9cfd66587bf4f"
checksum = "b6d1ba3c036ad548be962a93536441b393429b24da8492b1b5288012164b8a8f"
dependencies = [
"base64 0.13.0",
"byteorder",
@ -2208,9 +2208,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.5.6"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1"
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
dependencies = [
"aho-corasick",
"memchr",
@ -2219,9 +2219,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.26"
version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "remove_dir_all"
@ -2394,18 +2394,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.138"
version = "1.0.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47"
checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.138"
version = "1.0.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c"
checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb"
dependencies = [
"proc-macro2",
"quote",
@ -2425,9 +2425,9 @@ dependencies = [
[[package]]
name = "serde_yaml"
version = "0.8.24"
version = "0.8.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707d15895415db6628332b737c838b88c598522e4dc70647e59b72312924aebc"
checksum = "1ec0091e1f5aa338283ce049bd9dfefd55e1f168ac233e85c1ffe0038fb48cbe"
dependencies = [
"indexmap",
"ryu",
@ -3103,9 +3103,9 @@ checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be"
[[package]]
name = "weezl"
version = "0.1.6"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c97e489d8f836838d497091de568cf16b117486d529ec5579233521065bd5e4"
checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb"
[[package]]
name = "winapi"

View file

@ -10,7 +10,7 @@ homepage = "https://github.com/qarmin/czkawka"
repository = "https://github.com/qarmin/czkawka"
[dependencies]
clap = { version = "3.2.3", features = ["derive"]}
clap = { version = "3.2.11", features = ["derive"] }
# For enum types
image_hasher = "1.0.0"
@ -22,4 +22,4 @@ features = []
[features]
default = []
heif = ["czkawka_core/heif"]
heif = ["czkawka_core/heif"]

View file

@ -12,8 +12,8 @@ repository = "https://github.com/qarmin/czkawka"
[dependencies]
humansize = "1.1.1"
rayon = "1.5.1"
crossbeam-channel = "0.5.4"
rayon = "1.5.3"
crossbeam-channel = "0.5.5"
# For saving/loading config files to specific directories
directories-next = "2.0.0"
@ -26,13 +26,13 @@ hamming = "0.1.3"
# Needed by same music
bitflags = "1.3.2"
lofty="0.7.0"
lofty= "0.7.2"
# Futures - needed by async progress sender
futures = "0.3.21"
# Needed by broken files
zip = { version = "0.6.2", features=["aes-crypto", "bzip2", "deflate", "time"], default-features = false}
zip = { version = "0.6.2", features = ["aes-crypto", "bzip2", "deflate", "time"], default-features = false }
audio_checker = "0.1.0"
pdf = "0.7.2"
@ -48,15 +48,15 @@ vid_dup_finder_lib = "0.1.0"
ffmpeg_cmdline_utils = "0.1.1"
# Saving/Loading Cache
serde = "1.0.137"
serde = "1.0.139"
bincode = "1.3.3"
serde_json = "1.0.81"
serde_json = "1.0.82"
# Language
i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6.4"
rust-embed = "6.4.0"
once_cell = "1.10.0"
once_cell = "1.13.0"
# Raw image files
rawloader = "0.37.1"
@ -69,8 +69,8 @@ infer = "0.9.0"
num_cpus = "1.13.1"
libheif-rs = { version = "0.15.0", optional = true }
anyhow = { version = "1.0.57", optional = true }
anyhow = { version = "1.0.58", optional = true }
[features]
default = []
heif = ["dep:libheif-rs", "dep:anyhow"]
heif = ["dep:libheif-rs", "dep:anyhow"]

View file

@ -238,6 +238,12 @@ impl BadExtensions {
t => t,
};
}
#[cfg(target_family = "unix")]
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub const fn get_text_messages(&self) -> &Messages {
&self.text_messages

View file

@ -133,6 +133,8 @@ impl BigFile {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
/// List of allowed extensions, only files with this extensions will be checking if are duplicates
pub fn set_allowed_extensions(&mut self, allowed_extensions: String) {

View file

@ -171,6 +171,8 @@ impl BrokenFiles {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) -> bool {
self.directories.set_included_directory(included_directory, &mut self.text_messages)

View file

@ -13,7 +13,6 @@ pub struct Directories {
pub excluded_directories: Vec<PathBuf>,
pub included_directories: Vec<PathBuf>,
pub reference_directories: Vec<PathBuf>,
#[cfg(target_family = "unix")]
exclude_other_filesystems: Option<bool>,
#[cfg(target_family = "unix")]
included_dev_ids: Vec<u64>,
@ -181,7 +180,8 @@ impl Directories {
self.reference_directories.dedup();
// Optimize for duplicated included directories - "/", "/home". "/home/Pulpit" to "/"
if recursive_search {
// Do not use when not using recursive search or using
if recursive_search && !self.exclude_other_filesystems.unwrap_or(false) {
// This is only point which can't be done when recursive search is disabled.
let mut is_inside: bool;
for ed_checked in &self.excluded_directories {

View file

@ -271,6 +271,8 @@ impl DuplicateFinder {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) {
self.directories.set_included_directory(included_directory, &mut self.text_messages);

View file

@ -100,6 +100,8 @@ impl EmptyFiles {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) -> bool {
self.directories.set_included_directory(included_directory, &mut self.text_messages)

View file

@ -71,6 +71,8 @@ impl EmptyFolder {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_excluded_items(&mut self, excluded_items: Vec<String>) {
self.excluded_items.set_excluded_items(excluded_items, &mut self.text_messages);

View file

@ -99,6 +99,8 @@ impl InvalidSymlinks {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) -> bool {
self.directories.set_included_directory(included_directory, &mut self.text_messages)

View file

@ -199,6 +199,8 @@ impl SameMusic {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
/// Set included dir which needs to be relative, exists etc.
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) {

View file

@ -216,6 +216,8 @@ impl SimilarImages {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_allowed_extensions(&mut self, allowed_extensions: String) {
self.allowed_extensions.set_allowed_extensions(allowed_extensions, &mut self.text_messages);

View file

@ -170,6 +170,8 @@ impl SimilarVideos {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_minimal_file_size(&mut self, minimal_file_size: u64) {
self.minimal_file_size = match minimal_file_size {

View file

@ -113,6 +113,8 @@ impl Temporary {
pub fn set_exclude_other_filesystems(&mut self, exclude_other_filesystems: bool) {
self.directories.set_exclude_other_filesystems(exclude_other_filesystems);
}
#[cfg(not(target_family = "unix"))]
pub fn set_exclude_other_filesystems(&mut self, _exclude_other_filesystems: bool) {}
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) -> bool {
self.directories.set_included_directory(included_directory, &mut self.text_messages)

View file

@ -10,14 +10,14 @@ homepage = "https://github.com/qarmin/czkawka"
repository = "https://github.com/qarmin/czkawka"
[dependencies]
gdk4 = "0.4.7"
glib = "0.15.11"
gdk4 = "0.4.8"
glib = "0.15.12"
humansize = "1.1.1"
chrono = "0.4.19"
# Used for sending stop signal across threads
crossbeam-channel = "0.5.4"
crossbeam-channel = "0.5.5"
# To get informations about progress
futures = "0.3.21"
@ -32,13 +32,13 @@ open = "3.0.1"
image = "0.24.2"
# To be able to use custom select
regex = "1.5.5"
regex = "1.6.0"
# To get image_hasher types
image_hasher = "1.0.0"
# Move files to trash
trash = "2.1.4"
trash = "2.1.5"
# For moving files(why std::fs doesn't have such features)
fs_extra = "1.2.0"
@ -47,14 +47,14 @@ fs_extra = "1.2.0"
i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6.4"
rust-embed = "6.4.0"
once_cell = "1.10.0"
once_cell = "1.13.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["combaseapi", "objbase", "shobjidl_core", "windef", "winerror", "wtypesbase", "winuser"] }
[dependencies.gtk4]
version = "0.4.7"
default-features = false # just in case
version = "0.4.8"
default-features = false
features = ["v4_6"]
[dependencies.czkawka_core]
@ -64,4 +64,4 @@ features = []
[features]
default = []
heif = ["czkawka_core/heif"]
heif = ["czkawka_core/heif"]

View file

@ -268,6 +268,12 @@ header_about_button_tooltip = Opens dialog with info about app.
# Settings
## General
settings_ignore_other_filesystems = Ignore other filesystems(only Linux)
settings_ignore_other_filesystems_tooltip =
ignores files that are not in the same file system as searched directories.
Works same like -xdev option in find command on Linux
settings_save_at_exit_button_tooltip = Save configuration to file when closing app.
settings_load_at_start_button_tooltip =
Load configuration from file when opening app.

View file

@ -45,6 +45,7 @@ pub fn connect_button_search(
futures_sender_broken_files: futures::channel::mpsc::UnboundedSender<broken_files::ProgressData>,
futures_sender_bad_extensions: futures::channel::mpsc::UnboundedSender<common_dir_traversal::ProgressData>,
) {
let check_button_settings_one_filesystem = gui_data.settings.check_button_settings_one_filesystem.clone();
let combo_box_image_hash_size = gui_data.main_notebook.combo_box_image_hash_size.clone();
let combo_box_image_hash_algorithm = gui_data.main_notebook.combo_box_image_hash_algorithm.clone();
let combo_box_image_resize_algorithm = gui_data.main_notebook.combo_box_image_resize_algorithm.clone();
@ -147,6 +148,7 @@ pub fn connect_button_search(
.unwrap_or_else(|_| DEFAULT_MAXIMAL_FILE_SIZE.parse::<u64>().unwrap());
let show_dialog = Arc::new(AtomicBool::new(true));
let ignore_other_filesystems = check_button_settings_one_filesystem.is_active();
window_progress.set_title(Some(&flg!("window_progress_title")));
@ -214,6 +216,7 @@ pub fn connect_button_search(
df.set_use_prehash_cache(use_prehash_cache);
df.set_delete_outdated_cache(delete_outdated_cache);
df.set_case_sensitive_name_comparison(case_sensitive_name_comparison);
df.set_exclude_other_filesystems(ignore_other_filesystems);
df.find_duplicates(Some(&stop_receiver), Some(&futures_sender_duplicate_files));
let _ = glib_stop_sender.send(Message::Duplicates(df));
});
@ -235,6 +238,7 @@ pub fn connect_button_search(
vf.set_recursive_search(recursive_search);
vf.set_excluded_items(excluded_items);
vf.set_allowed_extensions(allowed_extensions);
vf.set_exclude_other_filesystems(ignore_other_filesystems);
vf.find_empty_files(Some(&stop_receiver), Some(&futures_sender_empty_files));
let _ = glib_stop_sender.send(Message::EmptyFiles(vf));
});
@ -253,6 +257,7 @@ pub fn connect_button_search(
ef.set_included_directory(included_directories);
ef.set_excluded_directory(excluded_directories);
ef.set_excluded_items(excluded_items);
ef.set_exclude_other_filesystems(ignore_other_filesystems);
ef.find_empty_folders(Some(&stop_receiver), Some(&futures_sender_empty_folder));
let _ = glib_stop_sender.send(Message::EmptyFolders(ef));
});
@ -281,6 +286,7 @@ pub fn connect_button_search(
bf.set_allowed_extensions(allowed_extensions);
bf.set_number_of_files_to_check(numbers_of_files_to_check);
bf.set_search_mode(big_files_mode);
bf.set_exclude_other_filesystems(ignore_other_filesystems);
bf.find_big_files(Some(&stop_receiver), Some(&futures_sender_big_file));
let _ = glib_stop_sender.send(Message::BigFiles(bf));
});
@ -301,6 +307,7 @@ pub fn connect_button_search(
tf.set_excluded_directory(excluded_directories);
tf.set_recursive_search(recursive_search);
tf.set_excluded_items(excluded_items);
tf.set_exclude_other_filesystems(ignore_other_filesystems);
tf.find_temporary_files(Some(&stop_receiver), Some(&futures_sender_temporary));
let _ = glib_stop_sender.send(Message::Temporary(tf));
});
@ -350,6 +357,7 @@ pub fn connect_button_search(
sf.set_delete_outdated_cache(delete_outdated_cache);
sf.set_exclude_images_with_same_size(ignore_same_size);
sf.set_save_also_as_json(save_also_as_json);
sf.set_exclude_other_filesystems(ignore_other_filesystems);
sf.find_similar_images(Some(&stop_receiver), Some(&futures_sender_similar_images));
let _ = glib_stop_sender.send(Message::SimilarImages(sf));
});
@ -385,6 +393,7 @@ pub fn connect_button_search(
sf.set_delete_outdated_cache(delete_outdated_cache);
sf.set_exclude_videos_with_same_size(ignore_same_size);
sf.set_save_also_as_json(save_also_as_json);
sf.set_exclude_other_filesystems(ignore_other_filesystems);
sf.find_similar_videos(Some(&stop_receiver), Some(&futures_sender_similar_videos));
let _ = glib_stop_sender.send(Message::SimilarVideos(sf));
});
@ -436,6 +445,7 @@ pub fn connect_button_search(
mf.set_music_similarity(music_similarity);
mf.set_approximate_comparison(approximate_comparison);
mf.set_save_also_as_json(save_also_as_json);
mf.set_exclude_other_filesystems(ignore_other_filesystems);
mf.find_same_music(Some(&stop_receiver), Some(&futures_sender_same_music));
let _ = glib_stop_sender.send(Message::SameMusic(mf));
});
@ -471,6 +481,7 @@ pub fn connect_button_search(
isf.set_recursive_search(recursive_search);
isf.set_excluded_items(excluded_items);
isf.set_allowed_extensions(allowed_extensions);
isf.set_exclude_other_filesystems(ignore_other_filesystems);
isf.find_invalid_links(Some(&stop_receiver), Some(&futures_sender_invalid_symlinks));
let _ = glib_stop_sender.send(Message::InvalidSymlinks(isf));
});
@ -511,6 +522,7 @@ pub fn connect_button_search(
br.set_allowed_extensions(allowed_extensions);
br.set_save_also_as_json(save_also_as_json);
br.set_checked_types(checked_types);
br.set_exclude_other_filesystems(ignore_other_filesystems);
br.find_broken_files(Some(&stop_receiver), Some(&futures_sender_broken_files));
let _ = glib_stop_sender.send(Message::BrokenFiles(br));
});
@ -548,6 +560,7 @@ pub fn connect_button_search(
be.set_maximal_file_size(maximal_file_size);
be.set_allowed_extensions(allowed_extensions);
be.set_recursive_search(recursive_search);
be.set_exclude_other_filesystems(ignore_other_filesystems);
be.find_bad_extensions_files(Some(&stop_receiver), Some(&futures_sender_bad_extensions));
let _ = glib_stop_sender.send(Message::BadExtensions(be));
});

View file

@ -22,6 +22,7 @@ pub struct GuiSettings {
pub check_button_settings_use_trash: gtk4::CheckButton,
pub label_settings_general_language: gtk4::Label,
pub combo_box_settings_language: gtk4::ComboBoxText,
pub check_button_settings_one_filesystem: gtk4::CheckButton,
// Duplicates
pub check_button_settings_hide_hard_links: gtk4::CheckButton,
@ -65,6 +66,7 @@ impl GuiSettings {
let notebook_settings: gtk4::Notebook = builder.object("notebook_settings").unwrap();
// General
let check_button_settings_one_filesystem: gtk4::CheckButton = builder.object("check_button_settings_one_filesystem").unwrap();
let check_button_settings_save_at_exit: gtk4::CheckButton = builder.object("check_button_settings_save_at_exit").unwrap();
let check_button_settings_load_at_start: gtk4::CheckButton = builder.object("check_button_settings_load_at_start").unwrap();
let check_button_settings_confirm_deletion: gtk4::CheckButton = builder.object("check_button_settings_confirm_deletion").unwrap();
@ -119,6 +121,7 @@ impl GuiSettings {
check_button_settings_use_trash,
label_settings_general_language,
combo_box_settings_language,
check_button_settings_one_filesystem,
check_button_settings_hide_hard_links,
entry_settings_cache_file_minimal_size,
entry_settings_prehash_cache_file_minimal_size,
@ -155,6 +158,7 @@ impl GuiSettings {
self.check_button_settings_save_also_json.set_label(Some(&flg!("settings_save_also_as_json_button")));
self.check_button_settings_use_trash.set_label(Some(&flg!("settings_use_trash_button")));
self.label_settings_general_language.set_label(&flg!("settings_language_label"));
self.check_button_settings_one_filesystem.set_label(Some(&flg!("settings_ignore_other_filesystems")));
self.check_button_settings_save_at_exit
.set_tooltip_text(Some(&flg!("settings_save_at_exit_button_tooltip")));
@ -173,6 +177,8 @@ impl GuiSettings {
self.check_button_settings_use_cache.set_tooltip_text(Some(&flg!("settings_use_cache_button_tooltip")));
self.check_button_settings_use_trash.set_tooltip_text(Some(&flg!("settings_use_trash_button_tooltip")));
self.label_settings_general_language.set_tooltip_text(Some(&flg!("settings_language_label_tooltip")));
self.check_button_settings_one_filesystem
.set_tooltip_text(Some(&flg!("settings_ignore_other_filesystems_tooltip")));
self.check_button_settings_hide_hard_links
.set_label(Some(&flg!("settings_duplicates_hide_hard_link_button")));

View file

@ -41,6 +41,7 @@ const DEFAULT_VIDEO_REMOVE_AUTO_OUTDATED_CACHE: bool = false;
const DEFAULT_IMAGE_REMOVE_AUTO_OUTDATED_CACHE: bool = true;
const DEFAULT_DUPLICATE_REMOVE_AUTO_OUTDATED_CACHE: bool = true;
const DEFAULT_DUPLICATE_CASE_SENSITIVE_NAME_CHECKING: bool = false;
const DEFAULT_GENERAL_IGNORE_OTHER_FILESYSTEMS: bool = false;
const DEFAULT_BROKEN_FILES_PDF: bool = true;
const DEFAULT_BROKEN_FILES_AUDIO: bool = true;
@ -417,6 +418,7 @@ enum LoadText {
VideoDeleteOutdatedCacheEntries,
UsePrehashCache,
MinimalPrehashCacheSize,
GeneralIgnoreOtherFilesystems,
Language,
ComboBoxDuplicateHashType,
ComboBoxDuplicateCheckMethod,
@ -480,6 +482,7 @@ fn create_hash_map() -> (HashMap<LoadText, String>, HashMap<String, LoadText>) {
(LoadText::BrokenFilesAudio, "broken_files_audio"),
(LoadText::BrokenFilesImage, "broken_files_image"),
(LoadText::BrokenFilesArchive, "broken_files_archive"),
(LoadText::GeneralIgnoreOtherFilesystems, "ignore_other_filesystems"),
];
let mut hashmap_ls: HashMap<LoadText, String> = Default::default();
let mut hashmap_sl: HashMap<String, LoadText> = Default::default();
@ -593,6 +596,10 @@ pub fn save_configuration(manual_execution: bool, upper_notebook: &GuiUpperNoteb
hashmap_ls.get(&LoadText::ShowBottomTextPanel).unwrap().to_string(),
settings.check_button_settings_show_text_view.is_active(),
);
saving_struct.save_var(
hashmap_ls.get(&LoadText::GeneralIgnoreOtherFilesystems).unwrap().to_string(),
settings.check_button_settings_one_filesystem.is_active(),
);
saving_struct.save_var(
hashmap_ls.get(&LoadText::BrokenFilesArchive).unwrap().to_string(),
@ -732,6 +739,10 @@ pub fn load_configuration(
let use_cache: bool = loaded_entries.get_bool(hashmap_ls.get(&LoadText::UseCache).unwrap().clone(), DEFAULT_USE_CACHE);
let use_json_cache: bool = loaded_entries.get_bool(hashmap_ls.get(&LoadText::UseJsonCacheFile).unwrap().clone(), DEFAULT_SAVE_ALSO_AS_JSON);
let use_trash: bool = loaded_entries.get_bool(hashmap_ls.get(&LoadText::DeleteToTrash).unwrap().clone(), DEFAULT_USE_TRASH);
let ignore_other_fs: bool = loaded_entries.get_bool(
hashmap_ls.get(&LoadText::GeneralIgnoreOtherFilesystems).unwrap().clone(),
DEFAULT_GENERAL_IGNORE_OTHER_FILESYSTEMS,
);
let delete_outdated_cache_duplicates: bool = loaded_entries.get_bool(
hashmap_ls.get(&LoadText::DuplicateDeleteOutdatedCacheEntries).unwrap().clone(),
DEFAULT_DUPLICATE_REMOVE_AUTO_OUTDATED_CACHE,
@ -893,6 +904,7 @@ pub fn load_configuration(
settings.check_button_settings_use_trash.set_active(use_trash);
settings.entry_settings_cache_file_minimal_size.set_text(&cache_minimal_size);
settings.entry_settings_prehash_cache_file_minimal_size.set_text(&cache_prehash_minimal_size);
settings.check_button_settings_one_filesystem.set_active(ignore_other_fs);
save_proper_value_to_combo_box(&main_notebook.combo_box_duplicate_hash_type, combo_box_duplicate_hash_type);
save_proper_value_to_combo_box(&main_notebook.combo_box_duplicate_check_method, combo_box_duplicate_checking_method);
@ -1028,6 +1040,7 @@ pub fn reset_configuration(manual_clearing: bool, upper_notebook: &GuiUpperNoteb
settings.check_button_duplicates_use_prehash_cache.set_active(DEFAULT_USE_PRECACHE);
settings.entry_settings_prehash_cache_file_minimal_size.set_text(DEFAULT_PREHASH_MINIMAL_CACHE_SIZE);
settings.combo_box_settings_language.set_active(Some(0));
settings.check_button_settings_one_filesystem.set_active(DEFAULT_GENERAL_IGNORE_OTHER_FILESYSTEMS);
main_notebook.combo_box_duplicate_hash_type.set_active(Some(0));
main_notebook.combo_box_duplicate_check_method.set_active(Some(0));