summaryrefslogtreecommitdiff
path: root/ui/recent.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-12-15 19:47:02 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2015-12-16 06:53:24 +0000
commitbfe73e3ad7162830c222a5b0d73433a72324baa5 (patch)
treedf1a1ee6779cb31093e9253152317e9f444fc91a /ui/recent.c
parent3b706bab624a22c500adb3bdf50123f73e56c4ca (diff)
downloadwireshark-bfe73e3ad7162830c222a5b0d73433a72324baa5.tar.gz
Qt: save custom colors in recent_common file
This allows to save colors across sessions for systems other than OSX that do not provide a system wide color picker While we are at it, let's stop reading the recent file twice at startup Bug: 11888 Change-Id: I69ff14d699d8111fe6a8bdac0157fcd115a60c2b Reviewed-on: https://code.wireshark.org/review/12659 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/recent.c')
-rw-r--r--ui/recent.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/recent.c b/ui/recent.c
index 64c6c1ee11..56bc280aef 100644
--- a/ui/recent.c
+++ b/ui/recent.c
@@ -71,6 +71,7 @@
#define RECENT_GUI_CONVERSATION_TABS "gui.conversation_tabs"
#define RECENT_GUI_ENDPOINT_TABS "gui.endpoint_tabs"
#define RECENT_GUI_RLC_PDUS_FROM_MAC_FRAMES "gui.rlc_pdus_from_mac_frames"
+#define RECENT_GUI_CUSTOM_COLORS "gui.custom_colors"
#define RECENT_GUI_GEOMETRY "gui.geom."
@@ -588,6 +589,7 @@ write_recent(void)
char *pf_dir_path;
char *rf_path;
FILE *rf;
+ char *string_list;
/* To do:
* - Split output lines longer than MAX_VAL_LEN
@@ -689,6 +691,12 @@ write_recent(void)
window_geom_recent_write_all(rf);
+ fprintf(rf, "\n# Custom colors.\n");
+ fprintf(rf, "# List of custom colors selected in Qt color picker.\n");
+ string_list = join_string_list(recent.custom_colors);
+ fprintf(rf, RECENT_GUI_CUSTOM_COLORS ": %s\n", string_list);
+ g_free(string_list);
+
fclose(rf);
/* XXX - catch I/O errors (e.g. "ran out of disk space") and return
@@ -929,6 +937,8 @@ read_set_recent_common_pair_static(gchar *key, const gchar *value,
parse_recent_boolean(value, &recent.privs_warn_if_elevated);
} else if (strcmp(key, RECENT_KEY_PRIVS_WARN_IF_NO_NPF) == 0) {
parse_recent_boolean(value, &recent.privs_warn_if_no_npf);
+ } else if (strcmp(key, RECENT_GUI_CUSTOM_COLORS) == 0) {
+ recent.custom_colors = prefs_get_string_list(value);
}
return PREFS_SET_OK;