Add Packet Editor Preference
svn path=/trunk/; revision=53134
This commit is contained in:
parent
6261789695
commit
49485528d8
|
@ -2321,6 +2321,10 @@ prefs_register_modules(void)
|
|||
"Layout content of the pane 3",
|
||||
(gint*)(void*)(&prefs.gui_layout_content_3), gui_layout_content, FALSE);
|
||||
|
||||
prefs_register_bool_preference(gui_module, "packet_editor.enabled",
|
||||
"Enable Packet Editor",
|
||||
"Enable Packet Editor (Experimental)",
|
||||
&prefs.gui_packet_editor);
|
||||
/* Console
|
||||
* These are preferences that can be read/written using the
|
||||
* preference module API. These preferences still use their own
|
||||
|
@ -2860,6 +2864,7 @@ pre_init_prefs(void)
|
|||
prefs.gui_layout_content_2 = layout_pane_content_pdetails;
|
||||
prefs.gui_layout_content_3 = layout_pane_content_pbytes;
|
||||
prefs.gui_qt_language = 0; /* (Auto-Detect) */
|
||||
prefs.gui_packet_editor = FALSE;
|
||||
|
||||
prefs.col_list = NULL;
|
||||
for (i = 0; i < DEF_NUM_COLS; i++) {
|
||||
|
|
|
@ -207,6 +207,7 @@ typedef struct _e_prefs {
|
|||
gboolean unknown_prefs; /* unknown or obsolete pref(s) */
|
||||
gboolean unknown_colorfilters; /* unknown or obsolete color filter(s) */
|
||||
guint gui_qt_language; /* Qt Translation language selection */
|
||||
gboolean gui_packet_editor; /* Enable Packet Editor */
|
||||
} e_prefs;
|
||||
|
||||
WS_DLL_PUBLIC e_prefs prefs;
|
||||
|
|
|
@ -4965,7 +4965,7 @@ set_menus_for_selected_packet(capture_file *cf)
|
|||
frame_selected);
|
||||
#ifdef WANT_PACKET_EDITOR
|
||||
set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/EditPacket",
|
||||
frame_selected);
|
||||
prefs.gui_packet_editor ? frame_selected : FALSE);
|
||||
#endif /* WANT_PACKET_EDITOR */
|
||||
set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/EditMenu/AddEditPktComment",
|
||||
frame_selected && wtap_dump_can_write(cf->linktypes, WTAP_COMMENT_PER_PACKET));
|
||||
|
|
|
@ -86,6 +86,7 @@ static gint scroll_percent_changed_cb(GtkWidget *recent_df_entry _U_,
|
|||
#define GUI_EXPERT_EYECANDY_KEY "expert_eyecandy"
|
||||
#define GUI_AUTO_SCROLL_KEY "auto_scroll_on_expand"
|
||||
#define GUI_SCROLL_PERCENT_KEY "scroll_percent_on_expand"
|
||||
#define GUI_PACKET_EDITOR "packet_editor"
|
||||
|
||||
static const enum_val_t filter_toolbar_placement_vals[] _U_ = {
|
||||
{ "FALSE", "Below the main toolbar", FALSE },
|
||||
|
@ -160,6 +161,7 @@ gui_prefs_show(void)
|
|||
GtkWidget *macosx_style_cb;
|
||||
#endif
|
||||
GtkWidget *expert_info_eyecandy_cb;
|
||||
GtkWidget *packet_editor_cb;
|
||||
|
||||
int pos = 0;
|
||||
char current_val_str[128];
|
||||
|
@ -340,6 +342,13 @@ gui_prefs_show(void)
|
|||
prefs.gui_expert_composite_eyecandy );
|
||||
g_object_set_data(G_OBJECT(main_vb), GUI_EXPERT_EYECANDY_KEY, expert_info_eyecandy_cb);
|
||||
|
||||
/* Enable Experimental Packet Editor */
|
||||
packet_editor_cb = create_preference_check_button(main_grid, pos++,
|
||||
"Enable Packet Editor (Experimental):",
|
||||
"Activate Packet Editor (Experimental)",
|
||||
prefs.gui_packet_editor);
|
||||
g_object_set_data(G_OBJECT(main_vb), GUI_PACKET_EDITOR, packet_editor_cb);
|
||||
|
||||
/* Show 'em what we got */
|
||||
gtk_widget_show_all(main_vb);
|
||||
|
||||
|
@ -408,6 +417,8 @@ gui_prefs_fetch(GtkWidget *w)
|
|||
prefs.gui_expert_composite_eyecandy =
|
||||
gtk_toggle_button_get_active((GtkToggleButton *)g_object_get_data(G_OBJECT(w), GUI_EXPERT_EYECANDY_KEY));
|
||||
|
||||
prefs.gui_packet_editor =
|
||||
gtk_toggle_button_get_active((GtkToggleButton *)g_object_get_data(G_OBJECT(w), GUI_PACKET_EDITOR));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue