aboutsummaryrefslogtreecommitdiffstats
path: root/color_filters.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2008-01-14 16:40:23 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2008-01-14 16:40:23 +0000
commit84aa0430416e8b1258b4a0d71cc21193c13f404a (patch)
tree78bc861dc4a2907a73ee807f8893914875221a25 /color_filters.c
parent6026eabe54ad8b375b74ec2b6cf8cc24d38be5d3 (diff)
This patch adds support for configuration profiles, which can be used to
configure and use more than one set of preferences and configuration files. This can be found in the "Configuration Profiles..." menu item from the Edit menu, or by pressing Shift-Ctrl-A. It's also possible to start wireshark and tshark with a named profile by using the "-C ProfileName" option. A new status pane in the main window will show the current profile. The configuration files currently stored in the Profiles are: - Preferences - Capture Filters - Display Filters - Coloring Rules - Disabled Protocols - User Accessible Tables The recent data are by design not added to the profile. Planned future enhancements: - make a more convenient function to switch between profiles - add a "clone profile" button to copy an existing profile - make the profiles list active and accept return as OK - save users "Decode as" in the profile - make new, clone and deletion of profiles more secure - make some of the recent values available in the profile This patch also fixes: - setting default status pane sizes - a bug setting status pane for packets when not having main lower pane. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24089 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'color_filters.c')
-rw-r--r--color_filters.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/color_filters.c b/color_filters.c
index 239823ce0b..652dcb19a6 100644
--- a/color_filters.c
+++ b/color_filters.c
@@ -299,6 +299,23 @@ color_filters_init(void)
}
void
+color_filters_reload(void)
+{
+ /* "move" old entries to the deleted list
+ * we must keep them until the dissection no longer needs them */
+ color_filter_deleted_list = g_slist_concat(color_filter_deleted_list, color_filter_list);
+ color_filter_list = NULL;
+
+ /* start the list with the temporary colorizing rules */
+ color_filters_add_tmp(&color_filter_list);
+
+ /* try to read the users filters */
+ if (!read_users_filters(&color_filter_list))
+ /* if that failed, try to read the global filters */
+ color_filters_read_globals(&color_filter_list);
+}
+
+void
color_filters_cleanup(void)
{
/* delete the previously deleted filters */
@@ -612,7 +629,7 @@ read_users_filters(GSList **cfl)
gboolean ret;
/* decide what file to open (from dfilter code) */
- path = get_persconffile_path("colorfilters", FALSE);
+ path = get_persconffile_path("colorfilters", TRUE, FALSE);
if ((f = eth_fopen(path, "r")) == NULL) {
if (errno != ENOENT) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
@@ -737,7 +754,7 @@ color_filters_write(GSList *cfl)
return FALSE;
}
- path = get_persconffile_path("colorfilters", TRUE);
+ path = get_persconffile_path("colorfilters", TRUE, TRUE);
if ((f = eth_fopen(path, "w+")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not open\n%s\nfor writing: %s.",