[gtk+] dialog: Remove alternative button order API



commit 3b336dda733f2978e7c4d30caf5b9217b1f53776
Author: Timm Bäder <mail baedert org>
Date:   Tue Oct 4 10:03:52 2016 +0200

    dialog: Remove alternative button order API

 docs/reference/gtk/gtk4-sections.txt |    2 -
 gtk/deprecated/gtkcolorseldialog.c   |    6 -
 gtk/deprecated/gtkfontsel.c          |    6 -
 gtk/gtkappchooserdialog.c            |    7 -
 gtk/gtkcolorchooserdialog.c          |    7 -
 gtk/gtkdialog.c                      |  215 ----------------------------------
 gtk/gtkdialog.h                      |   11 --
 gtk/gtkfilechoosernative.c           |    7 -
 gtk/gtkfilechooserwidget.c           |   12 --
 gtk/gtkfontchooserdialog.c           |    7 -
 gtk/gtkmessagedialog.c               |   10 --
 gtk/gtkmountoperation.c              |    6 -
 gtk/gtkpagesetupunixdialog.c         |    7 -
 gtk/gtkprintunixdialog.c             |    6 -
 14 files changed, 0 insertions(+), 309 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index de5eb7c..c2ab2d2 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -1070,8 +1070,6 @@ gtk_dialog_get_content_area
 gtk_dialog_get_header_bar
 <SUBSECTION>
 gtk_alternative_dialog_button_order
-gtk_dialog_set_alternative_button_order
-gtk_dialog_set_alternative_button_order_from_array
 
 <SUBSECTION Standard>
 GTK_DIALOG
diff --git a/gtk/deprecated/gtkcolorseldialog.c b/gtk/deprecated/gtkcolorseldialog.c
index 7ff28ec..b3913b3 100644
--- a/gtk/deprecated/gtkcolorseldialog.c
+++ b/gtk/deprecated/gtkcolorseldialog.c
@@ -203,12 +203,6 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
 
   gtk_widget_hide (priv->help_button);
 
-  gtk_dialog_set_alternative_button_order (dialog,
-                                          GTK_RESPONSE_OK,
-                                          GTK_RESPONSE_CANCEL,
-                                          GTK_RESPONSE_HELP,
-                                          -1);
-
   gtk_window_set_title (GTK_WINDOW (colorseldiag),
                         _("Color Selection"));
 }
diff --git a/gtk/deprecated/gtkfontsel.c b/gtk/deprecated/gtkfontsel.c
index 4525e39..a5b8aaf 100644
--- a/gtk/deprecated/gtkfontsel.c
+++ b/gtk/deprecated/gtkfontsel.c
@@ -1699,12 +1699,6 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
                                            GTK_RESPONSE_OK);
   gtk_widget_grab_default (priv->ok_button);
 
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (fontseldiag),
-                                          GTK_RESPONSE_OK,
-                                          GTK_RESPONSE_APPLY,
-                                          GTK_RESPONSE_CANCEL,
-                                          -1);
-
   gtk_window_set_title (GTK_WINDOW (fontseldiag),
                         _("Font Selection"));
 
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 8837e3e..1694547 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -713,13 +713,6 @@ gtk_app_chooser_dialog_init (GtkAppChooserDialog *self)
   gtk_widget_init_template (GTK_WIDGET (self));
   gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (self));
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (self),
-                                           GTK_RESPONSE_OK,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
   /* we can't override the class signal handler here, as it's a RUN_LAST;
    * we want our signal handler instead to be executed before any user code.
    */
diff --git a/gtk/gtkcolorchooserdialog.c b/gtk/gtkcolorchooserdialog.c
index fdedc87..a06b7d1 100644
--- a/gtk/gtkcolorchooserdialog.c
+++ b/gtk/gtkcolorchooserdialog.c
@@ -107,13 +107,6 @@ gtk_color_chooser_dialog_init (GtkColorChooserDialog *cc)
   gtk_widget_init_template (GTK_WIDGET (cc));
   gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (cc));
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (cc),
-                                           GTK_RESPONSE_OK,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
   g_signal_connect (cc, "response",
                     G_CALLBACK (gtk_color_chooser_dialog_response), NULL);
 }
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 85e6f75..0a6fa6c 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -836,31 +836,6 @@ gtk_dialog_style_updated (GtkWidget *widget)
   update_spacings (GTK_DIALOG (widget));
 }
 
-static GtkWidget *
-dialog_find_button (GtkDialog *dialog,
-                   gint       response_id)
-{
-  GtkWidget *child = NULL;
-  GList *children, *tmp_list;
-
-  children = get_action_children (dialog);
-
-  for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
-    {
-      ResponseData *rd = get_response_data (tmp_list->data, FALSE);
-
-      if (rd && rd->response_id == response_id)
-       {
-         child = tmp_list->data;
-         break;
-       }
-    }
-
-  g_list_free (children);
-
-  return child;
-}
-
 static void
 gtk_dialog_close (GtkDialog *dialog)
 {
@@ -1066,17 +1041,6 @@ gtk_dialog_add_button (GtkDialog   *dialog,
   button = gtk_button_new_with_label (button_text);
   gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
-  if (button_text)
-    {
-      GtkStockItem item;
-      if (gtk_stock_lookup (button_text, &item))
-        g_object_set (button, "use-stock", TRUE, NULL);
-    }
-
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
   gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
   gtk_widget_set_can_default (button, TRUE);
 
@@ -1487,185 +1451,6 @@ 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
- *
- * Returns %TRUE if dialogs are expected to use an alternative
- * button order on the screen @screen. See
- * gtk_dialog_set_alternative_button_order() for more details
- * about alternative button order.
- *
- * If you need to use this function, you should probably connect
- * to the ::notify:gtk-alternative-button-order signal on the
- * #GtkSettings object associated to @screen, in order to be
- * notified if the button order setting changes.
- *
- * Returns: Whether the alternative button order should be used
- *
- * Since: 2.6
- * Deprecated: 3.10: Deprecated
- */
-gboolean
-gtk_alternative_dialog_button_order (GdkScreen *screen)
-{
-  return gtk_alt_dialog_button_order ();
-}
-
-static void
-gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
-                                                gint       first_response_id,
-                                                va_list    args)
-{
-  GtkDialogPrivate *priv = dialog->priv;
-  GtkWidget *child;
-  gint response_id;
-  gint position;
-
-  response_id = first_response_id;
-  position = 0;
-  while (response_id != -1)
-    {
-      /* reorder child with response_id to position */
-      child = dialog_find_button (dialog, response_id);
-      if (child != NULL)
-        gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
-      else
-        g_warning ("%s : no child button with response id %d.", G_STRFUNC,
-                   response_id);
-
-      response_id = va_arg (args, gint);
-      position++;
-    }
-}
-
-/**
- * gtk_dialog_set_alternative_button_order:
- * @dialog: a #GtkDialog
- * @first_response_id: a response id used by one @dialog’s buttons
- * @...: a list of more response ids of @dialog’s buttons, terminated by -1
- *
- * Sets an alternative button order. If the
- * #GtkSettings:gtk-alternative-button-order setting is set to %TRUE,
- * the dialog buttons are reordered according to the order of the
- * response ids passed to this function.
- *
- * By default, GTK+ dialogs use the button order advocated by the
- * [GNOME Human Interface Guidelines](http://library.gnome.org/devel/hig-book/stable/)
- * with the affirmative button at the far
- * right, and the cancel button left of it. But the builtin GTK+ dialogs
- * and #GtkMessageDialogs do provide an alternative button order,
- * which is more suitable on some platforms, e.g. Windows.
- *
- * Use this function after adding all the buttons to your dialog, as the
- * following example shows:
- *
- * |[<!-- language="C" -->
- * cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- *                                        _("_Cancel"),
- *                                        GTK_RESPONSE_CANCEL);
- *
- * ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- *                                    _("_OK"),
- *                                    GTK_RESPONSE_OK);
- *
- * gtk_widget_grab_default (ok_button);
- *
- * help_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- *                                      _("_Help"),
- *                                      GTK_RESPONSE_HELP);
- *
- * gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
- *                                          GTK_RESPONSE_OK,
- *                                          GTK_RESPONSE_CANCEL,
- *                                          GTK_RESPONSE_HELP,
- *                                          -1);
- * ]|
- *
- * Since: 2.6
- * Deprecated: 3.10: Deprecated
- */
-void
-gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
-                                        gint       first_response_id,
-                                        ...)
-{
-  GtkDialogPrivate *priv = dialog->priv;
-  va_list args;
-
-  g_return_if_fail (GTK_IS_DIALOG (dialog));
-
-  if (priv->constructed && priv->use_header_bar)
-    return;
-
-  if (!gtk_alt_dialog_button_order ())
-    return;
-
-  va_start (args, first_response_id);
-
-  gtk_dialog_set_alternative_button_order_valist (dialog,
-                                                 first_response_id,
-                                                 args);
-  va_end (args);
-}
-/**
- * gtk_dialog_set_alternative_button_order_from_array:
- * @dialog: a #GtkDialog
- * @n_params: the number of response ids in @new_order
- * @new_order: (array length=n_params): an array of response ids of
- *     @dialog’s buttons
- *
- * Sets an alternative button order. If the
- * #GtkSettings:gtk-alternative-button-order setting is set to %TRUE,
- * the dialog buttons are reordered according to the order of the
- * response ids in @new_order.
- *
- * See gtk_dialog_set_alternative_button_order() for more information.
- *
- * 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,
-                                                    gint       n_params,
-                                                    gint      *new_order)
-{
-  GtkDialogPrivate *priv = dialog->priv;
-  GtkWidget *child;
-  gint position;
-
-  g_return_if_fail (GTK_IS_DIALOG (dialog));
-  g_return_if_fail (new_order != NULL);
-
-  if (dialog->priv->use_header_bar)
-    return;
-
-  if (!gtk_alt_dialog_button_order ())
-    return;
-
-  for (position = 0; position < n_params; position++)
-  {
-      /* reorder child with response_id to position */
-      child = dialog_find_button (dialog, new_order[position]);
-      if (child != NULL)
-        gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
-      else
-        g_warning ("%s : no child button with response id %d.", G_STRFUNC,
-                   new_order[position]);
-    }
-}
-
 typedef struct {
   gchar *widget_name;
   gint response_id;
diff --git a/gtk/gtkdialog.h b/gtk/gtkdialog.h
index 17f0503..1538bef 100644
--- a/gtk/gtkdialog.h
+++ b/gtk/gtkdialog.h
@@ -179,17 +179,6 @@ GDK_AVAILABLE_IN_ALL
 gint gtk_dialog_get_response_for_widget (GtkDialog *dialog,
                                          GtkWidget *widget);
 
-GDK_DEPRECATED_IN_3_10
-gboolean gtk_alternative_dialog_button_order (GdkScreen *screen);
-GDK_DEPRECATED_IN_3_10
-void     gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
-                                                  gint       first_response_id,
-                                                  ...);
-GDK_DEPRECATED_IN_3_10
-void     gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
-                                                             gint       n_params,
-                                                             gint      *new_order);
-
 /* Emit response signal */
 GDK_AVAILABLE_IN_ALL
 void gtk_dialog_response           (GtkDialog *dialog,
diff --git a/gtk/gtkfilechoosernative.c b/gtk/gtkfilechoosernative.c
index a3e5636..a6a75f8 100644
--- a/gtk/gtkfilechoosernative.c
+++ b/gtk/gtkfilechoosernative.c
@@ -516,13 +516,6 @@ gtk_file_chooser_native_init (GtkFileChooserNative *self)
 
   gtk_dialog_set_default_response (GTK_DIALOG (self->dialog),
                                    GTK_RESPONSE_ACCEPT);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (self->dialog),
-                                           GTK_RESPONSE_ACCEPT,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
   /* We don't want to destroy on delete event, instead we hide in the response cb */
   g_signal_connect (self->dialog,
                     "delete-event",
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 861bcfb..13383aa 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -1478,12 +1478,6 @@ confirm_delete (GtkFileChooserWidget *impl,
                                             _("If you delete an item, it will be permanently lost."));
   gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
   gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Delete"), GTK_RESPONSE_ACCEPT);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                           GTK_RESPONSE_ACCEPT,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
 
   if (gtk_window_has_group (toplevel))
@@ -6374,12 +6368,6 @@ confirm_dialog_should_accept_filename (GtkFileChooserWidget *impl,
 
   gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
   add_custom_button_to_dialog (GTK_DIALOG (dialog), _("_Replace"), GTK_RESPONSE_ACCEPT);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                           GTK_RESPONSE_ACCEPT,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
 
   if (gtk_window_has_group (toplevel))
diff --git a/gtk/gtkfontchooserdialog.c b/gtk/gtkfontchooserdialog.c
index 1931a86..109f841 100644
--- a/gtk/gtkfontchooserdialog.c
+++ b/gtk/gtkfontchooserdialog.c
@@ -152,13 +152,6 @@ gtk_font_chooser_dialog_init (GtkFontChooserDialog *fontchooserdiag)
   gtk_widget_init_template (GTK_WIDGET (fontchooserdiag));
   gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (fontchooserdiag));
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (fontchooserdiag),
-                                           GTK_RESPONSE_OK,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
   priv->select_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_OK);
   priv->cancel_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (fontchooserdiag), 
GTK_RESPONSE_CANCEL);
 
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index 36a9d6f..ed48e85 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -935,7 +935,6 @@ gtk_message_dialog_add_buttons (GtkMessageDialog* message_dialog,
 {
   GtkDialog* dialog = GTK_DIALOG (message_dialog);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   switch (buttons)
     {
     case GTK_BUTTONS_NONE:
@@ -957,26 +956,17 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     case GTK_BUTTONS_YES_NO:
       gtk_dialog_add_button (dialog, _("_No"), GTK_RESPONSE_NO);
       gtk_dialog_add_button (dialog, _("_Yes"), GTK_RESPONSE_YES);
-      gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                              GTK_RESPONSE_YES,
-                                              GTK_RESPONSE_NO,
-                                              -1);
       break;
 
     case GTK_BUTTONS_OK_CANCEL:
       gtk_dialog_add_button (dialog, _("_Cancel"), GTK_RESPONSE_CANCEL);
       gtk_dialog_add_button (dialog, _("_OK"), GTK_RESPONSE_OK);
-      gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                              GTK_RESPONSE_OK,
-                                              GTK_RESPONSE_CANCEL,
-                                              -1);
       break;
       
     default:
       g_warning ("Unknown GtkButtonsType");
       break;
     } 
