Commit 57139820 authored by William Jon McCann's avatar William Jon McCann Committed by Matthias Clasen

dialog: Mark alternate button order as deprecated

This feature was never implemented 100% correct, and
does not apply to action buttons in header bars.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
parent 3d354026
...@@ -1158,6 +1158,15 @@ gtk_dialog_get_response_for_widget (GtkDialog *dialog, ...@@ -1158,6 +1158,15 @@ gtk_dialog_get_response_for_widget (GtkDialog *dialog,
return rd->response_id; return rd->response_id;
} }
static gboolean
gtk_alt_dialog_button_order (void)
{
gboolean result;
g_object_get (gtk_settings_get_default (),
"gtk-alternative-button-order", &result, NULL);
return result;
}
/** /**
* gtk_alternative_dialog_button_order: * gtk_alternative_dialog_button_order:
* @screen: (allow-none): a #GdkScreen, or %NULL to use the default screen * @screen: (allow-none): a #GdkScreen, or %NULL to use the default screen
...@@ -1175,28 +1184,18 @@ gtk_dialog_get_response_for_widget (GtkDialog *dialog, ...@@ -1175,28 +1184,18 @@ gtk_dialog_get_response_for_widget (GtkDialog *dialog,
* Returns: Whether the alternative button order should be used * Returns: Whether the alternative button order should be used
* *
* Since: 2.6 * Since: 2.6
* Deprecated: 3.10: Deprecated
*/ */
gboolean gboolean
gtk_alternative_dialog_button_order (GdkScreen *screen) gtk_alternative_dialog_button_order (GdkScreen *screen)
{ {
GtkSettings *settings; return gtk_alt_dialog_button_order ();
gboolean result;
if (screen)
settings = gtk_settings_get_for_screen (screen);
else
settings = gtk_settings_get_default ();
g_object_get (settings,
"gtk-alternative-button-order", &result, NULL);
return result;
} }
static void static void
gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog, gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
gint first_response_id, gint first_response_id,
va_list args) va_list args)
{ {
GtkDialogPrivate *priv = dialog->priv; GtkDialogPrivate *priv = dialog->priv;
GtkWidget *child; GtkWidget *child;
...@@ -1263,19 +1262,18 @@ gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog, ...@@ -1263,19 +1262,18 @@ gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
* ]| * ]|
* *
* Since: 2.6 * Since: 2.6
* Deprecated: 3.10: Deprecated
*/ */
void void
gtk_dialog_set_alternative_button_order (GtkDialog *dialog, gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
gint first_response_id, gint first_response_id,
...) ...)
{ {
GdkScreen *screen;
va_list args; va_list args;
g_return_if_fail (GTK_IS_DIALOG (dialog)); g_return_if_fail (GTK_IS_DIALOG (dialog));
screen = gtk_widget_get_screen (GTK_WIDGET (dialog)); if (!gtk_alt_dialog_button_order ())
if (!gtk_alternative_dialog_button_order (screen))
return; return;
va_start (args, first_response_id); va_start (args, first_response_id);
...@@ -1302,6 +1300,7 @@ gtk_dialog_set_alternative_button_order (GtkDialog *dialog, ...@@ -1302,6 +1300,7 @@ gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
* This function is for use by language bindings. * This function is for use by language bindings.
* *
* Since: 2.6 * Since: 2.6
* Deprecated: 3.10: Deprecated
*/ */
void void
gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog, gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
...@@ -1309,16 +1308,14 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog, ...@@ -1309,16 +1308,14 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
gint *new_order) gint *new_order)
{ {
GtkDialogPrivate *priv = dialog->priv; GtkDialogPrivate *priv = dialog->priv;
GdkScreen *screen;
GtkWidget *child; GtkWidget *child;
gint position; gint position;
g_return_if_fail (GTK_IS_DIALOG (dialog)); g_return_if_fail (GTK_IS_DIALOG (dialog));
g_return_if_fail (new_order != NULL); g_return_if_fail (new_order != NULL);
screen = gtk_widget_get_screen (GTK_WIDGET (dialog)); if (!gtk_alt_dialog_button_order ())
if (!gtk_alternative_dialog_button_order (screen)) return;
return;
for (position = 0; position < n_params; position++) for (position = 0; position < n_params; position++)
{ {
......
...@@ -168,13 +168,13 @@ GDK_AVAILABLE_IN_ALL ...@@ -168,13 +168,13 @@ GDK_AVAILABLE_IN_ALL
gint gtk_dialog_get_response_for_widget (GtkDialog *dialog, gint gtk_dialog_get_response_for_widget (GtkDialog *dialog,
GtkWidget *widget); GtkWidget *widget);
GDK_AVAILABLE_IN_ALL GDK_DEPRECATED_IN_3_10
gboolean gtk_alternative_dialog_button_order (GdkScreen *screen); gboolean gtk_alternative_dialog_button_order (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL GDK_DEPRECATED_IN_3_10
void gtk_dialog_set_alternative_button_order (GtkDialog *dialog, void gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
gint first_response_id, gint first_response_id,
...); ...);
GDK_AVAILABLE_IN_ALL GDK_DEPRECATED_IN_3_10
void gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog, void gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
gint n_params, gint n_params,
gint *new_order); gint *new_order);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment