remove GTK1 code

svn path=/trunk/; revision=24810
This commit is contained in:
Ulf Lamping 2008-04-06 22:25:36 +00:00
parent 2f39b20003
commit 6bd3a882ee
2 changed files with 17 additions and 97 deletions

View File

@ -811,11 +811,7 @@ capture_remote_cb(GtkWidget *w _U_, gpointer d _U_)
"Null authentication");
gtk_box_pack_start(GTK_BOX(auth_vb), auth_null_rb, TRUE, TRUE, 0);
#if GTK_MAJOR_VERSION >= 2
auth_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(auth_null_rb));
#else
auth_group = gtk_radio_button_group(GTK_RADIO_BUTTON(auth_null_rb));
#endif
auth_passwd_rb = gtk_radio_button_new_with_label(auth_group,
"Password authentication");
gtk_box_pack_start(GTK_BOX(auth_vb), auth_passwd_rb, TRUE, TRUE, 0);
@ -919,11 +915,9 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
*m_resolv_cb, *n_resolv_cb, *t_resolv_cb,
*bbox, *ok_bt, *cancel_bt,
*help_bt;
#if GTK_MAJOR_VERSION >= 2 /* For some reason this button's action crashes under GTK 1. */
#ifdef HAVE_AIRPCAP
GtkWidget *advanced_hb, *advanced_bt;
#endif
#endif
#ifdef HAVE_PCAP_REMOTE
GtkWidget *iftype_om, *nocap_rpcap_cb, *datatx_udp_cb;
#ifdef HAVE_PCAP_SETSAMPLING
@ -933,9 +927,6 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
GtkAdjustment *samp_count_adj, *samp_timer_adj;
GSList *samp_group;
#endif
#endif
#if GTK_MAJOR_VERSION < 2
GtkAccelGroup *accel_group;
#endif
GtkTooltips *tooltips;
GtkAdjustment *snap_adj, *ringbuffer_nbf_adj,
@ -1018,14 +1009,6 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
tooltips = gtk_tooltips_new();
#if GTK_MAJOR_VERSION < 2
/* Accelerator group for the accelerators (or, as they're called in
Windows and, I think, in Motif, "mnemonics"; Alt+<key> is a mnemonic,
Ctrl+<key> is an accelerator). */
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(cap_open_w), accel_group);
#endif
main_vb = gtk_vbox_new(FALSE, 0);
gtk_container_border_width(GTK_CONTAINER(main_vb), 5);
gtk_container_add(GTK_CONTAINER(cap_open_w), main_vb);
@ -1254,7 +1237,6 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
OBJECT_SET_DATA(filter_bt, E_FILT_TE_PTR_KEY, filter_te);
/* advanced row */
#if GTK_MAJOR_VERSION >= 2 /* For some reason this button's action crashes under GTK 1. */
#ifdef HAVE_AIRPCAP
advanced_hb = gtk_hbox_new(FALSE,5);
gtk_box_pack_start(GTK_BOX(capture_vb), advanced_hb, FALSE, FALSE, 0);
@ -1262,13 +1244,8 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
advanced_bt = gtk_button_new_with_label("Wireless Settings");
/* set the text */
#if GTK_MAJOR_VERSION >= 2
/* XXX - find a way to set the GtkButton label in GTK 2.x */
gtk_button_set_label(GTK_BUTTON(advanced_bt), "Wireless Settings");
#else
/* Set the GtkButton label in GTK 1.x */
gtk_label_set_text(GTK_LABEL(GTK_BIN(advanced_bt)->child), "Wireless Settings");
#endif
/* Both the callback and the data are global */
SIGNAL_CONNECT(advanced_bt,"clicked",options_airpcap_advanced_cb,airpcap_tb);
@ -1287,7 +1264,6 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_box_pack_start(GTK_BOX(linktype_hb),advanced_bt,FALSE,FALSE,0);
gtk_widget_show(advanced_bt);
gtk_widget_show(advanced_hb);
#endif
#endif
/* Capture file-related options frame */
@ -1543,11 +1519,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_table_attach_defaults(GTK_TABLE(sampling_tb), samp_none_rb, 0, 1, 0, 1);
/* "Sampling by counter" row */
#if GTK_MAJOR_VERSION >= 2
samp_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(samp_none_rb));
#else
samp_group = gtk_radio_button_group(GTK_RADIO_BUTTON(samp_none_rb));
#endif
samp_count_rb = gtk_radio_button_new_with_label(samp_group, "1 of");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(samp_none_rb),
(capture_opts->sampling_method == CAPTURE_SAMP_BY_COUNT));
@ -1567,11 +1539,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_table_attach_defaults(GTK_TABLE(sampling_tb), sampling_lb, 2, 3, 1, 2);
/* "Sampling by timer" row */
#if GTK_MAJOR_VERSION >= 2
samp_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(samp_count_rb));
#else
samp_group = gtk_radio_button_group(GTK_RADIO_BUTTON(samp_count_rb));
#endif
samp_timer_rb = gtk_radio_button_new_with_label(samp_group, "1 every");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(samp_none_rb),
(capture_opts->sampling_method == CAPTURE_SAMP_BY_TIMER));
@ -1893,9 +1861,7 @@ select_link_type_cb(GtkWidget *w, gpointer data)
if (old_linktype != new_linktype) {
OBJECT_SET_DATA(linktype_om, E_CAP_OM_LT_VALUE_KEY, GINT_TO_POINTER(new_linktype));
capture_opts->linktype = GPOINTER_TO_INT(OBJECT_GET_DATA(linktype_om, E_CAP_OM_LT_VALUE_KEY));
#if GTK_MAJOR_VERSION >= 2
linktype_history=MAX(gtk_option_menu_get_history(GTK_OPTION_MENU(linktype_om)), 0);
#endif
}
}

