diff options
author | Rider Linden <rider@lindenlab.com> | 2018-06-21 09:13:19 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-06-21 09:13:19 -0700 |
commit | f07dc421e81d945531dc6f4befc19ea4fe4b9a47 (patch) | |
tree | 7ac8fa1fbfad64c616161488a5d0be10c1eaba34 /indra/newview/llviewerwindow.cpp | |
parent | 8b3957b310afa23e543c3eb33aca9131dba52b31 (diff) | |
parent | dc07de2f4a4c49d1877bf743b6f0d209392f6eb6 (diff) |
Merge
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1ad71ce93e..3c1b1590fa 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -261,10 +261,8 @@ static const F32 MIN_UI_SCALE = 0.75f; static const F32 MAX_UI_SCALE = 7.0f; static const F32 MIN_DISPLAY_SCALE = 0.75f; -std::string LLViewerWindow::sSnapshotBaseName; -std::string LLViewerWindow::sSnapshotDir; - -std::string LLViewerWindow::sMovieBaseName; +static LLCachedControl<std::string> sSnapshotBaseName(LLCachedControl<std::string>(gSavedPerAccountSettings, "SnapshotBaseName", "Snapshot")); +static LLCachedControl<std::string> sSnapshotDir(LLCachedControl<std::string>(gSavedPerAccountSettings, "SnapshotBaseDir", "")); LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); @@ -393,14 +391,12 @@ public: } } -#if LL_WINDOWS if (gSavedSettings.getBOOL("DebugShowMemory")) { addText(xpos, ypos, STRINGIZE("Memory: " << (LLMemory::getCurrentRSS() / 1024) << " (KB)")); ypos += y_inc; } -#endif if (gDisplayCameraPos) { @@ -1694,11 +1690,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) LL_INFOS() << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << LL_ENDL; } - // Default to application directory. - LLViewerWindow::sSnapshotBaseName = "Snapshot"; - LLViewerWindow::sMovieBaseName = "SLmovie"; - resetSnapshotLoc(); - /* LLWindowCallbacks* callbacks, @@ -1877,6 +1868,11 @@ void LLViewerWindow::showSystemUIScaleFactorChanged() LLNotificationsUtil::add("SystemUIScaleFactorChanged", LLSD(), LLSD(), onSystemUIScaleFactorChanged); } +std::string LLViewerWindow::getLastSnapshotDir() +{ + return sSnapshotDir; +} + //static bool LLViewerWindow::onSystemUIScaleFactorChanged(const LLSD& notification, const LLSD& response) { @@ -1946,6 +1942,10 @@ void LLViewerWindow::initBase() // Create global views + // Login screen and main_view.xml need edit menus for preferences and browser + LL_DEBUGS("AppInit") << "initializing edit menu" << LL_ENDL; + initialize_edit_menu(); + // Create the floater view at the start so that other views can add children to it. // (But wait to add it as a child of the root view so that it will be in front of the // other views.) @@ -2156,6 +2156,15 @@ void LLViewerWindow::shutdownViews() RecordToChatConsole::getInstance()->stopRecorder(); LL_INFOS() << "Warning logger is cleaned." << LL_ENDL ; + gFocusMgr.unlockFocus(); + gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setTopCtrl(NULL); + if (mWindow) + { + mWindow->allowLanguageTextInput(NULL, FALSE); + } + delete mDebugText; mDebugText = NULL; @@ -2188,7 +2197,11 @@ void LLViewerWindow::shutdownViews() view_listener_t::cleanup(); LL_INFOS() << "view listeners destroyed." << LL_ENDL ; - + + // Clean up pointers that are going to be invalid. (todo: check sMenuContainer) + mProgressView = NULL; + mPopupView = NULL; + // Delete all child views. delete mRootView; mRootView = NULL; @@ -4397,20 +4410,21 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke // Copy the directory + file name std::string filepath = picker.getFirstFile(); - LLViewerWindow::sSnapshotBaseName = gDirUtilp->getBaseFileName(filepath, true); - LLViewerWindow::sSnapshotDir = gDirUtilp->getDirName(filepath); + gSavedPerAccountSettings.setString("SnapshotBaseName", gDirUtilp->getBaseFileName(filepath, true)); + gSavedPerAccountSettings.setString("SnapshotBaseDir", gDirUtilp->getDirName(filepath)); } - if(LLViewerWindow::sSnapshotDir.empty()) + std::string snapshot_dir = sSnapshotDir; + if(snapshot_dir.empty()) { return FALSE; } // Check if there is enough free space to save snapshot #ifdef LL_WINDOWS - boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(sSnapshotDir)); + boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(snapshot_dir)); #else - boost::filesystem::space_info b_space = boost::filesystem::space(sSnapshotDir); + boost::filesystem::space_info b_space = boost::filesystem::space(snapshot_dir); #endif if (b_space.free < image->getDataSize()) { @@ -4448,7 +4462,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke void LLViewerWindow::resetSnapshotLoc() { - sSnapshotDir.clear(); + gSavedPerAccountSettings.setString("SnapshotBaseDir", std::string()); } // static @@ -4502,6 +4516,17 @@ void LLViewerWindow::playSnapshotAnimAndSound() send_sound_trigger(LLUUID(gSavedSettings.getString("UISndSnapshot")), 1.0f); } +BOOL LLViewerWindow::isSnapshotLocSet() const +{ + std::string snapshot_dir = sSnapshotDir; + return !snapshot_dir.empty(); +} + +void LLViewerWindow::resetSnapshotLoc() const +{ + gSavedPerAccountSettings.setString("SnapshotBaseDir", std::string()); +} + BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type) { return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type); |