From 65a63fb73ee86ffae029567be7b891f8cb5ca8de Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 19 Aug 2013 16:16:23 -0700 Subject: [PATCH] move checkForUpdates to menu to have option in menu --- interface/src/Application.cpp | 11 ++++------- interface/src/Menu.cpp | 7 +++++++ interface/src/Menu.h | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b834097c8a..02c3dbf0f7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -64,7 +64,6 @@ #include "renderer/ProgramObject.h" #include "ui/TextRenderer.h" #include "Swatch.h" -#include "fvupdater.h" using namespace std; @@ -209,16 +208,14 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : NodeList::getInstance()->startSilentNodeRemovalThread(); _window->setCentralWidget(_glWidget); - -#if defined(Q_OS_MAC) && defined(QT_NO_DEBUG) - // if this is a release OS X build use fervor to check for an update - FvUpdater::sharedUpdater()->SetFeedURL("https://s3-us-west-1.amazonaws.com/highfidelity/appcast.xml"); - FvUpdater::sharedUpdater()->CheckForUpdatesSilent(); -#endif // call Menu getInstance static method to set up the menu _window->setMenuBar(Menu::getInstance()); +#if defined(Q_OS_MAC) && defined(QT_NO_DEBUG) + Menu::getInstance()->checkForUpdates(); +#endif + _networkAccessManager = new QNetworkAccessManager(this); QRect available = desktop()->availableGeometry(); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 56317b86a2..df9539cc1c 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -20,6 +20,7 @@ #include #include "Application.h" +#include "fvupdater.h" #include "PairingHandler.h" #include "Menu.h" #include "Util.h" @@ -459,6 +460,12 @@ void Menu::exportSettings() { } } +void Menu::checkForUpdates() { + qDebug() << "Checking if there are available updates.\n"; + // if this is a release OS X build use fervor to check for an update + FvUpdater::sharedUpdater()->SetFeedURL("https://s3-us-west-1.amazonaws.com/highfidelity/appcast.xml"); + FvUpdater::sharedUpdater()->CheckForUpdatesSilent(); +} void Menu::loadAction(QSettings* set, QAction* action) { if (action->isChecked() != set->value(action->text(), action->isChecked()).toBool()) { diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 2d871fd890..fbc89e762e 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -58,6 +58,7 @@ public slots: void saveSettings(QSettings* settings = NULL); void importSettings(); void exportSettings(); + void checkForUpdates(); private slots: void editPreferences();