/* main.c
*
- * $Id: main.c,v 1.430 2004/05/04 20:49:33 guy Exp $
+ * $Id: main.c,v 1.431 2004/05/04 21:08:02 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
*/
void main_widgets_rearrange(void) {
GtkWidget *pane_content[3];
- gboolean filter_toolbar_show_in_statusbar = prefs.filter_toolbar_show_in_statusbar;
/* be a bit faster */
gtk_widget_hide(main_vbox);
gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, TRUE, 0);
/* main toolbar */
- if (recent.main_toolbar_show) {
- gtk_box_pack_start(GTK_BOX(main_vbox), main_tb, FALSE, TRUE, 0);
- }
+ gtk_box_pack_start(GTK_BOX(main_vbox), main_tb, FALSE, TRUE, 0);
/* filter toolbar in toolbar area */
- if (recent.filter_toolbar_show && !filter_toolbar_show_in_statusbar) {
+ if (!prefs.filter_toolbar_show_in_statusbar) {
gtk_box_pack_start(GTK_BOX(main_vbox), filter_tb, FALSE, TRUE, 1);
}
gtk_container_add(GTK_CONTAINER(main_vbox), main_first_pane);
- /* hide widgets on users recent settings */
- /* XXX - do we still need this? */
- main_widgets_show_or_hide();
-
/* statusbar hbox */
- if ((recent.filter_toolbar_show && filter_toolbar_show_in_statusbar) || recent.statusbar_show) {
- gtk_box_pack_start(GTK_BOX(main_vbox), stat_hbox, FALSE, TRUE, 0);
- }
+ gtk_box_pack_start(GTK_BOX(main_vbox), stat_hbox, FALSE, TRUE, 0);
/* filter toolbar in statusbar hbox */
- if (recent.filter_toolbar_show && filter_toolbar_show_in_statusbar) {
+ if (prefs.filter_toolbar_show_in_statusbar) {
gtk_box_pack_start(GTK_BOX(stat_hbox), filter_tb, FALSE, TRUE, 1);
}
/* statusbar */
- if (recent.statusbar_show) {
- gtk_box_pack_start(GTK_BOX(stat_hbox), status_pane, TRUE, TRUE, 0);
- gtk_paned_pack1(GTK_PANED(status_pane), info_bar, FALSE, FALSE);
- gtk_paned_pack2(GTK_PANED(status_pane), packets_bar, FALSE, FALSE);
- }
+ gtk_box_pack_start(GTK_BOX(stat_hbox), status_pane, TRUE, TRUE, 0);
+ gtk_paned_pack1(GTK_PANED(status_pane), info_bar, FALSE, FALSE);
+ gtk_paned_pack2(GTK_PANED(status_pane), packets_bar, FALSE, FALSE);
+
+ /* hide widgets on users recent settings */
+ main_widgets_show_or_hide();
gtk_widget_show(main_vbox);
}
{
gboolean main_second_pane_show;
+ if (recent.main_toolbar_show) {
+ gtk_widget_show(main_tb);
+ } else {
+ gtk_widget_hide(main_tb);
+ }
+
+ /*
+ * Show the status hbox if either:
+ *
+ * 1) we're showing the filter toolbar and we want it in the status
+ * line
+ *
+ * or
+ *
+ * 2) we're showing the status bar.
+ */
+ if ((recent.filter_toolbar_show && prefs.filter_toolbar_show_in_statusbar) ||
+ recent.statusbar_show) {
+ gtk_widget_show(stat_hbox);
+ } else {
+ gtk_widget_hide(stat_hbox);
+ }
+
+ if (recent.statusbar_show) {
+ gtk_widget_show(status_pane);
+ } else {
+ gtk_widget_hide(status_pane);
+ }
+
+ if (recent.filter_toolbar_show) {
+ gtk_widget_show(filter_tb);
+ } else {
+ gtk_widget_hide(filter_tb);
+ }
+
if (recent.packet_list_show) {
gtk_widget_show(pkt_scrollw);
} else {
/* menu.c
* Menu routines
*
- * $Id: menu.c,v 1.190 2004/05/04 20:49:33 guy Exp $
+ * $Id: menu.c,v 1.191 2004/05/04 21:08:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
GList *curnode)
{
menu_item_t *curr;
- menu_item_t *child;
+ menu_item_t *child;
- child = g_malloc(sizeof (menu_item_t));
+ child = g_malloc(sizeof (menu_item_t));
child->group = group;
- child->name = name;
+ child->name = name;
child->callback = callback;
- child->selected_packet_enabled = selected_packet_enabled;
- child->selected_tree_row_enabled = selected_tree_row_enabled;
+ child->selected_packet_enabled = selected_packet_enabled;
+ child->selected_tree_row_enabled = selected_tree_row_enabled;
child->callback_data = callback_data;
- child->enabled = FALSE;
+ child->enabled = FALSE;
child->children = NULL;
/* insert the new child node into the parent */
gboolean (*selected_tree_row_enabled)(field_info *),
gpointer callback_data)
{
- /*static const char toolspath[] = "/Statistics/";*/
- char *toolspath;
- char *p;
- char *menupath;
- size_t menupathlen;
- menu_item_t *child;
+ /*static const char toolspath[] = "/Statistics/";*/
+ char *toolspath;
+ char *p;
+ char *menupath;
+ size_t menupathlen;
+ menu_item_t *child;
GList *curnode;
GList *childnode;
/*
* The menu path must be relative.
*/
- g_assert(*name != '/');
+ g_assert(*name != '/');
switch(group) {
case(REGISTER_TAP_GROUP_GENERIC): toolspath = "/Statistics/"; break;
#if GTK_MAJOR_VERSION < 2
menu_item = gtk_menu_item_new_with_label("<Clear File List>");
#else
- menu_item = gtk_image_menu_item_new_from_stock
- (GTK_STOCK_CLEAR, NULL);
+ menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLEAR, NULL);
#endif
gtk_menu_append (GTK_MENU(submenu_recent_files), menu_item);
SIGNAL_CONNECT_OBJECT(GTK_OBJECT(menu_item), "activate",
/* write all capture filenames of the menu to the user's recent file */
void
menu_recent_file_write_all(FILE *rf) {
- GtkWidget *submenu_recent_files;
+ GtkWidget *submenu_recent_files;
GList *children;
- GList *child;
- gchar *cf_name;
+ GList *child;
+ gchar *cf_name;
- submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH);
+ submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH);
/* we have to iterate backwards through the children's list,
* so we get the latest item last in the file.
children = gtk_container_children(GTK_CONTAINER(submenu_recent_files));
child = g_list_last(children);
while(child != NULL) {
- /* get capture filename from the menu item label */
- cf_name = OBJECT_GET_DATA(child->data, MENU_RECENT_FILES_KEY);
- if (cf_name) {
- fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
- }
+ /* get capture filename from the menu item label */
+ cf_name = OBJECT_GET_DATA(child->data, MENU_RECENT_FILES_KEY);
+ if (cf_name) {
+ fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", cf_name);
+ }
child = g_list_previous(child);
}
- g_list_free(children);
+ g_list_free(children);
}
/* save current setting in recent */
recent.main_toolbar_show = GTK_CHECK_MENU_ITEM(w)->active;
- main_widgets_rearrange();
+ main_widgets_show_or_hide();
}
/* save current setting in recent */
recent.filter_toolbar_show = GTK_CHECK_MENU_ITEM(w)->active;
- main_widgets_rearrange();
+ main_widgets_show_or_hide();
}
/* save current setting in recent */
recent.statusbar_show = GTK_CHECK_MENU_ITEM(w)->active;
- main_widgets_rearrange();
+ main_widgets_show_or_hide();
}
{
gboolean is_enabled;
GList *child;
- menu_item_t *node_data = node->data;
+ menu_item_t *node_data = node->data;
/*
* Is this a leaf node or an interior node?
{
gboolean is_enabled;
GList *child;
- menu_item_t *node_data = node->data;
+ menu_item_t *node_data = node->data;
/*
* Is this a leaf node or an interior node?
{
gboolean is_enabled;
GList *child;
- menu_item_t *node_data = node->data;
+ menu_item_t *node_data = node->data;
/*
* Is this a leaf node or an interior node?