diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2008-04-05 23:16:59 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2008-04-05 23:16:59 +0000 |
commit | a171ea47690441183a008bc484f5d4354c4d0f68 (patch) | |
tree | 2e00dd102461a5d26a219f1aafd94cd379592194 | |
parent | 7b909cf305a5e6dc7941e362338dc3d012d04b67 (diff) |
click on the "expert info" indicator opens the corresponding dialog
svn path=/trunk/; revision=24798
-rw-r--r-- | gtk/expert_comp_dlg.c | 3 | ||||
-rw-r--r-- | gtk/expert_comp_dlg.h | 25 | ||||
-rw-r--r-- | gtk/main.c | 80 |
3 files changed, 84 insertions, 24 deletions
diff --git a/gtk/expert_comp_dlg.c b/gtk/expert_comp_dlg.c index dad99f8852..c98e45c2d4 100644 --- a/gtk/expert_comp_dlg.c +++ b/gtk/expert_comp_dlg.c @@ -45,6 +45,7 @@ #include "gui_stat_menu.h" #include <epan/stat_cmd_args.h> #include "help_dlg.h" +#include "expert_comp_dlg.h" /* used to keep track of the statistics for an entire program interface */ typedef struct _expert_comp_dlg_t { @@ -315,7 +316,7 @@ expert_comp_init(const char *optarg _U_, void* userdata _U_) cf_redissect_packets(&cfile); } -static void +void expert_comp_dlg_cb(GtkWidget *w _U_, gpointer d _U_) { expert_comp_init("", NULL); diff --git a/gtk/expert_comp_dlg.h b/gtk/expert_comp_dlg.h new file mode 100644 index 0000000000..db87a82ef9 --- /dev/null +++ b/gtk/expert_comp_dlg.h @@ -0,0 +1,25 @@ +/* expert_comp_dlg.h + * expert_comp_dlg 2005 Greg Morris + * + * $Id$ + * + * 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. + */ + +void expert_comp_dlg_cb(GtkWidget *w, gpointer d); diff --git a/gtk/main.c b/gtk/main.c index 10367d5ed9..164e6fc310 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -152,6 +152,7 @@ #include "log.h" #include "../epan/emem.h" #include "file_util.h" +#include "expert_comp_dlg.h" #ifdef HAVE_LIBPCAP #include "../image/wsicon16.xpm" #include "../image/wsicon32.xpm" @@ -1477,16 +1478,7 @@ set_display_filename(capture_file *cf) add_menu_recent_capture_file(cf->filename); } - /* convert file size */ - if (cf->f_datalen/1024/1024 > 10) { - size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d MB", cf->f_datalen/1024/1024); - } else if (cf->f_datalen/1024 > 10) { - size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d KB", cf->f_datalen/1024); - } else { - size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d Bytes", cf->f_datalen); - } - - /* statusbar */ + /* expert info indicator */ gtk_widget_hide(expert_info_error); gtk_widget_hide(expert_info_warn); gtk_widget_hide(expert_info_note); @@ -1510,6 +1502,16 @@ set_display_filename(capture_file *cf) break; } + /* statusbar */ + /* convert file size */ + if (cf->f_datalen/1024/1024 > 10) { + size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d MB", cf->f_datalen/1024/1024); + } else if (cf->f_datalen/1024 > 10) { + size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d KB", cf->f_datalen/1024); + } else { + size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d Bytes", cf->f_datalen); + } + status_msg = g_strdup_printf(" File: \"%s\" %s %02lu:%02lu:%02lu", (cf->filename) ? cf->filename : "", size_str, (long)cf->elapsed_time.secs/3600, @@ -1567,6 +1569,13 @@ main_cf_cb_file_closing(capture_file *cf) will there ever be more than one on the stack? */ statusbar_pop_file_msg(); + /* reset expert info indicator */ + gtk_widget_hide(expert_info_error); + gtk_widget_hide(expert_info_warn); + gtk_widget_hide(expert_info_note); + gtk_widget_hide(expert_info_chat); + gtk_widget_show(expert_info_none); + /* Restore the standard title bar message. */ set_main_window_name("The Wireshark Network Analyzer"); @@ -1751,7 +1760,7 @@ main_cf_cb_live_capture_update_continue(capture_file *cf) statusbar_pop_file_msg(); - /* expert info */ + /* expert info indicator */ gtk_widget_hide(expert_info_error); gtk_widget_hide(expert_info_warn); gtk_widget_hide(expert_info_note); @@ -3894,7 +3903,8 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs) *channel_offset_lb = NULL, *channel_offset_cb = NULL, *wrong_crc_lb = NULL, - *wrong_crc_cm = NULL; + *wrong_crc_cm = NULL, + *expert_image = NULL; GtkWidget *enable_decryption_lb; GtkWidget *enable_decryption_cb; @@ -4318,17 +4328,41 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs) OBJECT_SET_DATA(popup_menu_object, E_DFILTER_TE_KEY, filter_te); OBJECT_SET_DATA(popup_menu_object, E_MPACKET_LIST_KEY, packet_list); - /* expert status icons */ - expert_info_error = xpm_to_widget_from_parent(top_level, expert_error_xpm); - gtk_tooltips_set_tip(tooltips, expert_info_error, "Error is the highest expert info level", NULL); - expert_info_warn = xpm_to_widget_from_parent(top_level, expert_warn_xpm); - gtk_tooltips_set_tip(tooltips, expert_info_warn, "Warning is the highest expert info level", NULL); - expert_info_note = xpm_to_widget_from_parent(top_level, expert_note_xpm); - gtk_tooltips_set_tip(tooltips, expert_info_note, "Note is the highest expert info level", NULL); - expert_info_chat = xpm_to_widget_from_parent(top_level, expert_chat_xpm); - gtk_tooltips_set_tip(tooltips, expert_info_chat, "Chat is the highest expert info level", NULL); - expert_info_none = xpm_to_widget_from_parent(top_level, expert_none_xpm); - gtk_tooltips_set_tip(tooltips, expert_info_none, "No expert info", NULL); + /* expert info indicator */ + expert_image = xpm_to_widget_from_parent(top_level, expert_error_xpm); + gtk_tooltips_set_tip(tooltips, expert_image, "ERROR is the highest expert info level", NULL); + gtk_widget_show(expert_image); + expert_info_error = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(expert_info_error), expert_image); + SIGNAL_CONNECT(expert_info_error, "button_press_event", expert_comp_dlg_cb, NULL); + + expert_image = xpm_to_widget_from_parent(top_level, expert_warn_xpm); + gtk_tooltips_set_tip(tooltips, expert_image, "WARNING is the highest expert info level", NULL); + gtk_widget_show(expert_image); + expert_info_warn = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(expert_info_warn), expert_image); + SIGNAL_CONNECT(expert_info_warn, "button_press_event", expert_comp_dlg_cb, NULL); + + expert_image = xpm_to_widget_from_parent(top_level, expert_note_xpm); + gtk_tooltips_set_tip(tooltips, expert_image, "NOTE is the highest expert info level", NULL); + gtk_widget_show(expert_image); + expert_info_note = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(expert_info_note), expert_image); + SIGNAL_CONNECT(expert_info_note, "button_press_event", expert_comp_dlg_cb, NULL); + + expert_image = xpm_to_widget_from_parent(top_level, expert_chat_xpm); + gtk_tooltips_set_tip(tooltips, expert_image, "CHAT is the highest expert info level", NULL); + gtk_widget_show(expert_image); + expert_info_chat = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(expert_info_chat), expert_image); + SIGNAL_CONNECT(expert_info_chat, "button_press_event", expert_comp_dlg_cb, NULL); + + expert_image = xpm_to_widget_from_parent(top_level, expert_none_xpm); + gtk_tooltips_set_tip(tooltips, expert_image, "No expert info", NULL); + gtk_widget_show(expert_image); + expert_info_none = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(expert_info_none), expert_image); + SIGNAL_CONNECT(expert_info_none, "button_press_event", expert_comp_dlg_cb, NULL); gtk_widget_show(expert_info_none); |