Add preferences to save the main window size and position. If enabled,

the geometry is saved at exit.  Should we save the main window pane
sizes as well?

Move the DEF_WIDTH and DEF_HEIGHT #defines from gtk/main.h to prefs.h.
Remove the reference to DEF_WIDTH from proto_hier_stats_dlg.c.

svn path=/trunk/; revision=4462
This commit is contained in:
Gerald Combs 2001-12-31 04:41:50 +00:00
parent 0fa63e3baf
commit 30c5551caa
6 changed files with 234 additions and 39 deletions

View File

@ -1,7 +1,7 @@
/* gui_prefs.c
* Dialog box for GUI preferences
*
* $Id: gui_prefs.c,v 1.26 2001/04/17 18:49:55 guy Exp $
* $Id: gui_prefs.c,v 1.27 2001/12/31 04:41:50 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -49,6 +49,9 @@
static void create_option_menu(GtkWidget *main_vb, const gchar *key,
GtkWidget *main_tb, int table_position,
const gchar *label_text, const enum_val_t *enumvals, gint current_val);
static void create_option_check_button(GtkWidget *main_vb, const gchar *key,
GtkWidget *main_tb, int table_position, const gchar *label_text,
gboolean active);
static void font_browse_cb(GtkWidget *w, gpointer data);
static void font_browse_ok_cb(GtkWidget *w, GtkFontSelectionDialog *fs);
static void font_browse_destroy(GtkWidget *win, gpointer data);
@ -68,6 +71,8 @@ static void fetch_colors(void);
#define PTREE_LINE_STYLE_KEY "ptree_line_style"
#define PTREE_EXPANDER_STYLE_KEY "ptree_expander_style"
#define HEX_DUMP_HIGHLIGHT_STYLE_KEY "hex_dump_highlight_style"
#define GEOMETRY_POSITION_KEY "geometry_position"
#define GEOMETRY_SIZE_KEY "geometry_size"
#define FONT_DIALOG_PTR_KEY "font_dialog_ptr"
#define FONT_CALLER_PTR_KEY "font_caller_ptr"
@ -126,10 +131,12 @@ static gboolean font_changed;
has been set to the name of the font the user selected. */
static gchar *new_font_name;
#define GUI_TABLE_ROWS 8
GtkWidget*
gui_prefs_show(void)
{
GtkWidget *main_tb, *main_vb, *font_bt, *color_bt;
GtkWidget *main_tb, *main_vb, *hbox, *font_bt, *color_bt;
GtkWidget *geom_cb;
/* The colors or font haven't been changed yet. */
colors_changed = FALSE;
@ -139,53 +146,66 @@ gui_prefs_show(void)
main_vb = gtk_vbox_new(FALSE, 7);
gtk_container_border_width( GTK_CONTAINER(main_vb), 5 );
/* Main horizontal box */
/* XXX - Is therea a better way to center the table? */
hbox = gtk_hbox_new(FALSE, 7);
gtk_box_pack_start (GTK_BOX(main_vb), hbox, TRUE, FALSE, 0);
/* Main table */
main_tb = gtk_table_new(7, 2, FALSE);
gtk_box_pack_start( GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0 );
main_tb = gtk_table_new(GUI_TABLE_ROWS, 3, FALSE);
gtk_box_pack_start( GTK_BOX(hbox), main_tb, TRUE, FALSE, 0 );
gtk_table_set_row_spacings( GTK_TABLE(main_tb), 10 );
gtk_table_set_col_spacings( GTK_TABLE(main_tb), 15 );
gtk_table_set_col_spacing( GTK_TABLE(main_tb), 1, 50 );
/* Scrollbar placement */
create_option_menu(main_vb, SCROLLBAR_PLACEMENT_KEY, main_tb, 0,
"Vertical Scrollbar Placement:", scrollbar_placement_vals,
"Vertical scrollbar placement:", scrollbar_placement_vals,
prefs.gui_scrollbar_on_right);
/* Packet list selection browseable */
create_option_menu(main_vb, PLIST_SEL_BROWSE_KEY, main_tb, 1,
"Packet-list selection bar movement:", selection_mode_vals,
"Packet list mouse behavior:", selection_mode_vals,
prefs.gui_plist_sel_browse);
/* Proto tree selection browseable */
create_option_menu(main_vb, PTREE_SEL_BROWSE_KEY, main_tb, 2,
"Protocol-tree selection bar movement:", selection_mode_vals,
"Protocol tree mouse behavior:", selection_mode_vals,
prefs.gui_ptree_sel_browse);
/* Proto tree line style */
create_option_menu(main_vb, PTREE_LINE_STYLE_KEY, main_tb, 3,
"Protocol-tree line style:", line_style_vals,
"Protocol tree line style:", line_style_vals,
prefs.gui_ptree_line_style);
/* Proto tree expander style */
create_option_menu(main_vb, PTREE_EXPANDER_STYLE_KEY, main_tb, 4,
"Protocol-tree expander style:", expander_style_vals,
"Protocol tree expander style:", expander_style_vals,
prefs.gui_ptree_expander_style);
/* Hex Dump highlight style */
create_option_menu(main_vb, HEX_DUMP_HIGHLIGHT_STYLE_KEY, main_tb, 5,
"Hex dump highlight style:", highlight_style_vals,
"Hex display highlight style:", highlight_style_vals,
prefs.gui_hex_dump_highlight_style);
/* Geometry prefs */
create_option_check_button(main_vb, GEOMETRY_POSITION_KEY, main_tb,
6, "Save window position:", prefs.gui_geometry_save_position);
create_option_check_button(main_vb, GEOMETRY_SIZE_KEY, main_tb,
7, "Save window size:", prefs.gui_geometry_save_size);
/* "Font..." button - click to open a font selection dialog box. */
font_bt = gtk_button_new_with_label("Font...");
gtk_signal_connect(GTK_OBJECT(font_bt), "clicked",
GTK_SIGNAL_FUNC(font_browse_cb), NULL);
gtk_table_attach_defaults( GTK_TABLE(main_tb), font_bt, 1, 2, 6, 7 );
gtk_table_attach_defaults( GTK_TABLE(main_tb), font_bt, 2, 3, 0, 1 );
/* "Colors..." button - click to open a color selection dialog box. */
color_bt = gtk_button_new_with_label("Colors...");
gtk_signal_connect(GTK_OBJECT(color_bt), "clicked",
GTK_SIGNAL_FUNC(color_browse_cb), NULL);
gtk_table_attach_defaults( GTK_TABLE(main_tb), color_bt, 1, 2, 7, 8 );
gtk_table_attach_defaults( GTK_TABLE(main_tb), color_bt, 2, 3, 1, 2 );
/* Show 'em what we got */
gtk_widget_show_all(main_vb);
@ -198,7 +218,7 @@ create_option_menu(GtkWidget *main_vb, const gchar *key,
GtkWidget *main_tb, int table_position,
const gchar *label_text, const enum_val_t *enumvals, gint current_val)
{
GtkWidget *label, *menu, *menu_item, *option_menu;
GtkWidget *label, *menu_box, *menu, *menu_item, *option_menu;
int menu_index, index;
const enum_val_t *enum_valp;
@ -206,6 +226,9 @@ create_option_menu(GtkWidget *main_vb, const gchar *key,
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(main_tb), label, 0, 1,
table_position, table_position + 1);
menu_box = gtk_hbox_new(FALSE, 0);
gtk_table_attach_defaults(GTK_TABLE(main_tb), menu_box,
1, 2, table_position, table_position + 1);
/* Create a menu from the enumvals */
menu = gtk_menu_new();
@ -228,12 +251,30 @@ create_option_menu(GtkWidget *main_vb, const gchar *key,
gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu),
menu_index);
gtk_table_attach_defaults(GTK_TABLE(main_tb), option_menu,
1, 2, table_position, table_position + 1);
gtk_box_pack_start(GTK_BOX(menu_box), option_menu, FALSE, FALSE, 0);
gtk_object_set_data(GTK_OBJECT(main_vb), key, option_menu);
}
static void
create_option_check_button(GtkWidget *main_vb, const gchar *key,
GtkWidget *main_tb, int table_position, const gchar *label_text,
gboolean active)
{
GtkWidget *hbox, *check_box;
int menu_index, index;
const enum_val_t *enum_valp;
hbox = gtk_hbox_new(FALSE, 0);
gtk_table_attach_defaults(GTK_TABLE(main_tb), hbox, 1, 3,
table_position, table_position + 1);
check_box = gtk_check_button_new_with_label(label_text);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_box), active);
gtk_box_pack_start( GTK_BOX(hbox), check_box, FALSE, FALSE, 0 );
gtk_object_set_data(GTK_OBJECT(main_vb), key, check_box);
}
/* Create a font dialog for browsing. */
static void
font_browse_cb(GtkWidget *w, gpointer data)
@ -426,6 +467,12 @@ gui_prefs_fetch(GtkWidget *w)
prefs.gui_hex_dump_highlight_style = fetch_enum_value(
gtk_object_get_data(GTK_OBJECT(w), HEX_DUMP_HIGHLIGHT_STYLE_KEY),
highlight_style_vals);
prefs.gui_geometry_save_position =
gtk_toggle_button_get_active(gtk_object_get_data(GTK_OBJECT(w),
GEOMETRY_POSITION_KEY));
prefs.gui_geometry_save_size =
gtk_toggle_button_get_active(gtk_object_get_data(GTK_OBJECT(w),
GEOMETRY_SIZE_KEY));
if (font_changed) {
if (prefs.gui_font_name != NULL)

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.221 2001/12/21 20:33:47 guy Exp $
* $Id: main.c,v 1.222 2001/12/31 04:41:50 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -172,6 +172,7 @@ static guint main_ctx, file_ctx, help_ctx;
static GString *comp_info_str;
gchar *ethereal_path = NULL;
gchar *last_open_dir = NULL;
gint root_x = G_MAXINT, root_y = G_MAXINT, top_width, top_height;
ts_type timestamp_type = RELATIVE;
@ -735,6 +736,21 @@ statusbar_pop_field_msg(void)
static gboolean
main_window_delete_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
{
gint desk_x, desk_y;
/* Try to grab our geometry */
gdk_window_get_root_origin(top_level->window, &root_x, &root_y);
if (gdk_window_get_deskrelative_origin(top_level->window,
&desk_x, &desk_y)) {
if (desk_x <= root_x && desk_y <= root_y) {
root_x = desk_x;
root_y = desk_y;
}
}
/* XXX - Is this the "approved" method? */
gdk_window_get_size(top_level->window, &top_width, &top_height);
file_quit_cmd_cb(widget, data);
/* Say that the window should be deleted. */
@ -941,6 +957,9 @@ main(int argc, char *argv[])
e_prefs *prefs;
char badopt;
char *bold_font_name;
gint desk_x, desk_y;
gboolean prefs_write_needed = FALSE;
ethereal_path = argv[0];
@ -1638,6 +1657,66 @@ main(int argc, char *argv[])
gtk_main();
/* Try to save our geometry. GTK+ provides two routines to get a
window's position relative to the X root window. If I understand the
documentation correctly, gdk_window_get_deskrelative_origin applies
mainly to Enlightenment and gdk_window_get_root_origin applies for
all other WMs.
The code below tries both routines, and picks the one that returns
the upper-left-most coordinates.
More info at:
http://mail.gnome.org/archives/gtk-devel-list/2001-March/msg00289.html
http://www.gtk.org/faq/#AEN600 */
/* Re-read our saved preferences. */
/* XXX - Move all of this into a separate function? */
prefs = read_prefs(&gpf_open_errno, &gpf_path, &pf_open_errno, &pf_path);
if (pf_path == NULL) {
if (prefs->gui_geometry_save_position) {
if (top_level->window != NULL) {
gdk_window_get_root_origin(top_level->window, &root_x, &root_y);
if (gdk_window_get_deskrelative_origin(top_level->window,
&desk_x, &desk_y)) {
if (desk_x <= root_x && desk_y <= root_y) {
root_x = desk_x;
root_y = desk_y;
}
}
}
if (prefs->gui_geometry_main_x != root_x) {
prefs->gui_geometry_main_x = root_x;
prefs_write_needed = TRUE;
}
if (prefs->gui_geometry_main_y != root_y) {
prefs->gui_geometry_main_y = root_y;
prefs_write_needed = TRUE;
}
}
if (prefs->gui_geometry_save_size) {
if (top_level->window != NULL) {
/* XXX - Is this the "approved" method? */
gdk_window_get_size(top_level->window, &top_width, &top_height);
}
if (prefs->gui_geometry_main_width != top_width) {
prefs->gui_geometry_main_width = top_width;
prefs_write_needed = TRUE;
}
if (prefs->gui_geometry_main_height != top_height) {
prefs->gui_geometry_main_height = top_height;
prefs_write_needed = TRUE;
}
}
if (prefs_write_needed) {
write_prefs(&pf_path);
}
}
epan_cleanup();
g_free(rc_file);
@ -1821,7 +1900,7 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs)
TRUE,
TRUE
};
/* Main window */
top_level = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name(top_level, "main window");
@ -1830,7 +1909,16 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs)
gtk_signal_connect (GTK_OBJECT (top_level), "realize",
GTK_SIGNAL_FUNC (window_icon_realize_cb), NULL);
gtk_window_set_title(GTK_WINDOW(top_level), "The Ethereal Network Analyzer");
gtk_widget_set_usize(GTK_WIDGET(top_level), DEF_WIDTH, -1);
if (prefs->gui_geometry_save_position) {
gtk_widget_set_uposition(GTK_WIDGET(top_level),
prefs->gui_geometry_main_x, prefs->gui_geometry_main_y);
}
if (prefs->gui_geometry_save_size) {
gtk_widget_set_usize(GTK_WIDGET(top_level),
prefs->gui_geometry_main_width, prefs->gui_geometry_main_height);
} else {
gtk_widget_set_usize(GTK_WIDGET(top_level), DEF_WIDTH, -1);
}
gtk_window_set_policy(GTK_WINDOW(top_level), TRUE, TRUE, FALSE);
/* Container for menu bar, paned windows and progress/info box */

