diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-12-13 10:33:02 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-12-20 14:18:14 +0000 |
commit | 795f4eb106d877ba6f2bd30524cc871404e9e42a (patch) | |
tree | 2ba3df1aa07b2b6f565929f3efef916525c047cc /ui/software_update.c | |
parent | 0de990e022a74aab7b6b1c9bf35849a035327b92 (diff) | |
download | wireshark-795f4eb106d877ba6f2bd30524cc871404e9e42a.tar.gz |
Qt+Win32: Make software updates more friendly.
Add WinSparkle can_shutdown and shutdown_request callbacks which are
called prior to running the installer. Reject updates when we have
unsaved information. Add notes about possible improvements.
Ping-Bug: 9687
Ping-Bug: 12989
Change-Id: Ia126244b311417aa3105ea8136f186adc2745445
Reviewed-on: https://code.wireshark.org/review/19244
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/software_update.c')
-rw-r--r-- | ui/software_update.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/ui/software_update.c b/ui/software_update.c index a33dbd5b47..059b409b81 100644 --- a/ui/software_update.c +++ b/ui/software_update.c @@ -103,10 +103,8 @@ software_update_init(void) { win_sparkle_set_appcast_url(update_url); win_sparkle_set_automatic_check_for_updates(prefs.gui_update_enabled ? 1 : 0); win_sparkle_set_update_check_interval(prefs.gui_update_interval); - /* Todo: Fix bugs 9687 and 12989. - * win_sparkle_set_can_shutdown_callback(...); - * win_sparkle_set_shutdown_request_callback(...); - */ + win_sparkle_set_can_shutdown_callback(software_update_can_shutdown_callback); + win_sparkle_set_shutdown_request_callback(software_update_shutdown_request_callback); win_sparkle_init(); } @@ -140,10 +138,20 @@ software_update_check(void) { } /** Clean up software update checking. - * - * Does nothing on platforms that don't support software updates. */ -extern void software_update_cleanup(void) { +void software_update_cleanup(void) { +} + +/** Check to see if Wireshark can shut down safely (e.g. offer to save the + * current capture). + */ +int software_update_can_shutdown_callback(void) { + return FALSE; +} + +/** Shut down Wireshark in preparation for an upgrade. + */ +void software_update_shutdown_request_callback(void) { } #endif /* defined(HAVE_SOFTWARE_UPDATE) && defined (_WIN32) */ |