forked from osmocom/wireshark
More GLIB_CHECK_VERSION, GTK_CHECK_VERSION, and related whitespace
cleanup. svn path=/trunk/; revision=37970
This commit is contained in:
parent
f6d7f90c72
commit
2c469e3714
|
@ -591,10 +591,10 @@ highlight_field(tvbuff_t *tvb, gint byte, GtkTreeView *tree_view,
|
|||
gtk_tree_selection_select_path(gtk_tree_view_get_selection(tree_view),
|
||||
first_path);
|
||||
|
||||
/* If the last search was a string or hex search within "Packet data", the entire field might
|
||||
/* If the last search was a string or hex search within "Packet data", the entire field might
|
||||
not be highlighted. If the user just clicked on one of the bytes comprising that field, the
|
||||
above call didn't trigger a 'gtk_tree_view_get_selection' event. Call redraw_packet_bytes()
|
||||
to make the highlighting of the entire field visible. */
|
||||
to make the highlighting of the entire field visible. */
|
||||
if (!cfile.search_in_progress) {
|
||||
if (cfile.hex || (cfile.string && cfile.packet_data)) {
|
||||
redraw_packet_bytes(byte_nb_ptr_gbl, cfile.current_frame, cfile.finfo_selected);
|
||||
|
@ -1075,9 +1075,7 @@ savehex_cb(GtkWidget * w _U_, gpointer data _U_)
|
|||
* Build the dialog box we need.
|
||||
*/
|
||||
savehex_dlg = file_selection_new("Wireshark: Export Selected Packet Bytes", FILE_SELECTION_SAVE);
|
||||
#if GTK_CHECK_VERSION(2,8,0)
|
||||
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(savehex_dlg), TRUE);
|
||||
#endif
|
||||
|
||||
/* label */
|
||||
label = g_strdup_printf("Will save %u %s of raw binary data to specified file.",
|
||||
|
@ -1594,7 +1592,7 @@ packet_hex_print(GtkWidget *bv, const guint8 *pd, frame_data *fd,
|
|||
}
|
||||
bstart = cfile.search_pos - (blen-1);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
blen = finfo->length;
|
||||
bstart = finfo->start;
|
||||
}
|
||||
|
|
|
@ -58,21 +58,10 @@ man_addr_resolv_ok (GtkWidget *w _U_, gpointer data _U_)
|
|||
GtkWidget *addr_cb, *name_te, *resolv_cb;
|
||||
const gchar *addr, *name;
|
||||
gboolean active, redissect = FALSE;
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
#else
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
#endif
|
||||
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");
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
addr = gtk_combo_box_get_active_text (GTK_COMBO_BOX(addr_cb));
|
||||
#else
|
||||
gtk_combo_box_get_active_iter(GTK_COMBO_BOX(addr_cb), &iter);
|
||||
model = gtk_combo_box_get_model(GTK_COMBO_BOX(addr_cb));
|
||||
gtk_tree_model_get(model, &iter, 0, &addr, -1);
|
||||
#endif
|
||||
name = gtk_entry_get_text (GTK_ENTRY (name_te));
|
||||
|
||||
if (strlen (addr) && strlen (name)) {
|
||||
|
|
|
@ -459,10 +459,8 @@ create_list_view(void)
|
|||
list_view = GTK_TREE_VIEW(list_w);
|
||||
sortable = GTK_TREE_SORTABLE(list_store);
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
/* Speed up the list display */
|
||||
gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
|
||||
#endif
|
||||
|
||||
/* Setup the sortable columns */
|
||||
gtk_tree_sortable_set_sort_column_id(sortable, MC_COL_SRC_ADDR, GTK_SORT_ASCENDING);
|
||||
|
@ -653,7 +651,7 @@ mcaststream_dlg_create(void)
|
|||
|
||||
title_name_ptr = cf_get_display_name(&cfile);
|
||||
win_name = g_strdup_printf("%s - UDP Multicast Streams", title_name_ptr);
|
||||
mcaststream_dlg_w = dlg_window_new(win_name);
|
||||
mcaststream_dlg_w = dlg_window_new(win_name);
|
||||
|
||||
gtk_window_set_default_size(GTK_WINDOW(mcaststream_dlg_w), 620, 400);
|
||||
|
||||
|
|
119
gtk/menus.c
119
gtk/menus.c
|
@ -378,14 +378,14 @@ build_conversation_filter(int action, gboolean show_dialog)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
new_window_cb(GtkWidget *widget)
|
||||
{
|
||||
new_packet_window(widget, FALSE);
|
||||
}
|
||||
|
||||
#ifdef WANT_PACKET_EDITOR
|
||||
static void
|
||||
static void
|
||||
edit_window_cb(GtkWidget *widget)
|
||||
{
|
||||
new_packet_window(widget, TRUE);
|
||||
|
@ -607,7 +607,7 @@ tree_view_menu_prepare_or_not_selected_cb(GtkAction *action _U_, gpointer user_d
|
|||
}
|
||||
|
||||
/* Prepare for use of GTKUImanager */
|
||||
#ifdef MAIN_MENU_USE_UIMANAGER
|
||||
#ifdef MAIN_MENU_USE_UIMANAGER
|
||||
|
||||
static void
|
||||
copy_description_cb(GtkAction *action _U_, gpointer user_data)
|
||||
|
@ -936,67 +936,67 @@ help_menu_wireshark_cb(GtkAction *action _U_, gpointer user_data _U_)
|
|||
static void
|
||||
help_menu_wireshark_flt_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK_FILTER));
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_WIRESHARK_FILTER));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Tshark_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TSHARK));
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TSHARK));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_RawShark_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_RAWSHARK));
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_RAWSHARK));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Dumpcap_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_DUMPCAP));
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_DUMPCAP));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Mergecap_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_MERGECAP));
|
||||
topic_menu_cb(NULL/*widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_MERGECAP));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Editcap_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_EDITCAP));
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_EDITCAP));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Text2pcap_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TEXT2PCAP));
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(LOCALPAGE_MAN_TEXT2PCAP));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Website_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_HOME));
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_HOME));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Wiki_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_WIKI));
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_WIKI));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_Downloads_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_DOWNLOAD));
|
||||
topic_menu_cb(NULL/* widget _U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_DOWNLOAD));
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_SampleCaptures_cb(GtkAction *action _U_, gpointer user_data _U_)
|
||||
{
|
||||
topic_menu_cb( NULL/* widget_U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_SAMPLE_FILES));
|
||||
topic_menu_cb( NULL/* widget_U_ */, NULL /*GdkEventButton *event _U_*/, GINT_TO_POINTER(ONLINEPAGE_SAMPLE_FILES));
|
||||
}
|
||||
|
||||
static const char *ui_desc_menubar =
|
||||
|
@ -1365,7 +1365,7 @@ static const char *ui_desc_menubar =
|
|||
* circumstances, make a change that keeps them from doing so.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* GtkActionEntry
|
||||
* typedef struct {
|
||||
* const gchar *name;
|
||||
|
@ -1375,19 +1375,19 @@ static const char *ui_desc_menubar =
|
|||
* const gchar *tooltip;
|
||||
* GCallback callback;
|
||||
* } GtkActionEntry;
|
||||
* const gchar *name; The name of the action.
|
||||
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
|
||||
* const gchar *label; The label for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* If label is NULL, the label of the stock item with id stock_id is used.
|
||||
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
|
||||
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* GCallback callback; The function to call when the action is activated.
|
||||
* const gchar *name; The name of the action.
|
||||
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
|
||||
* const gchar *label; The label for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* If label is NULL, the label of the stock item with id stock_id is used.
|
||||
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
|
||||
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* GCallback callback; The function to call when the action is activated.
|
||||
*
|
||||
*/
|
||||
static const GtkActionEntry main_menu_bar_entries[] = {
|
||||
/* Top level */
|
||||
/* Top level */
|
||||
{ "/File", NULL, "_File", NULL, NULL, NULL },
|
||||
{ "/Edit", NULL, "_Edit", NULL, NULL, NULL },
|
||||
{ "/View", NULL, "_View", NULL, NULL, NULL },
|
||||
|
@ -1432,7 +1432,7 @@ static const GtkActionEntry main_menu_bar_entries[] = {
|
|||
NULL, NULL, G_CALLBACK(export_carrays_cmd_cb) },
|
||||
{ "/File/Export/File/PSML", NULL, "as XML - \"P_SML\" (packet summary) file...",
|
||||
NULL, NULL, G_CALLBACK(export_psml_cmd_cb) },
|
||||
{ "/File/Export/File/PDML", NULL, "as XML - \"P_DML\" (packet details) file...",
|
||||
{ "/File/Export/File/PDML", NULL, "as XML - \"P_DML\" (packet details) file...",
|
||||
NULL, NULL, G_CALLBACK(export_pdml_cmd_cb) },
|
||||
#endif /* _WIN32 */
|
||||
{ "/File/Export/SelectedPacketBytes", NULL, "Selected Packet _Bytes...", "<control>H", NULL, G_CALLBACK(savehex_cb) },
|
||||
|
@ -1659,7 +1659,7 @@ static const GtkActionEntry main_menu_bar_entries[] = {
|
|||
{ "/Analyze/ServiceResponseTime/ONC-RPC", WIRESHARK_STOCK_TIME, "ONC-RPC...", NULL, NULL, G_CALLBACK(gtk_rpcstat_cb) },
|
||||
|
||||
{ "/Analyze/BACnet", NULL, "BACnet", NULL, NULL, NULL },
|
||||
|
||||
|
||||
{ "/Analyze/StatisticsMenu/FlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Flo_w Graph...", NULL, NULL, G_CALLBACK(flow_graph_launch) },
|
||||
{ "/Analyze/StatisticsMenu/HTTP", NULL, "HTTP", NULL, NULL, NULL },
|
||||
{ "/Analyze/StatisticsMenu/TCPStreamGraphMenu", NULL, "TCP StreamGraph", NULL, NULL, NULL },
|
||||
|
@ -1668,7 +1668,7 @@ static const GtkActionEntry main_menu_bar_entries[] = {
|
|||
{ "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph", NULL, "Throughput Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
|
||||
{ "/Analyze/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph", NULL, "Round Trip Time Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
|
||||
{ "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph", NULL, "Window Scaling Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
|
||||
|
||||
|
||||
{ "/Analyze/StatisticsMenu/ONC-RPC-Programs", NULL, "ONC-RPC Programs", NULL, NULL, G_CALLBACK(gtk_rpcprogs_cb) },
|
||||
{ "/Analyze/StatisticsMenu/UDPMulticastStreams", NULL, "UDP Multicast Streams", NULL, NULL, G_CALLBACK(mcaststream_launch) },
|
||||
{ "/Analyze/StatisticsMenu/WLANTraffic", NULL, "WLAN Traffic", NULL, NULL, G_CALLBACK(wlanstat_launch) },
|
||||
|
@ -1709,7 +1709,7 @@ static const GtkActionEntry main_menu_bar_entries[] = {
|
|||
|
||||
{ "/Internals/Dissectortables", NULL, "_Dissector tables", NULL, NULL, G_CALLBACK(dissector_tables_dlg_cb) },
|
||||
{ "/Internals/SupportedProtocols", NULL, "_Supported Protocols (slow!)", NULL, NULL, G_CALLBACK(supported_cb) },
|
||||
|
||||
|
||||
{ "/Help/Contents", GTK_STOCK_HELP, "_Contents", "F1", NULL, G_CALLBACK(help_menu_cont_cb) },
|
||||
{ "/Help/ManualPages", NULL, "ManualPages", NULL, NULL, NULL },
|
||||
{ "/Help/ManualPages/Wireshark", NULL, "Wireshark", NULL, NULL, G_CALLBACK(help_menu_wireshark_cb) },
|
||||
|
@ -1729,19 +1729,19 @@ static const GtkActionEntry main_menu_bar_entries[] = {
|
|||
{ "/Help/AboutWireshark", WIRESHARK_STOCK_ABOUT, "_About Wireshark", NULL, NULL, G_CALLBACK(about_wireshark_cb) },
|
||||
};
|
||||
|
||||
static const GtkToggleActionEntry main_menu_bar_toggle_action_entries[] =
|
||||
static const GtkToggleActionEntry main_menu_bar_toggle_action_entries[] =
|
||||
{
|
||||
/* name, stock id, label, accel, tooltip, callback, is_active */
|
||||
{"/View/MainToolbar", NULL, "_Main Toolbar", NULL, NULL, G_CALLBACK(main_toolbar_show_hide_cb), TRUE},
|
||||
{"/View/FilterToolbar", NULL, "_FilterToolbar", NULL, NULL, G_CALLBACK(filter_toolbar_show_hide_cb), TRUE},
|
||||
{"/View/MainToolbar", NULL, "_Main Toolbar", NULL, NULL, G_CALLBACK(main_toolbar_show_hide_cb), TRUE},
|
||||
{"/View/FilterToolbar", NULL, "_FilterToolbar", NULL, NULL, G_CALLBACK(filter_toolbar_show_hide_cb), TRUE},
|
||||
#ifdef HAVE_AIRPCAP
|
||||
{"/View/WirelessToolbar", NULL, "_WirelessToolbar", NULL, NULL, G_CALLBACK(wireless_toolbar_show_hide_cb), TRUE},
|
||||
{"/View/WirelessToolbar", NULL, "_WirelessToolbar", NULL, NULL, G_CALLBACK(wireless_toolbar_show_hide_cb), TRUE},
|
||||
#endif /* HAVE_AIRPCAP */
|
||||
{"/View/Statusbar", NULL, "_Statusbar", NULL, NULL, G_CALLBACK(status_bar_show_hide_cb), TRUE},
|
||||
{"/View/PacketList", NULL, "Packet _List", NULL, NULL, G_CALLBACK(packet_list_show_hide_cb), TRUE},
|
||||
{"/View/PacketDetails", NULL, "Packet _Details", NULL, NULL, G_CALLBACK(packet_details_show_hide_cb), TRUE},
|
||||
{"/View/PacketBytes", NULL, "Packet _Bytes", NULL, NULL, G_CALLBACK(packet_bytes_show_hide_cb), TRUE},
|
||||
{"/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes", NULL, "Display Seconds with hours and minutes", NULL, NULL, G_CALLBACK(view_menu_seconds_time_cb), FALSE},
|
||||
{"/View/Statusbar", NULL, "_Statusbar", NULL, NULL, G_CALLBACK(status_bar_show_hide_cb), TRUE},
|
||||
{"/View/PacketList", NULL, "Packet _List", NULL, NULL, G_CALLBACK(packet_list_show_hide_cb), TRUE},
|
||||
{"/View/PacketDetails", NULL, "Packet _Details", NULL, NULL, G_CALLBACK(packet_details_show_hide_cb), TRUE},
|
||||
{"/View/PacketBytes", NULL, "Packet _Bytes", NULL, NULL, G_CALLBACK(packet_bytes_show_hide_cb), TRUE},
|
||||
{"/View/TimeDisplayFormat/DisplaySecondsWithHoursAndMinutes", NULL, "Display Seconds with hours and minutes", NULL, NULL, G_CALLBACK(view_menu_seconds_time_cb), FALSE},
|
||||
{"/View/NameResolution/ResolveName", NULL, "_Resolve Name", NULL, NULL, G_CALLBACK(resolve_name_cb), FALSE},
|
||||
{"/View/NameResolution/EnableforMACLayer", NULL, "Enable for _MAC Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_MAC_cb), TRUE},
|
||||
{"/View/NameResolution/EnableforNetworkLayer", NULL, "Enable for _Network Layer", NULL, NULL, G_CALLBACK(view_menu_en_for_network_cb), TRUE },
|
||||
|
@ -3285,9 +3285,7 @@ static const char *ui_desc_tree_view_menu_popup =
|
|||
" <separator/>\n"
|
||||
" <menuitem name='WikiProtocolPage' action='/WikiProtocolPage'/>\n"
|
||||
" <menuitem name='FilterFieldReference' action='/FilterFieldReference'/>\n"
|
||||
#if GLIB_CHECK_VERSION(2,14,0) /* GRegex */
|
||||
" <menuitem name='ProtocolHelp' action='/ProtocolHelp'/>\n"
|
||||
#endif /* GLIB_CHECK_VERSION(2,14,0) */
|
||||
" <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n"
|
||||
" <separator/>\n"
|
||||
" <menuitem name='DecodeAs' action='/DecodeAs'/>\n"
|
||||
|
@ -3355,9 +3353,7 @@ static const GtkActionEntry tree_view_menu_popup_action_entries[] = {
|
|||
|
||||
{ "/WikiProtocolPage", WIRESHARK_STOCK_WIKI, "Wiki Protocol Page", NULL, NULL, G_CALLBACK(selected_ptree_info_cb) },
|
||||
{ "/FilterFieldReference", WIRESHARK_STOCK_INTERNET, "Filter Field Reference", NULL, NULL, G_CALLBACK(selected_ptree_ref_cb) },
|
||||
#if GLIB_CHECK_VERSION(2,14,0) /* GRegex */
|
||||
{ "/ProtocolHelp", NULL, "Protocol Help", NULL, NULL, NULL },
|
||||
#endif /* GLIB_CHECK_VERSION(2,14,0) */
|
||||
{ "/ProtocolPreferences", NULL, "Protocol Preferences", NULL, NULL, NULL },
|
||||
{ "/DecodeAs", WIRESHARK_STOCK_DECODE_AS, "Decode As...", NULL, NULL, G_CALLBACK(decode_as_cb) },
|
||||
{ "/DisableProtocol", WIRESHARK_STOCK_CHECKBOX, "Disable Protocol...", NULL, NULL, G_CALLBACK(proto_disable_cb) },
|
||||
|
@ -3397,11 +3393,7 @@ static const GtkActionEntry statusbar_profiles_menu_action_entries [] =
|
|||
{
|
||||
{ "/Profiles", NULL, "Configuration Profiles...", NULL, NULL, G_CALLBACK(profile_dialog_cb) },
|
||||
{ "/New", GTK_STOCK_NEW, "New...", NULL, NULL, G_CALLBACK(profile_new_cb) },
|
||||
#if GLIB_CHECK_VERSION(2,6,0)
|
||||
{ "/Edit", GTK_STOCK_EDIT, "Edit...", NULL, NULL, G_CALLBACK(profile_edit_cb) },
|
||||
#else
|
||||
{ "/Edit", NULL, "Edit...", NULL, NULL, G_CALLBACK(profile_edit_cb) },
|
||||
#endif
|
||||
{ "/Delete", GTK_STOCK_DELETE, "Delete", NULL, NULL, G_CALLBACK(profile_delete_cb) },
|
||||
{ "/Change", NULL, "Change", NULL, NULL, NULL },
|
||||
{ "/Change/Default", NULL, "Default", NULL, NULL, NULL },
|
||||
|
@ -3726,7 +3718,7 @@ menus_init(void) {
|
|||
|
||||
/* main */
|
||||
#ifdef MAIN_MENU_USE_UIMANAGER
|
||||
main_menu_bar_action_group = gtk_action_group_new ("MenuActionGroup");
|
||||
main_menu_bar_action_group = gtk_action_group_new ("MenuActionGroup");
|
||||
gtk_action_group_add_actions (main_menu_bar_action_group, /* the action group */
|
||||
main_menu_bar_entries, /* an array of action descriptions */
|
||||
G_N_ELEMENTS(main_menu_bar_entries), /* the number of entries */
|
||||
|
@ -3755,13 +3747,13 @@ menus_init(void) {
|
|||
|
||||
ui_manager_main_menubar = gtk_ui_manager_new ();
|
||||
gtk_ui_manager_insert_action_group (ui_manager_main_menubar, main_menu_bar_action_group, 0);
|
||||
gtk_ui_manager_add_ui_from_string (ui_manager_main_menubar,ui_desc_menubar, -1, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
fprintf (stderr, "Warning: building main menubar failed: %s\n",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
gtk_ui_manager_add_ui_from_string (ui_manager_main_menubar,ui_desc_menubar, -1, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
fprintf (stderr, "Warning: building main menubar failed: %s\n",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
g_object_unref(main_menu_bar_action_group);
|
||||
gtk_window_add_accel_group (GTK_WINDOW(top_level),
|
||||
|
@ -4071,7 +4063,7 @@ gboolean enabled = FALSE;
|
|||
* the main menu.
|
||||
*/
|
||||
tap_menu_item_add(
|
||||
group, gui_path, name, label, stock_id,
|
||||
group, gui_path, name, label, stock_id,
|
||||
accelerator, tooltip, callback, enabled,
|
||||
selected_packet_enabled, selected_tree_row_enabled,
|
||||
callback_data, curnode);
|
||||
|
@ -4144,7 +4136,7 @@ register_stat_menu_item(
|
|||
register_stat_menu_item_stock(
|
||||
name,
|
||||
group,
|
||||
NULL, /* stock_id */
|
||||
NULL, /* stock_id */
|
||||
callback,
|
||||
selected_packet_enabled,
|
||||
selected_tree_row_enabled,
|
||||
|
@ -4459,12 +4451,8 @@ set_menu_sensitivity(GtkUIManager *ui_manager, const gchar *path, gint val)
|
|||
#endif
|
||||
return;
|
||||
}
|
||||
#if GLIB_CHECK_VERSION(2,6,0)
|
||||
gtk_action_set_sensitive (action,
|
||||
val); /* TRUE to make the action sensitive */
|
||||
#else
|
||||
g_object_set (G_OBJECT (action), "sensitive", val, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef MAIN_MENU_USE_UIMANAGER
|
||||
|
@ -4715,12 +4703,12 @@ recent_changed_cb (GtkUIManager *ui_manager,
|
|||
|
||||
merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (ui_manager),
|
||||
"recent-files-merge-id"));
|
||||
|
||||
|
||||
/* remove the UI */
|
||||
gtk_ui_manager_remove_ui (ui_manager, merge_id);
|
||||
|
||||
/* remove the action group; gtk_ui_manager_remove_action_group()
|
||||
* should really take the action group's name instead of its
|
||||
* should really take the action group's name instead of its
|
||||
* pointer.
|
||||
*/
|
||||
action_groups = gtk_ui_manager_get_action_groups (ui_manager);
|
||||
|
@ -4753,7 +4741,7 @@ recent_clear_cb(GtkAction *action _U_, gpointer user_data _U_)
|
|||
g_list_free(recent_files_list);
|
||||
recent_files_list = NULL;
|
||||
g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
|
||||
/* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
|
||||
/* Calling recent_changed_cb will rebuild the GUI call add_recent_items which will in turn call
|
||||
* main_welcome_reset_recent_capture_files
|
||||
*/
|
||||
recent_changed_cb(ui_manager_main_menubar, NULL);
|
||||
|
@ -4802,7 +4790,7 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
|
|||
"recent-info-empty",
|
||||
GTK_UI_MANAGER_MENUITEM,
|
||||
FALSE);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4864,7 +4852,7 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
|
|||
"clear-recent-info",
|
||||
GTK_UI_MANAGER_MENUITEM,
|
||||
FALSE);
|
||||
|
||||
|
||||
}
|
||||
#endif /* MAIN_MENU_USE_UIMANAGER */
|
||||
|
||||
|
@ -7127,4 +7115,3 @@ void set_menus_for_profiles(gboolean default_profile)
|
|||
* ex: set shiftwidth=4 tabstop=8 expandtab
|
||||
* :indentSize=4:tabSize=8:noTabs=true:
|
||||
*/
|
||||
|
||||
|
|
|
@ -109,10 +109,8 @@ GtkWidget* create_list(void)
|
|||
list_view = GTK_TREE_VIEW(list);
|
||||
sortable = GTK_TREE_SORTABLE(list_store);
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
/* Speed up the list display */
|
||||
gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
|
||||
#endif
|
||||
|
||||
/* Setup the sortable columns */
|
||||
gtk_tree_sortable_set_sort_column_id(sortable, OPC_COLUMN, GTK_SORT_ASCENDING);
|
||||
|
@ -328,12 +326,7 @@ mtp3_stat_draw(
|
|||
}
|
||||
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
|
||||
#else
|
||||
gtk_list_store_append (list_store, &iter);
|
||||
gtk_list_store_set (list_store, &iter,
|
||||
#endif
|
||||
OPC_COLUMN, dlg.entries[0],
|
||||
DPC_COLUMN, dlg.entries[1],
|
||||
SI_COLUMN, mtp3_service_indicator_code_short_vals[j].strptr,
|
||||
|
@ -381,7 +374,7 @@ mtp3_stat_gtk_win_create(
|
|||
gtk_box_pack_start(GTK_BOX(vbox), dlg_p->scrolled_win, TRUE, TRUE, 0);
|
||||
|
||||
dlg_p->table = create_list();
|
||||
|
||||
|
||||
gtk_widget_show(dlg_p->table);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(dlg_p->scrolled_win), dlg_p->table);
|
||||
|
|
|
@ -99,13 +99,11 @@ GtkWidget* create_list(void)
|
|||
/* Create a view */
|
||||
list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
|
||||
|
||||
list_view = GTK_TREE_VIEW(list);
|
||||
sortable = GTK_TREE_SORTABLE(list_store);
|
||||
list_view = GTK_TREE_VIEW(list);
|
||||
sortable = GTK_TREE_SORTABLE(list_store);
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
/* Speed up the list display */
|
||||
gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
|
||||
#endif
|
||||
/* Speed up the list display */
|
||||
gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
|
||||
|
||||
/* Setup the sortable columns */
|
||||
gtk_tree_sortable_set_sort_column_id(sortable, SI_COLUMN, GTK_SORT_ASCENDING);
|
||||
|
@ -114,27 +112,27 @@ GtkWidget* create_list(void)
|
|||
/* The view now holds a reference. We can get rid of our own reference */
|
||||
g_object_unref (G_OBJECT (list_store));
|
||||
|
||||
/*
|
||||
* Create the first column packet, associating the "text" attribute of the
|
||||
* cell_renderer to the first column of the model
|
||||
*/
|
||||
/* 1:st column */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("SI", renderer,
|
||||
"text", SI_COLUMN,
|
||||
/*
|
||||
* Create the first column packet, associating the "text" attribute of the
|
||||
* cell_renderer to the first column of the model
|
||||
*/
|
||||
/* 1:st column */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("SI", renderer,
|
||||
"text", SI_COLUMN,
|
||||
NULL);
|
||||
|
||||
gtk_tree_view_column_set_sort_column_id(column, SI_COLUMN);
|
||||
gtk_tree_view_column_set_sort_column_id(column, SI_COLUMN);
|
||||
gtk_tree_view_column_set_resizable(column, TRUE);
|
||||
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_min_width(column, 110);
|
||||
|
||||
/* Add the column to the view. */
|
||||
/* Add the column to the view. */
|
||||
gtk_tree_view_append_column (list_view, column);
|
||||
|
||||
/* 2:nd column... */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Num MSUs", renderer,
|
||||
column = gtk_tree_view_column_new_with_attributes ("Num MSUs", renderer,
|
||||
"text", NUM_MSUS_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_sort_column_id(column, NUM_MSUS_COLUMN);
|
||||
|
@ -143,9 +141,9 @@ GtkWidget* create_list(void)
|
|||
gtk_tree_view_column_set_min_width(column, 100);
|
||||
gtk_tree_view_append_column (list_view, column);
|
||||
|
||||
/* 3:d column... */
|
||||
/* 3:d column... */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("MSUs/sec", renderer,
|
||||
column = gtk_tree_view_column_new_with_attributes ("MSUs/sec", renderer,
|
||||
"text", NUM_MSUS_SEC_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_sort_column_id(column, NUM_MSUS_SEC_COLUMN);
|
||||
|
@ -154,9 +152,9 @@ GtkWidget* create_list(void)
|
|||
gtk_tree_view_column_set_min_width(column, 100);
|
||||
gtk_tree_view_append_column (list_view, column);
|
||||
|
||||
/* 4:d column... */
|
||||
/* 4:d column... */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
|
||||
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
|
||||
"text", NUM_BYTES_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_sort_column_id(column, NUM_BYTES_COLUMN);
|
||||
|
@ -167,10 +165,10 @@ GtkWidget* create_list(void)
|
|||
|
||||
/* 5:th column... */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Bytes/MSU", renderer,
|
||||
"text", NUM_BYTES_MSU_COLUMN,
|
||||
column = gtk_tree_view_column_new_with_attributes ("Bytes/MSU", renderer,
|
||||
"text", NUM_BYTES_MSU_COLUMN,
|
||||
NULL);
|
||||
|
||||
|
||||
|
||||
gtk_tree_view_column_set_sort_column_id(column, NUM_BYTES_MSU_COLUMN);
|
||||
gtk_tree_view_column_set_resizable(column, TRUE);
|
||||
|
@ -180,8 +178,8 @@ GtkWidget* create_list(void)
|
|||
|
||||
/* 6:th column... */
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Bytes/sec", renderer,
|
||||
"text", NUM_BYTES_SEC_COLUMN,
|
||||
column = gtk_tree_view_column_new_with_attributes ("Bytes/sec", renderer,
|
||||
"text", NUM_BYTES_SEC_COLUMN,
|
||||
NULL);
|
||||
|
||||
gtk_tree_view_column_set_sort_column_id(column, NUM_BYTES_SEC_COLUMN);
|
||||
|
@ -190,15 +188,15 @@ GtkWidget* create_list(void)
|
|||
gtk_tree_view_column_set_min_width(column, 100);
|
||||
gtk_tree_view_append_column (list_view, column);
|
||||
|
||||
/* Now enable the sorting of each column */
|
||||
/* Now enable the sorting of each column */
|
||||
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), TRUE);
|
||||
gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(list_view), TRUE);
|
||||
|
||||
/* Setup the selection handler */
|
||||
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
|
||||
gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
|
||||
/* Setup the selection handler */
|
||||
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
|
||||
gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
|
||||
|
||||
return list;
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
|
@ -254,12 +252,7 @@ mtp3_sum_draw(
|
|||
entries[4] = (num_msus) ? g_strdup_printf("%.2f", (double)num_bytes/num_msus) : g_strdup("N/A");
|
||||
entries[5] = (seconds) ? g_strdup_printf("%.2f", (double)num_bytes/seconds) : g_strdup("N/A");
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
|
||||
#else
|
||||
gtk_list_store_append (list_store, &iter);
|
||||
gtk_list_store_set (list_store, &iter,
|
||||
#endif
|
||||
SI_COLUMN, mtp3_service_indicator_code_short_vals[i].strptr,
|
||||
NUM_MSUS_COLUMN, num_msus,
|
||||
NUM_MSUS_SEC_COLUMN, entries[2],
|
||||
|
@ -290,7 +283,7 @@ mtp3_sum_gtk_sum_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
double seconds;
|
||||
int tot_num_msus;
|
||||
double tot_num_bytes;
|
||||
|
||||
|
||||
/* initialize the tally */
|
||||
summary_fill_in(&cfile, &summary);
|
||||
|
||||
|
@ -360,7 +353,7 @@ mtp3_sum_gtk_sum_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
gtk_widget_show(table_fr);
|
||||
|
||||
table = create_list();
|
||||
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(table_fr), table);
|
||||
gtk_widget_show(table);
|
||||
|
||||
|
|
|
@ -737,10 +737,8 @@ create_view_and_model(void)
|
|||
|
||||
packetlist->view = tree_view_new(GTK_TREE_MODEL(packetlist));
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
gtk_tree_view_set_fixed_height_mode(GTK_TREE_VIEW(packetlist->view),
|
||||
TRUE);
|
||||
#endif
|
||||
g_signal_connect(packetlist->view, "cursor-changed",
|
||||
G_CALLBACK(new_packet_list_select_cb), NULL);
|
||||
g_signal_connect(packetlist->view, "row-activated",
|
||||
|
|
|
@ -7,17 +7,17 @@
|
|||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
@ -31,8 +31,6 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
|
||||
#include <epan/filesystem.h>
|
||||
|
||||
#include "../simple_dialog.h"
|
||||
|
@ -62,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));
|
||||
|
||||
|
||||
/* Perhaps the user specified a directory instead of a file.
|
||||
Check whether they did. */
|
||||
if(test_for_directory(filename) == EISDIR) {
|
||||
|
@ -106,7 +104,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
|
|||
gchar *format_name;
|
||||
guint format_index = 0;
|
||||
guint default_index = 0;
|
||||
|
||||
|
||||
pixbuf = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE(pixmap), NULL,
|
||||
0, 0, 0, 0, -1, -1);
|
||||
|
||||
|
@ -128,9 +126,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
|
|||
|
||||
save_as_w = file_selection_new("Wireshark: Save Graph As ...",
|
||||
FILE_SELECTION_SAVE);
|
||||
#if GTK_CHECK_VERSION(2,8,0)
|
||||
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(save_as_w), TRUE);
|
||||
#endif
|
||||
|
||||
/* Container for each row of widgets */
|
||||
main_vb = gtk_vbox_new(FALSE, 0);
|
||||
|
@ -147,7 +143,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
|
|||
|
||||
type_cm = gtk_combo_box_new_text();
|
||||
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 */
|
||||
file_formats = gdk_pixbuf_get_formats();
|
||||
ffp = file_formats;
|
||||
|
@ -179,7 +175,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
|
|||
#else
|
||||
gdk_window_set_transient_for(save_as_w->window, parent);
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
if(gtk_dialog_run(GTK_DIALOG(save_as_w)) == GTK_RESPONSE_ACCEPT)
|
||||
pixbuf_save_button_cb(save_as_w, pixbuf);
|
||||
|
@ -207,5 +203,3 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
|
|||
window_destroy(save_as_w);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* GTK_CHECK_VERSION(2,6,0) */
|
||||
|
|
|
@ -901,10 +901,6 @@ ifopts_edit_linktype_changed_cb(GtkComboBox *cb, gpointer udata)
|
|||
#endif
|
||||
gint linktype;
|
||||
GtkTreeModel *list_model;
|
||||
#if ! GTK_CHECK_VERSION(2,6,0)
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
#endif
|
||||
GtkTreeIter list_iter;
|
||||
GtkListStore *list_store;
|
||||
|
||||
|
@ -926,14 +922,8 @@ ifopts_edit_linktype_changed_cb(GtkComboBox *cb, gpointer udata)
|
|||
-1);
|
||||
|
||||
/* get current description text and set value in list_store for currently selected interface */
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
text = gtk_combo_box_get_active_text(cb);
|
||||
if (text) {
|
||||
#else
|
||||
if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(cb), &iter)) {
|
||||
model = gtk_combo_box_get_model(GTK_COMBO_BOX(cb));
|
||||
gtk_tree_model_get(model, &iter, 0, &text, -1);
|
||||
#endif
|
||||
#ifdef HAVE_PCAP_CREATE
|
||||
linktype = ifopts_description_to_val(ifnm, monitor_mode, text);
|
||||
#else
|
||||
|
@ -1135,12 +1125,7 @@ ifopts_options_add(GtkListStore *list_store, if_info_t *if_info)
|
|||
|
||||
/* add row to ListStore */
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
|
||||
#else
|
||||
gtk_list_store_append (list_store, &iter);
|
||||
gtk_list_store_set (list_store, &iter,
|
||||
#endif
|
||||
DEVICE_COLUMN, text[0],
|
||||
DESC_COLUMN, text[1],
|
||||
#ifdef HAVE_PCAP_CREATE
|
||||
|
|
|
@ -143,14 +143,14 @@ column_prefs_show(GtkWidget *prefs_window) {
|
|||
store = gtk_list_store_new(N_COLUMN,
|
||||
G_TYPE_BOOLEAN,
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
|
||||
column_row_deleted_handler_id =
|
||||
column_row_deleted_handler_id =
|
||||
g_signal_connect(GTK_TREE_MODEL(store), "row-deleted", G_CALLBACK(column_dnd_row_deleted_cb), NULL);
|
||||
|
||||
column_l = tree_view_new(GTK_TREE_MODEL(store));
|
||||
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(column_l), TRUE);
|
||||
gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(column_l), FALSE);
|
||||
gtk_tree_view_set_reorderable(GTK_TREE_VIEW(column_l), TRUE);
|
||||
gtk_tooltips_set_tip (tooltips, column_l,
|
||||
gtk_tooltips_set_tip (tooltips, column_l,
|
||||
"Click on a title to change its name.\nDrag an item to change its order.", NULL);
|
||||
|
||||
renderer = gtk_cell_renderer_toggle_new();
|
||||
|
@ -198,12 +198,7 @@ column_prefs_show(GtkWidget *prefs_window) {
|
|||
}
|
||||
fmt = g_strdup_printf("%s", col_format_desc(cur_fmt));
|
||||
}
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
gtk_list_store_insert_with_values(store, &iter, G_MAXINT,
|
||||
#else
|
||||
gtk_list_store_append(store, &iter);
|
||||
gtk_list_store_set(store, &iter,
|
||||
#endif
|
||||
VISIBLE_COLUMN, cfmt->visible,
|
||||
TITLE_COLUMN, cfmt->title, FORMAT_COLUMN, fmt, DATA_COLUMN, clp, -1);
|
||||
|
||||
|
@ -241,7 +236,7 @@ column_prefs_show(GtkWidget *prefs_window) {
|
|||
gtk_tooltips_set_tip (tooltips, remove_bt,
|
||||
"Remove the selected column.", NULL);
|
||||
gtk_widget_show(remove_bt);
|
||||
|
||||
|
||||
/* properties frame */
|
||||
props_fr = gtk_frame_new("Properties");
|
||||
gtk_box_pack_start (GTK_BOX (bottom_hb), props_fr, TRUE, TRUE, 0);
|
||||
|
@ -284,7 +279,7 @@ column_prefs_show(GtkWidget *prefs_window) {
|
|||
/* XXX: column_field_changed_cb will be called for every character entered in the entry box. */
|
||||
/* Consider Changing logic so that the field is "accepted" only when a return is entered ?? */
|
||||
/* Also: entry shouldn't be accepted if it's not a valid filter ? */
|
||||
column_field_changed_handler_id =
|
||||
column_field_changed_handler_id =
|
||||
g_signal_connect(field_te, "changed", G_CALLBACK(column_field_changed_cb), column_l);
|
||||
|
||||
g_object_set_data(G_OBJECT(main_vb), E_FILT_AUTOCOMP_PTR_KEY, NULL);
|
||||
|
@ -313,7 +308,7 @@ column_prefs_show(GtkWidget *prefs_window) {
|
|||
|
||||
/* XXX: column_occurrence_changed_cb will be called for every character entered in the entry box. */
|
||||
/* Consider Changing logic so that the field is "accepted" only when a return is entered ?? */
|
||||
column_occurrence_changed_handler_id =
|
||||
column_occurrence_changed_handler_id =
|
||||
g_signal_connect(occurrence_te, "changed", G_CALLBACK(column_occurrence_changed_cb), column_l);
|
||||
|
||||
gtk_table_attach_defaults(GTK_TABLE(tb), occurrence_te, 3, 4, 1, 2);
|
||||
|
@ -404,12 +399,7 @@ column_list_new_cb(GtkWidget *w _U_, gpointer data) {
|
|||
column_prefs_add_custom (cur_fmt, title, NULL, 0);
|
||||
|
||||
model = gtk_tree_view_get_model(column_l);
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
gtk_list_store_insert_with_values(GTK_LIST_STORE(model), &iter, G_MAXINT,
|
||||
#else
|
||||
gtk_list_store_append(GTK_LIST_STORE(model), &iter);
|
||||
gtk_list_store_set(GTK_LIST_STORE(model), &iter,
|
||||
#endif
|
||||
VISIBLE_COLUMN, TRUE,
|
||||
TITLE_COLUMN, title,
|
||||
FORMAT_COLUMN, col_format_desc(cur_fmt),
|
||||
|
@ -507,20 +497,20 @@ column_title_changed_cb(GtkCellRendererText *cell _U_, const gchar *str_path, co
|
|||
GtkTreePath *path = gtk_tree_path_new_from_string (str_path);
|
||||
GtkTreeIter iter;
|
||||
|
||||
gtk_tree_model_get_iter(model, &iter, path);
|
||||
|
||||
gtk_tree_model_get_iter(model, &iter, path);
|
||||
|
||||
gtk_list_store_set(GTK_LIST_STORE(model), &iter, TITLE_COLUMN, new_title, -1);
|
||||
|
||||
gtk_tree_model_get(model, &iter, DATA_COLUMN, &clp, -1);
|
||||
if (clp) {
|
||||
if (clp) {
|
||||
cfmt = (fmt_data *) clp->data;
|
||||
g_free(cfmt->title);
|
||||
cfmt->title = g_strdup(new_title);
|
||||
}
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
cfile.cinfo.columns_changed = TRUE;
|
||||
return TRUE;
|
||||
cfile.cinfo.columns_changed = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -708,7 +698,7 @@ column_field_changed_cb(GtkEditable *te, gpointer data) {
|
|||
return; /* no action req'd */
|
||||
}
|
||||
|
||||
/* The user has entered a new value in the field entry box: make the req'd changes */
|
||||
/* The user has entered a new value in the field entry box: make the req'd changes */
|
||||
cur_fmt = get_column_format_from_str(cfmt->fmt);
|
||||
if (cfmt->custom_occurrence) {
|
||||
fmt = g_strdup_printf("%s (%s#%d)", col_format_desc(cur_fmt), field, cfmt->custom_occurrence);
|
||||
|
@ -757,7 +747,7 @@ column_occurrence_changed_cb(GtkEditable *te, gpointer data) {
|
|||
return; /* no action req'd */
|
||||
}
|
||||
|
||||
/* The user has entered a new value in the field occurrence entry box: make the req'd changes */
|
||||
/* The user has entered a new value in the field occurrence entry box: make the req'd changes */
|
||||
cur_fmt = get_column_format_from_str(cfmt->fmt);
|
||||
if (occurrence) {
|
||||
fmt = g_strdup_printf("%s (%s#%d)", col_format_desc(cur_fmt), cfmt->custom_field, occurrence);
|
||||
|
@ -775,7 +765,7 @@ column_occurrence_changed_cb(GtkEditable *te, gpointer data) {
|
|||
/*
|
||||
* Callback for the "row-deleted" signal emitted when a list item is dragged.
|
||||
* http://library.gnome.org/devel/gtk/stable/GtkTreeModel.html#GtkTreeModel-rows-reordered
|
||||
* says that DND deletes, THEN inserts the row.
|
||||
* says that DND deletes, THEN inserts the row.
|
||||
*
|
||||
* XXX: For the record: For Gtk+ 2.16.0 testing shows the actual sequence for drag-and-drop to be as follows:
|
||||
* 1. Insert a new, empty row at the destination;
|
||||
|
@ -784,7 +774,7 @@ column_occurrence_changed_cb(GtkEditable *te, gpointer data) {
|
|||
* 4. Delete the source row;
|
||||
* 5. Emit a "row-deleted" signal; invoke any row-deleted callbacks & etc.
|
||||
*
|
||||
* The code below (invoked as a consequence of a "row-deleted" signal) rebuilds
|
||||
* The code below (invoked as a consequence of a "row-deleted" signal) rebuilds
|
||||
* prefs.col_list by iterating over the (re-ordered) tree model.
|
||||
*/
|
||||
static void
|
||||
|
|
|
@ -43,8 +43,6 @@
|
|||
|
||||
#include "gtk/proto_help.h"
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,14,0) /* GRegex */
|
||||
|
||||
#define PH_MENU_TOP "/Protocol Help"
|
||||
|
||||
#define PH_FILE_LOG "ph.log"
|
||||
|
@ -664,11 +662,3 @@ static void ph_logging_handler(const gchar *domain _U_, GLogLevelFlags level, co
|
|||
}
|
||||
}
|
||||
#endif /* PH_DEBUG_LOG */
|
||||
|
||||
#else /* GLIB_CHECK_VERSION(2,14,0) */ /* No GRegex */
|
||||
|
||||
void proto_help_init(void) {}
|
||||
void proto_help_menu_init(GtkWidget *widget _U_) {}
|
||||
void proto_help_menu_modify(GtkTreeSelection *selection _U_, capture_file *cf _U_) {}
|
||||
|
||||
#endif /* GLIB_CHECK_VERSION(2,14,0) */
|
||||
|
|
|
@ -429,13 +429,13 @@ create_tree(GtkWidget *container, ph_stats_t *ps)
|
|||
|
||||
/* Scrolled Window */
|
||||
sw = scrolled_window_new(NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
|
||||
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
|
||||
GTK_SHADOW_IN);
|
||||
gtk_container_add(GTK_CONTAINER(container), sw);
|
||||
|
||||
store = gtk_tree_store_new(NUM_STAT_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_FLOAT,
|
||||
G_TYPE_FLOAT);
|
||||
tree = tree_view_new(GTK_TREE_MODEL(store));
|
||||
|
@ -449,21 +449,12 @@ create_tree(GtkWidget *container, ph_stats_t *ps)
|
|||
NULL);
|
||||
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
||||
gtk_tree_view_append_column(tree_view, column);
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
renderer = gtk_cell_renderer_progress_new();
|
||||
column = gtk_tree_view_column_new_with_attributes("% Packets", renderer,
|
||||
"text", PRCT_PKTS_COLUMN,
|
||||
"value", PRCT_PKTS_VALUE_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_expand(column, TRUE);
|
||||
#else
|
||||
gtk_tree_view_column_set_expand(column, TRUE);
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
column = gtk_tree_view_column_new_with_attributes("% Packets", renderer,
|
||||
"text", PRCT_PKTS_COLUMN,
|
||||
NULL);
|
||||
g_object_set(G_OBJECT(renderer), "xalign", 1.0, NULL);
|
||||
#endif
|
||||
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
||||
gtk_tree_view_append_column(tree_view, column);
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
|
@ -473,20 +464,12 @@ create_tree(GtkWidget *container, ph_stats_t *ps)
|
|||
g_object_set(G_OBJECT(renderer), "xalign", 1.0, NULL);
|
||||
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
||||
gtk_tree_view_append_column(tree_view, column);
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
renderer = gtk_cell_renderer_progress_new();
|
||||
column = gtk_tree_view_column_new_with_attributes("% Bytes", renderer,
|
||||
"text", PRCT_BYTES_COLUMN,
|
||||
"value", PRCT_BYTES_VALUE_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_expand(column, TRUE);
|
||||
#else
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
column = gtk_tree_view_column_new_with_attributes("% Bytes", renderer,
|
||||
"text", PRCT_BYTES_COLUMN,
|
||||
NULL);
|
||||
g_object_set(G_OBJECT(renderer), "xalign", 1.0, NULL);
|
||||
#endif
|
||||
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
||||
gtk_tree_view_append_column(tree_view, column);
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
|
@ -603,4 +586,3 @@ proto_hier_stats_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
* ex: set shiftwidth=4 tabstop=8 expandtab
|
||||
* :indentSize=4:tabSize=8:noTabs=true:
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue