osx: Implement auto-upgrade function using Sparkle
During the upgrade, NFD and ndn-autoupdate will be stopped (and, if
enabled, automatically started with new versions).
Change-Id: I010ae4a8aa6f99a0039d58065ab7eb0c9189a979
diff --git a/src/tray-menu.hpp b/src/tray-menu.hpp
index 3c7b0f0..841f068 100644
--- a/src/tray-menu.hpp
+++ b/src/tray-menu.hpp
@@ -39,10 +39,16 @@
#include "key-viewer-dialog.hpp"
+#ifdef OSX_BUILD
+#include "osx-auto-update-sparkle.hpp"
+#endif // OSX_BUILD
+
namespace ndn {
class Face;
+namespace ncc {
+
class TrayMenu : public QWidget
{
Q_OBJECT
@@ -113,6 +119,11 @@
static void
appendMsg(QString &target, QString source);
+#ifdef OSX_BUILD
+ void
+ checkForUpdates();
+#endif // OSX_BUILD
+
private:
QQmlContext* m_context;
bool m_isNfdRunning;
@@ -125,7 +136,9 @@
QSettings m_settings;
#ifdef OSX_BUILD
QAction* m_entryEnableCli;
-#endif
+ QAction* m_checkForUpdates;
+ OsxAutoUpdateSparkle m_sparkle;
+#endif // OSX_BUILD
QAction* m_entryQuit;
@@ -133,6 +146,7 @@
Face& m_face;
};
+} // namespace ncc
} // namespace ndn
#endif // NCC_TRAY_MENU_HPP