A little
This commit is contained in:
parent
86c3ef3a30
commit
579d0cd960
|
@ -7,6 +7,7 @@ use slint::{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
|
||||
|
||||
// Duplicates
|
||||
#[repr(u8)]
|
||||
pub enum IntDataDuplicateFiles {
|
||||
ModificationDatePart1,
|
||||
|
@ -22,6 +23,7 @@ pub enum StrDataDuplicateFiles {
|
|||
ModificationDate,
|
||||
}
|
||||
|
||||
// Empty Folders
|
||||
#[repr(u8)]
|
||||
pub enum IntDataEmptyFolders {
|
||||
ModificationDatePart1,
|
||||
|
@ -34,6 +36,7 @@ pub enum StrDataEmptyFolders {
|
|||
Path,
|
||||
ModificationDate,
|
||||
}
|
||||
// Big Files
|
||||
#[repr(u8)]
|
||||
pub enum IntDataBigFiles {
|
||||
ModificationDatePart1,
|
||||
|
@ -50,6 +53,7 @@ pub enum StrDataBigFiles {
|
|||
ModificationDate,
|
||||
}
|
||||
|
||||
// Empty files
|
||||
#[repr(u8)]
|
||||
pub enum IntDataEmptyFiles {
|
||||
ModificationDatePart1,
|
||||
|
@ -64,6 +68,7 @@ pub enum StrDataEmptyFiles {
|
|||
Path,
|
||||
ModificationDate,
|
||||
}
|
||||
// Temporary Files
|
||||
#[repr(u8)]
|
||||
pub enum IntDataTemporaryFiles {
|
||||
ModificationDatePart1,
|
||||
|
@ -79,6 +84,7 @@ pub enum StrDataTemporaryFiles {
|
|||
ModificationDate,
|
||||
}
|
||||
|
||||
// Similar Images
|
||||
#[repr(u8)]
|
||||
pub enum IntDataSimilarImages {
|
||||
ModificationDatePart1,
|
||||
|
@ -99,6 +105,7 @@ pub enum StrDataSimilarImages {
|
|||
ModificationDate,
|
||||
}
|
||||
|
||||
// Similar Videos
|
||||
#[repr(u8)]
|
||||
pub enum IntDataSimilarVideos {
|
||||
ModificationDatePart1,
|
||||
|
@ -115,6 +122,7 @@ pub enum StrDataSimilarVideos {
|
|||
ModificationDate,
|
||||
}
|
||||
|
||||
// Similar Music
|
||||
#[repr(u8)]
|
||||
pub enum IntDataSimilarMusic {
|
||||
ModificationDatePart1,
|
||||
|
@ -136,6 +144,8 @@ pub enum StrDataSimilarMusic {
|
|||
Path,
|
||||
ModificationDate,
|
||||
}
|
||||
|
||||
// Invalid Symlinks
|
||||
#[repr(u8)]
|
||||
pub enum IntDataInvalidSymlinks {
|
||||
ModificationDatePart1,
|
||||
|
@ -150,6 +160,8 @@ pub enum StrDataInvalidSymlinks {
|
|||
TypeOfError,
|
||||
ModificationDate,
|
||||
}
|
||||
|
||||
// Broken Files
|
||||
#[repr(u8)]
|
||||
pub enum IntDataBrokenFiles {
|
||||
ModificationDatePart1,
|
||||
|
|
|
@ -39,6 +39,9 @@ pub fn connect_scan_button(app: &MainWindow, progress_sender: Sender<ProgressDat
|
|||
|
||||
let a = app.as_weak();
|
||||
match active_tab {
|
||||
CurrentTab::DuplicateFiles => {
|
||||
scan_duplicates(a, progress_sender, stop_receiver, custom_settings);
|
||||
}
|
||||
CurrentTab::EmptyFolders => {
|
||||
scan_empty_folders(a, progress_sender, stop_receiver, custom_settings);
|
||||
}
|
||||
|
@ -51,9 +54,6 @@ pub fn connect_scan_button(app: &MainWindow, progress_sender: Sender<ProgressDat
|
|||
CurrentTab::BigFiles => {
|
||||
scan_big_files(a, progress_sender, stop_receiver, custom_settings);
|
||||
}
|
||||
CurrentTab::DuplicateFiles => {
|
||||
scan_duplicates(a, progress_sender, stop_receiver, custom_settings);
|
||||
}
|
||||
CurrentTab::Settings | CurrentTab::About => panic!("Button should be disabled"),
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
|
|
|
@ -22,7 +22,9 @@ pub fn connect_show_preview(app: &MainWindow) {
|
|||
|
||||
let active_tab = gui_state.get_active_tab();
|
||||
|
||||
if active_tab == CurrentTab::SimilarImages && !settings.get_similar_images_show_image_preview() {
|
||||
if (active_tab == CurrentTab::SimilarImages && !settings.get_similar_images_show_image_preview())
|
||||
|| (active_tab == CurrentTab::DuplicateFiles && !settings.get_duplicate_image_preview())
|
||||
{
|
||||
set_preview_visible(&gui_state, None);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export global GuiState {
|
|||
in-out property <bool> visible_tool_settings;
|
||||
|
||||
in-out property <bool> available_subsettings: active_tab == CurrentTab.SimilarImages;
|
||||
in-out property <CurrentTab> active_tab: CurrentTab.EmptyFiles;
|
||||
in-out property <CurrentTab> active_tab: CurrentTab.DuplicateFiles;
|
||||
in-out property <bool> is_tool_tab_active: active_tab != CurrentTab.Settings && active_tab != CurrentTab.About;
|
||||
in-out property <[SelectModel]> select_results_list: [{data: SelectMode.SelectAll, name: "Select All"}, {data: SelectMode.UnselectAll, name: "Deselect All"}, {data: SelectMode.SelectTheSmallestResolution, name: "Select the smallest resolution"}];
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ export component MainList {
|
|||
{checked: false, selected_row: false, header_row: false, val_str: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"], val_int: []},
|
||||
{checked: true, selected_row: false, header_row: false, val_str: ["lokkaler", "/Xd1/Vide2", "01.23.1911"], val_int: []}
|
||||
];
|
||||
in-out property <[MainListModel]> temporary-files_model: [];
|
||||
in-out property <[MainListModel]> temporary_files_model: [];
|
||||
in-out property <[MainListModel]> similar_images_model: [
|
||||
{checked: false, selected_row: false, header_row: true, val_str: ["Original", "500KB", "100x100", "kropkarz", "/Xd1", "24.10.2023"], val_int: []},
|
||||
{checked: false, selected_row: false, header_row: false, val_str: ["Similar", "500KB", "100x100", "witasphere", "/Xd1/Imagerren2", "25.11.1991"], val_int: []},
|
||||
|
@ -34,40 +34,133 @@ export component MainList {
|
|||
|
||||
callback changed_current_tab();
|
||||
callback released_key(string);
|
||||
|
||||
out property <length> path_px: 350px;
|
||||
out property <length> name_px: 100px;
|
||||
out property <length> mod_px: 150px;
|
||||
out property <length> size_px: 50px;
|
||||
|
||||
duplicates := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.DuplicateFiles;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Size", "File Name", "Path", "Modification Date"];
|
||||
column-sizes: [35px, size_px, name_px, path_px, mod_px];
|
||||
values <=> duplicate_files_model;
|
||||
parentPathIdx: 3;
|
||||
fileNameIdx: 2;
|
||||
}
|
||||
|
||||
empty_folders := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.EmptyFolders;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Folder Name", "Path", "Modification Date"];
|
||||
column-sizes: [35px, 100px, 350px, 150px];
|
||||
column-sizes: [35px, name_px, path_px, mod_px];
|
||||
values <=> empty-folder-model;
|
||||
parentPathIdx: 2;
|
||||
fileNameIdx: 1;
|
||||
}
|
||||
|
||||
big_files := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.BigFiles;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Size", "File Name", "Path", "Modification Date"];
|
||||
column-sizes: [35px, size_px, name_px, path_px, mod_px];
|
||||
values <=> big_files_model;
|
||||
parentPathIdx: 3;
|
||||
fileNameIdx: 2;
|
||||
}
|
||||
|
||||
empty_files := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.EmptyFiles;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "File Name", "Path", "Modification Date"];
|
||||
column-sizes: [35px, 100px, 350px, 150px];
|
||||
column-sizes: [35px, name_px, path_px, mod_px];
|
||||
values <=> empty-files-model;
|
||||
parentPathIdx: 2;
|
||||
fileNameIdx: 1;
|
||||
}
|
||||
|
||||
temporary_files := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.TemporaryFiles;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Size", "File Name", "Path", "Modification Date"];
|
||||
column-sizes: [35px, size_px, name_px, path_px, mod_px];
|
||||
values <=> temporary_files_model;
|
||||
parentPathIdx: 3;
|
||||
fileNameIdx: 2;
|
||||
}
|
||||
|
||||
similar_images := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.SimilarImages;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Similarity", "Size", "Dimensions", "File Name", "Path", "Modification Date"];
|
||||
column-sizes: [35px, 80px, 80px, 80px, 100px, 350px, 150px];
|
||||
column-sizes: [35px, 80px, 80px, 80px, name_px, path_px, mod_px];
|
||||
values <=> similar-images-model;
|
||||
parentPathIdx: 5;
|
||||
fileNameIdx: 4;
|
||||
}
|
||||
|
||||
similar_videos := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.SimilarVideos;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Size", "File Name", "Path", "Modification Date"];
|
||||
column-sizes: [35px, size_px, name_px, path_px, mod_px];
|
||||
values <=> similar_videos_model;
|
||||
parentPathIdx: 3;
|
||||
fileNameIdx: 2;
|
||||
}
|
||||
|
||||
similar_music := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.SimilarMusic;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Size", "File Name", "Title","Artist", "Year", "Bitrate", "Length", "Genre", "Path", "Modification Date"];
|
||||
column-sizes: [35px, size_px, name_px, 80px, 80px, 80px, 80px, 80px, 80px, path_px, mod_px];
|
||||
values <=> similar_music_model;
|
||||
parentPathIdx: 9;
|
||||
fileNameIdx: 2;
|
||||
}
|
||||
|
||||
invalid_symlink := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.InvalidSymlinks;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Symlink Name", "Symlink Folder", "Destination Path", "Modification Date"];
|
||||
column-sizes: [35px, name_px, path_px, path_px, mod_px];
|
||||
values <=> invalid_symlinks_model;
|
||||
parentPathIdx: 2;
|
||||
fileNameIdx: 1;
|
||||
}
|
||||
|
||||
broken_files := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.BrokenFiles;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "Size", "File Name", "Type of Error", "Path", "Modification Date"];
|
||||
column-sizes: [35px, size_px, name_px, 200px, path_px, mod_px];
|
||||
values <=> broken_files_model;
|
||||
parentPathIdx: 4;
|
||||
fileNameIdx: 2;
|
||||
}
|
||||
|
||||
bad_extensions := SelectableTableView {
|
||||
visible: GuiState.active_tab == CurrentTab.BadExtensions;
|
||||
min-width: 200px;
|
||||
height: parent.height;
|
||||
columns: ["Selection", "File Name", "Path", "Current Extension", "Proper Extension"];
|
||||
column-sizes: [35px, name_px, path_px, 40px, 200px];
|
||||
values <=> bad_extensions_model;
|
||||
parentPathIdx: 4;
|
||||
fileNameIdx: 2;
|
||||
}
|
||||
|
||||
settings_list := SettingsList {
|
||||
visible: GuiState.active_tab == CurrentTab.Settings;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue