[Xfce4-commits] [apps/mousepad] 09/10: Add wrappers to silence deprecation warnings

noreply at xfce.org noreply at xfce.org
Sat Jul 19 13:47:18 CEST 2014


This is an automated email from the git hooks/post-receive script.

mbrush pushed a commit to branch master
in repository apps/mousepad.

commit c234bad8bfda0ae4871ae730b73232e5ebbe2cf0
Author: Matthew Brush <mbrush at codebrainz.ca>
Date:   Sat Jul 19 04:09:27 2014 -0700

    Add wrappers to silence deprecation warnings
    
    Where it's not worth making wrappers (eg. GtkTable, gtkrc) just
    disable the GCC warning around that code.
    
    Remove use of GDK_THREADS_ENTER/LEAVE() since uses in idle/timeout
    callbacks will occur in the main GUI thread anyway.
---
 mousepad/mousepad-dialogs.c         |    9 +++++----
 mousepad/mousepad-document.c        |    2 +-
 mousepad/mousepad-encoding-dialog.c |   10 +++-------
 mousepad/mousepad-gtkcompat.h       |   28 ++++++++++++++++++++++++++
 mousepad/mousepad-print.c           |   16 ++++++++++++---
 mousepad/mousepad-replace-dialog.c  |    8 ++++----
 mousepad/mousepad-search-bar.c      |   14 +++++++++----
 mousepad/mousepad-statusbar.c       |    9 +++++----
 mousepad/mousepad-util.c            |    7 ++++---
 mousepad/mousepad-window.c          |   37 ++++++++++++++++-------------------
 10 files changed, 90 insertions(+), 50 deletions(-)

diff --git a/mousepad/mousepad-dialogs.c b/mousepad/mousepad-dialogs.c
index 1739822..1a8ae00 100644
--- a/mousepad/mousepad-dialogs.c
+++ b/mousepad/mousepad-dialogs.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-dialogs.h>
 #include <mousepad/mousepad-util.h>
 
@@ -121,7 +122,7 @@ mousepad_dialogs_other_tab_size (GtkWindow *parent,
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), MOUSEPAD_RESPONSE_OK);
 
   /* create scale widget */
-  scale = gtk_hscale_new_with_range (1, 32, 1);
+  scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 1, 32, 1);
   gtk_range_set_value (GTK_RANGE (scale), active_size);
   gtk_scale_set_digits (GTK_SCALE (scale), 0);
   gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
@@ -202,7 +203,7 @@ mousepad_dialogs_go_to (GtkWindow     *parent,
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), MOUSEPAD_RESPONSE_JUMP_TO);
   gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 
-  vbox = gtk_vbox_new (FALSE, 6);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG(dialog))), vbox, TRUE, TRUE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
   gtk_widget_show (vbox);
@@ -211,7 +212,7 @@ mousepad_dialogs_go_to (GtkWindow     *parent,
   size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
   /* line number box */
-  hbox = gtk_hbox_new (FALSE, 12);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
   gtk_widget_show (hbox);
 
@@ -230,7 +231,7 @@ mousepad_dialogs_go_to (GtkWindow     *parent,
   gtk_widget_show (line_spin);
 
   /* column box */
-  hbox = gtk_hbox_new (FALSE, 12);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
   gtk_widget_show (hbox);
 
diff --git a/mousepad/mousepad-document.c b/mousepad/mousepad-document.c
index 8591b48..bff9170 100644
--- a/mousepad/mousepad-document.c
+++ b/mousepad/mousepad-document.c
@@ -475,7 +475,7 @@ mousepad_document_get_tab_label (MousepadDocument *document)
   GtkWidget  *button;
 
   /* create the box */
-  hbox = gtk_hbox_new (FALSE, 0);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   gtk_widget_show (hbox);
 
   /* the ebox */
diff --git a/mousepad/mousepad-encoding-dialog.c b/mousepad/mousepad-encoding-dialog.c
index a912514..5c17f14 100644
--- a/mousepad/mousepad-encoding-dialog.c
+++ b/mousepad/mousepad-encoding-dialog.c
@@ -127,11 +127,11 @@ mousepad_encoding_dialog_init (MousepadEncodingDialog *dialog)
                                _("Please select an encoding below."), GTK_STOCK_FILE);
 
   /* dialog vbox */
-  vbox = gtk_vbox_new (FALSE, 6);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), vbox, TRUE, TRUE, 0);
   gtk_widget_show (vbox);
 
-  hbox = gtk_hbox_new (FALSE, 6);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
   gtk_widget_show (hbox);
 
@@ -183,7 +183,7 @@ mousepad_encoding_dialog_init (MousepadEncodingDialog *dialog)
   gtk_widget_show (icon);
 
   /* error box */
-  dialog->error_box = gtk_hbox_new (FALSE, 6);
+  dialog->error_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_box_pack_start (GTK_BOX (vbox), dialog->error_box, FALSE, FALSE, 0);
 
   /* error icon */
@@ -249,8 +249,6 @@ mousepad_encoding_dialog_test_encodings_idle (gpointer user_data)
   guint                   i, n;
   gchar                  *encoded;
 
-  GDK_THREADS_ENTER ();
-
   /* get the filename */
   filename = mousepad_file_get_filename (dialog->document->file);
 
@@ -322,8 +320,6 @@ mousepad_encoding_dialog_test_encodings_idle (gpointer user_data)
   /* select the first item */
   gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->combo), 0);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
diff --git a/mousepad/mousepad-gtkcompat.h b/mousepad/mousepad-gtkcompat.h
index 70a4510..0d38b44 100644
--- a/mousepad/mousepad-gtkcompat.h
+++ b/mousepad/mousepad-gtkcompat.h
@@ -21,6 +21,16 @@ G_BEGIN_DECLS
 #endif
 
 #if ! GTK_CHECK_VERSION(3, 0, 0)
+# define gtk_scale_new_with_range(orientation, min, max, step) \
+  (((orientation) == GTK_ORIENTATION_HORIZONTAL) ? \
+    gtk_hscale_new_with_range (min, max, step) : \
+    gtk_vscale_new_with_range (min, max, step))
+# define gtk_box_new(orientation, spacing) \
+  (((orientation) == GTK_ORIENTATION_HORIZONTAL) ? \
+    gtk_hbox_new (FALSE, spacing) : gtk_vbox_new (FALSE, spacing))
+# define gtk_separator_new(orientation) \
+  (((orientation) == GTK_ORIENTATION_HORIZONTAL) ? \
+    gtk_hseparator_new () : gtk_vseparator_new ())
 static inline gint
 gtk_widget_get_allocated_width (GtkWidget *widget)
 {
@@ -42,6 +52,24 @@ gtk_widget_get_allocated_height (GtkWidget *widget)
 # define gtk_dialog_set_has_separator(dialog, setting) do { } while (0)
 #endif
 
+#if ! GTK_CHECK_VERSION(3, 2, 0)
+# define GTK_FONT_CHOOSER_DIALOG(obj) GTK_FONT_SELECTION_DIALOG (obj)
+# define gtk_font_chooser_dialog_new(title, window) \
+  g_object_new (GTK_TYPE_FONT_SELECTION_DIALOG, "title", title, \
+                "transient-for", window, NULL)
+/* These don't exist in any version, just for compatibility */
+# define gtk_font_chooser_dialog_set_font_name(dialog, fontname) \
+  gtk_font_selection_dialog_set_font_name (dialog, fontname)
+# define gtk_font_chooser_dialog_get_font_name(dialog) \
+  gtk_font_selection_dialog_get_font_name (dialog)
+# else
+/* These don't exist in any version, just for compatibility */
+# define gtk_font_chooser_dialog_set_font_name(dialog, fontname) \
+  gtk_font_chooser_set_font (GTK_FONT_CHOOSER (dialog), fontname)
+# define gtk_font_chooser_dialog_get_font_name(dialog) \
+  gtk_font_chooser_get_font (GTK_FONT_CHOOSER (dialog))
+#endif
+
 /* GtkSourceView3 compatibility */
 #if ! GTK_CHECK_VERSION(3, 0, 0)
 # define GTK_SOURCE_TYPE_LANGUAGE     GTK_TYPE_SOURCE_LANGUAGE
diff --git a/mousepad/mousepad-print.c b/mousepad/mousepad-print.c
index 5a83dbc..b7fadc7 100644
--- a/mousepad/mousepad-print.c
+++ b/mousepad/mousepad-print.c
@@ -585,7 +585,7 @@ mousepad_print_create_custom_widget (GtkPrintOperation *operation)
   GtkWidget     *table;
   GtkAdjustment *adjustment;
 
-  vbox = gtk_vbox_new (FALSE, 6);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
 
   frame = gtk_frame_new (NULL);
@@ -623,7 +623,7 @@ mousepad_print_create_custom_widget (GtkPrintOperation *operation)
   gtk_container_add (GTK_CONTAINER (frame), alignment);
   gtk_widget_show (alignment);
 
-  vbox2 = gtk_vbox_new (FALSE, 6);
+  vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_container_add (GTK_CONTAINER (alignment), vbox2);
   gtk_widget_show (vbox2);
 
@@ -646,7 +646,7 @@ mousepad_print_create_custom_widget (GtkPrintOperation *operation)
   gtk_box_pack_start (GTK_BOX (vbox2), alignment, FALSE, FALSE, 0);
   gtk_widget_show (alignment);
 
-  print->widget_line_numbers_hbox = gtk_hbox_new (FALSE, 6);
+  print->widget_line_numbers_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_widget_set_sensitive (print->widget_line_numbers_hbox, print->print_line_numbers);
   gtk_container_add (GTK_CONTAINER (alignment), print->widget_line_numbers_hbox);
   gtk_widget_show (print->widget_line_numbers_hbox);
@@ -700,6 +700,12 @@ mousepad_print_create_custom_widget (GtkPrintOperation *operation)
   gtk_container_add (GTK_CONTAINER (frame), alignment);
   gtk_widget_show (alignment);
 
+  /* In GTK3, GtkTable is deprecated */
+#if GTK_CHECK_VERSION(3, 0, 0) && defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
   table = gtk_table_new (3, 2, FALSE);
   gtk_table_set_col_spacings (GTK_TABLE (table), 6);
   gtk_table_set_row_spacings (GTK_TABLE (table), 6);
@@ -736,6 +742,10 @@ mousepad_print_create_custom_widget (GtkPrintOperation *operation)
   g_signal_connect (G_OBJECT (print->widget_line_numbers_font), "font-set", G_CALLBACK (mousepad_print_button_font_set), print);
   gtk_widget_show (print->widget_line_numbers_font);
 
+#if GTK_CHECK_VERSION(3, 0, 0) && defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
+
   return vbox;
 }
 
