diff options
-rw-r--r-- | gtk/gtkdialog.c | 39 | ||||
-rw-r--r-- | gtk/gtkdialog.h | 6 |
2 files changed, 21 insertions, 24 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index d5a54a06e0..09d20c09a4 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -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,28 +1184,18 @@ 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 gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog, - gint first_response_id, - va_list args) + gint first_response_id, + va_list args) { GtkDialogPrivate *priv = dialog->priv; GtkWidget *child; @@ -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,16 +1308,14 @@ 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)) - return; + if (!gtk_alt_dialog_button_order ()) + return; for (position = 0; position < n_params; position++) { diff --git a/gtk/gtkdialog.h b/gtk/gtkdialog.h index 1742985e8a..39dd113c20 100644 --- a/gtk/gtkdialog.h +++ b/gtk/gtkdialog.h @@ -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); |