[gtk+/dialogs: 2/25] dialog: Mark alternate button order as deprecated



commit 625a04d003461eca65a982d0c7b5ad3dbc990bcd
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 dab61ce..42981ad 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -1352,6 +1352,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
@@ -1369,28 +1378,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;
@@ -1457,13 +1456,13 @@ 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));
@@ -1471,8 +1470,7 @@ gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
   if (dialog->priv->use_header_bar)
     return;
 
-  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);
@@ -1499,6 +1497,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,
@@ -1506,7 +1505,6 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
                                                     gint      *new_order)
 {
   GtkDialogPrivate *priv = dialog->priv;
-  GdkScreen *screen;
   GtkWidget *child;
   gint position;
 
@@ -1516,9 +1514,8 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
   if (dialog->priv->use_header_bar)
     return;
 
-  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 665e816..3761f7d 100644
--- a/gtk/gtkdialog.h
+++ b/gtk/gtkdialog.h
@@ -171,13 +171,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]