add ability to pass appid through to file dialogs (#1042)

* dialog: add new Dialog::create() method with new DialogSettings struct to allow passing app_id from portal; deprecating Dialog::new()

* dialog: remove deprecation, move to builder pattern, add path_opt and kind options to DialogSettings

* dialog: instances of -> DialogSettings to -> Self
This commit is contained in:
ellieplayswow 2025-06-27 23:26:24 +01:00 committed by GitHub
parent d74576e446
commit aba90279e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 48 additions and 10 deletions

View file

@ -66,6 +66,7 @@ use trash::TrashItem;
#[cfg(all(feature = "wayland", feature = "desktop-applet"))]
use wayland_client::{protocol::wl_output::WlOutput, Proxy};
use crate::dialog::DialogSettings;
use crate::{
clipboard::{ClipboardCopy, ClipboardKind, ClipboardPaste},
config::{
@ -2562,8 +2563,9 @@ impl Application for App {
.map(|parent| parent.to_path_buf())
{
let (mut dialog, dialog_task) = Dialog::new(
DialogKind::OpenFolder,
Some(destination),
DialogSettings::new()
.kind(DialogKind::OpenFolder)
.path(destination),
Message::FileDialogMessage,
Message::ExtractToResult,
);