View File

@ -65,7 +65,7 @@
#include <unistd.h>
#endif
#if GTK_MAJOR_VERSION >= 2 && _WIN32
#if _WIN32
#include <gdk/gdkwin32.h>
#include <windows.h>
#include "win32-file-dlg.h"
@ -427,14 +427,11 @@ static GtkWidget *file_open_w;
static void
file_open_cmd(GtkWidget *w)
{
#if GTK_MAJOR_VERSION >= 2 && _WIN32
#if _WIN32
win32_open_file(GDK_WINDOW_HWND(top_level->window));
#else /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#else /* _WIN32 */
GtkWidget *main_hb, *main_vb, *filter_hbox, *filter_bt, *filter_te,
*m_resolv_cb, *n_resolv_cb, *t_resolv_cb, *prev;
#if GTK_MAJOR_VERSION < 2
GtkAccelGroup *accel_group;
#endif
GtkTooltips *tooltips = gtk_tooltips_new();
/* No Apply button, and "OK" just sets our text widget, it doesn't
activate it (i.e., it doesn't cause us to try to open the file). */
@ -461,14 +458,6 @@ file_open_cmd(GtkWidget *w)
gtk_window_set_default_size(GTK_WINDOW(file_open_w), DEF_WIDTH, DEF_HEIGHT);
#endif
#if GTK_MAJOR_VERSION < 2
/* Accelerator group for the accelerators (or, as they're called in
Windows and, I think, in Motif, "mnemonics"; Alt+<key> is a mnemonic,
Ctrl+<key> is an accelerator). */
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(file_open_w), accel_group);
#endif
switch (prefs.gui_fileopen_style) {
case FO_STYLE_LAST_OPENED:
@ -608,7 +597,7 @@ file_open_cmd(GtkWidget *w)
gtk_widget_show(file_open_w);
window_present(file_open_w);
#endif /* (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 */
#endif /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#endif /* _WIN32 */
}
static void file_open_answered_cb(gpointer dialog _U_, gint btn, gpointer data _U_)
@ -770,17 +759,14 @@ static GtkWidget *file_merge_w;
static void
file_merge_cmd(GtkWidget *w)
{
#if GTK_MAJOR_VERSION >= 2 && _WIN32
#if _WIN32
win32_merge_file(GDK_WINDOW_HWND(top_level->window));
packet_list_freeze();
packet_list_thaw();
#else /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#else /* _WIN32 */
GtkWidget *main_hb, *main_vb, *ft_hb, *ft_lb, *filter_hbox,
*filter_bt, *filter_te, *prepend_rb, *chrono_rb,
*append_rb, *prev;
#if GTK_MAJOR_VERSION < 2
GtkAccelGroup *accel_group;
#endif
GtkTooltips *tooltips = gtk_tooltips_new();
/* No Apply button, and "OK" just sets our text widget, it doesn't
activate it (i.e., it doesn't cause us to try to open the file). */
@ -810,14 +796,6 @@ file_merge_cmd(GtkWidget *w)
gtk_window_set_default_size(GTK_WINDOW(file_merge_w), DEF_WIDTH, DEF_HEIGHT);
#endif
#if GTK_MAJOR_VERSION < 2
/* Accelerator group for the accelerators (or, as they're called in
Windows and, I think, in Motif, "mnemonics"; Alt+<key> is a mnemonic,
Ctrl+<key> is an accelerator). */
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(file_merge_w), accel_group);
#endif
switch (prefs.gui_fileopen_style) {
case FO_STYLE_LAST_OPENED:
@ -977,7 +955,7 @@ file_merge_cmd(GtkWidget *w)
gtk_widget_show(file_merge_w);
window_present(file_merge_w);
#endif /* (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 */
#endif /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#endif /* _WIN32 */
}
static void file_merge_answered_cb(gpointer dialog _U_, gint btn, gpointer data _U_)
@ -1288,16 +1266,12 @@ gpointer action_after_save_data_g;
void
file_save_as_cmd(action_after_save_e action_after_save, gpointer action_after_save_data)
{
#if GTK_MAJOR_VERSION >= 2 && _WIN32
#if _WIN32
win32_save_as_file(GDK_WINDOW_HWND(top_level->window), action_after_save, action_after_save_data);
#else /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#else /* _WIN32 */
GtkWidget *main_vb, *ft_hb, *ft_lb, *range_fr, *compressed_cb;
GtkTooltips *tooltips;
#if GTK_MAJOR_VERSION < 2
GtkAccelGroup *accel_group;
#endif
if (file_save_as_w != NULL) {
/* There's already an "Save Capture File As" dialog box; reactivate it. */
reactivate_window(file_save_as_w);
@ -1322,11 +1296,6 @@ file_save_as_cmd(action_after_save_e action_after_save, gpointer action_after_sa
action_after_save_g = action_after_save;
action_after_save_data_g = action_after_save_data;
#if GTK_MAJOR_VERSION < 2
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(file_save_as_w), accel_group);
#endif
/* Container for each row of widgets */
main_vb = gtk_vbox_new(FALSE, 5);
@ -1340,11 +1309,7 @@ file_save_as_cmd(action_after_save_e action_after_save, gpointer action_after_sa
gtk_widget_show(range_fr);
/* range table */
range_tb = range_new(&range
#if GTK_MAJOR_VERSION < 2
, accel_group
#endif
);
range_tb = range_new(&range);
gtk_container_add(GTK_CONTAINER(range_fr), range_tb);
gtk_widget_show(range_tb);
@ -1400,7 +1365,7 @@ file_save_as_cmd(action_after_save_e action_after_save, gpointer action_after_sa
gtk_widget_show(file_save_as_w);
window_present(file_save_as_w);
#endif /* (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 */
#endif /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#endif /* _WIN32 */
}
void
@ -1668,13 +1633,10 @@ color_global_cb(GtkWidget *widget _U_, gpointer data)
void
file_color_import_cmd_cb(GtkWidget *color_filters, gpointer filter_list _U_)
{
#if GTK_MAJOR_VERSION >= 2 && _WIN32
#if _WIN32
win32_import_color_file(GDK_WINDOW_HWND(top_level->window), color_filters);
#else /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#else /* _WIN32 */
GtkWidget *main_vb, *cfglobal_but;
#if GTK_MAJOR_VERSION < 2
GtkAccelGroup *accel_group;
#endif
/* No Apply button, and "OK" just sets our text widget, it doesn't
activate it (i.e., it doesn't cause us to try to open the file). */
@ -1688,14 +1650,6 @@ file_color_import_cmd_cb(GtkWidget *color_filters, gpointer filter_list _U_)
file_color_import_w = file_selection_new("Wireshark: Import Color Filters",
FILE_SELECTION_OPEN);
#if GTK_MAJOR_VERSION < 2
/* Accelerator group for the accelerators (or, as they're called in
Windows and, I think, in Motif, "mnemonics"; Alt+<key> is a mnemonic,
Ctrl+<key> is an accelerator). */
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(file_color_import_w), accel_group);
#endif
/* Container for each row of widgets */
main_vb = gtk_vbox_new(FALSE, 3);
gtk_container_border_width(GTK_CONTAINER(main_vb), 5);
@ -1732,7 +1686,7 @@ file_color_import_cmd_cb(GtkWidget *color_filters, gpointer filter_list _U_)
gtk_widget_show(file_color_import_w);
window_present(file_color_import_w);
#endif /* (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 */
#endif /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#endif /* _WIN32 */
}
static void
@ -1832,9 +1786,9 @@ color_toggle_selected_cb(GtkWidget *widget, gpointer data _U_)
void
file_color_export_cmd_cb(GtkWidget *w _U_, gpointer filter_list)
{
#if GTK_MAJOR_VERSION >= 2 && _WIN32
#if _WIN32
win32_export_color_file(GDK_WINDOW_HWND(top_level->window), filter_list);
#else /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#else /* _WIN32 */
GtkWidget *main_vb, *cfglobal_but;
if (file_color_export_w != NULL) {
@ -1893,7 +1847,7 @@ file_color_export_cmd_cb(GtkWidget *w _U_, gpointer filter_list)
gtk_widget_show(file_color_export_w);
window_present(file_color_export_w);
#endif /* (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 */
#endif /* GTK_MAJOR_VERSION >= 2 && _WIN32 */
#endif /* _WIN32 */
}
static void