dialog: GTK_DIALOG_ERROR_ABORTED => GTK_DIALOG_ERROR_CANCELLED
authorBenjamin Otte <otte@redhat.com>
Wed, 23 Nov 2022 22:35:11 +0000 (23:35 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 24 Dec 2022 12:56:57 +0000 (07:56 -0500)
This is done via the GCancellable, so let's call it cancelling.

gtk/gopenuriportal.c
gtk/gtkalertdialog.c
gtk/gtkcolordialog.c
gtk/gtkdialogerror.h
gtk/gtkfiledialog.c
gtk/gtkfontdialog.c

index 8a2ac1db6bf88a70aa8448a376d500ed3691add8..b90771c51c42f7d41c86c6fa19f62685f6b1bb00 100644 (file)
@@ -252,8 +252,8 @@ canceled (GCancellable *cancellable,
   send_close (data);
 
   g_task_return_new_error (task,
-                           GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED,
-                           "The OpenURI portal call was cancelled programmatically");
+                           GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED,
+                           "The OpenURI portal call was cancelled by the application");
   g_object_unref (task);
 }
 
@@ -390,8 +390,8 @@ open_uri_done (GObject      *source,
         {
           g_error_free (error);
           g_task_return_new_error (data->task,
-                                   GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED,
-                                   "The operation was aborted programmatically");
+                                   GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED,
+                                   "The operation was cancelled by the application");
         }
       else
         g_task_return_error (data->task, error);
index ee40bcf1ee165d1e8888b9155ee1136318251f78..645ab6d829789e131a50c1a2748903dcda0216ba 100644 (file)
@@ -606,7 +606,11 @@ response_cb (GTask *task,
   if (cancellable)
     g_signal_handlers_disconnect_by_func (cancellable, cancelled_cb, task);
 
-  if (response >= 0)
+  if (response == GTK_RESPONSE_CLOSE)
+    {
+      g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by application");
+    }
+  else if (response >= 0)
     {
       g_task_return_int (task, response);
     }
index e5ebe9d978f6dcd423deb76728be67c821ca7bdf..d93c68ad3f4c99411fb265085706a79d491dc799 100644 (file)
@@ -387,7 +387,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       g_task_return_pointer (task, gdk_rgba_copy (&color), (GDestroyNotify) gdk_rgba_free);
     }
   else if (response == GTK_RESPONSE_CLOSE)
-    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED, "Aborted by application");
+    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by application");
   else if (response == GTK_RESPONSE_CANCEL ||
            response == GTK_RESPONSE_DELETE_EVENT)
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
index 809d00e53847c764ce638e62a34170b310f4d3e2..9344d6293754e2037641b1a575a3bbcbd2de78ec 100644 (file)
@@ -39,8 +39,8 @@ G_BEGIN_DECLS
  * GtkDialogError:
  * @GTK_DIALOG_ERROR_FAILED: Generic error condition for when
  *   an operation fails and no more specific code is applicable
- * @GTK_DIALOG_ERROR_ABORTED: The async function call was aborted
- *   programmatically (via its `GCancellable`)
+ * @GTK_DIALOG_ERROR_CANCELLED: The async function call was cancelled
+ *   via its `GCancellable`
  * @GTK_DIALOG_ERROR_DISMISSED: The operation was cancelled
  *   by the user (via a Cancel or Close button)
  *
@@ -52,7 +52,7 @@ G_BEGIN_DECLS
 typedef enum
 {
   GTK_DIALOG_ERROR_FAILED,
-  GTK_DIALOG_ERROR_ABORTED,
+  GTK_DIALOG_ERROR_CANCELLED,
   GTK_DIALOG_ERROR_DISMISSED
 } GtkDialogError;
 
index a5a42b379d71fd4cff7550850ea6a11d6ef8823a..cf54c8273ba258d45e7adfd924a777b92a1e32f3 100644 (file)
@@ -652,7 +652,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 G_GNUC_END_IGNORE_DEPRECATIONS
     }
   else if (response == GTK_RESPONSE_CLOSE)
-    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED, "Aborted by application");
+    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by application");
   else if (response == GTK_RESPONSE_CANCEL ||
            response == GTK_RESPONSE_DELETE_EVENT)
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
index 39e068cec2cfa9a443b5e76a52bab1eed01e9e6b..fdf6b2310782354315ff7bf42a0814be38b8716f 100644 (file)
@@ -561,7 +561,7 @@ response_cb (GTask *task,
         }
     }
   else if (response == GTK_RESPONSE_CLOSE)
-    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED, "Aborted by application");
+    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by application");
   else if (response == GTK_RESPONSE_CANCEL)
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
   else