View File

@ -1,7 +1,7 @@
/* main.h
* Global defines, etc.
*
* $Id: main.h,v 1.24 2001/11/21 23:16:26 gram Exp $
* $Id: main.h,v 1.25 2001/12/31 04:41:50 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -37,8 +37,6 @@
*/
#define RC_FILE "gtkrc"
#define DEF_WIDTH 750
#define DEF_HEIGHT 550
#ifdef HAVE_LIBPCAP
#define DEF_READY_MESSAGE " Ready to load or capture"
#else

View File

@ -1,6 +1,6 @@
/* proto_hier_stats_dlg.c
*
* $Id: proto_hier_stats_dlg.c,v 1.5 2001/12/12 21:38:59 gerald Exp $
* $Id: proto_hier_stats_dlg.c,v 1.6 2001/12/31 04:41:50 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -157,11 +157,8 @@ create_tree(GtkWidget *container, ph_stats_t *ps)
/* Fill in the data. */
fill_in_ctree(tree, ps);
/* Try to size the CTree to a good initial size.
* 5 is a magic number that I pulled out off my hat.
* Using DEF_WIDTH is pretty bogus, too. */
height = GTK_CLIST(tree)->rows * (GTK_CLIST(tree)->row_height + 5);
gtk_widget_set_usize(tree, DEF_WIDTH, height);
gtk_widget_set_usize(tree, 500, height);
gtk_container_add(GTK_CONTAINER(sw), tree);

76
prefs.c
View File

@ -1,7 +1,7 @@
/* prefs.c
* Routines for handling preferences
*
* $Id: prefs.c,v 1.74 2001/12/08 01:45:35 guy Exp $
* $Id: prefs.c,v 1.75 2001/12/31 04:41:48 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -785,17 +785,23 @@ read_prefs(int *gpf_errno_return, char **gpf_path_return,
*/
prefs.gui_font_name = g_strdup("-*-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-iso8859-1");
#endif
prefs.gui_marked_fg.pixel = 65535;
prefs.gui_marked_fg.red = 65535;
prefs.gui_marked_fg.green = 65535;
prefs.gui_marked_fg.blue = 65535;
prefs.gui_marked_bg.pixel = 0;
prefs.gui_marked_bg.red = 0;
prefs.gui_marked_bg.green = 0;
prefs.gui_marked_bg.blue = 0;
prefs.gui_marked_fg.pixel = 65535;
prefs.gui_marked_fg.red = 65535;
prefs.gui_marked_fg.green = 65535;
prefs.gui_marked_fg.blue = 65535;
prefs.gui_marked_bg.pixel = 0;
prefs.gui_marked_bg.red = 0;
prefs.gui_marked_bg.green = 0;
prefs.gui_marked_bg.blue = 0;
prefs.gui_geometry_save_position = 0;
prefs.gui_geometry_save_size = 1;
prefs.gui_geometry_main_x = 20;
prefs.gui_geometry_main_y = 20;
prefs.gui_geometry_main_width = DEF_WIDTH;
prefs.gui_geometry_main_height = -1;
/* set the default values for the capture dialog box */
prefs.capture_prom_mode = TRUE;
prefs.capture_prom_mode = TRUE;
prefs.capture_real_time = FALSE;
prefs.capture_auto_scroll = FALSE;
prefs.name_resolve = PREFS_RESOLV_ALL;
@ -1049,6 +1055,12 @@ prefs_set_pref(char *prefarg)
#define PRS_GUI_FONT_NAME "gui.font_name"
#define PRS_GUI_MARKED_FG "gui.marked_frame.fg"
#define PRS_GUI_MARKED_BG "gui.marked_frame.bg"
#define PRS_GUI_GEOMETRY_SAVE_POSITION "gui.geometry.save.position"
#define PRS_GUI_GEOMETRY_SAVE_SIZE "gui.geometry.save.size"
#define PRS_GUI_GEOMETRY_MAIN_X "gui.geometry.main.x"
#define PRS_GUI_GEOMETRY_MAIN_Y "gui.geometry.main.y"
#define PRS_GUI_GEOMETRY_MAIN_WIDTH "gui.geometry.main.width"
#define PRS_GUI_GEOMETRY_MAIN_HEIGHT "gui.geometry.main.height"
/*
* This applies to more than just captures, so it's not "capture.name_resolve";
@ -1286,6 +1298,28 @@ set_pref(gchar *pref_name, gchar *value)
prefs.gui_marked_bg.red = RED_COMPONENT(cval);
prefs.gui_marked_bg.green = GREEN_COMPONENT(cval);
prefs.gui_marked_bg.blue = BLUE_COMPONENT(cval);
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_SAVE_POSITION) == 0) {
if (strcasecmp(value, "true") == 0) {
prefs.gui_geometry_save_position = TRUE;
}
else {
prefs.gui_geometry_save_position = FALSE;
}
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_SAVE_SIZE) == 0) {
if (strcasecmp(value, "true") == 0) {
prefs.gui_geometry_save_size = TRUE;
}
else {
prefs.gui_geometry_save_size = FALSE;
}
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_MAIN_X) == 0) {
prefs.gui_geometry_main_x = strtol(value, NULL, 10);
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_MAIN_Y) == 0) {
prefs.gui_geometry_main_y = strtol(value, NULL, 10);
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_MAIN_WIDTH) == 0) {
prefs.gui_geometry_main_width = strtol(value, NULL, 10);
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_MAIN_HEIGHT) == 0) {
prefs.gui_geometry_main_height = strtol(value, NULL, 10);
/* handle the capture options */
} else if (strcmp(pref_name, PRS_CAP_PROM_MODE) == 0) {
@ -1683,6 +1717,22 @@ write_prefs(const char **pf_path_return)
(prefs.gui_marked_bg.green * 255 / 65535),
(prefs.gui_marked_bg.blue * 255 / 65535));
fprintf(pf, "\n# Save window position at exit? TRUE/FALSE\n");
fprintf(pf, PRS_GUI_GEOMETRY_SAVE_POSITION ": %s\n",
prefs.gui_geometry_save_position == TRUE ? "TRUE" : "FALSE");
fprintf(pf, "\n# Save window size at exit? TRUE/FALSE\n");
fprintf(pf, PRS_GUI_GEOMETRY_SAVE_SIZE ": %s\n",
prefs.gui_geometry_save_size == TRUE ? "TRUE" : "FALSE");
fprintf(pf, "\n# Main window geometry. Decimal integers.\n");
fprintf(pf, PRS_GUI_GEOMETRY_MAIN_X ": %d\n", prefs.gui_geometry_main_x);
fprintf(pf, PRS_GUI_GEOMETRY_MAIN_Y ": %d\n", prefs.gui_geometry_main_y);
fprintf(pf, PRS_GUI_GEOMETRY_MAIN_WIDTH ": %d\n",
prefs.gui_geometry_main_width);
fprintf(pf, PRS_GUI_GEOMETRY_MAIN_HEIGHT ": %d\n",
prefs.gui_geometry_main_height);
fprintf(pf, "\n# Resolve addresses to names? TRUE/FALSE/{list of address types to resolve}\n");
fprintf(pf, PRS_NAME_RESOLVE ": %s\n",
name_resolve_to_string(prefs.name_resolve));
@ -1744,6 +1794,12 @@ copy_prefs(e_prefs *dest, e_prefs *src)
dest->gui_font_name = g_strdup(src->gui_font_name);
dest->gui_marked_fg = src->gui_marked_fg;
dest->gui_marked_bg = src->gui_marked_bg;
dest->gui_geometry_save_position = src->gui_geometry_save_position;
dest->gui_geometry_save_size = src->gui_geometry_save_size;
dest->gui_geometry_main_x = src->gui_geometry_main_x;
dest->gui_geometry_main_y = src->gui_geometry_main_y;
dest->gui_geometry_main_width = src->gui_geometry_main_width;
dest->gui_geometry_main_height = src->gui_geometry_main_height;
/* values for the capture dialog box */
dest->capture_prom_mode = src->capture_prom_mode;
dest->capture_real_time = src->capture_real_time;

11
prefs.h
View File

@ -1,7 +1,7 @@
/* prefs.h
* Definitions for preference handling routines
*
* $Id: prefs.h,v 1.34 2001/11/04 02:50:19 guy Exp $
* $Id: prefs.h,v 1.35 2001/12/31 04:41:48 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -32,6 +32,9 @@
#define PR_DEST_CMD 0
#define PR_DEST_FILE 1
#define DEF_WIDTH 750
#define DEF_HEIGHT 550
/* 32 types are sufficient (as are 640k of RAM) */
/* FIXME: Maybe MANUF/m, IP/i, IP6/6, IPX/x, UDP+TCP/t etc would be
more useful/consistent */
@ -67,6 +70,12 @@ typedef struct _e_prefs {
gchar *gui_font_name;
color_t gui_marked_fg;
color_t gui_marked_bg;
gboolean gui_geometry_save_position;
gboolean gui_geometry_save_size;
gint gui_geometry_main_x;
gint gui_geometry_main_y;
gint gui_geometry_main_width;
gint gui_geometry_main_height;
guint32 name_resolve;
gboolean capture_prom_mode;
gboolean capture_real_time;