Skip to content

Commit 3748411

Browse files
authored
Trash music (#732)
1 parent 19afce5 commit 3748411

File tree

9 files changed

+150
-40
lines changed

9 files changed

+150
-40
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ results*.txt
77
TestSuite*
88
*.snap
99
flatpak/
10-
*.zip
10+
*.zip
11+
*.zst

Cargo.lock

+116-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ members = [
55
"czkawka_gui",
66
]
77
[profile.release]
8-
# Panic = "abort" will crash entire app when processing invalid image file.
9-
# Since crash happens in external library, this is only way to handle this(I think).
8+
# panic = "unwind" in opposite to "abort", allows to catch panic!()
9+
# Since Czkawka parse different types of files with few libraries, it is possible
10+
# that some files will cause crash, so at this moment I don't recommend to use "abort"
11+
# until you are ready to occasional crashes
1012
panic = "unwind"
1113

1214
# LTO setting is disabled by default, because release mode is usually needed to develop app and compilation with LTO would take a lot of time

Changelog.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## Version 5.0.0 - ?.?.2022r
2+
- GTK 4 port - [#466](https://github.com/qarmin/czkawka/pull/466)
3+
- Resize preview with window - [#466](https://github.com/qarmin/czkawka/pull/466)
4+
- Fix removing only one item from list view - [#466](https://github.com/qarmin/czkawka/pull/466)
5+
- Fix showing help command in duplicate CLI mode - [#720](https://github.com/qarmin/czkawka/pull/720)
6+
- Fix freeze when not choosing any tag in similiar music mode - [TODO]()
7+
- Read more tags from music files - [#705](https://github.com/qarmin/czkawka/pull/705)
8+
- Improve checking for invalid extensions - [#705](https://github.com/qarmin/czkawka/pull/705)
9+
- Support for finding invalid PDF files - [#705](https://github.com/qarmin/czkawka/pull/705)
10+
- Re-enable checking for broken music files(`libasound.so.2` no longer needed) - [#705](https://github.com/qarmin/czkawka/pull/705)
11+
112
## Version 4.1.0 - 24.04.2022r
213
- New mode - finding files whose content not match with their extension - [#678](https://github.com/qarmin/czkawka/pull/678)
314
- Builtin icons - no more invalid, theme/OS dependant icons - [#659](https://github.com/qarmin/czkawka/pull/659)

czkawka_core/src/common.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ pub const ZIP_FILES_EXTENSIONS: &[&str] = &[".zip"];
2828
pub const PDF_FILES_EXTENSIONS: &[&str] = &[".pdf"];
2929

3030
pub const AUDIO_FILES_EXTENSIONS: &[&str] = &[
31-
".mp3", ".flac", ".wav", ".ogg", ".m4a", ".aac", ".aiff", ".pcm", ".aif", ".aiff", ".aifc", ".m3a", ".mp2", ".mp4a", ".mp2a", ".mpga", ".wave", ".weba",
32-
".wma",
33-
/*".ac3",*/
34-
/*".oga", https://github.com/Serial-ATA/lofty-rs/issues/47#issuecomment-1120414259*/
31+
".mp3", ".flac", ".wav", ".ogg", ".m4a", ".aac", ".aiff", ".pcm", ".aif", ".aiff", ".aifc", ".m3a", ".mp2", ".mp4a", ".mp2a", ".mpga", ".wave", ".weba", ".wma", ".oga",
3532
];
3633

3734
pub const VIDEO_FILES_EXTENSIONS: &[&str] = &[

czkawka_gui/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ regex = "1.5.5"
3838
image_hasher = "1.0.0"
3939

4040
# Move files to trash
41-
trash = "1.3.0"
41+
trash = "2.1.4"
4242

4343
# For moving files(why std::fs doesn't have such features)
4444
fs_extra = "1.2.0"

czkawka_gui/src/connect_things/connect_button_search.rs

+5
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,11 @@ pub fn connect_button_search(
441441
);
442442
entry_info.set_text(&flg!("search_not_choosing_any_music"));
443443
show_dialog.store(false, Ordering::Relaxed);
444+
445+
notebook_main.set_sensitive(true);
446+
notebook_upper.set_sensitive(true);
447+
button_settings.set_sensitive(true);
448+
button_app_info.set_sensitive(true);
444449
}
445450
}
446451
NotebookMainEnum::Symlinks => {

czkawka_gui/src/connect_things/connect_button_stop.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub fn connect_button_stop(gui_data: &GuiData) {
2626
let button_stop_in_dialog = gui_data.progress_window.button_stop_in_dialog.clone();
2727
let stop_dialog = gui_data.progress_window.window_progress.clone();
2828
let stop_sender = gui_data.stop_sender.clone();
29-
// TODO GTK 4 change this to connect released, not sure why not works here
3029

3130
button_stop_in_dialog.connect_clicked(move |_a| {
3231
stop_dialog.set_title(Some(&format!("{} ({})", flg!("window_progress_title"), flg!("progress_stop_additional_message"))));

czkawka_gui/src/initialize_gui.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -538,16 +538,17 @@ fn connect_event_mouse(gui_data: &GuiData) {
538538
let check_button_settings_show_preview = gui_data.settings.check_button_settings_show_preview_duplicates.clone();
539539
let image_preview = gui_data.main_notebook.image_preview_duplicates.clone();
540540
let preview_path = gui_data.preview_path.clone();
541+
let tree_view = gui_data.main_notebook.tree_view_duplicate_finder.clone();
541542

542-
let gc = gui_data.main_notebook.gc_tree_view_duplicate_finder.clone();
543+
tree_view.set_property("activate-on-single-click", true);
543544

544-
// TODO GTK 4, currently not works, connect_pressed shows previous thing
545-
gc.connect_released(move |gc, _event, _, _| {
546-
let tree_view = gc.widget().downcast::<gtk4::TreeView>().unwrap();
545+
// TODO GTK 4, currently not works, connect_pressed shows previous thing - https://gitlab.gnome.org/GNOME/gtk/-/issues/4939
546+
// Use connect_released when it will be fixed, currently using connect_row_activated workaround
547+
tree_view.connect_row_activated(move |tree_view, _b, _c| {
547548
let nb_object = &NOTEBOOKS_INFOS[NotebookMainEnum::Duplicate as usize];
548549
let preview_path = preview_path.clone();
549550
show_preview(
550-
&tree_view,
551+
tree_view,
551552
&text_view_errors,
552553
&check_button_settings_show_preview,
553554
&image_preview,
@@ -563,16 +564,16 @@ fn connect_event_mouse(gui_data: &GuiData) {
563564
let check_button_settings_show_preview = gui_data.settings.check_button_settings_show_preview_similar_images.clone();
564565
let preview_path = gui_data.preview_path.clone();
565566
let image_preview = gui_data.main_notebook.image_preview_similar_images.clone();
567+
let tree_view = gui_data.main_notebook.tree_view_similar_images_finder.clone();
566568

567-
let gc = gui_data.main_notebook.gc_tree_view_similar_images_finder.clone();
569+
tree_view.set_property("activate-on-single-click", true);
568570

569571
// TODO GTK 4, currently not works, connect_pressed shows previous thing
570-
gc.connect_released(move |gc, _event, _, _| {
571-
let tree_view = gc.widget().downcast::<gtk4::TreeView>().unwrap();
572+
tree_view.connect_row_activated(move |tree_view, _b, _c| {
572573
let nb_object = &NOTEBOOKS_INFOS[NotebookMainEnum::SimilarImages as usize];
573574
let preview_path = preview_path.clone();
574575
show_preview(
575-
&tree_view,
576+
tree_view,
576577
&text_view_errors,
577578
&check_button_settings_show_preview,
578579
&image_preview,

0 commit comments

Comments
 (0)