mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
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:
parent
8957302bd4
commit
977fedfdf1
@ -252,8 +252,8 @@ canceled (GCancellable *cancellable,
|
|||||||
send_close (data);
|
send_close (data);
|
||||||
|
|
||||||
g_task_return_new_error (task,
|
g_task_return_new_error (task,
|
||||||
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED,
|
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED,
|
||||||
"The OpenURI portal call was cancelled programmatically");
|
"The OpenURI portal call was cancelled by the application");
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,8 +390,8 @@ open_uri_done (GObject *source,
|
|||||||
{
|
{
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_task_return_new_error (data->task,
|
g_task_return_new_error (data->task,
|
||||||
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED,
|
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED,
|
||||||
"The operation was aborted programmatically");
|
"The operation was cancelled by the application");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_task_return_error (data->task, error);
|
g_task_return_error (data->task, error);
|
||||||
|
@ -606,7 +606,11 @@ response_cb (GTask *task,
|
|||||||
if (cancellable)
|
if (cancellable)
|
||||||
g_signal_handlers_disconnect_by_func (cancellable, cancelled_cb, task);
|
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);
|
g_task_return_int (task, response);
|
||||||
}
|
}
|
||||||
|
@ -387,7 +387,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
|||||||
g_task_return_pointer (task, gdk_rgba_copy (&color), (GDestroyNotify) gdk_rgba_free);
|
g_task_return_pointer (task, gdk_rgba_copy (&color), (GDestroyNotify) gdk_rgba_free);
|
||||||
}
|
}
|
||||||
else if (response == GTK_RESPONSE_CLOSE)
|
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 ||
|
else if (response == GTK_RESPONSE_CANCEL ||
|
||||||
response == GTK_RESPONSE_DELETE_EVENT)
|
response == GTK_RESPONSE_DELETE_EVENT)
|
||||||
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
|
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
|
||||||
|
@ -39,8 +39,8 @@ G_BEGIN_DECLS
|
|||||||
* GtkDialogError:
|
* GtkDialogError:
|
||||||
* @GTK_DIALOG_ERROR_FAILED: Generic error condition for when
|
* @GTK_DIALOG_ERROR_FAILED: Generic error condition for when
|
||||||
* an operation fails and no more specific code is applicable
|
* an operation fails and no more specific code is applicable
|
||||||
* @GTK_DIALOG_ERROR_ABORTED: The async function call was aborted
|
* @GTK_DIALOG_ERROR_CANCELLED: The async function call was cancelled
|
||||||
* programmatically (via its `GCancellable`)
|
* via its `GCancellable`
|
||||||
* @GTK_DIALOG_ERROR_DISMISSED: The operation was cancelled
|
* @GTK_DIALOG_ERROR_DISMISSED: The operation was cancelled
|
||||||
* by the user (via a Cancel or Close button)
|
* by the user (via a Cancel or Close button)
|
||||||
*
|
*
|
||||||
@ -52,7 +52,7 @@ G_BEGIN_DECLS
|
|||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
GTK_DIALOG_ERROR_FAILED,
|
GTK_DIALOG_ERROR_FAILED,
|
||||||
GTK_DIALOG_ERROR_ABORTED,
|
GTK_DIALOG_ERROR_CANCELLED,
|
||||||
GTK_DIALOG_ERROR_DISMISSED
|
GTK_DIALOG_ERROR_DISMISSED
|
||||||
} GtkDialogError;
|
} GtkDialogError;
|
||||||
|
|
||||||
|
@ -652,7 +652,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
}
|
}
|
||||||
else if (response == GTK_RESPONSE_CLOSE)
|
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 ||
|
else if (response == GTK_RESPONSE_CANCEL ||
|
||||||
response == GTK_RESPONSE_DELETE_EVENT)
|
response == GTK_RESPONSE_DELETE_EVENT)
|
||||||
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
|
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
|
||||||
|
@ -561,7 +561,7 @@ response_cb (GTask *task,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (response == GTK_RESPONSE_CLOSE)
|
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)
|
else if (response == GTK_RESPONSE_CANCEL)
|
||||||
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
|
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user