feat: completed base feature set for the app

This commit is contained in:
2026-07-18 20:25:17 +02:00
parent e9d6c70eb0
commit 638202b96c
46 changed files with 4486 additions and 541 deletions

View File

@@ -16,6 +16,20 @@ pub fn pick_folder(title: String) -> Task<Message> {
)
}
/// Pick an existing portable project folder.
pub fn pick_project_folder(title: String) -> Task<Message> {
Task::perform(
async move {
rfd::AsyncFileDialog::new()
.set_title(&title)
.pick_folder()
.await
.map(|h| h.path().to_path_buf())
},
Message::ProjectFolderPicked,
)
}
/// Pick one or more image/media files using the native file dialog.
pub fn pick_media_files(title: String, filter_label: String) -> Task<Message> {
Task::perform(
@@ -33,3 +47,26 @@ pub fn pick_media_files(title: String, filter_label: String) -> Task<Message> {
Message::MediaFilesPicked,
)
}
/// Pick a replacement image for an existing media item.
pub fn pick_media_replacement(
media_id: String,
title: String,
filter_label: String,
) -> Task<Message> {
Task::perform(
async move {
let path = rfd::AsyncFileDialog::new()
.set_title(&title)
.add_filter(
&filter_label,
&["jpg", "jpeg", "png", "gif", "webp", "tiff", "bmp"],
)
.pick_file()
.await
.map(|handle| handle.path().to_path_buf());
(media_id, path)
},
|(media_id, path)| Message::MediaReplacementPicked { media_id, path },
)
}