[Pkg-privacy-commits] [nautilus-wipe] 14/37: Pause the operation while the cancel confirmation dialog is shown
Intrigeri
intrigeri at moszumanska.debian.org
Wed Dec 7 18:46:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch master
in repository nautilus-wipe.
commit 4a4c899743ff5d94d1ccc507838b578b61d702f9
Author: Colomban Wendling <ban at herbesfolles.org>
Date: Mon Jul 18 18:16:37 2016 +0200
Pause the operation while the cancel confirmation dialog is shown
This still allows the confirmation dialog yet makes it effective faster
as the operation will be paused waiting for an answer, effectively
canceling it at the time the button was initially pressed if confirmed.
This also follows better the wording of that dialog that suggests the
operation is paused by suggesting one can "resume it" by not canceling
it.
---
nautilus-wipe/nw-operation-manager.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/nautilus-wipe/nw-operation-manager.c b/nautilus-wipe/nw-operation-manager.c
index 288a57c..b9b093a 100644
--- a/nautilus-wipe/nw-operation-manager.c
+++ b/nautilus-wipe/nw-operation-manager.c
@@ -509,7 +509,14 @@ progress_dialog_response_handler (GtkDialog *dialog,
switch (response_id) {
case GTK_RESPONSE_CANCEL:
- case GTK_RESPONSE_DELETE_EVENT:
+ case GTK_RESPONSE_DELETE_EVENT: {
+ gboolean was_paused = nw_progress_dialog_get_paused (NW_PROGRESS_DIALOG (dialog));
+
+ if (! was_paused) {
+ /* we pause the operation while the user things on whether to really
+ * cancel or not, so the */
+ gsd_async_operation_pause (GSD_ASYNC_OPERATION (opdata->operation));
+ }
if (display_dialog (GTK_WINDOW (dialog), GTK_MESSAGE_QUESTION, TRUE,
opdata->title,
_("Are you sure you want to cancel this operation?"),
@@ -519,8 +526,11 @@ progress_dialog_response_handler (GtkDialog *dialog,
_("Cancel operation"), GTK_RESPONSE_ACCEPT,
NULL) == GTK_RESPONSE_ACCEPT) {
gsd_async_operation_cancel (GSD_ASYNC_OPERATION (opdata->operation));
+ } else if (! was_paused) {
+ gsd_async_operation_resume (GSD_ASYNC_OPERATION (opdata->operation));
}
break;
+ }
case NW_PROGRESS_DIALOG_RESPONSE_PAUSE:
nw_progress_dialog_set_paused (NW_PROGRESS_DIALOG (dialog),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/nautilus-wipe.git
More information about the Pkg-privacy-commits
mailing list