aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2015-12-29 07:57:36 +0100
committerRoland Knall <rknall@gmail.com>2016-02-01 12:12:41 +0000
commit927ffaa794d5fb24e0b4f3fba08c4c31f4dd7d63 (patch)
tree70676d0b7e00e0b10678d0f7f3ff7dd707eabcd2 /epan
parent5e89f9332228015c3e5c813939bf35dbcc5a105d (diff)
extcap: Add Save functionality to options dialog
This patch creates the functionality of saving all parameters for extcap devices in the general preference section. For now, multiselect and fileselect do not save their values but patches for this will be provided in the future Also, all preferences are stored as strings to make handling easier. This might change in the future, but for the first version it will stick. Restore to Defaults is not implemented as of yet, and will be in a future version, once the preference storing is finalized Bug: 11666 Change-Id: I178346405146d2e43f4f3481c05c92c0b3595af5 Reviewed-on: https://code.wireshark.org/review/13451 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/prefs.c22
-rw-r--r--epan/prefs.h3
2 files changed, 25 insertions, 0 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 2fb1b0d567..fc471e00ad 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -2082,6 +2082,10 @@ prefs_register_modules(void)
{
module_t *printing, *capture_module, *console_module,
*gui_layout_module, *gui_font_module;
+#ifdef HAVE_EXTCAP
+ module_t *extcap_module;
+#endif
+
struct pref_custom_cbs custom_cbs;
if (protocols_module != NULL) {
@@ -2089,6 +2093,24 @@ prefs_register_modules(void)
return;
}
+#ifdef HAVE_EXTCAP
+ /* GUI
+ * These are "simple" GUI preferences that can be read/written using the
+ * preference module API. These preferences still use their own
+ * configuration screens for access, but this cuts down on the
+ * preference "string compare list" in set_pref()
+ */
+ extcap_module = prefs_register_module(NULL, "extcap", "Extcap Utilities",
+ "Extcap Utilities", NULL, FALSE);
+
+ /* Setting default value to true */
+ prefs.extcap_save_on_start = TRUE;
+ prefs_register_bool_preference(extcap_module, "gui_save_on_start",
+ "Save arguments on start of capture",
+ "Save arguments on start of capture",
+ &prefs.extcap_save_on_start);
+#endif
+
/* GUI
* These are "simple" GUI preferences that can be read/written using the
* preference module API. These preferences still use their own
diff --git a/epan/prefs.h b/epan/prefs.h
index 6bb48d70dd..fd8afce28b 100644
--- a/epan/prefs.h
+++ b/epan/prefs.h
@@ -236,6 +236,9 @@ typedef struct _e_prefs {
gint st_sort_defcolflag;
gboolean st_sort_defdescending;
gboolean st_sort_showfullname;
+#ifdef HAVE_EXTCAP
+ gboolean extcap_save_on_start;
+#endif
} e_prefs;
WS_DLL_PUBLIC e_prefs prefs;