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,
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:
* @screen: (allow-none): a #GdkScreen, or %NULL to use the default screen
......@@ -1175,22 +1184,12 @@ gtk_dialog_get_response_for_widget (GtkDialog *dialog,
* Returns: Whether the alternative button order should be used
*
* Since: 2.6
* Deprecated: 3.10: Deprecated
*/
gboolean
gtk_alternative_dialog_button_order (GdkScreen *screen)
{
GtkSettings *settings;
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;
return gtk_alt_dialog_button_order ();
}
static void
......@@ -1263,19 +1262,18 @@ gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
* ]|
*
* Since: 2.6
* Deprecated: 3.10: Deprecated
*/
void
gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
gint first_response_id,
...)
{
GdkScreen *screen;
va_list args;
g_return_if_fail (GTK_IS_DIALOG (dialog));
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
if (!gtk_alternative_dialog_button_order (screen))
if (!gtk_alt_dialog_button_order ())
return;
va_start (args, first_response_id);
......@@ -1302,6 +1300,7 @@ gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
* This function is for use by language bindings.
*
* Since: 2.6
* Deprecated: 3.10: Deprecated
*/
void
gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
......@@ -1309,15 +1308,13 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
gint *new_order)
{
GtkDialogPrivate *priv = dialog->priv;
GdkScreen *screen;
GtkWidget *child;
gint position;
g_return_if_fail (GTK_IS_DIALOG (dialog));
g_return_if_fail (new_order != NULL);
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
if (!gtk_alternative_dialog_button_order (screen))
if (!gtk_alt_dialog_button_order ())
return;
for (position = 0; position < n_params; position++)
......
......@@ -168,13 +168,13 @@ GDK_AVAILABLE_IN_ALL
gint gtk_dialog_get_response_for_widget (GtkDialog *dialog,
GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
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,
gint first_response_id,
...);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
gint n_params,
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