Replace deprecated functions.
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 24 Jul 2011 17:25:52 +0000 (17:25 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 24 Jul 2011 17:25:52 +0000 (17:25 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38186 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/main_filter_toolbar.c
gtk/manual_addr_resolv.c
gtk/new_packet_list.c
gtk/pixmap_save.c
gtk/prefs_capture.c
gtk/prefs_column.c
gtk/prefs_dlg.c
gtk/prefs_stream.c

index e37aa22b672ce421514d4d001351189730ac05a4..52855c44b662ca9e7e273b094009a329dcc04865 100644 (file)
@@ -34,6 +34,7 @@
 #include <string.h>
 
 #include <gtk/gtk.h>
+#include "gtk/old-gtk-compat.h"
 
 #include "filter_dlg.h"
 #include "filter_autocomplete.h"
@@ -50,7 +51,6 @@
 #include "main_toolbar.h"
 #include "main_filter_toolbar.h"
 
-#include "gtk/old-gtk-compat.h"
 
 GtkWidget   *main_display_filter_widget=NULL;
 
@@ -124,7 +124,7 @@ GtkWidget *filter_toolbar_new(void)
        gtk_widget_set_tooltip_text( GTK_WIDGET(filter_bt), "Open the \"Display Filter\" dialog, to edit/apply filters");
 
     /* Create the filter combobox */
-    filter_cm = gtk_combo_box_entry_new_text ();
+    filter_cm = gtk_combo_box_text_new_with_entry ();
     filter_te = gtk_bin_get_child(GTK_BIN(filter_cm));
     main_display_filter_widget=filter_te;
     g_object_set_data(G_OBJECT(filter_bt), E_FILT_TE_PTR_KEY, filter_te);
@@ -319,7 +319,7 @@ dfilter_combo_add(GtkWidget *filter_cm, char *s) {
     int index;
 
     if(!dfilter_entry_match(filter_cm,s, &index))
-        gtk_combo_box_append_text(GTK_COMBO_BOX(filter_cm), s);
+         gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(filter_cm), s);
     g_free(s);
 
     return TRUE;
@@ -391,11 +391,11 @@ main_filter_packets(capture_file *cf, const gchar *dftext, gboolean force)
         int index;
 
         if(!dfilter_entry_match(filter_cm,s, &index)){
-            gtk_combo_box_prepend_text(GTK_COMBO_BOX(filter_cm), s);
+            gtk_combo_box_text_prepend_text(GTK_COMBO_BOX_TEXT(filter_cm), s);
             index++;
         }
         while ((guint)index >= prefs.gui_recent_df_entries_max){
-            gtk_combo_box_remove_text(GTK_COMBO_BOX(filter_cm), index);
+            gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(filter_cm), index);
             index--;
         }
     }
index 43b58b651cbc291dbfc3d0863071beb29a9426e7..ca9ce892afe24ad76775db55ed1e5e4a0a46fb4b 100644 (file)
@@ -43,6 +43,7 @@
 #include "gtk/main.h"
 #include "gtk/menus.h"
 #include "gtk/manual_addr_resolv.h"
+#include "gtk/old-gtk-compat.h"
 
 GtkWidget *man_addr_resolv_dlg = NULL;
 
@@ -61,7 +62,7 @@ man_addr_resolv_ok (GtkWidget *w _U_, gpointer data _U_)
   addr_cb = g_object_get_data (G_OBJECT(man_addr_resolv_dlg), "address");
   name_te = g_object_get_data (G_OBJECT(man_addr_resolv_dlg), "name");
 
-  addr = gtk_combo_box_get_active_text (GTK_COMBO_BOX(addr_cb));
+  addr = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(addr_cb));
   name = gtk_entry_get_text (GTK_ENTRY (name_te));
 
   if (strlen (addr) && strlen (name)) {
@@ -119,12 +120,12 @@ manual_addr_resolv_dlg (GtkWidget *w _U_, gpointer data)
   addr_lb = gtk_label_new("Address:");
   gtk_table_attach_defaults (GTK_TABLE (table), addr_lb, 0, 1, 0, 1);
 
-  addr_cb = gtk_combo_box_entry_new_text();
+  addr_cb = gtk_combo_box_text_new_with_entry();
   if (data) {
     GList *addr_entry;
     addr_list = get_ip_address_list_from_packet_list_row(data);
     for (addr_entry = addr_list; addr_entry != NULL; addr_entry = g_list_next (addr_entry)) {
-      gtk_combo_box_append_text(GTK_COMBO_BOX(addr_cb), addr_entry->data);
+      gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(addr_cb), addr_entry->data);
     }
     gtk_combo_box_set_active (GTK_COMBO_BOX(addr_cb), 0);
   }
index 986f88d7cc4071c56c9a97ae174623a4ab0187b3..9fe7d55258c72c053ca972386aa6021ba69ac980 100644 (file)
@@ -357,9 +357,9 @@ col_details_edit_dlg (gint col_id, GtkTreeViewColumn *col)
        gtk_misc_set_alignment(GTK_MISC(label), 1.0f, 0.5f);
        gtk_widget_set_tooltip_text(label, "Select which packet information to present in the column.");
 
-       format_cmb = gtk_combo_box_new_text();
+       format_cmb = gtk_combo_box_text_new();
        for (i = 0; i < NUM_COL_FMTS; i++) {
-         gtk_combo_box_append_text(GTK_COMBO_BOX(format_cmb), col_format_desc(i));
+          gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(format_cmb), col_format_desc(i));
        }
        g_signal_connect(format_cmb, "changed", G_CALLBACK(col_details_format_changed_cb), NULL);
        gtk_table_attach_defaults(GTK_TABLE(main_tb), format_cmb, 1, 2, 1, 2);
index de73edfa5c839844d79bcf3916e0815dc6931d52..71aaf5024c59effc93eabd6ee9e3b2401d889fb0 100644 (file)
@@ -60,7 +60,7 @@ pixbuf_save_button_cb(GtkWidget *save_as_w_lcl, GdkPixbuf *pixbuf)
 
        filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(save_as_w_lcl));
        type_cm = g_object_get_data(G_OBJECT(save_as_w_lcl), "type_cm");
-       file_type = gtk_combo_box_get_active_text(GTK_COMBO_BOX(type_cm));
+       file_type = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(type_cm));
 
        /* Perhaps the user specified a directory instead of a file.
           Check whether they did. */
@@ -142,7 +142,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
        gtk_box_pack_start(GTK_BOX(save_as_type_hb), type_lb, FALSE, FALSE, 0);
        gtk_widget_show(type_lb);
 
-       type_cm = gtk_combo_box_new_text();
+       type_cm = gtk_combo_box_text_new();
        gtk_box_pack_start(GTK_BOX(save_as_type_hb), type_cm, FALSE, FALSE, 0);
 
        /* List all of the file formats the gdk-pixbuf library supports */
@@ -152,7 +152,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
                pixbuf_format = ffp->data;
                if (gdk_pixbuf_format_is_writable(pixbuf_format)) {
                        format_name = gdk_pixbuf_format_get_name(pixbuf_format);
-                       gtk_combo_box_append_text(GTK_COMBO_BOX(type_cm),
+                        gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(type_cm),
                                                  format_name);
                        if (!(g_ascii_strcasecmp(format_name, "png")))
                                default_index = format_index;
index 43c21868fa185bf15eb59e1827c0ec6420487317..7c704732a721776a2ba5cb2998c98dffa9be6d2d 100644 (file)
@@ -45,6 +45,7 @@
 #include "gtk/main_welcome.h"
 #include "gtk/help_dlg.h"
 #include "gtk/stock_icons.h"
+#include "gtk/old-gtk-compat.h"
 #include <epan/strutil.h>
 
 
@@ -123,7 +124,7 @@ capture_prefs_show(void)
        gtk_misc_set_alignment(GTK_MISC(if_lb), 1.0f, 0.5f);
        gtk_widget_show(if_lb);
 
-       if_cbxe = gtk_combo_box_entry_new_text();
+       if_cbxe = gtk_combo_box_text_new_with_entry();
        /*
         * XXX - what if we can't get the list?
         */
@@ -133,7 +134,7 @@ capture_prefs_show(void)
        if (combo_list != NULL) {
                GList *combo_entry;
                for (combo_entry = combo_list; combo_entry != NULL; combo_entry = g_list_next(combo_entry)) {
-                               gtk_combo_box_append_text(GTK_COMBO_BOX(if_cbxe), combo_entry->data);
+                                gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(if_cbxe), combo_entry->data);
                }
        }
        if (prefs.capture_device) {
@@ -535,7 +536,7 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
        gtk_misc_set_alignment(GTK_MISC(if_linktype_lb), 1.0f, 0.5f);
        gtk_widget_show(if_linktype_lb);
 
-       if_linktype_cb = gtk_combo_box_new_text();
+       if_linktype_cb = gtk_combo_box_text_new();
        num_linktypes = 0;
        interfaces_info_nochange = FALSE;
        g_signal_connect(if_linktype_cb, "changed", G_CALLBACK(ifopts_edit_linktype_changed_cb),
@@ -733,7 +734,7 @@ ifopts_edit_ifsel_cb(GtkTreeSelection       *selection _U_,
         /*  -- remove old linktype list (if any) from the ComboBox */
        while (num_linktypes > 0) {
                num_linktypes--;
-               gtk_combo_box_remove_text (GTK_COMBO_BOX(if_linktype_cb), num_linktypes);
+               gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(if_linktype_cb), num_linktypes);
        }
 
         /*
@@ -761,7 +762,7 @@ ifopts_edit_ifsel_cb(GtkTreeSelection       *selection _U_,
                                if (strcmp(linktype, text) == 0) {
                                        selected = num_linktypes;
                                }
-                               gtk_combo_box_append_text(GTK_COMBO_BOX(if_linktype_cb), text);
+                                gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(if_linktype_cb), text);
                                num_linktypes++;
                        }
                        gtk_widget_set_sensitive(if_linktype_lb, num_linktypes >= 2);
@@ -828,7 +829,7 @@ ifopts_edit_monitor_changed_cb(GtkToggleButton *tbt, gpointer udata)
         /*  -- remove old linktype list (if any) from the ComboBox */
        while (num_linktypes > 0) {
                num_linktypes--;
-               gtk_combo_box_remove_text (GTK_COMBO_BOX(if_linktype_cb), num_linktypes);
+               gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(if_linktype_cb), num_linktypes);
        }
 
        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (udata))); /* Get store */
@@ -861,7 +862,7 @@ ifopts_edit_monitor_changed_cb(GtkToggleButton *tbt, gpointer udata)
                            lt_entry = g_list_next(lt_entry)) {
                                data_link_info_t *dli_p = lt_entry->data;
                                text = (dli_p->description != NULL) ? dli_p->description : dli_p->name;
-                               gtk_combo_box_append_text(GTK_COMBO_BOX(if_linktype_cb), text);
+                                gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(if_linktype_cb), text);
                                num_linktypes++;
                        }
                        gtk_widget_set_sensitive(if_linktype_lb, num_linktypes >= 2);
@@ -917,7 +918,7 @@ ifopts_edit_linktype_changed_cb(GtkComboBox *cb, gpointer udata)
                -1);
 
        /* get current description text and set value in list_store for currently selected interface */
-       text = gtk_combo_box_get_active_text(cb);
+       text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(cb));
        if (text) {
 #ifdef HAVE_PCAP_CREATE
                linktype = ifopts_description_to_val(ifnm, monitor_mode, text);
index 8c69bfedebdbf2f8cabc959ad1f001963637ba24..cce743b63021a70bbf63e6f8ffcf5332fa01bb81 100644 (file)
@@ -43,7 +43,7 @@
 #include "gtk/new_packet_list.h"
 #include "gtk/filter_dlg.h"
 #include "gtk/filter_autocomplete.h"
-
+#include "gtk/old-gtk-compat.h"
 
 static GtkWidget *remove_bt, *field_te, *field_lb, *occurrence_te, *occurrence_lb, *fmt_cmb;
 static gulong column_menu_changed_handler_id;
@@ -311,10 +311,10 @@ column_prefs_show(GtkWidget *prefs_window) {
                           "0=all (default), 1=first, 2=second, ..., -1=last.");
     gtk_widget_show(occurrence_te);
 
-    fmt_cmb = gtk_combo_box_new_text();
+    fmt_cmb = gtk_combo_box_text_new();
 
     for (i = 0; i < NUM_COL_FMTS; i++)
-        gtk_combo_box_append_text(GTK_COMBO_BOX(fmt_cmb), col_format_desc(i));
+         gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(fmt_cmb), col_format_desc(i));
 
     column_menu_changed_handler_id = g_signal_connect(fmt_cmb, "changed", G_CALLBACK(column_menu_changed_cb), column_l);
 
index ba37c8700d117e65ed9b2d9ec9c85f138bf58b41..6dae47ff5462b5ccbdd36034483954df9ce8eaaa 100644 (file)
@@ -57,7 +57,7 @@
 #include "gtk/help_dlg.h"
 #include "gtk/keys.h"
 #include "gtk/uat_gui.h"
-
+#include "gtk/old-gtk-compat.h"
 
 #ifdef HAVE_LIBPCAP
 #ifdef _WIN32
@@ -787,13 +787,13 @@ create_preference_option_menu(GtkWidget *main_tb, int table_position,
   set_option_label(main_tb, table_position, label_text, tooltip_text);
 
   /* Create a menu from the enumvals */
-  combo_box = gtk_combo_box_new_text ();
+  combo_box = gtk_combo_box_text_new();
   if (tooltip_text != NULL)
     gtk_widget_set_tooltip_text(combo_box, tooltip_text);
   menu_idx = 0;
   for (enum_valp = enumvals, idx = 0; enum_valp->name != NULL;
        enum_valp++, idx++) {
-    gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), enum_valp->description);
+     gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), enum_valp->description);
     if (enum_valp->value == current_val)
       menu_idx = idx;
   }
index 64449234e3a2337032dd57afacbd734e7b841172..74f49f2922daca63905152af1cd47fd6da7148d1 100644 (file)
@@ -37,7 +37,7 @@
 #include "gtk/prefs_stream.h"
 #include "gtk/keys.h"
 #include "gtk/follow_tcp.h"
-
+#include "gtk/old-gtk-compat.h"
 
 #define SAMPLE_MARKED_TEXT  "Sample marked packet text\n"
 #define SAMPLE_IGNORED_TEXT "Sample ignored packet text\n"
@@ -114,9 +114,9 @@ stream_prefs_show(void)
   /* We have to create this now, and configure it below. */
   colorsel = gtk_color_selection_new();
 
-  combo_box = gtk_combo_box_new_text ();
+  combo_box = gtk_combo_box_text_new();
   for (i = 0; i < mcount; i++){
-         gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), mt[i]);
+          gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), mt[i]);
   }
   gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), CFG_IDX);
   g_signal_connect(combo_box, "changed", G_CALLBACK(update_current_color), colorsel);