[gtk+] dialog: Mark alternate button order as deprecated



commit 57139820c97250ad22c8202c3924d69a05fe7edf
Author: William Jon McCann <william jon mccann gmail com>
Date:   Sun Dec 8 17:38:34 2013 +0100

    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

 gtk/gtkdialog.c |   39 ++++++++++++++++++---------------------
 gtk/gtkdialog.h |    6 +++---
 2 files changed, 21 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index d5a54a0..09d20c0 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 1742985..39dd113 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]