mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 07:54:14 +00:00
use FileLauncher
This commit is contained in:
parent
5c28a405ee
commit
da3618aa0a
@ -8,8 +8,9 @@ use window::Window;
|
||||
|
||||
use adw::ApplicationWindow;
|
||||
use gtk::{
|
||||
gio::{AppInfo, AppLaunchContext, SimpleAction},
|
||||
gio::{Cancellable, File, SimpleAction},
|
||||
prelude::{ActionMapExt, GtkWindowExt},
|
||||
FileLauncher,
|
||||
};
|
||||
use sqlite::Transaction;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
@ -90,10 +91,15 @@ impl Browser {
|
||||
|
||||
action_tool_profile.connect_activate({
|
||||
move |_, _| {
|
||||
// @TODO [4_10] https://docs.gtk.org/gtk4/class.FileLauncher.html
|
||||
let _ = AppInfo::launch_default_for_uri(
|
||||
&format!("file://{}", profile_path.to_string_lossy()),
|
||||
Some(&AppLaunchContext::new()),
|
||||
FileLauncher::new(Some(&File::for_path(&profile_path))).launch(
|
||||
None::<>k::Window>,
|
||||
None::<&Cancellable>,
|
||||
|result| {
|
||||
if let Err(error) = result {
|
||||
// @TODO
|
||||
println!("Could not delegate launch action: {error}")
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user