diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-24 17:36:41 +0200 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-24 17:36:41 +0200 |
commit | 268e4854c056170b4703e341e7e9d02f332d61d4 (patch) | |
tree | c5e75a1e3eed76679cc856e4b397aa11f4986cd6 /indra/newview | |
parent | c4a10e9a53bd8f55b63b28783fa3758c21f6a122 (diff) | |
parent | 76be5ddc7022508e7d3fcb04165b4a6f64f1d58d (diff) |
Merge from default branch
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 48 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 9 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 8 |
5 files changed, 84 insertions, 21 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1eca897ea5..994e546bd0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3585,7 +3585,7 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>http://docs.lindenlab.com/help/helpfloater.php?topic=[TOPIC]&channel=[CHANNEL]&version=[VERSION]&os=[OS]&language=[LANGUAGE]&version_major=[VERSION_MAJOR]&version_minor=[VERSION_MINOR]&version_patch=[VERSION_PATCH]&version_build=[VERSION_BUILD]</string> + <string>http://viewer-help.secondlife.com/[LANGUAGE]/[CHANNEL]/[VERSION]/[TOPIC]</string> </map> <key>HighResSnapshot</key> <map> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4f2d3e9645..fa0ea557ba 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1360,19 +1360,25 @@ bool LLAppViewer::cleanup() llinfos << "Waiting for pending IO to finish: " << pending << llendflush; ms_sleep(100); } - llinfos << "Shutting down." << llendflush; + llinfos << "Shutting down Views" << llendflush; // Destroy the UI if( gViewerWindow) gViewerWindow->shutdownViews(); + + llinfos << "Cleaning up Inevntory" << llendflush; // Cleanup Inventory after the UI since it will delete any remaining observers // (Deleted observers should have already removed themselves) gInventory.cleanupInventory(); + + llinfos << "Cleaning up Selections" << llendflush; // Clean up selection managers after UI is destroyed, as UI may be observing them. // Clean up before GL is shut down because we might be holding on to objects with texture references LLSelectMgr::cleanupGlobals(); + + llinfos << "Shutting down OpenGL" << llendflush; // Shut down OpenGL if( gViewerWindow) @@ -1386,11 +1392,18 @@ bool LLAppViewer::cleanup() gViewerWindow = NULL; llinfos << "ViewerWindow deleted" << llendflush; } + + llinfos << "Cleaning up Keyboard & Joystick" << llendflush; // viewer UI relies on keyboard so keep it aound until viewer UI isa gone delete gKeyboard; gKeyboard = NULL; + // Turn off Space Navigator and similar devices + LLViewerJoystick::getInstance()->terminate(); + + llinfos << "Cleaning up Objects" << llendflush; + LLViewerObject::cleanupVOClasses(); LLWaterParamManager::cleanupClass(); @@ -1413,6 +1426,8 @@ bool LLAppViewer::cleanup() } LLPrimitive::cleanupVolumeManager(); + llinfos << "Additional Cleanup..." << llendflush; + LLViewerParcelMgr::cleanupGlobals(); // *Note: this is where gViewerStats used to be deleted. @@ -1432,9 +1447,11 @@ bool LLAppViewer::cleanup() // Also after shutting down the messaging system since it has VFS dependencies // + llinfos << "Cleaning up VFS" << llendflush; LLVFile::cleanupClass(); - llinfos << "VFS cleaned up" << llendflush; + llinfos << "Saving Data" << llendflush; + // Quitting with "Remember Password" turned off should always stomp your // saved password, whether or not you successfully logged in. JC if (!gSavedSettings.getBOOL("RememberPassword")) @@ -1476,13 +1493,16 @@ bool LLAppViewer::cleanup() gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask); } - // Turn off Space Navigator and similar devices - LLViewerJoystick::getInstance()->terminate(); - removeMarkerFile(); // Any crashes from here on we'll just have to ignore writeDebugInfo(); + LLLocationHistory::getInstance()->save(); + + LLAvatarIconIDCache::getInstance()->save(); + + llinfos << "Shutting down Threads" << llendflush; + // Let threads finish LLTimer idleTimer; idleTimer.reset(); @@ -1515,14 +1535,9 @@ bool LLAppViewer::cleanup() sTextureFetch = NULL; delete sImageDecodeThread; sImageDecodeThread = NULL; - - LLLocationHistory::getInstance()->save(); - - LLAvatarIconIDCache::getInstance()->save(); - delete mFastTimerLogThread; mFastTimerLogThread = NULL; - + if (LLFastTimerView::sAnalyzePerformance) { llinfos << "Analyzing performance" << llendl; @@ -1544,6 +1559,8 @@ bool LLAppViewer::cleanup() } LLMetricPerformanceTester::cleanClass() ; + llinfos << "Cleaning up Media and Textures" << llendflush; + //Note: //LLViewerMedia::cleanupClass() has to be put before gTextureList.shutdown() //because some new image might be generated during cleaning up media. --bao @@ -1557,13 +1574,13 @@ bool LLAppViewer::cleanup() LLVFSThread::cleanupClass(); LLLFSThread::cleanupClass(); - llinfos << "VFS Thread finished" << llendflush; - #ifndef LL_RELEASE_FOR_DOWNLOAD llinfos << "Auditing VFS" << llendl; gVFS->audit(); #endif + llinfos << "Misc Cleanup" << llendflush; + // For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up. // (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve delete gStaticVFS; @@ -1577,12 +1594,11 @@ bool LLAppViewer::cleanup() LLWatchdog::getInstance()->cleanup(); + llinfos << "Shutting down message system" << llendflush; end_messaging_system(); - llinfos << "Message system deleted." << llendflush; // *NOTE:Mani - The following call is not thread safe. LLCurl::cleanupClass(); - llinfos << "LLCurl cleaned up." << llendflush; // If we're exiting to launch an URL, do that here so the screen // is at the right resolution before we launch IE. @@ -1603,7 +1619,7 @@ bool LLAppViewer::cleanup() ll_close_fail_log(); - llinfos << "Goodbye" << llendflush; + llinfos << "Goodbye!" << llendflush; // return 0; return true; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 95e8adca81..e20249a737 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -165,7 +165,6 @@ BOOL LLVoiceSetKeyDialog::handleKeyHere(KEY key, MASK mask) { mParent->setKey(key); } - closeFloater(); return result; } @@ -311,7 +310,8 @@ F32 LLFloaterPreference::sAspectRatio = 0.0; LLFloaterPreference::LLFloaterPreference(const LLSD& key) : LLFloater(key), mGotPersonalInfo(false), - mOriginalIMViaEmail(false) + mOriginalIMViaEmail(false), + mCancelOnClose(true) { //Build Floater is now Called from LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); @@ -393,6 +393,20 @@ void LLFloaterPreference::draw() LLFloater::draw(); } +void LLFloaterPreference::saveSettings() +{ + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); + child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + child_list_t::const_iterator end = tabcontainer->getChildList()->end(); + for ( ; iter != end; ++iter) + { + LLView* view = *iter; + LLPanelPreference* panel = dynamic_cast<LLPanelPreference*>(view); + if (panel) + panel->saveSettings(); + } +} + void LLFloaterPreference::apply() { LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); @@ -556,6 +570,11 @@ void LLFloaterPreference::onOpen(const LLSD& key) LLPanelLogin::setAlwaysRefresh(true); refresh(); + + // Make sure the current state of prefs are saved away when + // when the floater is opened. That will make cancel do its + // job + saveSettings(); } void LLFloaterPreference::onVertexShaderEnable() @@ -574,7 +593,7 @@ void LLFloaterPreference::onClose(bool app_quitting) { gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex()); LLPanelLogin::setAlwaysRefresh(false); - cancel(); // will be a no-op if OK or apply was performed just prior. + if (mCancelOnClose) cancel(); } void LLFloaterPreference::onOpenHardwareSettings() @@ -597,7 +616,11 @@ void LLFloaterPreference::onBtnOK() if (canClose()) { apply(); + // Here we do not want to cancel on close, so we do this funny thing + // that prevents cancel from undoing our changes when we hit OK + mCancelOnClose = false; closeFloater(false); + mCancelOnClose = true; gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); LLUIColorTable::instance().saveUserSettings(); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); @@ -625,6 +648,7 @@ void LLFloaterPreference::onBtnApply( ) } } apply(); + saveSettings(); LLPanelLogin::refreshLocation( false ); } @@ -641,7 +665,8 @@ void LLFloaterPreference::onBtnCancel() } refresh(); } - closeFloater(); // side effect will also cancel any unsaved changes. + cancel(); + closeFloater(); } // static @@ -1500,6 +1525,11 @@ BOOL LLPanelPreference::postBuild() void LLPanelPreference::apply() { + // no-op +} + +void LLPanelPreference::saveSettings() +{ // Save the value of all controls in the hierarchy mSavedValues.clear(); std::list<LLView*> view_stack; diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 41c8bb7124..a30422564a 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -97,6 +97,10 @@ protected: // callback for when client turns on shaders void onVertexShaderEnable(); + // This function squirrels away the current values of the controls so that + // cancel() can restore them. + void saveSettings(); + public: @@ -145,6 +149,7 @@ private: static std::string sSkin; bool mGotPersonalInfo; bool mOriginalIMViaEmail; + bool mCancelOnClose; bool mOriginalHideOnlineStatus; std::string mDirectoryVisibility; @@ -161,6 +166,10 @@ public: virtual void cancel(); void setControlFalse(const LLSD& user_data); + // This function squirrels away the current values of the controls so that + // cancel() can restore them. + virtual void saveSettings(); + private: typedef std::map<LLControlVariable*, LLSD> control_values_map_t; control_values_map_t mSavedValues; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 6f3dabe5a7..9bb2a4ad0a 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -931,6 +931,14 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == DECODE_IMAGE) { + if (mDesiredDiscard < 0) + { + // We aborted, don't decode + mState = DONE; + setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); + return true; + } + if (mFormattedImage->getDataSize() <= 0) { llerrs << "Decode entered with invalid mFormattedImage. ID = " << mID << llendl; |