Skip to content

Commit

Permalink
Add the configuration option for the duplicated files warning
Browse files Browse the repository at this point in the history
  • Loading branch information
breard-r committed Nov 20, 2024
1 parent 7c2a91d commit 4464714
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions locale/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cpn_config_menu_main_title = General
cpn_config_menu_clipboard_title = Clipboard
view_config_main_msg_empty_files_warning = Display a warning when loading a directory that contains empty files.
view_config_main_msg_duplicated_files_warning = Display a warning when files with the same fingerprint are detected.
view_config_main_msg_include_hidden_files = Include hidden files.
view_config_main_msg_include_system_files = Include system files.
Expand Down
1 change: 1 addition & 0 deletions locale/fr-BE.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cpn_config_menu_main_title = Général
cpn_config_menu_clipboard_title = Presse-papier
view_config_main_msg_empty_files_warning = Afficher un avertissement en cas de chargement d'un dossier comprenant des fichiers vides.
view_config_main_msg_duplicated_files_warning = Afficher un avertissement lorsque des fichiers avec la même empreinte sont détectés.
view_config_main_msg_include_hidden_files = Inclure les fichiers cachés.
view_config_main_msg_include_system_files = Inclure les fichiers système.
Expand Down
1 change: 1 addition & 0 deletions locale/fr-FR.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cpn_config_menu_main_title = Général
cpn_config_menu_clipboard_title = Presse-papier
view_config_main_msg_empty_files_warning = Afficher un avertissement en cas de chargement d'un dossier comprenant des fichiers vides.
view_config_main_msg_duplicated_files_warning = Afficher un avertissement lorsque des fichiers avec la même empreinte sont détectés.
view_config_main_msg_include_hidden_files = Inclure les fichiers cachés.
view_config_main_msg_include_system_files = Inclure les fichiers système.
Expand Down
23 changes: 23 additions & 0 deletions src/views/config_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@ pub fn MainConfig() -> Element {
},
}
}

// Duplicated files warning
p {
label {
r#for: "cfg_main_duplicated_files_warning",
{ t!("view_config_main_msg_duplicated_files_warning") }
}
}
div {
Checkbox {
id: "cfg_main_duplicated_files_warning",
checked: cfg_sig().is_duplicate_file_warning_enabled(),
onchange: move |event: FormEvent| {
let new_value = parse_bool(&event.data.value());
spawn(async move {
let mut cfg = cfg_sig();
cfg.enable_duplicate_file_warning = Some(new_value);
cfg.write_to_file();
cfg_sig.set(cfg);
});
},
}
}
}
}
}
Expand Down

0 comments on commit 4464714

Please sign in to comment.