aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2020-02-13 15:18:14 -0800
committerAnders Broman <a.broman58@gmail.com>2020-02-15 11:13:25 +0000
commitd7bbe384f51b99b03694db811f48cf5a098ad65c (patch)
treef48a399d76c2badef1319228fda10928fb7d5b1e /ui
parent7247b98d45d906b297b3f307c26ff9bd322ad51d (diff)
Test+Qt: Add an automatic update check.
Add software_update_info() to the software update module, which returns the name of our update library if we have one. Use it to add automatic update information to the compiled information in `wireshark --version`. Add a "release" test suite, which contains a test for automatic updates. Ping-Bug: 16381 Change-Id: I867a96bdcfde8be541eca2dc0e84b5000276e7dd Reviewed-on: https://code.wireshark.org/review/36107 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/main.cpp11
-rw-r--r--ui/software_update.c13
-rw-r--r--ui/software_update.h6
3 files changed, 28 insertions, 2 deletions
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index 96f26191dd..abb3a728e4 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -79,6 +79,7 @@
#include "ui/commandline.h"
#include "ui/capture_ui_utils.h"
#include "ui/preference_utils.h"
+#include "ui/software_update.h"
#include "ui/taps.h"
#include "ui/qt/conversation_dialog.h"
@@ -137,8 +138,8 @@
# INFO = 64
# DEBUG = 128
-*/
#define DEBUG_STARTUP_TIME_LOGLEVEL 252
+*/
/* update the main window */
void main_window_update(void)
@@ -226,6 +227,14 @@ get_gui_compiled_info(GString *str)
g_string_append(str, "without QtMultimedia");
#endif
+ g_string_append(str, ", ");
+ const char *update_info = software_update_info();
+ if (update_info) {
+ g_string_append_printf(str, "with automatic updates using %s", update_info);
+ } else {
+ g_string_append_printf(str, "without automatic updates");
+ }
+
#ifdef _WIN32
g_string_append(str, ", ");
#ifdef HAVE_AIRPCAP
diff --git a/ui/software_update.c b/ui/software_update.c
index 44217ea4aa..0f8f8b4507 100644
--- a/ui/software_update.c
+++ b/ui/software_update.c
@@ -123,6 +123,10 @@ extern void software_update_cleanup(void) {
win_sparkle_cleanup();
}
+const char *software_update_info(void) {
+ return "WinSparkle " WIN_SPARKLE_VERSION_STRING;
+}
+
#elif defined (__APPLE__)
/** Initialize software updates.
*/
@@ -146,6 +150,10 @@ software_update_check(void) {
*/
void software_update_cleanup(void) {
}
+
+const char *software_update_info(void) {
+ return "Sparkle";
+}
#endif
#else /* No updates */
@@ -167,6 +175,10 @@ software_update_check(void) {
void software_update_cleanup(void) {
}
+const char *software_update_info(void) {
+ return NULL;
+}
+
#endif /* defined(HAVE_SOFTWARE_UPDATE) && defined (_WIN32) */
/*
@@ -181,4 +193,3 @@ void software_update_cleanup(void) {
* ex: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
-
diff --git a/ui/software_update.h b/ui/software_update.h
index b764c5b5b4..a5a72b3939 100644
--- a/ui/software_update.h
+++ b/ui/software_update.h
@@ -41,6 +41,12 @@ extern void software_update_check(void);
*/
extern void software_update_cleanup(void);
+/** Fetch a description of the software update mechanism.
+ *
+ * @return NULL, "Sparkle", or "WinSparkle".
+ */
+extern const char *software_update_info(void);
+
#ifdef _WIN32
/** Check to see if Wireshark can shut down safely (e.g. offer to save the
* current capture). Called from a separate thread.