diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llappviewer.cpp | 52 | ||||
-rw-r--r-- | indra/newview/lllogininstance.cpp | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 38 | ||||
-rw-r--r-- | indra/newview/tests/lllogininstance_test.cpp | 1 | ||||
-rw-r--r-- | indra/viewer_components/updater/llupdaterservice.cpp | 17 | ||||
-rw-r--r-- | indra/viewer_components/updater/llupdaterservice.h | 5 |
6 files changed, 107 insertions, 14 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1306e92b35..41be4eb065 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2408,6 +2408,49 @@ namespace { LLUpdaterService().startChecking(install_if_ready); } } + + void apply_update_ok_callback(LLSD const & notification, LLSD const & response) + { + llinfos << "LLUpdate restarting viewer" << llendl; + static const bool install_if_ready = true; + // *HACK - this lets us launch the installer immediately for now + LLUpdaterService().startChecking(install_if_ready); + } + + void on_required_update_downloaded(LLSD const & data) + { + std::string notification_name; + if(LLStartUp::getStartupState() <= STATE_LOGIN_WAIT) + { + // The user never saw the progress bar. + notification_name = "RequiredUpdateDownloadedVerboseDialog"; + } + else + { + notification_name = "RequiredUpdateDownloadedDialog"; + } + LLSD substitutions; + substitutions["VERSION"] = data["version"]; + LLNotificationsUtil::add(notification_name, substitutions, LLSD(), &apply_update_ok_callback); + } + + void on_optional_update_downloaded(LLSD const & data) + { + std::string notification_name; + if(LLStartUp::getStartupState() < STATE_STARTED) + { + // CHOP-262 we need to use a different notification + // method prior to login. + notification_name = "DownloadBackgroundDialog"; + } + else + { + notification_name = "DownloadBackgroundTip"; + } + LLSD substitutions; + substitutions["VERSION"] = data["version"]; + LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_update_callback); + } bool notify_update(LLSD const & evt) { @@ -2415,17 +2458,14 @@ namespace { switch (evt["type"].asInteger()) { case LLUpdaterService::DOWNLOAD_COMPLETE: - if(LLStartUp::getStartupState() < STATE_STARTED) + if(evt["required"].asBoolean()) { - // CHOP-262 we need to use a different notification - // method prior to login. - notification_name = "DownloadBackgroundDialog"; + on_required_update_downloaded(evt); } else { - notification_name = "DownloadBackgroundTip"; + on_optional_update_downloaded(evt); } - LLNotificationsUtil::add(notification_name, LLSD(), LLSD(), apply_update_callback); break; case LLUpdaterService::INSTALL_ERROR: LLNotificationsUtil::add("FailedUpdateInstall"); diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 3ff1487286..1858cbdcd9 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -62,6 +62,7 @@ #include "llappviewer.h" #include <boost/scoped_ptr.hpp> +#include <sstream> namespace { class MandatoryUpdateMachine { @@ -261,7 +262,7 @@ void MandatoryUpdateMachine::CheckingForUpdate::enter(void) mProgressView = gViewerWindow->getProgressView(); mProgressView->setMessage("Looking for update..."); - mProgressView->setText("Update"); + mProgressView->setText("There is a required update for your Second Life installation."); mProgressView->setPercent(0); mProgressView->setVisible(true); mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). @@ -411,7 +412,10 @@ void MandatoryUpdateMachine::WaitingForDownload::enter(void) llinfos << "entering waiting for download" << llendl; mProgressView = gViewerWindow->getProgressView(); mProgressView->setMessage("Downloading update..."); - mProgressView->setText("Update"); + std::ostringstream stream; + stream << "There is a required update for your Second Life installation." << std::endl << + "Version " << mMachine.mUpdaterService.updatedVersion(); + mProgressView->setText(stream.str()); mProgressView->setPercent(0); mProgressView->setVisible(true); mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 80a210f9bc..eecbeeb8dc 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2893,6 +2893,9 @@ http://secondlife.com/download. name="UpdaterServiceNotRunning" type="alertmodal"> There is a required update for your Second Life Installation. + +You may download this update from http://www.secondlife.com/downloads +or you can install it now. <usetemplate name="okcancelbuttons" notext="Quit Second Life" @@ -2903,8 +2906,8 @@ There is a required update for your Second Life Installation. icon="notify.tga" name="DownloadBackgroundTip" type="notify"> -An updated version of [APP_NAME] has been downloaded. -It will be applied the next time you restart [APP_NAME] +We have downloaded and update to your [APP_NAME] installation. +Version [VERSION] <usetemplate name="okcancelbuttons" notext="Wait" @@ -2915,12 +2918,35 @@ It will be applied the next time you restart [APP_NAME] icon="alertmodal.tga" name="DownloadBackgroundDialog" type="alertmodal"> - An updated version of [APP_NAME] has been downloaded. - It will be applied the next time you restart [APP_NAME] +We have downloaded and update to your [APP_NAME] installation. +Version [VERSION] <usetemplate name="okcancelbuttons" - notext="Wait" - yestext="Restart Now"/> + notext="Later..." + yestext="Install now and restart [APP_NAME]"/> + </notification> + + <notification + icon="alertmodal.tga" + name="RequiredUpdateDownloadedVerboseDialog" + type="alertmodal"> +We have downloaded a required software update. +Version [VERSION] + +We must restart [APP_NAME] to install the update. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="RequiredUpdateDownloadedDialog" + type="alertmodal"> +We must restart [APP_NAME] to install the update. + <usetemplate + name="okbutton" + yestext="OK"/> </notification> <notification diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 59a8e40607..9e321db889 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -219,6 +219,7 @@ void LLUpdaterService::startChecking(bool install_if_ready) {} void LLUpdaterService::stopChecking() {} bool LLUpdaterService::isChecking() { return false; } LLUpdaterService::eUpdaterState LLUpdaterService::getState() { return INITIAL; } +std::string LLUpdaterService::updatedVersion() { return ""; } //----------------------------------------------------------------------------- #include "llnotifications.h" diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index b29356b968..78f768facf 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -122,6 +122,7 @@ public: LLUpdaterService::eUpdaterState getState(); void setAppExitCallback(LLUpdaterService::app_exit_callback_t aecb) { mAppExitCallback = aecb;} + std::string updatedVersion(void); bool checkForInstall(bool launchInstaller); // Test if a local install is ready. bool checkForResume(); // Test for resumeable d/l. @@ -143,6 +144,8 @@ public: bool onMainLoop(LLSD const & event); private: + std::string mNewVersion; + void restartTimer(unsigned int seconds); void setState(LLUpdaterService::eUpdaterState state); void stopTimer(); @@ -254,6 +257,11 @@ LLUpdaterService::eUpdaterState LLUpdaterServiceImpl::getState() return mState; } +std::string LLUpdaterServiceImpl::updatedVersion(void) +{ + return mNewVersion; +} + bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) { bool foundInstall = false; // return true if install is found. @@ -360,6 +368,7 @@ void LLUpdaterServiceImpl::optionalUpdate(std::string const & newVersion, std::string const & hash) { stopTimer(); + mNewVersion = newVersion; mIsDownloading = true; mUpdateDownloader.download(uri, hash, false); @@ -371,6 +380,7 @@ void LLUpdaterServiceImpl::requiredUpdate(std::string const & newVersion, std::string const & hash) { stopTimer(); + mNewVersion = newVersion; mIsDownloading = true; mUpdateDownloader.download(uri, hash, true); @@ -400,6 +410,8 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) event["pump"] = LLUpdaterService::pumpName(); LLSD payload; payload["type"] = LLSD(LLUpdaterService::DOWNLOAD_COMPLETE); + payload["required"] = data["required"]; + payload["version"] = mNewVersion; event["payload"] = payload; LLEventPumps::instance().obtain("mainlooprepeater").post(event); @@ -578,6 +590,11 @@ void LLUpdaterService::setImplAppExitCallback(LLUpdaterService::app_exit_callbac return mImpl->setAppExitCallback(aecb); } +std::string LLUpdaterService::updatedVersion(void) +{ + return mImpl->updatedVersion(); +} + std::string const & ll_get_version(void) { static std::string version(""); diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 1ffa609019..421481bc43 100644 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -90,6 +90,11 @@ public: app_exit_callback_t aecb = callable; setImplAppExitCallback(aecb); } + + // If an update is or has been downloaded, this method will return the + // version string for that update. An empty string will be returned + // otherwise. + std::string updatedVersion(void); private: boost::shared_ptr<LLUpdaterServiceImpl> mImpl; |