using button compatibility macros

svn path=/trunk/; revision=9633
This commit is contained in:
Ulf Lamping 2004-01-10 14:11:58 +00:00
parent 02d575db13
commit b9cde84cac
4 changed files with 82 additions and 321 deletions

View File

@ -1,7 +1,7 @@
/* capture_dlg.c /* capture_dlg.c
* Routines for packet capture windows * Routines for packet capture windows
* *
* $Id: capture_dlg.c,v 1.91 2003/12/23 00:16:45 ulfl Exp $ * $Id: capture_dlg.c,v 1.92 2004/01/10 14:11:57 ulfl Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -370,12 +370,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_container_add(GTK_CONTAINER(capture_vb), snap_hb); gtk_container_add(GTK_CONTAINER(capture_vb), snap_hb);
gtk_widget_show(snap_hb); gtk_widget_show(snap_hb);
#if GTK_MAJOR_VERSION < 2 snap_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC("_Limit each packet to", accel_group);
snap_cb = dlg_check_button_new_with_label_with_mnemonic(
"_Limit each packet to", accel_group);
#else
snap_cb = gtk_check_button_new_with_mnemonic("_Limit each packet to");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(snap_cb), gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(snap_cb),
capture_opts.has_snaplen); capture_opts.has_snaplen);
SIGNAL_CONNECT(snap_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w); SIGNAL_CONNECT(snap_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
@ -396,13 +391,8 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_widget_show(snap_lb); gtk_widget_show(snap_lb);
/* Promiscuous mode row */ /* Promiscuous mode row */
#if GTK_MAJOR_VERSION < 2 promisc_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC(
promisc_cb = dlg_check_button_new_with_label_with_mnemonic(
"Capture packets in _promiscuous mode", accel_group); "Capture packets in _promiscuous mode", accel_group);
#else
promisc_cb = gtk_check_button_new_with_mnemonic(
"Capture packets in _promiscuous mode");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(promisc_cb), gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(promisc_cb),
capture_opts.promisc_mode); capture_opts.promisc_mode);
gtk_container_add(GTK_CONTAINER(capture_vb), promisc_cb); gtk_container_add(GTK_CONTAINER(capture_vb), promisc_cb);
@ -454,12 +444,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_container_add(GTK_CONTAINER(file_vb), ringbuffer_hb); gtk_container_add(GTK_CONTAINER(file_vb), ringbuffer_hb);
gtk_widget_show(ringbuffer_hb); gtk_widget_show(ringbuffer_hb);
#if GTK_MAJOR_VERSION < 2 ringbuffer_on_tb = CHECK_BUTTON_NEW_WITH_MNEMONIC("Use _ring buffer", accel_group);
ringbuffer_on_tb = dlg_check_button_new_with_label_with_mnemonic(
"Use _ring buffer", accel_group);
#else
ringbuffer_on_tb = gtk_check_button_new_with_mnemonic("Use _ring buffer");
#endif
/* Ring buffer mode is allowed only if we're not doing an "Update list of /* Ring buffer mode is allowed only if we're not doing an "Update list of
packets in real time" capture, so force it off if we're doing such packets in real time" capture, so force it off if we're doing such
a capture. */ a capture. */
@ -524,13 +509,8 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_widget_show(display_vb); gtk_widget_show(display_vb);
/* "Update display in real time" row */ /* "Update display in real time" row */
#if GTK_MAJOR_VERSION < 2 sync_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC(
sync_cb = dlg_check_button_new_with_label_with_mnemonic(
"_Update list of packets in real time", accel_group); "_Update list of packets in real time", accel_group);
#else
sync_cb = gtk_check_button_new_with_mnemonic(
"_Update list of packets in real time");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sync_cb), gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sync_cb),
capture_opts.sync_mode); capture_opts.sync_mode);
SIGNAL_CONNECT(sync_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w); SIGNAL_CONNECT(sync_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
@ -538,13 +518,8 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_widget_show(sync_cb); gtk_widget_show(sync_cb);
/* "Auto-scroll live update" row */ /* "Auto-scroll live update" row */
#if GTK_MAJOR_VERSION < 2 auto_scroll_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC(
auto_scroll_cb = dlg_check_button_new_with_label_with_mnemonic(
"_Automatic scrolling in live capture", accel_group); "_Automatic scrolling in live capture", accel_group);
#else
auto_scroll_cb = gtk_check_button_new_with_mnemonic(
"_Automatic scrolling in live capture");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(auto_scroll_cb), auto_scroll_live); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(auto_scroll_cb), auto_scroll_live);
gtk_container_add(GTK_CONTAINER(display_vb), auto_scroll_cb); gtk_container_add(GTK_CONTAINER(display_vb), auto_scroll_cb);
gtk_widget_show(auto_scroll_cb); gtk_widget_show(auto_scroll_cb);
@ -642,37 +617,22 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_container_add(GTK_CONTAINER(resolv_fr), resolv_vb); gtk_container_add(GTK_CONTAINER(resolv_fr), resolv_vb);
gtk_widget_show(resolv_vb); gtk_widget_show(resolv_vb);
#if GTK_MAJOR_VERSION < 2 m_resolv_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC(
m_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
"Enable _MAC name resolution", accel_group); "Enable _MAC name resolution", accel_group);
#else
m_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _MAC name resolution");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(m_resolv_cb), gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(m_resolv_cb),
g_resolv_flags & RESOLV_MAC); g_resolv_flags & RESOLV_MAC);
gtk_container_add(GTK_CONTAINER(resolv_vb), m_resolv_cb); gtk_container_add(GTK_CONTAINER(resolv_vb), m_resolv_cb);
gtk_widget_show(m_resolv_cb); gtk_widget_show(m_resolv_cb);
#if GTK_MAJOR_VERSION < 2 n_resolv_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC(
n_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
"Enable _network name resolution", accel_group); "Enable _network name resolution", accel_group);
#else
n_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _network name resolution");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(n_resolv_cb), gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(n_resolv_cb),
g_resolv_flags & RESOLV_NETWORK); g_resolv_flags & RESOLV_NETWORK);
gtk_container_add(GTK_CONTAINER(resolv_vb), n_resolv_cb); gtk_container_add(GTK_CONTAINER(resolv_vb), n_resolv_cb);
gtk_widget_show(n_resolv_cb); gtk_widget_show(n_resolv_cb);
#if GTK_MAJOR_VERSION < 2 t_resolv_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC(
t_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
"Enable _transport name resolution", accel_group); "Enable _transport name resolution", accel_group);
#else
t_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _transport name resolution");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(t_resolv_cb), gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(t_resolv_cb),
g_resolv_flags & RESOLV_TRANSPORT); g_resolv_flags & RESOLV_TRANSPORT);
gtk_container_add(GTK_CONTAINER(resolv_vb), t_resolv_cb); gtk_container_add(GTK_CONTAINER(resolv_vb), t_resolv_cb);
@ -685,22 +645,14 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_container_add(GTK_CONTAINER(main_vb), bbox); gtk_container_add(GTK_CONTAINER(main_vb), bbox);
gtk_widget_show(bbox); gtk_widget_show(bbox);
#if GTK_MAJOR_VERSION < 2 ok_bt = BUTTON_NEW_FROM_STOCK(STOCK_OK);
ok_bt = gtk_button_new_with_label ("OK");
#else
ok_bt = gtk_button_new_from_stock(GTK_STOCK_OK);
#endif
SIGNAL_CONNECT(ok_bt, "clicked", capture_prep_ok_cb, cap_open_w); SIGNAL_CONNECT(ok_bt, "clicked", capture_prep_ok_cb, cap_open_w);
GTK_WIDGET_SET_FLAGS(ok_bt, GTK_CAN_DEFAULT); GTK_WIDGET_SET_FLAGS(ok_bt, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (bbox), ok_bt, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (bbox), ok_bt, TRUE, TRUE, 0);
gtk_widget_grab_default(ok_bt); gtk_widget_grab_default(ok_bt);
gtk_widget_show(ok_bt); gtk_widget_show(ok_bt);
#if GTK_MAJOR_VERSION < 2 cancel_bt = BUTTON_NEW_FROM_STOCK(STOCK_CANCEL);
cancel_bt = gtk_button_new_with_label ("Cancel");
#else
cancel_bt = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
#endif
SIGNAL_CONNECT(cancel_bt, "clicked", capture_prep_close_cb, cap_open_w); SIGNAL_CONNECT(cancel_bt, "clicked", capture_prep_close_cb, cap_open_w);
GTK_WIDGET_SET_FLAGS(cancel_bt, GTK_CAN_DEFAULT); GTK_WIDGET_SET_FLAGS(cancel_bt, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (bbox), cancel_bt, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (bbox), cancel_bt, TRUE, TRUE, 0);
@ -1194,17 +1146,17 @@ capture_prep_adjust_sensitivity(GtkWidget *tb _U_, gpointer parent_w)
gtk_label_set_text(GTK_LABEL(filesize_lb), "kilobyte(s) captured"); gtk_label_set_text(GTK_LABEL(filesize_lb), "kilobyte(s) captured");
} }
/* The maximum packet count spinbox is sensitive iff the "Stop capture /* The maximum packet count spinbox is sensitive if the "Stop capture
after N packets captured" checkbox is on. */ after N packets captured" checkbox is on. */
gtk_widget_set_sensitive(GTK_WIDGET(count_sb), gtk_widget_set_sensitive(GTK_WIDGET(count_sb),
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(count_cb))); gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(count_cb)));
/* The maximum file size spinbox is sensitive iff the "Stop capture /* The maximum file size spinbox is sensitive if the "Stop capture
after N kilobytes captured" checkbox is on. */ after N kilobytes captured" checkbox is on. */
gtk_widget_set_sensitive(GTK_WIDGET(filesize_sb), gtk_widget_set_sensitive(GTK_WIDGET(filesize_sb),
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filesize_cb))); gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filesize_cb)));
/* The capture duration spinbox is sensitive iff the "Stop capture /* The capture duration spinbox is sensitive if the "Stop capture
after N seconds" checkbox is on. */ after N seconds" checkbox is on. */
gtk_widget_set_sensitive(GTK_WIDGET(duration_sb), gtk_widget_set_sensitive(GTK_WIDGET(duration_sb),
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(duration_cb))); gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(duration_cb)));

View File

@ -1,7 +1,7 @@
/* color_dlg.c /* color_dlg.c
* Definitions for dialog boxes for color filters * Definitions for dialog boxes for color filters
* *
* $Id: color_dlg.c,v 1.30 2004/01/09 20:20:41 obiot Exp $ * $Id: color_dlg.c,v 1.31 2004/01/10 14:11:58 ulfl Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -240,7 +240,7 @@ colorize_dialog_new (char *filter)
gtk_widget_show (order_vbox); gtk_widget_show (order_vbox);
gtk_container_add(GTK_CONTAINER(order_fr), order_vbox); gtk_container_add(GTK_CONTAINER(order_fr), order_vbox);
color_filter_up = gtk_button_new_with_label (("Up")); color_filter_up = BUTTON_NEW_FROM_STOCK(STOCK_GO_UP);
gtk_widget_ref (color_filter_up); gtk_widget_ref (color_filter_up);
OBJECT_SET_DATA_FULL(color_win, "color_filter_up", color_filter_up, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_filter_up", color_filter_up, gtk_widget_unref);
WIDGET_SET_SIZE (color_filter_up, -1, 20); WIDGET_SET_SIZE (color_filter_up, -1, 20);
@ -255,7 +255,7 @@ colorize_dialog_new (char *filter)
gtk_widget_show (order_move_label); gtk_widget_show (order_move_label);
gtk_box_pack_start (GTK_BOX (order_vbox), order_move_label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (order_vbox), order_move_label, FALSE, FALSE, 0);
color_filter_down = gtk_button_new_with_label (("Down")); color_filter_down = BUTTON_NEW_FROM_STOCK(STOCK_GO_DOWN);
gtk_widget_ref (color_filter_down); gtk_widget_ref (color_filter_down);
OBJECT_SET_DATA_FULL(color_win, "color_filter_down", color_filter_down, OBJECT_SET_DATA_FULL(color_win, "color_filter_down", color_filter_down,
gtk_widget_unref); gtk_widget_unref);
@ -353,11 +353,7 @@ colorize_dialog_new (char *filter)
gtk_widget_show (button_edit_vbox); gtk_widget_show (button_edit_vbox);
gtk_container_add(GTK_CONTAINER(edit_fr), button_edit_vbox); gtk_container_add(GTK_CONTAINER(edit_fr), button_edit_vbox);
#if GTK_MAJOR_VERSION < 2 color_new = BUTTON_NEW_FROM_STOCK(STOCK_NEW);
color_new = gtk_button_new_with_label (("New..."));
#else
color_new = gtk_button_new_from_stock(GTK_STOCK_NEW);
#endif
gtk_widget_ref (color_new); gtk_widget_ref (color_new);
OBJECT_SET_DATA_FULL(color_win, "color_new", color_new, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_new", color_new, gtk_widget_unref);
gtk_widget_show (color_new); gtk_widget_show (color_new);
@ -378,11 +374,7 @@ colorize_dialog_new (char *filter)
gtk_tooltips_set_tip (tooltips, color_edit, ("Edit the selected filter"), NULL); gtk_tooltips_set_tip (tooltips, color_edit, ("Edit the selected filter"), NULL);
gtk_widget_set_sensitive (color_edit, FALSE); gtk_widget_set_sensitive (color_edit, FALSE);
#if GTK_MAJOR_VERSION < 2 color_delete = BUTTON_NEW_FROM_STOCK(STOCK_DELETE);
color_delete = gtk_button_new_with_label (("Delete"));
#else
color_delete = gtk_button_new_from_stock(GTK_STOCK_DELETE);
#endif
gtk_widget_ref (color_delete); gtk_widget_ref (color_delete);
OBJECT_SET_DATA_FULL(color_win, "color_delete", color_delete, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_delete", color_delete, gtk_widget_unref);
gtk_widget_show (color_delete); gtk_widget_show (color_delete);
@ -405,22 +397,14 @@ colorize_dialog_new (char *filter)
gtk_widget_show (okapply_vbox); gtk_widget_show (okapply_vbox);
gtk_box_pack_start (GTK_BOX (button_ok_hbox), okapply_vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (button_ok_hbox), okapply_vbox, TRUE, TRUE, 0);
#if GTK_MAJOR_VERSION < 2 color_ok = BUTTON_NEW_FROM_STOCK(STOCK_OK);
color_ok = gtk_button_new_with_label (("OK"));
#else
color_ok = gtk_button_new_from_stock(GTK_STOCK_OK);
#endif
gtk_widget_ref (color_ok); gtk_widget_ref (color_ok);
OBJECT_SET_DATA_FULL(color_win, "color_ok", color_ok, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_ok", color_ok, gtk_widget_unref);
gtk_widget_show (color_ok); gtk_widget_show (color_ok);
gtk_box_pack_start (GTK_BOX (okapply_vbox), color_ok, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (okapply_vbox), color_ok, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, color_ok, ("Accept filter list; apply changes"), NULL); gtk_tooltips_set_tip (tooltips, color_ok, ("Accept filter list; apply changes"), NULL);
#if GTK_MAJOR_VERSION < 2 color_apply = BUTTON_NEW_FROM_STOCK(STOCK_APPLY);
color_apply = gtk_button_new_with_label (("Apply"));
#else
color_apply = gtk_button_new_from_stock(GTK_STOCK_APPLY);
#endif
gtk_widget_ref (color_apply); gtk_widget_ref (color_apply);
OBJECT_SET_DATA_FULL(color_win, "color_apply", color_apply, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_apply", color_apply, gtk_widget_unref);
gtk_widget_show (color_apply); gtk_widget_show (color_apply);
@ -433,22 +417,14 @@ colorize_dialog_new (char *filter)
gtk_widget_show (saverevert_vbox); gtk_widget_show (saverevert_vbox);
gtk_box_pack_start (GTK_BOX (button_ok_hbox), saverevert_vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (button_ok_hbox), saverevert_vbox, TRUE, TRUE, 0);
#if GTK_MAJOR_VERSION < 2 color_save = BUTTON_NEW_FROM_STOCK(STOCK_SAVE);
color_save = gtk_button_new_with_label (("Save"));
#else
color_save = gtk_button_new_from_stock(GTK_STOCK_SAVE);
#endif
gtk_widget_ref(color_save); gtk_widget_ref(color_save);
OBJECT_SET_DATA_FULL(color_win, "color_save", color_save, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_save", color_save, gtk_widget_unref);
gtk_widget_show(color_save); gtk_widget_show(color_save);
gtk_box_pack_start(GTK_BOX (saverevert_vbox), color_save, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX (saverevert_vbox), color_save, FALSE, FALSE, 0);
gtk_tooltips_set_tip(tooltips, color_save, ("Save all filters to disk"), NULL); gtk_tooltips_set_tip(tooltips, color_save, ("Save all filters to disk"), NULL);
#if GTK_MAJOR_VERSION < 2 color_revert = BUTTON_NEW_FROM_STOCK(STOCK_REVERT_TO_SAVED);
color_revert = gtk_button_new_with_label (("Revert"));
#else
color_revert = gtk_button_new_from_stock(GTK_STOCK_REVERT_TO_SAVED);
#endif
gtk_widget_ref(color_revert); gtk_widget_ref(color_revert);
OBJECT_SET_DATA_FULL(color_win, "color_revert", color_revert, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_revert", color_revert, gtk_widget_unref);
gtk_widget_show(color_revert); gtk_widget_show(color_revert);
@ -473,11 +449,7 @@ colorize_dialog_new (char *filter)
gtk_box_pack_start(GTK_BOX (importexport_vbox), color_import, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX (importexport_vbox), color_import, FALSE, FALSE, 0);
gtk_tooltips_set_tip(tooltips, color_import, ("Include filters from specified file"), NULL); gtk_tooltips_set_tip(tooltips, color_import, ("Include filters from specified file"), NULL);
#if GTK_MAJOR_VERSION < 2 color_cancel = BUTTON_NEW_FROM_STOCK(STOCK_CANCEL);
color_cancel = gtk_button_new_with_label (("Cancel"));
#else
color_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
#endif
gtk_widget_ref (color_cancel); gtk_widget_ref (color_cancel);
OBJECT_SET_DATA_FULL(color_win, "color_cancel", color_cancel, gtk_widget_unref); OBJECT_SET_DATA_FULL(color_win, "color_cancel", color_cancel, gtk_widget_unref);
gtk_widget_show (color_cancel); gtk_widget_show (color_cancel);

View File

@ -1,7 +1,7 @@
/* file_dlg.c /* file_dlg.c
* Dialog boxes for handling files * Dialog boxes for handling files
* *
* $Id: file_dlg.c,v 1.79 2004/01/09 18:11:21 ulfl Exp $ * $Id: file_dlg.c,v 1.80 2004/01/10 14:11:58 ulfl Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -288,13 +288,7 @@ file_open_cmd_cb(GtkWidget *w, gpointer data _U_)
OBJECT_SET_DATA(GTK_FILE_SELECTION(file_open_w)->ok_button, OBJECT_SET_DATA(GTK_FILE_SELECTION(file_open_w)->ok_button,
E_RFILTER_TE_KEY, filter_te); E_RFILTER_TE_KEY, filter_te);
#if GTK_MAJOR_VERSION < 2 m_resolv_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC("Enable _MAC name resolution", accel_group);
m_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
"Enable _MAC name resolution", accel_group);
#else
m_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _MAC name resolution");
#endif
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_resolv_cb), gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_resolv_cb),
g_resolv_flags & RESOLV_MAC); g_resolv_flags & RESOLV_MAC);
gtk_box_pack_start(GTK_BOX(main_vb), m_resolv_cb, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(main_vb), m_resolv_cb, FALSE, FALSE, 0);
@ -302,13 +296,7 @@ file_open_cmd_cb(GtkWidget *w, gpointer data _U_)
OBJECT_SET_DATA(GTK_FILE_SELECTION(file_open_w)->ok_button, OBJECT_SET_DATA(GTK_FILE_SELECTION(file_open_w)->ok_button,
E_FILE_M_RESOLVE_KEY, m_resolv_cb); E_FILE_M_RESOLVE_KEY, m_resolv_cb);
#if GTK_MAJOR_VERSION < 2 n_resolv_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC("Enable _network name resolution", accel_group);
n_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
"Enable _network name resolution", accel_group);
#else
n_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _network name resolution");
#endif
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(n_resolv_cb), gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(n_resolv_cb),
g_resolv_flags & RESOLV_NETWORK); g_resolv_flags & RESOLV_NETWORK);
gtk_box_pack_start(GTK_BOX(main_vb), n_resolv_cb, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(main_vb), n_resolv_cb, FALSE, FALSE, 0);
@ -316,13 +304,7 @@ file_open_cmd_cb(GtkWidget *w, gpointer data _U_)
OBJECT_SET_DATA(GTK_FILE_SELECTION(file_open_w)->ok_button, OBJECT_SET_DATA(GTK_FILE_SELECTION(file_open_w)->ok_button,
E_FILE_N_RESOLVE_KEY, n_resolv_cb); E_FILE_N_RESOLVE_KEY, n_resolv_cb);
#if GTK_MAJOR_VERSION < 2 t_resolv_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC("Enable _transport name resolution", accel_group);
t_resolv_cb = dlg_check_button_new_with_label_with_mnemonic(
"Enable _transport name resolution", accel_group);
#else
t_resolv_cb = gtk_check_button_new_with_mnemonic(
"Enable _transport name resolution");
#endif
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_resolv_cb), gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_resolv_cb),
g_resolv_flags & RESOLV_TRANSPORT); g_resolv_flags & RESOLV_TRANSPORT);
gtk_box_pack_start(GTK_BOX(main_vb), t_resolv_cb, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(main_vb), t_resolv_cb, FALSE, FALSE, 0);
@ -398,11 +380,11 @@ file_open_ok_cb(GtkWidget *w, GtkFileSelection *fs) {
/* Set the global resolving variable */ /* Set the global resolving variable */
g_resolv_flags = prefs.name_resolve & RESOLV_CONCURRENT; g_resolv_flags = prefs.name_resolve & RESOLV_CONCURRENT;
m_resolv_cb = OBJECT_GET_DATA(w, E_FILE_M_RESOLVE_KEY); m_resolv_cb = OBJECT_GET_DATA(w, E_FILE_M_RESOLVE_KEY);
g_resolv_flags |= GTK_TOGGLE_BUTTON (m_resolv_cb)->active ? RESOLV_MAC : RESOLV_NONE; g_resolv_flags |= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (m_resolv_cb)) ? RESOLV_MAC : RESOLV_NONE;
n_resolv_cb = OBJECT_GET_DATA(w, E_FILE_N_RESOLVE_KEY); n_resolv_cb = OBJECT_GET_DATA(w, E_FILE_N_RESOLVE_KEY);
g_resolv_flags |= GTK_TOGGLE_BUTTON (n_resolv_cb)->active ? RESOLV_NETWORK : RESOLV_NONE; g_resolv_flags |= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (n_resolv_cb)) ? RESOLV_NETWORK : RESOLV_NONE;
t_resolv_cb = OBJECT_GET_DATA(w, E_FILE_T_RESOLVE_KEY); t_resolv_cb = OBJECT_GET_DATA(w, E_FILE_T_RESOLVE_KEY);
g_resolv_flags |= GTK_TOGGLE_BUTTON (t_resolv_cb)->active ? RESOLV_TRANSPORT : RESOLV_NONE; g_resolv_flags |= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (t_resolv_cb)) ? RESOLV_TRANSPORT : RESOLV_NONE;
/* We've crossed the Rubicon; get rid of the file selection box. */ /* We've crossed the Rubicon; get rid of the file selection box. */
gtk_widget_hide(GTK_WIDGET (fs)); gtk_widget_hide(GTK_WIDGET (fs));
@ -496,7 +478,6 @@ can_save_with_wiretap(int ft)
static void static void
file_set_save_dynamics(void) { file_set_save_dynamics(void) {
gboolean filtered_active; gboolean filtered_active;
/* gboolean filtered_sensitive;*/
gchar label_text[100]; gchar label_text[100];
gint selected_num; gint selected_num;
@ -622,7 +603,7 @@ static void
toggle_captured_cb(GtkWidget *widget, gpointer data _U_) toggle_captured_cb(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
/* They changed the state of the "captured" button. */ /* They changed the state of the "captured" button. */
range.process_filtered = FALSE; range.process_filtered = FALSE;
/* XXX: the following line fails, I have no idea why */ /* XXX: the following line fails, I have no idea why */
@ -639,7 +620,7 @@ static void
toggle_filtered_cb(GtkWidget *widget, gpointer data _U_) toggle_filtered_cb(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process_filtered = TRUE; range.process_filtered = TRUE;
set_file_type_list(ft_om); set_file_type_list(ft_om);
@ -654,7 +635,7 @@ static void
toggle_select_all(GtkWidget *widget, gpointer data _U_) toggle_select_all(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_all; range.process = range_process_all;
set_file_type_list(ft_om); set_file_type_list(ft_om);
file_set_save_dynamics(); file_set_save_dynamics();
@ -665,7 +646,7 @@ static void
toggle_select_selected(GtkWidget *widget, gpointer data _U_) toggle_select_selected(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_selected; range.process = range_process_selected;
set_file_type_list(ft_om); set_file_type_list(ft_om);
file_set_save_dynamics(); file_set_save_dynamics();
@ -676,7 +657,7 @@ static void
toggle_select_marked_only(GtkWidget *widget, gpointer data _U_) toggle_select_marked_only(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_marked; range.process = range_process_marked;
set_file_type_list(ft_om); set_file_type_list(ft_om);
file_set_save_dynamics(); file_set_save_dynamics();
@ -687,7 +668,7 @@ static void
toggle_select_marked_range(GtkWidget *widget, gpointer data _U_) toggle_select_marked_range(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_marked_range; range.process = range_process_marked_range;
set_file_type_list(ft_om); set_file_type_list(ft_om);
file_set_save_dynamics(); file_set_save_dynamics();
@ -698,7 +679,7 @@ static void
toggle_select_user_range(GtkWidget *widget, gpointer data _U_) toggle_select_user_range(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_user_range; range.process = range_process_user_range;
set_file_type_list(ft_om); set_file_type_list(ft_om);
file_set_save_dynamics(); file_set_save_dynamics();
@ -762,7 +743,6 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
{ {
GtkWidget *ok_bt, *main_vb, *ft_hb, *ft_lb, *range_fr, *range_tb; GtkWidget *ok_bt, *main_vb, *ft_hb, *ft_lb, *range_fr, *range_tb;
GtkTooltips *tooltips; GtkTooltips *tooltips;
gchar label_text[100];
#if GTK_MAJOR_VERSION < 2 #if GTK_MAJOR_VERSION < 2
GtkAccelGroup *accel_group; GtkAccelGroup *accel_group;
@ -822,22 +802,14 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
gtk_widget_show(range_tb); gtk_widget_show(range_tb);
/* captured button */ /* captured button */
#if GTK_MAJOR_VERSION < 2 captured_bt = TOGGLE_BUTTON_NEW_WITH_MNEMONIC("_Captured", accel_group);
captured_bt = dlg_toggle_button_new_with_label_with_mnemonic("_Captured" ,accel_group);
#else
captured_bt = gtk_toggle_button_new_with_mnemonic("_Captured");
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), captured_bt, 1, 2, 0, 1); gtk_table_attach_defaults(GTK_TABLE(range_tb), captured_bt, 1, 2, 0, 1);
SIGNAL_CONNECT(captured_bt, "toggled", toggle_captured_cb, NULL); SIGNAL_CONNECT(captured_bt, "toggled", toggle_captured_cb, NULL);
gtk_tooltips_set_tip (tooltips,captured_bt,("Process all the below chosen packets"), NULL); gtk_tooltips_set_tip (tooltips,captured_bt,("Process all the below chosen packets"), NULL);
gtk_widget_show(captured_bt); gtk_widget_show(captured_bt);
/* displayed button */ /* displayed button */
#if GTK_MAJOR_VERSION < 2 displayed_bt = TOGGLE_BUTTON_NEW_WITH_MNEMONIC("_Displayed", accel_group);
displayed_bt = dlg_toggle_button_new_with_label_with_mnemonic("_Displayed" ,accel_group);
#else
displayed_bt = gtk_toggle_button_new_with_mnemonic("_Displayed");
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), displayed_bt, 2, 3, 0, 1); gtk_table_attach_defaults(GTK_TABLE(range_tb), displayed_bt, 2, 3, 0, 1);
SIGNAL_CONNECT(displayed_bt, "toggled", toggle_filtered_cb, NULL); SIGNAL_CONNECT(displayed_bt, "toggled", toggle_filtered_cb, NULL);
gtk_tooltips_set_tip (tooltips,displayed_bt,("Process only the below chosen packets, which also passes the current display filter"), NULL); gtk_tooltips_set_tip (tooltips,displayed_bt,("Process only the below chosen packets, which also passes the current display filter"), NULL);
@ -845,12 +817,7 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
/* Process all packets */ /* Process all packets */
g_snprintf(label_text, sizeof(label_text), "_All packets"); select_all_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(NULL, "_All packets", accel_group);
#if GTK_MAJOR_VERSION < 2
select_all_rb = dlg_radio_button_new_with_label_with_mnemonic(NULL, label_text ,accel_group);
#else
select_all_rb = gtk_radio_button_new_with_mnemonic(NULL, label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_all_rb, 0, 1, 1, 2); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_all_rb, 0, 1, 1, 2);
gtk_tooltips_set_tip (tooltips,select_all_rb,("Process all packets"), NULL); gtk_tooltips_set_tip (tooltips,select_all_rb,("Process all packets"), NULL);
SIGNAL_CONNECT(select_all_rb, "toggled", toggle_select_all, NULL); SIGNAL_CONNECT(select_all_rb, "toggled", toggle_select_all, NULL);
@ -865,14 +832,7 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
/* Process currently selected */ /* Process currently selected */
g_snprintf(label_text, sizeof(label_text), "_Selected packet only"); select_curr_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "_Selected packet only", accel_group);
#if GTK_MAJOR_VERSION < 2
select_curr_rb = dlg_radio_button_new_with_label_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text,accel_group);
#else
select_curr_rb = gtk_radio_button_new_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_curr_rb, 0, 1, 2, 3); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_curr_rb, 0, 1, 2, 3);
gtk_tooltips_set_tip (tooltips,select_curr_rb,("Process the currently selected packet only"), NULL); gtk_tooltips_set_tip (tooltips,select_curr_rb,("Process the currently selected packet only"), NULL);
SIGNAL_CONNECT(select_curr_rb, "toggled", toggle_select_selected, NULL); SIGNAL_CONNECT(select_curr_rb, "toggled", toggle_select_selected, NULL);
@ -887,14 +847,7 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
/* Process marked packets */ /* Process marked packets */
g_snprintf(label_text, sizeof(label_text), "_Marked packets only"); select_marked_only_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "_Marked packets only", accel_group);
#if GTK_MAJOR_VERSION < 2
select_marked_only_rb = dlg_radio_button_new_with_label_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text,accel_group);
#else
select_marked_only_rb = gtk_radio_button_new_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_only_rb, 0, 1, 3, 4); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_only_rb, 0, 1, 3, 4);
gtk_tooltips_set_tip (tooltips,select_marked_only_rb,("Process marked packets only"), NULL); gtk_tooltips_set_tip (tooltips,select_marked_only_rb,("Process marked packets only"), NULL);
SIGNAL_CONNECT(select_marked_only_rb, "toggled", toggle_select_marked_only, NULL); SIGNAL_CONNECT(select_marked_only_rb, "toggled", toggle_select_marked_only, NULL);
@ -909,14 +862,7 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
/* Process packet range between first and last packet */ /* Process packet range between first and last packet */
g_snprintf(label_text, sizeof(label_text), "From first _to last marked packet"); select_marked_range_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "From first _to last marked packet", accel_group);
#if GTK_MAJOR_VERSION < 2
select_marked_range_rb = dlg_radio_button_new_with_label_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text,accel_group);
#else
select_marked_range_rb = gtk_radio_button_new_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_range_rb, 0, 1, 4, 5); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_range_rb, 0, 1, 4, 5);
gtk_tooltips_set_tip (tooltips,select_marked_range_rb,("Process all packets between the first and last marker"), NULL); gtk_tooltips_set_tip (tooltips,select_marked_range_rb,("Process all packets between the first and last marker"), NULL);
SIGNAL_CONNECT(select_marked_range_rb, "toggled", toggle_select_marked_range, NULL); SIGNAL_CONNECT(select_marked_range_rb, "toggled", toggle_select_marked_range, NULL);
@ -931,14 +877,7 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
/* Process a user specified provided packet range : -10,30,40-70,80- */ /* Process a user specified provided packet range : -10,30,40-70,80- */
g_snprintf(label_text, sizeof(label_text), "Specify a packet _range:"); select_user_range_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "Specify a packet _range:", accel_group);
#if GTK_MAJOR_VERSION < 2
select_user_range_rb = dlg_radio_button_new_with_label_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text,accel_group);
#else
select_user_range_rb = gtk_radio_button_new_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_user_range_rb, 0, 1, 5, 6); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_user_range_rb, 0, 1, 5, 6);
gtk_tooltips_set_tip (tooltips,select_user_range_rb,("Process a specified packet range"), NULL); gtk_tooltips_set_tip (tooltips,select_user_range_rb,("Process a specified packet range"), NULL);
SIGNAL_CONNECT(select_user_range_rb, "toggled", toggle_select_user_range, NULL); SIGNAL_CONNECT(select_user_range_rb, "toggled", toggle_select_user_range, NULL);
@ -1287,7 +1226,7 @@ color_set_export_marked_sensitive(GtkWidget * cfmark_cb)
static void static void
color_toggle_marked_cb(GtkWidget *widget, gpointer data _U_) color_toggle_marked_cb(GtkWidget *widget, gpointer data _U_)
{ {
color_marked = GTK_TOGGLE_BUTTON (widget)->active; color_marked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget));
} }
void void

View File

@ -1,7 +1,7 @@
/* print_dlg.c /* print_dlg.c
* Dialog boxes for printing * Dialog boxes for printing
* *
* $Id: print_dlg.c,v 1.52 2004/01/09 18:11:21 ulfl Exp $ * $Id: print_dlg.c,v 1.53 2004/01/10 14:11:58 ulfl Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -119,7 +119,6 @@ static GtkWidget *print_w;
static void static void
file_set_print_dynamics(void) { file_set_print_dynamics(void) {
gboolean filtered_active; gboolean filtered_active;
/* gboolean filtered_sensitive;*/
gchar label_text[100]; gchar label_text[100];
gint selected_num; gint selected_num;
@ -178,7 +177,7 @@ static void
toggle_captured_cb(GtkWidget *widget, gpointer data _U_) toggle_captured_cb(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
/* They changed the state of the "captured" button. */ /* They changed the state of the "captured" button. */
range.process_filtered = FALSE; range.process_filtered = FALSE;
/* XXX: the following line fails, I have no idea why */ /* XXX: the following line fails, I have no idea why */
@ -195,7 +194,7 @@ static void
toggle_filtered_cb(GtkWidget *widget, gpointer data _U_) toggle_filtered_cb(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process_filtered = TRUE; range.process_filtered = TRUE;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(captured_bt), FALSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(captured_bt), FALSE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(displayed_bt), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(displayed_bt), TRUE);
@ -208,7 +207,7 @@ static void
toggle_select_all(GtkWidget *widget, gpointer data _U_) toggle_select_all(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_all; range.process = range_process_all;
file_set_print_dynamics(); file_set_print_dynamics();
} }
@ -218,7 +217,7 @@ static void
toggle_select_selected(GtkWidget *widget, gpointer data _U_) toggle_select_selected(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_selected; range.process = range_process_selected;
file_set_print_dynamics(); file_set_print_dynamics();
} }
@ -228,7 +227,7 @@ static void
toggle_select_marked_only(GtkWidget *widget, gpointer data _U_) toggle_select_marked_only(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_marked; range.process = range_process_marked;
file_set_print_dynamics(); file_set_print_dynamics();
} }
@ -238,7 +237,7 @@ static void
toggle_select_marked_range(GtkWidget *widget, gpointer data _U_) toggle_select_marked_range(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_marked_range; range.process = range_process_marked_range;
file_set_print_dynamics(); file_set_print_dynamics();
} }
@ -248,7 +247,7 @@ static void
toggle_select_user_range(GtkWidget *widget, gpointer data _U_) toggle_select_user_range(GtkWidget *widget, gpointer data _U_)
{ {
/* is the button now active? */ /* is the button now active? */
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
range.process = range_process_user_range; range.process = range_process_user_range;
file_set_print_dynamics(); file_set_print_dynamics();
} }
@ -332,7 +331,6 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
GtkWidget *bbox, *ok_bt, *cancel_bt; GtkWidget *bbox, *ok_bt, *cancel_bt;
GtkTooltips *tooltips; GtkTooltips *tooltips;
gchar label_text[100];
if (print_w != NULL) { if (print_w != NULL) {
@ -386,27 +384,14 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
gtk_widget_show(printer_vb); gtk_widget_show(printer_vb);
/* "Plain text" / "Postscript" radio buttons */ /* "Plain text" / "Postscript" radio buttons */
#if GTK_MAJOR_VERSION < 2 text_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(NULL, "Plain _text", accel_group);
text_rb = dlg_radio_button_new_with_label_with_mnemonic(NULL, "Plain _text",
accel_group);
#else
text_rb = gtk_radio_button_new_with_mnemonic(NULL, "Plain _text");
#endif
if (print_format == PR_FMT_TEXT) if (print_format == PR_FMT_TEXT)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(text_rb), TRUE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(text_rb), TRUE);
gtk_tooltips_set_tip (tooltips, text_rb, ("Print output in ascii \"plain text\" format"), NULL); gtk_tooltips_set_tip (tooltips, text_rb, ("Print output in ascii \"plain text\" format"), NULL);
gtk_box_pack_start(GTK_BOX(printer_vb), text_rb, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(printer_vb), text_rb, FALSE, FALSE, 0);
gtk_widget_show(text_rb); gtk_widget_show(text_rb);
#if GTK_MAJOR_VERSION < 2 format_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(text_rb, "_PostScript", accel_group);
format_rb = dlg_radio_button_new_with_label_with_mnemonic(
gtk_radio_button_group(GTK_RADIO_BUTTON(text_rb)),
"_PostScript",
accel_group);
#else
format_rb = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(text_rb), "_PostScript");
#endif
if (print_format == PR_FMT_PS) if (print_format == PR_FMT_PS)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(format_rb), TRUE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(format_rb), TRUE);
gtk_tooltips_set_tip (tooltips, format_rb, ("Print output in \"postscript\" format"), NULL); gtk_tooltips_set_tip (tooltips, format_rb, ("Print output in \"postscript\" format"), NULL);
@ -427,12 +412,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
/* Output to file button */ /* Output to file button */
#if GTK_MAJOR_VERSION < 2 dest_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC("Output to _File:", accel_group);
dest_cb = dlg_check_button_new_with_label_with_mnemonic("Output to _File:",
accel_group);
#else
dest_cb = gtk_check_button_new_with_mnemonic("Output to _File:");
#endif
if (print_to_file) if (print_to_file)
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(dest_cb), TRUE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(dest_cb), TRUE);
gtk_tooltips_set_tip (tooltips, dest_cb, ("Output to file instead of printer"), NULL); gtk_tooltips_set_tip (tooltips, dest_cb, ("Output to file instead of printer"), NULL);
@ -496,22 +476,14 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
gtk_widget_show(range_tb); gtk_widget_show(range_tb);
/* captured button */ /* captured button */
#if GTK_MAJOR_VERSION < 2 captured_bt = TOGGLE_BUTTON_NEW_WITH_MNEMONIC("_Captured", accel_group);
captured_bt = dlg_toggle_button_new_with_label_with_mnemonic("_Captured" ,accel_group);
#else
captured_bt = gtk_toggle_button_new_with_mnemonic("_Captured");
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), captured_bt, 1, 2, 0, 1); gtk_table_attach_defaults(GTK_TABLE(range_tb), captured_bt, 1, 2, 0, 1);
SIGNAL_CONNECT(captured_bt, "toggled", toggle_captured_cb, NULL); SIGNAL_CONNECT(captured_bt, "toggled", toggle_captured_cb, NULL);
gtk_tooltips_set_tip (tooltips,captured_bt,("Process all the below chosen packets"), NULL); gtk_tooltips_set_tip (tooltips,captured_bt,("Process all the below chosen packets"), NULL);
gtk_widget_show(captured_bt); gtk_widget_show(captured_bt);
/* displayed button */ /* displayed button */
#if GTK_MAJOR_VERSION < 2 displayed_bt = TOGGLE_BUTTON_NEW_WITH_MNEMONIC("_Displayed", accel_group);
displayed_bt = dlg_toggle_button_new_with_label_with_mnemonic("_Displayed" ,accel_group);
#else
displayed_bt = gtk_toggle_button_new_with_mnemonic("_Displayed");
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), displayed_bt, 2, 3, 0, 1); gtk_table_attach_defaults(GTK_TABLE(range_tb), displayed_bt, 2, 3, 0, 1);
SIGNAL_CONNECT(displayed_bt, "toggled", toggle_filtered_cb, NULL); SIGNAL_CONNECT(displayed_bt, "toggled", toggle_filtered_cb, NULL);
gtk_tooltips_set_tip (tooltips,displayed_bt,("Process only the below chosen packets, which also passes the current display filter"), NULL); gtk_tooltips_set_tip (tooltips,displayed_bt,("Process only the below chosen packets, which also passes the current display filter"), NULL);
@ -519,14 +491,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
/* Process all packets */ /* Process all packets */
g_snprintf(label_text, sizeof(label_text), "_All packets"); select_all_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(NULL, "_All packets", accel_group);
#if GTK_MAJOR_VERSION < 2
select_all_rb = dlg_radio_button_new_with_label_with_mnemonic(
NULL,
label_text, accel_group);
#else
select_all_rb = gtk_radio_button_new_with_mnemonic(NULL, label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_all_rb, 0, 1, 1, 2); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_all_rb, 0, 1, 1, 2);
gtk_tooltips_set_tip (tooltips, select_all_rb, gtk_tooltips_set_tip (tooltips, select_all_rb,
("Process all packets"), NULL); ("Process all packets"), NULL);
@ -542,15 +507,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
/* Process currently selected */ /* Process currently selected */
g_snprintf(label_text, sizeof(label_text), "_Selected packet only"); select_curr_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "_Selected packet only", accel_group);
#if GTK_MAJOR_VERSION < 2
select_curr_rb = dlg_radio_button_new_with_label_with_mnemonic(
gtk_radio_button_group(GTK_RADIO_BUTTON(select_all_rb)),
label_text, accel_group);
#else
select_curr_rb = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(select_all_rb), label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_curr_rb, 0, 1, 2, 3); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_curr_rb, 0, 1, 2, 3);
gtk_tooltips_set_tip (tooltips, select_curr_rb, ("Process the currently selected packet only"), NULL); gtk_tooltips_set_tip (tooltips, select_curr_rb, ("Process the currently selected packet only"), NULL);
SIGNAL_CONNECT(select_curr_rb, "toggled", toggle_select_selected, NULL); SIGNAL_CONNECT(select_curr_rb, "toggled", toggle_select_selected, NULL);
@ -565,15 +522,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
/* Process marked packets */ /* Process marked packets */
g_snprintf(label_text, sizeof(label_text), "_Marked packets only"); select_marked_only_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "_Marked packets only", accel_group);
#if GTK_MAJOR_VERSION < 2
select_marked_only_rb = dlg_radio_button_new_with_label_with_mnemonic(
gtk_radio_button_group(GTK_RADIO_BUTTON(select_all_rb)),
label_text, accel_group);
#else
select_marked_only_rb = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(select_all_rb), label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_only_rb, 0, 1, 3, 4); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_only_rb, 0, 1, 3, 4);
gtk_tooltips_set_tip (tooltips, select_marked_only_rb, ("Process marked packets only"), NULL); gtk_tooltips_set_tip (tooltips, select_marked_only_rb, ("Process marked packets only"), NULL);
SIGNAL_CONNECT(select_marked_only_rb, "toggled", toggle_select_marked_only, NULL); SIGNAL_CONNECT(select_marked_only_rb, "toggled", toggle_select_marked_only, NULL);
@ -588,14 +537,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
/* Process packet range between first and last packet */ /* Process packet range between first and last packet */
g_snprintf(label_text, sizeof(label_text), "From first _to last marked packet"); select_marked_range_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "From first _to last marked packet", accel_group);
#if GTK_MAJOR_VERSION < 2
select_marked_range_rb = dlg_radio_button_new_with_label_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text,accel_group);
#else
select_marked_range_rb = gtk_radio_button_new_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_range_rb, 0, 1, 4, 5); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_marked_range_rb, 0, 1, 4, 5);
gtk_tooltips_set_tip (tooltips,select_marked_range_rb,("Process all packets between the first and last marker"), NULL); gtk_tooltips_set_tip (tooltips,select_marked_range_rb,("Process all packets between the first and last marker"), NULL);
SIGNAL_CONNECT(select_marked_range_rb, "toggled", toggle_select_marked_range, NULL); SIGNAL_CONNECT(select_marked_range_rb, "toggled", toggle_select_marked_range, NULL);
@ -610,14 +552,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
/* Process a user specified provided packet range : -10,30,40-70,80- */ /* Process a user specified provided packet range : -10,30,40-70,80- */
g_snprintf(label_text, sizeof(label_text), "Specify a packet _range:"); select_user_range_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(select_all_rb, "Specify a packet _range:", accel_group);
#if GTK_MAJOR_VERSION < 2
select_user_range_rb = dlg_radio_button_new_with_label_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text,accel_group);
#else
select_user_range_rb = gtk_radio_button_new_with_mnemonic(gtk_radio_button_group (GTK_RADIO_BUTTON (select_all_rb)),
label_text);
#endif
gtk_table_attach_defaults(GTK_TABLE(range_tb), select_user_range_rb, 0, 1, 5, 6); gtk_table_attach_defaults(GTK_TABLE(range_tb), select_user_range_rb, 0, 1, 5, 6);
gtk_tooltips_set_tip (tooltips,select_user_range_rb,("Process a specified packet range"), NULL); gtk_tooltips_set_tip (tooltips,select_user_range_rb,("Process a specified packet range"), NULL);
SIGNAL_CONNECT(select_user_range_rb, "toggled", toggle_select_user_range, NULL); SIGNAL_CONNECT(select_user_range_rb, "toggled", toggle_select_user_range, NULL);
@ -658,12 +593,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
gtk_widget_show(packet_vb); gtk_widget_show(packet_vb);
/* "Print detail" check buttons */ /* "Print detail" check buttons */
#if GTK_MAJOR_VERSION < 2 details_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC("Print packet d_etails", accel_group);
details_cb = dlg_check_button_new_with_label_with_mnemonic("Print packet d_etails",
accel_group);
#else
details_cb = gtk_check_button_new_with_mnemonic("Print packet d_etails");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(details_cb), TRUE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(details_cb), TRUE);
SIGNAL_CONNECT(details_cb, "clicked", print_cmd_toggle_detail, NULL); SIGNAL_CONNECT(details_cb, "clicked", print_cmd_toggle_detail, NULL);
gtk_tooltips_set_tip (tooltips, details_cb, ("Print packet details, or packet summary only"), NULL); gtk_tooltips_set_tip (tooltips, details_cb, ("Print packet details, or packet summary only"), NULL);
@ -682,51 +612,26 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
gtk_widget_show(details_vb); gtk_widget_show(details_vb);
/* "All collapsed"/"As displayed"/"All Expanded" radio buttons */ /* "All collapsed"/"As displayed"/"All Expanded" radio buttons */
#if GTK_MAJOR_VERSION < 2 collapse_all_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(NULL, "All dissections co_llapsed", accel_group);
collapse_all_rb = dlg_radio_button_new_with_label_with_mnemonic(NULL,
"All dissections co_llapsed", accel_group);
#else
collapse_all_rb = gtk_radio_button_new_with_mnemonic(
NULL, "All dissections co_llapsed");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(collapse_all_rb), FALSE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(collapse_all_rb), FALSE);
gtk_tooltips_set_tip (tooltips, collapse_all_rb, ("Print packet details tree \"collapsed\""), NULL); gtk_tooltips_set_tip (tooltips, collapse_all_rb, ("Print packet details tree \"collapsed\""), NULL);
gtk_container_add(GTK_CONTAINER(details_vb), collapse_all_rb); gtk_container_add(GTK_CONTAINER(details_vb), collapse_all_rb);
gtk_widget_show(collapse_all_rb); gtk_widget_show(collapse_all_rb);
#if GTK_MAJOR_VERSION < 2 as_displayed_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(collapse_all_rb, "Dissections as displa_yed", accel_group);
as_displayed_rb = dlg_radio_button_new_with_label_with_mnemonic(
gtk_radio_button_group(GTK_RADIO_BUTTON(collapse_all_rb)),
"Dissections as displa_yed", accel_group);
#else
as_displayed_rb = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(collapse_all_rb), "Dissections as displa_yed");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(as_displayed_rb), TRUE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(as_displayed_rb), TRUE);
gtk_tooltips_set_tip (tooltips, as_displayed_rb, ("Print packet details tree \"as displayed\""), NULL); gtk_tooltips_set_tip (tooltips, as_displayed_rb, ("Print packet details tree \"as displayed\""), NULL);
gtk_container_add(GTK_CONTAINER(details_vb), as_displayed_rb); gtk_container_add(GTK_CONTAINER(details_vb), as_displayed_rb);
gtk_widget_show(as_displayed_rb); gtk_widget_show(as_displayed_rb);
#if GTK_MAJOR_VERSION < 2 expand_all_rb = RADIO_BUTTON_NEW_WITH_MNEMONIC(collapse_all_rb, "All dissections e_xpanded", accel_group);
expand_all_rb = dlg_radio_button_new_with_label_with_mnemonic(
gtk_radio_button_group(GTK_RADIO_BUTTON(collapse_all_rb)),
"All dissections e_xpanded", accel_group);
#else
expand_all_rb = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(collapse_all_rb), "All dissections e_xpanded");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(expand_all_rb), FALSE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(expand_all_rb), FALSE);
gtk_tooltips_set_tip (tooltips, expand_all_rb, ("Print packet details tree \"expanded\""), NULL); gtk_tooltips_set_tip (tooltips, expand_all_rb, ("Print packet details tree \"expanded\""), NULL);
gtk_container_add(GTK_CONTAINER(details_vb), expand_all_rb); gtk_container_add(GTK_CONTAINER(details_vb), expand_all_rb);
gtk_widget_show(expand_all_rb); gtk_widget_show(expand_all_rb);
/* "Print hex" check button. */ /* "Print hex" check button. */
#if GTK_MAJOR_VERSION < 2 hex_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC("Packet _hex data", accel_group);
hex_cb = dlg_check_button_new_with_label_with_mnemonic("Packet _hex data",
accel_group);
#else
hex_cb = gtk_check_button_new_with_mnemonic("Packet _hex data");
#endif
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(hex_cb), FALSE); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(hex_cb), FALSE);
gtk_tooltips_set_tip (tooltips, hex_cb, ("Add hexdump of packet data"), NULL); gtk_tooltips_set_tip (tooltips, hex_cb, ("Add hexdump of packet data"), NULL);
gtk_container_add(GTK_CONTAINER(details_vb), hex_cb); gtk_container_add(GTK_CONTAINER(details_vb), hex_cb);
@ -749,11 +654,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
gtk_container_add(GTK_CONTAINER(main_vb), bbox); gtk_container_add(GTK_CONTAINER(main_vb), bbox);
gtk_widget_show(bbox); gtk_widget_show(bbox);
#if GTK_MAJOR_VERSION < 2 ok_bt = BUTTON_NEW_FROM_STOCK(STOCK_OK);
ok_bt = gtk_button_new_with_label ("OK");
#else
ok_bt = gtk_button_new_from_stock(GTK_STOCK_OK);
#endif
OBJECT_SET_DATA(ok_bt, PRINT_FORMAT_RB_KEY, format_rb); OBJECT_SET_DATA(ok_bt, PRINT_FORMAT_RB_KEY, format_rb);
OBJECT_SET_DATA(ok_bt, PRINT_DEST_CB_KEY, dest_cb); OBJECT_SET_DATA(ok_bt, PRINT_DEST_CB_KEY, dest_cb);
#ifndef _WIN32 #ifndef _WIN32
@ -772,11 +673,7 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
gtk_widget_grab_default(ok_bt); gtk_widget_grab_default(ok_bt);
gtk_widget_show(ok_bt); gtk_widget_show(ok_bt);
#if GTK_MAJOR_VERSION < 2 cancel_bt = BUTTON_NEW_FROM_STOCK(STOCK_CANCEL);
cancel_bt = gtk_button_new_with_label ("Cancel");
#else
cancel_bt = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
#endif
SIGNAL_CONNECT(cancel_bt, "clicked", print_close_cb, print_w); SIGNAL_CONNECT(cancel_bt, "clicked", print_close_cb, print_w);
GTK_WIDGET_SET_FLAGS(cancel_bt, GTK_CAN_DEFAULT); GTK_WIDGET_SET_FLAGS(cancel_bt, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, cancel_bt, ("Cancel print and exit dialog"), NULL); gtk_tooltips_set_tip (tooltips, cancel_bt, ("Cancel print and exit dialog"), NULL);
@ -816,7 +713,8 @@ print_cmd_toggle_dest(GtkWidget *widget, gpointer data _U_)
#endif #endif
file_bt = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_FILE_BT_KEY)); file_bt = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_FILE_BT_KEY));
file_te = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_FILE_TE_KEY)); file_te = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_FILE_TE_KEY));
if (GTK_TOGGLE_BUTTON (widget)->active) {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
/* They selected "Print to File" */ /* They selected "Print to File" */
to_file = TRUE; to_file = TRUE;
} else { } else {
@ -845,7 +743,7 @@ print_cmd_toggle_detail(GtkWidget *widget, gpointer data _U_)
expand_all_rb = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_EXPAND_ALL_RB_KEY)); expand_all_rb = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_EXPAND_ALL_RB_KEY));
hex_cb = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_HEX_CB_KEY)); hex_cb = GTK_WIDGET(OBJECT_GET_DATA(widget, PRINT_HEX_CB_KEY));
if (GTK_TOGGLE_BUTTON (widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) {
/* They selected "Print detail" */ /* They selected "Print detail" */
print_detail = TRUE; print_detail = TRUE;
} else { } else {
@ -888,7 +786,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
#endif #endif
button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_DEST_CB_KEY); button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_DEST_CB_KEY);
print_to_file = GTK_TOGGLE_BUTTON (button)->active; print_to_file = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (button));
print_args.to_file = print_to_file; print_args.to_file = print_to_file;
if (print_args.to_file) { if (print_args.to_file) {
@ -916,26 +814,26 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
} }
button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_FORMAT_RB_KEY); button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_FORMAT_RB_KEY);
if (GTK_TOGGLE_BUTTON (button)->active) if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (button)))
print_format = PR_FMT_PS; print_format = PR_FMT_PS;
else else
print_format = PR_FMT_TEXT; print_format = PR_FMT_TEXT;
print_args.format = print_format; print_args.format = print_format;
button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_DETAILS_CB_KEY); button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_DETAILS_CB_KEY);
print_args.print_summary = !(GTK_TOGGLE_BUTTON (button)->active); print_args.print_summary = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (button));
button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_HEX_CB_KEY); button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_HEX_CB_KEY);
print_args.print_hex = GTK_TOGGLE_BUTTON (button)->active; print_args.print_hex = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (button));
print_args.print_dissections = print_dissections_collapsed; print_args.print_dissections = print_dissections_collapsed;
button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_AS_DISPLAYED_RB_KEY); button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_AS_DISPLAYED_RB_KEY);
if (GTK_TOGGLE_BUTTON (button)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (button))) {
print_args.print_dissections = print_dissections_as_displayed; print_args.print_dissections = print_dissections_as_displayed;
} }
button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_EXPAND_ALL_RB_KEY); button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_EXPAND_ALL_RB_KEY);
if (GTK_TOGGLE_BUTTON (button)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (button))) {
print_args.print_dissections = print_dissections_expanded; print_args.print_dissections = print_dissections_expanded;
} }