diff --git a/mousepad/mousepad-replace-dialog.c b/mousepad/mousepad-replace-dialog.c
index 6a22d05..3ffd6f8 100644
--- a/mousepad/mousepad-replace-dialog.c
+++ b/mousepad/mousepad-replace-dialog.c
@@ -152,7 +152,7 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   gtk_widget_show (vbox);
 
   /* horizontal box for search string */
-  hbox = gtk_hbox_new (FALSE, 8);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
   gtk_widget_show (hbox);
 
@@ -176,7 +176,7 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   g_signal_connect_swapped (G_OBJECT (dialog->search_entry), "changed", G_CALLBACK (mousepad_replace_dialog_changed), dialog);
 
   /* horizontal box for replace string */
-  hbox = gtk_hbox_new (FALSE, 8);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
   gtk_widget_show (hbox);
 
@@ -195,7 +195,7 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   dialog->replace_entry = gtk_bin_get_child (GTK_BIN (combo));
 
   /* search direction */
-  hbox = gtk_hbox_new (FALSE, 8);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL(label), combo);
   gtk_widget_show (hbox);
@@ -234,7 +234,7 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   mousepad_replace_dialog_bind_setting (dialog, MOUSEPAD_SETTING_SEARCH_MATCH_WHOLE_WORD, check, "active");
 
   /* horizontal box for the replace all options */
-  hbox = gtk_hbox_new (FALSE, 8);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
   gtk_widget_show (hbox);
 
diff --git a/mousepad/mousepad-search-bar.c b/mousepad/mousepad-search-bar.c
index c3073f4..3315ed9 100644
--- a/mousepad/mousepad-search-bar.c
+++ b/mousepad/mousepad-search-bar.c
@@ -136,6 +136,12 @@ mousepad_search_bar_class_init (MousepadSearchBarClass *klass)
   binding_set = gtk_binding_set_by_class (klass);
   gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "hide-bar", 0);
 
+  /* In GTK3, gtkrc is deprecated */
+#if GTK_CHECK_VERSION(3, 0, 0) && defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
   /* hide the shadow around the toolbar */
   gtk_rc_parse_string ("style \"mousepad-search-bar-style\"\n"
                          "{\n"
@@ -150,6 +156,10 @@ mousepad_search_bar_class_init (MousepadSearchBarClass *klass)
                          "}\n"
                        "widget \"MousepadWindow.*.Gtk*ToolButton\" style \"mousepad-button-style\"\n");
 
+#if GTK_CHECK_VERSION(3, 0, 0) && defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
+
   /* add an activate-backwards signal to GtkEntry */
   entry_class = g_type_class_ref (GTK_TYPE_ENTRY);
   if (G_LIKELY (g_signal_lookup("activate-backward", GTK_TYPE_ENTRY) == 0))
@@ -463,8 +473,6 @@ mousepad_search_bar_highlight_timeout (gpointer user_data)
   MousepadSearchBar   *bar = MOUSEPAD_SEARCH_BAR (user_data);
   MousepadSearchFlags  flags;
 
