From 329253d8e45259bd30d29c43fad1c16f328ed0b0 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 19 Aug 2013 17:17:26 -0700 Subject: [PATCH] move update checking later in init, add menu option --- interface/src/Application.cpp | 9 +++++---- interface/src/Menu.cpp | 7 ++++++- interface/src/Menu.h | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 02c3dbf0f7..1785bf4d0c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -212,10 +212,6 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : // 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(); @@ -309,6 +305,11 @@ void Application::initializeGL() { // update before the first render update(0.0f); + + // now that things are drawn - if this is an OS X release build we can check for an update +#if defined(Q_OS_MAC) && defined(QT_NO_DEBUG) + Menu::getInstance()->checkForUpdates(); +#endif } void Application::paintGL() { diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index df9539cc1c..d80d972fb0 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -64,6 +64,11 @@ Menu::Menu() : this, SLOT(editPreferences())))->setMenuRole(QAction::PreferencesRole); +#if defined(Q_OS_MAC) && defined(QT_NO_DEBUG) + // show "Check for Updates" in the menu + (addActionToQMenuAndActionHash(fileMenu, MenuOption::CheckForUpdates, 0, this, SLOT(checkForUpdates())))->setMenuRole(QAction::ApplicationSpecificRole); +#endif + QMenu* pairMenu = addMenu("Pair"); addActionToQMenuAndActionHash(pairMenu, MenuOption::Pair, 0, PairingHandler::getInstance(), SLOT(sendPairRequest())); @@ -463,7 +468,7 @@ 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()->SetFeedURL("file://localhost/Users/birarda/Desktop/appcast.xml"); FvUpdater::sharedUpdater()->CheckForUpdatesSilent(); } diff --git a/interface/src/Menu.h b/interface/src/Menu.h index fbc89e762e..e399101702 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -113,6 +113,7 @@ namespace MenuOption { const QString Atmosphere = "Atmosphere"; const QString Bandwidth = "Bandwidth Display"; const QString BandwidthDetails = "Bandwidth Details"; + const QString CheckForUpdates = "Check for Updates..."; const QString Collisions = "Collisions"; const QString CopyVoxels = "Copy Voxels"; const QString CoverageMap = "Render Coverage Map";