1
0
Fork 0
mirror of synced 2024-05-03 12:03:22 +12:00
This commit is contained in:
Rafał Mikrut 2024-02-18 17:15:53 +01:00
parent b954e67ecf
commit fb85df9b87
7 changed files with 26 additions and 17 deletions

View file

@ -13,6 +13,7 @@
- Added scan progress bar - [#1183](https://github.com/qarmin/czkawka/pull/1183)
- Clean and safe cancelling of scan - [#1183](https://github.com/qarmin/czkawka/pull/1183)
- Unification of CLI arguments - [#1183](https://github.com/qarmin/czkawka/pull/1183)
- Hardlink support for similar images/videos - [#1201](https://github.com/qarmin/czkawka/pull/1201)
### Krokiet GUI
- Initial release of new gui - [#1102](https://github.com/qarmin/czkawka/pull/1102)

View file

@ -38,10 +38,6 @@ Each tool uses different technologies, so you can find instructions for each of
- [Czkawka Core](czkawka_core/README.md)</br>
- [Krokiet GUI (Slint frontend)](krokiet/README.md)</br>
## Benchmarks
TODO
## Comparison to other tools
Bleachbit is a master at finding and removing temporary files, while Czkawka only finds the most basic ones. So these two apps shouldn't be compared directly or be considered as an alternative to one another.

View file

@ -3,6 +3,8 @@
Krokiet is new Czkawka frontend written in Slint, which uses Rust in opposite to Gtk 4 frontend which uses mostly
C code.
![Krokiet](https://github.com/qarmin/czkawka/assets/41945903/52628a29-ecd6-4692-9ee4-8a680c889193)
Different toolkit means different look, limitations and features, so you should not expect same features like in Gtk 4
frontend(but of course I want implement most of features from other project).
@ -10,7 +12,7 @@ frontend(but of course I want implement most of features from other project).
Krokiet should not have any special runtime requirements - it should work on almost any device non-antic device.
Prebuild binaries should work on Windows 10,11, Mac, Ubuntu 22.04/20.04 and similar(libheif version + czkawka_gui requires Ubuntu 22.04+ and rest Ubuntu 20.04) - https://github.com/qarmin/czkawka/releases/
Prebuild binaries should work on Windows 10,11, Mac, Ubuntu 22.04/20.04 and similar(libheif version and czkawka_gui requires Ubuntu 22.04+, rest Ubuntu 20.04) - https://github.com/qarmin/czkawka/releases/

View file

@ -1,8 +1,8 @@
#![allow(dead_code)] // TODO later remove
use std::path::PathBuf;
use crate::{CurrentTab, ExcludedDirectoriesModel, IncludedDirectoriesModel, MainListModel, MainWindow};
use slint::{ModelRc, SharedString, VecModel};
use crate::{CurrentTab, ExcludedDirectoriesModel, IncludedDirectoriesModel, MainListModel, MainWindow, Settings};
use slint::{ComponentHandle, Model, ModelRc, SharedString, VecModel};
// Int model is used to store data in unchanged(* except that we need to split u64 into two i32) form and is used to sort/select data
// Str model is used to display data in gui
@ -373,6 +373,11 @@ pub fn create_excluded_directories_model_from_pathbuf(items: &[PathBuf]) -> Mode
ModelRc::new(VecModel::from(converted))
}
pub fn check_if_all_included_dirs_are_referenced(app: &MainWindow) -> bool {
let included = app.global::<Settings>().get_included_directories_model();
included.iter().all(|x| x.referenced_folder)
}
pub fn create_vec_model_from_vec_string(items: Vec<String>) -> VecModel<SharedString> {
VecModel::from(items.into_iter().map(SharedString::from).collect::<Vec<_>>())
}

View file

@ -107,14 +107,13 @@ fn move_selected_items(items_to_move: Vec<(String, String)>, preserve_structure:
// Tries to copy file/folder, and returns error if it fails
fn try_to_copy_item(input_file: &Path, output_file: &Path) -> Option<String> {
let res;
if input_file.is_dir() {
let res = if input_file.is_dir() {
let options = fs_extra::dir::CopyOptions::new();
res = fs_extra::dir::copy(&input_file, &output_file, &options); // TODO consider to use less buggy library
fs_extra::dir::copy(input_file, output_file, &options) // TODO consider to use less buggy library
} else {
let options = fs_extra::file::CopyOptions::new();
res = fs_extra::file::copy(&input_file, &output_file, &options);
}
fs_extra::file::copy(input_file, output_file, &options)
};
if let Err(e) = res {
return Some(format!("Error while copying {input_file:?} to {output_file:?}, reason {e}"));
}

View file

@ -24,7 +24,7 @@ use czkawka_core::similar_images::{ImagesEntry, SimilarImages};
use czkawka_core::similar_videos::{SimilarVideos, VideosEntry};
use czkawka_core::temporary::{Temporary, TemporaryFileEntry};
use crate::common::split_u64_into_i32s;
use crate::common::{check_if_all_included_dirs_are_referenced, split_u64_into_i32s};
use crate::settings::{
collect_settings, get_audio_check_type_idx, get_biggest_item_idx, get_duplicates_check_method_idx, get_duplicates_hash_type_idx, get_image_hash_alg_idx,
get_resize_algorithm_idx, SettingsCustom, ALLOWED_AUDIO_CHECK_TYPE_VALUES, ALLOWED_BIG_FILE_SIZE_VALUES, ALLOWED_DUPLICATES_CHECK_METHOD_VALUES,
@ -35,9 +35,15 @@ use crate::{CurrentTab, GuiState, MainListModel, MainWindow, ProgressToSend};
pub fn connect_scan_button(app: &MainWindow, progress_sender: Sender<ProgressData>, stop_receiver: Receiver<()>) {
let a = app.as_weak();
app.on_scan_starting(move |active_tab| {
let app = a.upgrade().unwrap();
if check_if_all_included_dirs_are_referenced(&app) {
app.invoke_scan_ended("Cannot start scan when all included directories are set as referenced folders.".into());
return;
}
let progress_sender = progress_sender.clone();
let stop_receiver = stop_receiver.clone();
let app = a.upgrade().unwrap();
app.set_progress_datas(ProgressToSend {
all_progress: 0,
@ -516,7 +522,7 @@ fn scan_similar_music(a: Weak<MainWindow>, progress_sender: Sender<ProgressData>
if music_similarity == MusicSimilarity::NONE {
a.upgrade_in_event_loop(move |app| {
app.set_text_summary_text("Cannot find similar music files without any similarity method selected.".into());
app.invoke_scan_ended("Cannot find similar music files without any similarity method selected.".into());
})
.unwrap();
return Ok(());
@ -706,7 +712,7 @@ fn scan_broken_files(a: Weak<MainWindow>, progress_sender: Sender<ProgressData>,
if checked_types == CheckedTypes::NONE {
a.upgrade_in_event_loop(move |app| {
app.set_text_summary_text("Cannot find broken files without any file type selected.".into());
app.invoke_scan_ended("Cannot find broken files without any file type selected.".into());
})
.unwrap();
return Ok(());

View file

@ -63,7 +63,7 @@ fn set_select_buttons(app: &MainWindow) {
| CurrentTab::InvalidSymlinks
| CurrentTab::BrokenFiles
| CurrentTab::BadExtensions => vec![],
CurrentTab::Settings | CurrentTab::About => unreachable!("Settings and About tabs should not have select buttons"),
CurrentTab::Settings | CurrentTab::About => vec![], // Not available in settings and about, so may be set any value here
};
base_buttons.extend(additional_buttons);