From b89b41991e49e24b826d1b44ebfe3587a8b248ab Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Fri, 10 Dec 2010 09:43:01 -0800 Subject: ui improvements to more closely match UX design. --- indra/viewer_components/updater/llupdaterservice.cpp | 17 +++++++++++++++++ indra/viewer_components/updater/llupdaterservice.h | 5 +++++ 2 files changed, 22 insertions(+) (limited to 'indra/viewer_components/updater') 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 mImpl; -- cgit v1.2.3