-  GDK_THREADS_ENTER ();
-
   /* set search flags */
   flags = MOUSEPAD_SEARCH_FLAGS_DIR_FORWARD
           | MOUSEPAD_SEARCH_FLAGS_ITER_AREA_START
@@ -473,8 +481,6 @@ mousepad_search_bar_highlight_timeout (gpointer user_data)
   /* emit signal */
   mousepad_search_bar_find_string (bar, flags);
 
-  GDK_THREADS_LEAVE ();
-
   /* stop the timeout */
   return FALSE;
 }
diff --git a/mousepad/mousepad-statusbar.c b/mousepad/mousepad-statusbar.c
index f2fd009..8e723ec 100644
--- a/mousepad/mousepad-statusbar.c
+++ b/mousepad/mousepad-statusbar.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-statusbar.h>
 #include <mousepad/mousepad-window.h>
 #include <mousepad/mousepad-util.h>
@@ -113,7 +114,7 @@ mousepad_statusbar_init (MousepadStatusbar *statusbar)
 #endif
 
   /* create a new horizontal box */
-  box = gtk_hbox_new (FALSE, 8);
+  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
   gtk_widget_show (box);
 
   /* reorder the gtk statusbar */
@@ -128,7 +129,7 @@ mousepad_statusbar_init (MousepadStatusbar *statusbar)
   g_list_free (frame);
 
   /* separator */
-  separator = gtk_vseparator_new ();
+  separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
   gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, 0);
   gtk_widget_show (separator);
 
@@ -146,7 +147,7 @@ mousepad_statusbar_init (MousepadStatusbar *statusbar)
   gtk_widget_show (statusbar->language);
 
   /* separator */
-  separator = gtk_vseparator_new ();
+  separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
   gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, 0);
   gtk_widget_show (separator);
 
@@ -156,7 +157,7 @@ mousepad_statusbar_init (MousepadStatusbar *statusbar)
   gtk_widget_show (statusbar->position);
 
   /* separator */
-  separator = gtk_vseparator_new ();
+  separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
   gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, 0);
   gtk_widget_show (separator);
 
diff --git a/mousepad/mousepad-util.c b/mousepad/mousepad-util.c
index d58d558..0c27183 100644
--- a/mousepad/mousepad-util.c
+++ b/mousepad/mousepad-util.c
@@ -15,6 +15,7 @@
  */
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-gtkcompat.h>
 #include <mousepad/mousepad-util.h>
 
 
