move update checking later in init, add menu option

This commit is contained in:
Stephen Birarda 2013-08-19 17:17:26 -07:00
parent 65a63fb73e
commit 329253d8e4
3 changed files with 12 additions and 5 deletions

View file

@ -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() {

View file

@ -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();
}

View file

@ -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";