dialog: GTK_DIALOG_ERROR_ABORTED => GTK_DIALOG_ERROR_CANCELLED

This is done via the GCancellable, so let's call it cancelling.
This commit is contained in:
Benjamin Otte 2022-11-23 23:35:11 +01:00 committed by Matthias Clasen
parent 8957302bd4
commit 977fedfdf1
6 changed files with 15 additions and 11 deletions

View 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);

View 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);
}

View 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");

View 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;

View 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");

View 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