1
0
Fork 0
mirror of synced 2024-04-26 08:42:07 +12:00

Add button to disable by default size of letters when selecting things (#657)

* Add button to disable by default size of letters when selecting things

* Change wording
This commit is contained in:
Rafał Mikrut 2022-04-03 12:57:47 +02:00 committed by GitHub
parent 2d8a930ae5
commit c13f9255e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 6 deletions

View file

@ -182,6 +182,11 @@ popover_custom_regex_check_button_entry_tooltip =
This uses the default Rust regex implementation. You can read more about it here: https://docs.rs/regex.
popover_custom_case_sensitive_check_button_tooltip =
Enables case-sensitive detection.
When disabled /home/* finds both /HoMe/roman and /home/roman.
popover_custom_not_all_check_button_tooltip =
Prevents selecting all records in group.
@ -192,6 +197,7 @@ popover_custom_not_all_check_button_tooltip =
popover_custom_regex_path_label = Path
popover_custom_regex_name_label = Name
popover_custom_regex_regex_label = Regex Path + Name
popover_custom_case_sensitive_check_button = Case sensitive
popover_custom_all_in_group_label = Don't select all records in group
popover_custom_mode_unselect = Unselect Custom
@ -237,7 +243,7 @@ progress_stop_button = Stop
about_repository_button_tooltip = Link to repository page with source code.
about_donation_button_tooltip = Link to donation page.
about_instruction_button_tooltip = Link to instruction page.
about_translation_button_tooltip = Link to Crowdin page with app translations. Officially Polish and English are supported, but any help with other language will be appreciated.
about_translation_button_tooltip = Link to Crowdin page with app translations. Officially Polish and English are supported.
about_repository_button = Repository
about_donation_button = Donation

View file

@ -258,6 +258,9 @@ fn popover_custom_select_unselect(
let check_button_name = gtk::CheckButton::builder().label(&flg!("popover_custom_regex_name_label")).build();
let check_button_rust_regex = gtk::CheckButton::builder().label(&flg!("popover_custom_regex_regex_label")).build();
let check_button_case_sensitive = gtk::CheckButton::builder().label(&flg!("popover_custom_case_sensitive_check_button")).build();
check_button_case_sensitive.set_active(false);
let check_button_select_not_all_results = gtk::CheckButton::builder().label(&flg!("popover_custom_all_in_group_label")).build();
check_button_select_not_all_results.set_active(true);
@ -279,6 +282,7 @@ fn popover_custom_select_unselect(
check_button_rust_regex.set_tooltip_text(Some(&flg!("popover_custom_regex_check_button_entry_tooltip")));
entry_rust_regex.set_tooltip_text(Some(&flg!("popover_custom_regex_check_button_entry_tooltip")));
check_button_case_sensitive.set_tooltip_text(Some(&flg!("popover_custom_case_sensitive_check_button_tooltip")));
check_button_select_not_all_results.set_tooltip_text(Some(&flg!("popover_custom_not_all_check_button_tooltip")));
}
{
@ -347,8 +351,10 @@ fn popover_custom_select_unselect(
grid.attach(&label_regex_valid, 0, 4, 2, 1);
grid.attach(&check_button_case_sensitive, 0, 5, 2, 1);
if select_things {
grid.attach(&check_button_select_not_all_results, 0, 5, 2, 1);
grid.attach(&check_button_select_not_all_results, 0, 6, 2, 1);
}
let box_widget = get_dialog_box_child(&dialog);
@ -372,6 +378,7 @@ fn popover_custom_select_unselect(
let check_path = check_button_path.is_active();
let check_name = check_button_name.is_active();
let check_regex = check_button_rust_regex.is_active();
let case_sensitive = check_button_case_sensitive.is_active();
let check_all_selected = check_button_select_not_all_results.is_active();
@ -441,11 +448,27 @@ fn popover_custom_select_unselect(
if check_regex && compiled_regex.find(&path_and_name).is_some() {
need_to_change_thing = true;
} else {
if check_name && Common::regex_check(&name_wildcard, &name) {
need_to_change_thing = true;
if check_name {
if case_sensitive {
if Common::regex_check(&name_wildcard, &name) {
need_to_change_thing = true;
}
} else {
if Common::regex_check(&name_wildcard.to_lowercase(), &name.to_lowercase()) {
need_to_change_thing = true;
}
}
}
if check_path && Common::regex_check(&path_wildcard, &path) {
need_to_change_thing = true;
if check_path {
if case_sensitive {
if Common::regex_check(&path_wildcard, &path) {
need_to_change_thing = true;
}
} else {
if Common::regex_check(&path_wildcard.to_lowercase(), &path.to_lowercase()) {
need_to_change_thing = true;
}
}
}
}