dialog: GTK_DIALOG_ERROR_CANCELLED => GTK_DIALOG_ERROR_DISMISSED
authorBenjamin Otte <otte@redhat.com>
Wed, 23 Nov 2022 22:32:19 +0000 (23:32 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 24 Dec 2022 12:56:57 +0000 (07:56 -0500)
The term "cancelling" is used with GCancellable, a user clicking a close
button is not that.
User input is usually described as "dismissing", so we use that term.

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

index 16c63cbd9af1059a64c91874b4faf42709ac69a9..8a2ac1db6bf88a70aa8448a376d500ed3691add8 100644 (file)
@@ -151,7 +151,7 @@ response_received (GDBusConnection *connection,
       g_task_return_boolean (task, TRUE);
       break;
     case XDG_DESKTOP_PORTAL_CANCELLED:
-      g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "The portal dialog was closed");
+      g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "The portal dialog was dismissed by the user");
       break;
     case XDG_DESKTOP_PORTAL_FAILED:
     default:
index 3d027335999ac6bc4a98567a93901e804c4950c6..e5ebe9d978f6dcd423deb76728be67c821ca7bdf 100644 (file)
@@ -390,7 +390,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED, "Aborted 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_CANCELLED, "Cancelled by user");
+    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
   else
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response);
 
index f2ce55c0657f954ef88e1aadc8ed01d25364f1a0..809d00e53847c764ce638e62a34170b310f4d3e2 100644 (file)
@@ -41,8 +41,8 @@ G_BEGIN_DECLS
  *   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 operation was cancelled
- *   by the user (via a Close button)
+ * @GTK_DIALOG_ERROR_DISMISSED: The operation was cancelled
+ *   by the user (via a Cancel or Close button)
  *
  * Error codes in the `GTK_DIALOG_ERROR` domain that can be returned
  * by async dialog functions.
@@ -53,7 +53,7 @@ typedef enum
 {
   GTK_DIALOG_ERROR_FAILED,
   GTK_DIALOG_ERROR_ABORTED,
-  GTK_DIALOG_ERROR_CANCELLED
+  GTK_DIALOG_ERROR_DISMISSED
 } GtkDialogError;
 
 GDK_AVAILABLE_IN_4_10
index d35deeac06afb278f2264175538d5493e563820b..a5a42b379d71fd4cff7550850ea6a11d6ef8823a 100644 (file)
@@ -655,7 +655,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED, "Aborted 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_CANCELLED, "Cancelled by user");
+    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
   else
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response);
 
index 334dcaf93a23840b0f0889a32f6589e77c18de30..39e068cec2cfa9a443b5e76a52bab1eed01e9e6b 100644 (file)
@@ -563,7 +563,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");
   else if (response == GTK_RESPONSE_CANCEL)
-  g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by user");
+    g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
   else
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response);