-G_GNUC_END_IGNORE_DEPRECATIONS
 
   g_object_notify (G_OBJECT (message_dialog), "buttons");
 }
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 8c2893f..8340844 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -547,12 +547,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
                           NULL);
   gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (dialog,
-                                           GTK_RESPONSE_OK,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
 
   /* Build contents */
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
diff --git a/gtk/gtkpagesetupunixdialog.c b/gtk/gtkpagesetupunixdialog.c
index 5659e47..368f03a 100644
--- a/gtk/gtkpagesetupunixdialog.c
+++ b/gtk/gtkpagesetupunixdialog.c
@@ -198,13 +198,6 @@ gtk_page_setup_unix_dialog_init (GtkPageSetupUnixDialog *dialog)
                           NULL);
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                           GTK_RESPONSE_OK,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
   /* Do this in code, we want the translatable strings without the markup */
   gtk_list_store_append (priv->printer_list, &iter);
   tmp = g_strdup_printf ("<b>%s</b>\n%s", _("Any Printer"), _("For portable documents"));
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index cbb50ec..877337b 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -675,12 +675,6 @@ error_dialogs (GtkPrintUnixDialog *print_dialog,
                       gtk_dialog_add_button (GTK_DIALOG (dialog),
                                              _("_Replace"),
                                              GTK_RESPONSE_ACCEPT);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-                      gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                                               GTK_RESPONSE_ACCEPT,
-                                                               GTK_RESPONSE_CANCEL,
-                                                               -1);
-G_GNUC_END_IGNORE_DEPRECATIONS
                       gtk_dialog_set_default_response (GTK_DIALOG (dialog),
                                                        GTK_RESPONSE_ACCEPT);
 


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