forked from osmocom/wireshark
Remove the "Save column widths" option so we always save the widths.
svn path=/trunk/; revision=25968
This commit is contained in:
parent
d182dfab21
commit
e0740e22e5
15
epan/prefs.c
15
epan/prefs.c
|
@ -1158,7 +1158,6 @@ init_prefs(void) {
|
|||
prefs.gui_geometry_save_position = FALSE;
|
||||
prefs.gui_geometry_save_size = TRUE;
|
||||
prefs.gui_geometry_save_maximized= TRUE;
|
||||
prefs.gui_geometry_save_column_width = FALSE;
|
||||
prefs.gui_console_open = console_open_never;
|
||||
prefs.gui_fileopen_style = FO_STYLE_LAST_OPENED;
|
||||
prefs.gui_recent_df_entries_max = 10;
|
||||
|
@ -1638,7 +1637,6 @@ prefs_is_capture_device_hidden(const char *name)
|
|||
#define PRS_GUI_GEOMETRY_SAVE_POSITION "gui.geometry.save.position"
|
||||
#define PRS_GUI_GEOMETRY_SAVE_SIZE "gui.geometry.save.size"
|
||||
#define PRS_GUI_GEOMETRY_SAVE_MAXIMIZED "gui.geometry.save.maximized"
|
||||
#define PRS_GUI_GEOMETRY_SAVE_COLUMN_WIDTH "gui.geometry.save.column_width"
|
||||
#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"
|
||||
|
@ -1966,13 +1964,6 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
|
|||
else {
|
||||
prefs.gui_geometry_save_maximized = FALSE;
|
||||
}
|
||||
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_SAVE_COLUMN_WIDTH) == 0) {
|
||||
if (g_ascii_strcasecmp(value, "true") == 0) {
|
||||
prefs.gui_geometry_save_column_width = TRUE;
|
||||
}
|
||||
else {
|
||||
prefs.gui_geometry_save_column_width = FALSE;
|
||||
}
|
||||
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_MAIN_X) == 0) { /* deprecated */
|
||||
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_MAIN_Y) == 0) { /* deprecated */
|
||||
} else if (strcmp(pref_name, PRS_GUI_GEOMETRY_MAIN_WIDTH) == 0) { /* deprecated */
|
||||
|
@ -2707,11 +2698,6 @@ write_prefs(char **pf_path_return)
|
|||
fprintf(pf, PRS_GUI_GEOMETRY_SAVE_MAXIMIZED ": %s\n",
|
||||
prefs.gui_geometry_save_maximized == TRUE ? "TRUE" : "FALSE");
|
||||
|
||||
fprintf(pf, "\n# Save packet list column widths?\n");
|
||||
fprintf(pf, "# TRUE or FALSE (case-insensitive).\n");
|
||||
fprintf(pf, PRS_GUI_GEOMETRY_SAVE_COLUMN_WIDTH ": %s\n",
|
||||
prefs.gui_geometry_save_column_width == TRUE ? "TRUE" : "FALSE");
|
||||
|
||||
fprintf(pf, "\n# Open a console window (WIN32 only)?\n");
|
||||
fprintf(pf, "# One of: NEVER, AUTOMATIC, ALWAYS\n");
|
||||
fprintf(pf, PRS_GUI_CONSOLE_OPEN ": %s\n",
|
||||
|
@ -3024,7 +3010,6 @@ copy_prefs(e_prefs *dest, e_prefs *src)
|
|||
dest->gui_geometry_save_position = src->gui_geometry_save_position;
|
||||
dest->gui_geometry_save_size = src->gui_geometry_save_size;
|
||||
dest->gui_geometry_save_maximized = src->gui_geometry_save_maximized;
|
||||
dest->gui_geometry_save_column_width = src->gui_geometry_save_column_width;
|
||||
dest->gui_webbrowser = g_strdup(src->gui_webbrowser);
|
||||
dest->gui_window_title = g_strdup(src->gui_window_title);
|
||||
dest->console_log_level = src->console_log_level;
|
||||
|
|
|
@ -123,7 +123,6 @@ typedef struct _e_prefs {
|
|||
gboolean gui_geometry_save_position;
|
||||
gboolean gui_geometry_save_size;
|
||||
gboolean gui_geometry_save_maximized;
|
||||
gboolean gui_geometry_save_column_width;
|
||||
console_open_e gui_console_open;
|
||||
guint gui_recent_df_entries_max;
|
||||
guint gui_recent_files_count_max;
|
||||
|
|
|
@ -90,7 +90,7 @@ view_zoom_in_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
|
||||
save_gui_zoom_level = recent.gui_zoom_level;
|
||||
recent.gui_zoom_level++;
|
||||
switch (user_font_apply(FALSE)) {
|
||||
switch (user_font_apply()) {
|
||||
|
||||
case FA_SUCCESS:
|
||||
break;
|
||||
|
@ -116,7 +116,7 @@ view_zoom_out_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
|
||||
save_gui_zoom_level = recent.gui_zoom_level;
|
||||
recent.gui_zoom_level--;
|
||||
switch (user_font_apply(FALSE)) {
|
||||
switch (user_font_apply()) {
|
||||
|
||||
case FA_SUCCESS:
|
||||
break;
|
||||
|
@ -142,7 +142,7 @@ view_zoom_100_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
|
||||
save_gui_zoom_level = recent.gui_zoom_level;
|
||||
recent.gui_zoom_level = 0;
|
||||
switch (user_font_apply(FALSE)) {
|
||||
switch (user_font_apply()) {
|
||||
|
||||
case FA_SUCCESS:
|
||||
break;
|
||||
|
@ -236,7 +236,7 @@ font_zoom(char *gui_font_name)
|
|||
}
|
||||
|
||||
fa_ret_t
|
||||
user_font_apply(gboolean saved_column_width) {
|
||||
user_font_apply(void) {
|
||||
char *gui_font_name;
|
||||
PangoFontDescription *new_r_font, *new_b_font;
|
||||
PangoFontDescription *old_r_font = NULL, *old_b_font = NULL;
|
||||
|
@ -274,7 +274,7 @@ user_font_apply(gboolean saved_column_width) {
|
|||
}
|
||||
|
||||
/* the font(s) seem to be ok */
|
||||
packet_list_set_font(new_r_font, saved_column_width);
|
||||
packet_list_set_font(new_r_font);
|
||||
set_ptree_font_all(new_r_font);
|
||||
old_r_font = m_r_font;
|
||||
old_b_font = m_b_font;
|
||||
|
|
|
@ -49,11 +49,9 @@ typedef enum {
|
|||
/** Applies a new user font, corresponding to the preferences font name and recent zoom level.
|
||||
* Will also redraw the screen.
|
||||
*
|
||||
* @param saved_column_width set if using saved column widths
|
||||
*
|
||||
* @return if the new font could be set or not
|
||||
*/
|
||||
extern fa_ret_t user_font_apply(gboolean saved_column_width);
|
||||
extern fa_ret_t user_font_apply(void);
|
||||
|
||||
/** Test, if the given font name is available.
|
||||
*
|
||||
|
|
|
@ -2444,7 +2444,7 @@ main(int argc, char *argv[])
|
|||
menu_auto_scroll_live_changed(auto_scroll_live);
|
||||
#endif
|
||||
|
||||
switch (user_font_apply(prefs->gui_geometry_save_column_width)) {
|
||||
switch (user_font_apply()) {
|
||||
case FA_SUCCESS:
|
||||
break;
|
||||
case FA_FONT_NOT_RESIZEABLE:
|
||||
|
@ -3305,5 +3305,5 @@ void change_configuration_profile (const gchar *profile_name)
|
|||
packet_list_recreate ();
|
||||
status_expert_update();
|
||||
cfile.cinfo.columns_changed = FALSE; /* Reset value */
|
||||
user_font_apply(prefs.gui_geometry_save_column_width);
|
||||
user_font_apply();
|
||||
}
|
||||
|
|
|
@ -440,7 +440,7 @@ packet_list_set_sel_browse(gboolean val, gboolean force_set)
|
|||
|
||||
/* Set the font of the packet list window. */
|
||||
void
|
||||
packet_list_set_font(PangoFontDescription *font, gboolean saved_column_width)
|
||||
packet_list_set_font(PangoFontDescription *font)
|
||||
{
|
||||
int i;
|
||||
gint col_width;
|
||||
|
@ -455,10 +455,7 @@ packet_list_set_font(PangoFontDescription *font, gboolean saved_column_width)
|
|||
|
||||
/* Compute default column sizes. */
|
||||
for (i = 0; i < cfile.cinfo.num_cols; i++) {
|
||||
col_width = -1;
|
||||
if (saved_column_width) {
|
||||
col_width = recent_get_column_width(i);
|
||||
}
|
||||
col_width = recent_get_column_width(i);
|
||||
if (col_width == -1) {
|
||||
layout = gtk_widget_create_pango_layout(packet_list,
|
||||
get_column_width_string(get_column_format(i), i));
|
||||
|
@ -498,7 +495,7 @@ packet_list_new(e_prefs *prefs)
|
|||
gtk_container_add(GTK_CONTAINER(pkt_scrollw), packet_list);
|
||||
|
||||
packet_list_set_sel_browse(prefs->gui_plist_sel_browse, FALSE);
|
||||
packet_list_set_font(user_font_get_regular(), prefs->gui_geometry_save_column_width);
|
||||
packet_list_set_font(user_font_get_regular());
|
||||
gtk_widget_set_name(packet_list, "packet list");
|
||||
g_signal_connect(packet_list, "select-row", G_CALLBACK(packet_list_select_cb), NULL);
|
||||
g_signal_connect(packet_list, "unselect-row", G_CALLBACK(packet_list_unselect_cb), NULL);
|
||||
|
@ -814,9 +811,7 @@ packet_list_set_time_width(gint col_fmt, gint column)
|
|||
gint width = -1;
|
||||
PangoLayout *layout;
|
||||
|
||||
if (prefs.gui_geometry_save_column_width) {
|
||||
width = recent_get_column_width(column);
|
||||
}
|
||||
width = recent_get_column_width(column);
|
||||
if (width == -1) {
|
||||
layout = gtk_widget_create_pango_layout(packet_list,
|
||||
get_column_longest_string(col_fmt));
|
||||
|
|
|
@ -94,9 +94,8 @@ extern gboolean packet_list_get_event_row_column(GtkWidget *widget,
|
|||
/** Set the font of the packet list.
|
||||
*
|
||||
* @param font the new font
|
||||
* @param saved_column_width set if using saved column widths
|
||||
*/
|
||||
extern void packet_list_set_font(PangoFontDescription *font, gboolean saved_column_width);
|
||||
extern void packet_list_set_font(PangoFontDescription *font);
|
||||
|
||||
/** Set the selection mode of the packet list window.
|
||||
*
|
||||
|
|
|
@ -63,7 +63,6 @@ static gint recent_df_entries_changed_cb(GtkWidget *recent_df_entry _U_,
|
|||
#define GEOMETRY_POSITION_KEY "geometry_position"
|
||||
#define GEOMETRY_SIZE_KEY "geometry_size"
|
||||
#define GEOMETRY_MAXIMIZED_KEY "geometry_maximized"
|
||||
#define GEOMETRY_COLUMN_WIDTH_KEY "geometry_column_width"
|
||||
|
||||
#define GUI_CONSOLE_OPEN_KEY "console_open"
|
||||
#define GUI_FILEOPEN_KEY "fileopen_behavior"
|
||||
|
@ -165,7 +164,7 @@ gui_prefs_show(void)
|
|||
GtkWidget *recent_files_count_max_te, *recent_df_entries_max_te, *ask_unsaved_cb, *find_wrap_cb;
|
||||
GtkWidget *use_pref_save_cb;
|
||||
GtkWidget *webbrowser_te;
|
||||
GtkWidget *save_position_cb, *save_size_cb, *save_maximized_cb, *save_column_width_cb;
|
||||
GtkWidget *save_position_cb, *save_size_cb, *save_maximized_cb;
|
||||
|
||||
GtkTooltips *tooltips = gtk_tooltips_new();
|
||||
|
||||
|
@ -223,12 +222,6 @@ gui_prefs_show(void)
|
|||
"maximed state of the main window.", NULL);
|
||||
g_object_set_data(G_OBJECT(main_vb), GEOMETRY_MAXIMIZED_KEY, save_maximized_cb);
|
||||
|
||||
save_column_width_cb = create_preference_check_button(main_tb, pos++,
|
||||
"Save column widths:", NULL, prefs.gui_geometry_save_column_width);
|
||||
gtk_tooltips_set_tip(tooltips, save_column_width_cb, "Whether to save the "
|
||||
"column widths.", NULL);
|
||||
g_object_set_data(G_OBJECT(main_vb), GEOMETRY_COLUMN_WIDTH_KEY, save_column_width_cb);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* How the console window should be opened */
|
||||
console_open_om = create_preference_option_menu(main_tb, pos++,
|
||||
|
@ -385,8 +378,7 @@ gui_prefs_fetch(GtkWidget *w)
|
|||
gtk_toggle_button_get_active(g_object_get_data(G_OBJECT(w), GEOMETRY_SIZE_KEY));
|
||||
prefs.gui_geometry_save_maximized =
|
||||
gtk_toggle_button_get_active(g_object_get_data(G_OBJECT(w), GEOMETRY_MAXIMIZED_KEY));
|
||||
prefs.gui_geometry_save_column_width =
|
||||
gtk_toggle_button_get_active(g_object_get_data(G_OBJECT(w), GEOMETRY_COLUMN_WIDTH_KEY));
|
||||
|
||||
#ifdef _WIN32
|
||||
prefs.gui_console_open = fetch_enum_value(
|
||||
g_object_get_data(G_OBJECT(w), GUI_CONSOLE_OPEN_KEY), gui_console_open_vals);
|
||||
|
@ -444,7 +436,7 @@ gui_prefs_apply(GtkWidget *w _U_ , gboolean redissect)
|
|||
|
||||
if (font_changed) {
|
||||
/* This redraws the hex dump windows. */
|
||||
switch (user_font_apply(FALSE)) {
|
||||
switch (user_font_apply()) {
|
||||
|
||||
case FA_SUCCESS:
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue