window: Port delete confirmation to AdwAlertDialog
This commit is contained in:
parent
7c8e9c1666
commit
dfd74b060f
1 changed files with 2 additions and 4 deletions
|
|
@ -609,9 +609,7 @@ impl LpWindow {
|
||||||
///
|
///
|
||||||
/// Fallback for when trash not available or explicit call with shortcut
|
/// Fallback for when trash not available or explicit call with shortcut
|
||||||
async fn delete_future(&self, path: &Path) {
|
async fn delete_future(&self, path: &Path) {
|
||||||
let dialog = adw::MessageDialog::builder()
|
let dialog = adw::AlertDialog::builder()
|
||||||
.modal(true)
|
|
||||||
.transient_for(self)
|
|
||||||
.heading(gettext("Permanently Delete Image?"))
|
.heading(gettext("Permanently Delete Image?"))
|
||||||
.body(gettext_f(
|
.body(gettext_f(
|
||||||
"After deleting the image “{}” it will be permanently lost.",
|
"After deleting the image “{}” it will be permanently lost.",
|
||||||
|
|
@ -627,7 +625,7 @@ impl LpWindow {
|
||||||
]);
|
]);
|
||||||
dialog.set_response_appearance("delete", adw::ResponseAppearance::Destructive);
|
dialog.set_response_appearance("delete", adw::ResponseAppearance::Destructive);
|
||||||
|
|
||||||
if "delete" == dialog.choose_future().await {
|
if "delete" == dialog.choose_future(self).await {
|
||||||
let file = gio::File::for_path(path);
|
let file = gio::File::for_path(path);
|
||||||
let result = file.delete_future(glib::Priority::default()).await;
|
let result = file.delete_future(glib::Priority::default()).await;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue