[geary/wip/warn-delete-713875: 1/2] Prompt before deleting messages
- From: Charles Lindsay <clindsay src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/warn-delete-713875: 1/2] Prompt before deleting messages
- Date: Tue, 11 Feb 2014 00:10:47 +0000 (UTC)
commit 878b984119df35bff3b7f21e47f5cc3d89d779a5
Author: Charles Lindsay <chaz yorba org>
Date: Mon Feb 10 13:54:08 2014 -0800
Prompt before deleting messages
src/client/application/geary-controller.vala | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index 13562cf..52f2256 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -1921,6 +1921,16 @@ public class GearyController : Geary.BaseObject {
return false;
}
+ public bool confirm_delete(int num_messages) {
+ main_window.present();
+ AlertDialog dialog = new ConfirmationDialog(main_window, ngettext(
+ "Do you want to permanently delete this message?",
+ "Do you want to permanently delete these messages?", num_messages),
+ null, _("Delete"));
+
+ return (dialog.run() == Gtk.ResponseType.OK);
+ }
+
private async void archive_or_delete_selection_async(bool archive, bool trash,
Cancellable? cancellable) throws Error {
if (main_window.conversation_viewer.current_conversation != null
@@ -1963,10 +1973,14 @@ public class GearyController : Geary.BaseObject {
debug("Deleting selected messages");
Geary.FolderSupport.Remove? supports_remove = current_folder as Geary.FolderSupport.Remove;
- if (supports_remove == null)
+ if (supports_remove == null) {
debug("Folder %s doesn't support remove", current_folder.to_string());
- else
- yield supports_remove.remove_email_async(ids, cancellable);
+ } else {
+ if (confirm_delete(ids.size))
+ yield supports_remove.remove_email_async(ids, cancellable);
+ else
+ last_deleted_conversation = null;
+ }
}
private void on_archive_or_delete_selection_finished(Object? source, AsyncResult result) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]