@@ -422,7 +423,7 @@ mousepad_util_dialog_header (GtkDialog   *dialog,
   gtk_container_remove (GTK_CONTAINER (dialog), dialog_vbox);
 
   /* add a new vbox to the main window */
-  vbox = gtk_vbox_new (FALSE, 0);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_container_add (GTK_CONTAINER (dialog), vbox);
   gtk_widget_show (vbox);
 
@@ -434,7 +435,7 @@ mousepad_util_dialog_header (GtkDialog   *dialog,
   gtk_widget_show (ebox);
 
   /* create a hbox */
-  hbox = gtk_hbox_new (FALSE, 12);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
   gtk_container_add (GTK_CONTAINER (ebox), hbox);
   gtk_widget_show (hbox);
@@ -458,7 +459,7 @@ mousepad_util_dialog_header (GtkDialog   *dialog,
   g_free (full_title);
 
   /* add the separator between header and content */
-  line = gtk_hseparator_new ();
+  line = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
   gtk_box_pack_start (GTK_BOX (vbox), line, FALSE, FALSE, 0);
   gtk_widget_show (line);
 
diff --git a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
index 5705c94..ae55465 100644
--- a/mousepad/mousepad-window.c
+++ b/mousepad/mousepad-window.c
@@ -864,6 +864,12 @@ mousepad_window_create_root_warning (MousepadWindow *window)
     {
       GtkWidget *ebox, *label, *separator;
 
+  /* In GTK3, gtkrc is deprecated */
+#if GTK_CHECK_VERSION(3, 0, 0) && defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
       /* install default settings for the root warning text box */
       gtk_rc_parse_string ("style\"mousepad-window-root-style\"\n"
                              "{\n"
@@ -873,6 +879,10 @@ mousepad_window_create_root_warning (MousepadWindow *window)
                            "widget\"MousepadWindow.*.root-warning\"style\"mousepad-window-root-style\"\n"
                            "widget\"MousepadWindow.*.root-warning.GtkLabel\"style\"mousepad-window-root-style\"\n");
 
+#if GTK_CHECK_VERSION(3, 0, 0) && defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
+
       /* add the box for the root warning */
       ebox = gtk_event_box_new ();
       gtk_widget_set_name (ebox, "root-warning");
@@ -885,7 +895,7 @@ mousepad_window_create_root_warning (MousepadWindow *window)
       gtk_container_add (GTK_CONTAINER (ebox), label);
       gtk_widget_show (label);
 
-      separator = gtk_hseparator_new ();
+      separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
       gtk_box_pack_start (GTK_BOX (window->box), separator, FALSE, FALSE, 0);
       gtk_widget_show (separator);
     }
@@ -1056,7 +1066,7 @@ mousepad_window_init (MousepadWindow *window)
   gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
 
   /* create the main table */
-  window->box = gtk_vbox_new (FALSE, 0);
+  window->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_container_add (GTK_CONTAINER (window), window->box);
   gtk_widget_show (window->box);
 
@@ -1321,8 +1331,6 @@ mousepad_window_save_geometry_timer (gpointer user_data)
   MousepadWindow  *window = MOUSEPAD_WINDOW (user_data);
   gboolean         remember_size, remember_position, remember_state;
 
-  GDK_THREADS_ENTER ();
-
   /* check if we should remember the window geometry */
   remember_size = MOUSEPAD_SETTING_GET_BOOLEAN (REMEMBER_SIZE);
   remember_position = MOUSEPAD_SETTING_GET_BOOLEAN (REMEMBER_POSITION);
@@ -1373,8 +1381,6 @@ mousepad_window_save_geometry_timer (gpointer user_data)
         }
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -2765,8 +2771,6 @@ mousepad_window_update_gomenu_idle (gpointer user_data)
 
   g_return_val_if_fail (MOUSEPAD_IS_WINDOW (user_data), FALSE);
 
-  GDK_THREADS_ENTER ();
-
   /* get the window */
   window = MOUSEPAD_WINDOW (user_data);
 
@@ -2841,8 +2845,6 @@ mousepad_window_update_gomenu_idle (gpointer user_data)
   /* release our lock */
   lock_menu_updates--;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -2966,8 +2968,6 @@ mousepad_window_recent_menu_idle (gpointer user_data)
   gchar           name[32];
   gint            n, i;
 
-  GDK_THREADS_ENTER ();
-
   if (window->recent_merge_id != 0)
     {
       /* unmerge the ui controls from the previous update */
@@ -3081,8 +3081,6 @@ mousepad_window_recent_menu_idle (gpointer user_data)
   g_list_free (items);
   g_list_free (filtered);
 
-  GDK_THREADS_LEAVE ();
-
   /* stop the idle function */
   return FALSE;
 }
@@ -3510,7 +3508,7 @@ mousepad_window_paste_history_menu_item (const gchar *text,
   item = gtk_menu_item_new ();
 
   /* create a hbox */
-  hbox = gtk_hbox_new (FALSE, 14);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 14);
   gtk_container_add (GTK_CONTAINER (item), hbox);
   gtk_widget_show (hbox);
 
@@ -3793,7 +3791,7 @@ mousepad_window_action_open (GtkAction      *action,
   gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), TRUE);
 
   /* encoding selector */
-  hbox = gtk_hbox_new (FALSE, 6);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
   gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (chooser), hbox);
   gtk_widget_show (hbox);
@@ -4871,15 +4869,14 @@ mousepad_window_action_select_font (GtkAction      *action,
   g_return_if_fail (MOUSEPAD_IS_WINDOW (window));
   g_return_if_fail (MOUSEPAD_IS_DOCUMENT (window->active));
 
-  dialog = gtk_font_selection_dialog_new (_("Choose Mousepad Font"));
-  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+  dialog = gtk_font_chooser_dialog_new (_("Choose Mousepad Font"), GTK_WINDOW (window));
 
   /* set the current font name */
   font_name = MOUSEPAD_SETTING_GET_STRING (FONT_NAME);
 
   if (G_LIKELY (font_name))
     {
-      gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (dialog), font_name);
+      gtk_font_chooser_dialog_set_font_name (GTK_FONT_CHOOSER_DIALOG (dialog), font_name);
       g_free (font_name);
     }
 
@@ -4887,7 +4884,7 @@ mousepad_window_action_select_font (GtkAction      *action,
   if (G_LIKELY (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK))
     {
       /* get the selected font from the dialog */
-      font_name = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (dialog));
+      font_name = gtk_font_chooser_dialog_get_font_name (GTK_FONT_CHOOSER_DIALOG (dialog));
 
       /* store the font in the preferences */
       MOUSEPAD_SETTING_SET_STRING (FONT_NAME, font_name);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list