summaryrefslogtreecommitdiff
path: root/ui/recent.c
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2017-01-24 17:34:07 +0100
committerRoland Knall <rknall@gmail.com>2017-02-24 08:12:46 +0000
commit321386e9f49d88b64f48868c6e4079b2073547a1 (patch)
treed30943f392b322b6dd7e1245f7efc3915051ab55 /ui/recent.c
parentbd9afdddfe45b4c9c6e966df7264d12cdfd85f42 (diff)
downloadwireshark-321386e9f49d88b64f48868c6e4079b2073547a1.tar.gz
PluginIF: AdditionalToolbar
Creates an interface for plugins and other parts of the code, to add a new toolbar to the system and have various widget types interact with this toolbar. All toolbars added via this interface, will be added to an additional submenu called "Additional Toolbars" within Wireshark. Also a demo plugin is being provided, demonstrating various features of the toolbar, including updating the gui elements. It also demonstrates how to update toolbar items. Change-Id: I8d0351224b3d7f4b90220d58970b51695551d7e3 Reviewed-on: https://code.wireshark.org/review/19803 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/recent.c')
-rw-r--r--ui/recent.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/recent.c b/ui/recent.c
index aaad91b0ad..d1894e0ed8 100644
--- a/ui/recent.c
+++ b/ui/recent.c
@@ -73,6 +73,7 @@
#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_TOOLBAR_SHOW "gui.additional_toolbar_show"
#define RECENT_GUI_GEOMETRY "gui.geom."
@@ -858,6 +859,12 @@ write_profile_recent(void)
fprintf(rf, RECENT_GUI_FILEOPEN_REMEMBERED_DIR ": %s\n", get_last_open_dir());
}
+ fprintf(rf, "\n# Additional Toolbars shown\n");
+ fprintf(rf, "# List of additional toolbars to show.\n");
+ string_list = join_string_list(recent.gui_additional_toolbars);
+ fprintf(rf, RECENT_GUI_TOOLBAR_SHOW ": %s\n", string_list);
+ g_free(string_list);
+
fclose(rf);
/* XXX - catch I/O errors (e.g. "ran out of disk space") and return
@@ -1111,6 +1118,8 @@ read_set_recent_pair_static(gchar *key, const gchar *value,
g_free (recent.gui_fileopen_remembered_dir);
}
recent.gui_fileopen_remembered_dir = g_strdup(value);
+ } else if (strcmp(key, RECENT_GUI_TOOLBAR_SHOW) == 0) {
+ recent.gui_additional_toolbars = prefs_get_string_list(value);
}
return PREFS_SET_OK;
@@ -1279,6 +1288,11 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
recent.gui_fileopen_remembered_dir = NULL;
}
+ if (recent.gui_additional_toolbars) {
+ g_list_free_full (recent.gui_additional_toolbars, g_free);
+ recent.gui_additional_toolbars = NULL;
+ }
+
/* Construct the pathname of the user's profile recent file. */
rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE);