completely hide the main window panes, if we currently don't have a capture file.

svn path=/trunk/; revision=13312
This commit is contained in:
Ulf Lamping 2005-02-05 17:53:39 +00:00
parent 9e93bf4747
commit fe7e1ec13c
3 changed files with 16 additions and 3 deletions

View File

@ -167,6 +167,7 @@ static guint packets_ctx;
static gchar *packets_str = NULL;
GString *comp_info_str, *runtime_info_str;
gchar *ethereal_path = NULL;
gboolean have_capture_file = FALSE; /* XXX - is there an aquivalent in cfile? */
#ifdef _WIN32
static gboolean has_console; /* TRUE if app has console */
@ -849,6 +850,13 @@ void packets_bar_update(void)
}
}
void
main_set_for_capture_file(gboolean have_capture_file_in)
{
have_capture_file = have_capture_file_in;
main_widgets_show_or_hide();
}
gboolean
main_do_quit(void)
@ -2715,19 +2723,19 @@ main_widgets_show_or_hide(void)
gtk_widget_hide(filter_tb);
}
if (recent.packet_list_show) {
if (recent.packet_list_show && have_capture_file) {
gtk_widget_show(pkt_scrollw);
} else {
gtk_widget_hide(pkt_scrollw);
}
if (recent.tree_view_show) {
if (recent.tree_view_show && have_capture_file) {
gtk_widget_show(tv_scrollw);
} else {
gtk_widget_hide(tv_scrollw);
}
if (recent.byte_view_show) {
if (recent.byte_view_show && have_capture_file) {
gtk_widget_show(byte_nb_ptr);
} else {
gtk_widget_hide(byte_nb_ptr);

View File

@ -276,6 +276,10 @@ extern void dnd_open_file_cmd(GtkSelectionData *selection_data);
/** Update the packets statusbar to the current values. */
extern void packets_bar_update(void);
/** Tell the main window that we have a capture file (or not) */
extern void
main_set_for_capture_file(gboolean have_capture_file_in);
#ifdef _WIN32
/** Win32 only: Create a console. Beware: cannot be closed again. */
extern void create_console(void);

View File

@ -1632,6 +1632,7 @@ set_menus_for_captured_packets(gboolean have_captured_packets)
have_captured_packets);
set_toolbar_for_captured_packets(have_captured_packets);
packets_bar_update();
main_set_for_capture_file(have_captured_packets);
}
/* Enable or disable menu items based on whether a packet is selected and,