diff options
-rw-r--r-- | ui/preference_utils.c | 6 | ||||
-rw-r--r-- | ui/qt/wireshark_application.cpp | 7 | ||||
-rw-r--r-- | ui/qt/wireshark_application.h | 2 | ||||
-rw-r--r-- | ui/recent.c | 7 | ||||
-rw-r--r-- | ui/recent.h | 2 |
5 files changed, 16 insertions, 8 deletions
diff --git a/ui/preference_utils.c b/ui/preference_utils.c index 70684f5a55..404c13c997 100644 --- a/ui/preference_utils.c +++ b/ui/preference_utils.c @@ -19,6 +19,7 @@ #include <epan/packet.h> #include <epan/decode_as.h> #include <epan/uat-int.h> +#include <ui/recent.h> #ifdef HAVE_LIBPCAP #include "capture_opts.h" @@ -62,7 +63,7 @@ prefs_main_write(void) g_strerror(errno)); g_free(pf_dir_path); } else { - /* Write the preferencs out. */ + /* Write the preferences out. */ err = write_prefs(&pf_path); if (err != 0) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, @@ -70,6 +71,9 @@ prefs_main_write(void) g_strerror(err)); g_free(pf_path); } + /* Write recent and recent_common files out to ensure sync with prefs. */ + write_profile_recent(); + write_recent(); } } diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp index 7fb754652f..eb56e2f167 100644 --- a/ui/qt/wireshark_application.cpp +++ b/ui/qt/wireshark_application.cpp @@ -359,7 +359,7 @@ int WiresharkApplication::monospaceTextSize(const char *str) #endif } -void WiresharkApplication::setConfigurationProfile(const gchar *profile_name, bool write_recent) +void WiresharkApplication::setConfigurationProfile(const gchar *profile_name, bool write_recent_file) { char *rf_path; int rf_open_errno; @@ -402,7 +402,7 @@ void WiresharkApplication::setConfigurationProfile(const gchar *profile_name, bo /* Get the current geometry, before writing it to disk */ emit profileChanging(); - if (write_recent && profile_exists(get_profile_name(), FALSE)) + if (write_recent_file && profile_exists(get_profile_name(), FALSE)) { /* Write recent file for profile we are leaving, if it still exists */ write_profile_recent(); @@ -454,6 +454,9 @@ void WiresharkApplication::setConfigurationProfile(const gchar *profile_name, bo emit localInterfaceListChanged(); emit packetDissectionChanged(); + + /* Write recent_common file to ensure last used profile setting is stored. */ + write_recent(); } void WiresharkApplication::reloadLuaPluginsDelayed() diff --git a/ui/qt/wireshark_application.h b/ui/qt/wireshark_application.h index 704caf633d..09e8fe4c56 100644 --- a/ui/qt/wireshark_application.h +++ b/ui/qt/wireshark_application.h @@ -112,7 +112,7 @@ public: const QFont monospaceFont(bool zoomed = false) const; void setMonospaceFont(const char *font_string); int monospaceTextSize(const char *str); - void setConfigurationProfile(const gchar *profile_name, bool write_recent = true); + void setConfigurationProfile(const gchar *profile_name, bool write_recent_file = true); void reloadLuaPluginsDelayed(); bool isInitialized() { return initialized_; } void setReloadingLua(bool is_reloading) { is_reloading_lua_ = is_reloading; } diff --git a/ui/recent.c b/ui/recent.c index ad954d12a9..330cb4b92a 100644 --- a/ui/recent.c +++ b/ui/recent.c @@ -634,7 +634,7 @@ write_recent_enum(FILE *rf, const char *description, const char *name, fprintf(rf, "%s: %s\n", name, if_invalid != NULL ? if_invalid : "Unknown"); } -/* Attempt to write out "recent common" to the user's recent common file. +/* Attempt to write out "recent common" to the user's recent_common file. If we got an error report it with a dialog box and return FALSE, otherwise return TRUE. */ gboolean @@ -671,9 +671,10 @@ write_recent(void) } g_free(rf_path); - fputs("# Recent settings file for Wireshark " VERSION ".\n" + fputs("# Common recent settings file for Wireshark " VERSION ".\n" "#\n" - "# This file is regenerated each time Wireshark is quit.\n" + "# This file is regenerated each time Wireshark is quit\n" + "# and when changing configuration profile.\n" "# So be careful, if you want to make manual changes here.\n" "\n" "######## Recent capture files (latest last), cannot be altered through command line ########\n" diff --git a/ui/recent.h b/ui/recent.h index 1df1310039..c1200c9ff5 100644 --- a/ui/recent.h +++ b/ui/recent.h @@ -140,7 +140,7 @@ extern void recent_init(void); /** Cleanup/Frees recent settings (done at shutdown) */ extern void recent_cleanup(void); -/** Write recent settings file. +/** Write recent_common settings file. * * @return TRUE if succeeded, FALSE if failed */ |