From 321386e9f49d88b64f48868c6e4079b2073547a1 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Tue, 24 Jan 2017 17:34:07 +0100 Subject: PluginIF: AdditionalToolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke Reviewed-by: Roland Knall --- ui/recent.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ui/recent.c') 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); -- cgit v1.2.1