From 5966831b0cc4f5abae63369d56d83d7cafb7810b Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 4 Apr 2019 13:20:36 +0300 Subject: SL-10881 Add HiDPI status to Help - About Second Life report --- indra/newview/llappviewer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 577082f01f..7476ab1c5f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3173,6 +3173,10 @@ LLSD LLAppViewer::getViewerInfo() const substitution["datetime"] = (S32)(gVFS ? gVFS->creationTime() : 0); info["VFS_TIME"] = LLTrans::getString("AboutTime", substitution); +#if LL_DARWIN + info["HIDPI"] = gHiDPISupport; +#endif + // Libraries info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); @@ -3315,6 +3319,9 @@ std::string LLAppViewer::getViewerInfoString(bool default_string) const } support << "\n" << LLTrans::getString("AboutOGL", args, default_string); support << "\n\n" << LLTrans::getString("AboutSettings", args, default_string); +#if LL_DARWIN + support << "\n" << LLTrans::getString("AboutOSXHiDPI", args, default_string); +#endif support << "\n\n" << LLTrans::getString("AboutLibs", args, default_string); if (info.has("COMPILER")) { -- cgit v1.2.3 From f7f939ecf2ed1a0a5970b91aa0227fa0cf012a72 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 10 Apr 2019 16:17:55 +0300 Subject: Don't crash Test Viewer due to missing version checker --- indra/newview/llappviewer.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7476ab1c5f..5592cd3e59 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1167,11 +1167,18 @@ bool LLAppViewer::init() // ForceAddressSize updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize"))); - // Run the updater. An exception from launching the updater should bother us. - if (!beingDebugged()) +#if LL_WINDOWS && !LL_RELEASE_FOR_DOWNLOAD && !LL_SEND_CRASH_REPORTS + // This is neither a release package, nor crash-reporting enabled test build + // try to run version updater, but don't bother if it fails (file might be missing) + LLLeap *leap_p = LLLeap::create(updater, false); + if (!leap_p) { - LLLeap::create(updater, true); + LL_WARNS("LLLeap") << "Failed to run LLLeap" << LL_ENDL; } +#else + // Run the updater. An exception from launching the updater should bother us. + LLLeap::create(updater, true); +#endif // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. -- cgit v1.2.3 From c9cc8f6ddedefc681ac2fe08034c57c87c1d745c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 10 Apr 2019 21:31:01 +0300 Subject: Don't crash Test Viewer due to missing version checker --- indra/newview/llappviewer.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5592cd3e59..6202a382b1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1167,14 +1167,10 @@ bool LLAppViewer::init() // ForceAddressSize updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize"))); -#if LL_WINDOWS && !LL_RELEASE_FOR_DOWNLOAD && !LL_SEND_CRASH_REPORTS - // This is neither a release package, nor crash-reporting enabled test build - // try to run version updater, but don't bother if it fails (file might be missing) - LLLeap *leap_p = LLLeap::create(updater, false); - if (!leap_p) - { - LL_WARNS("LLLeap") << "Failed to run LLLeap" << LL_ENDL; - } +#if !LL_RELEASE_FOR_DOWNLOAD && !LL_SEND_CRASH_REPORTS + // This is neither a release package, nor crash-reporting enabled test build + // Note: pointless to launch on Windows - it shouldn't expect secondlife-bin.exe + LL_WARNS("LLLeap") << "Launching without version checker" << LL_ENDL; #else // Run the updater. An exception from launching the updater should bother us. LLLeap::create(updater, true); -- cgit v1.2.3 From a2d4122de41ff161b7397ca663a41595cb9dbf2a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 25 Apr 2019 15:40:44 -0400 Subject: Reorder logic in LLAppViewer::initConfiguration(); remove dup code. There were two nearly-identical copies of a stanza that calls sendURLToOtherInstance(). Remove one. It's possible that the reason no one noticed the duplication was because the two copies were 70 lines apart. Move setSkinFolder(), setUseSpellCheck() and setSecondaryDictionaries() stanzas to consolidate SLURL-handling code more closely. Also move logic for NextLoginLocation and CmdLineLoginLocation. Remove a couple unnecessary std::ostringstream instances. Streaming a single string literal to std::ostringstream and retrieving its str() is the same as simply converting the literal to std::string, only slower. OSMessageBox() accepts const std::string&. Given that you have a std::string in hand, passing its c_str() to OSMessageBox() is not only unnecessary but wasteful: it requires silently converting the const char* back to a different std::string instance. Calling a class method from another method of the same class does not require ClassName:: qualification. Calling a singleton subclass method from another non-static method of the same subclass does not require going through ClassName::instance() or sInstance or whatever. --- indra/newview/llappviewer.cpp | 124 +++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 68 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1bc21ec469..9d658ab376 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2429,9 +2429,9 @@ bool LLAppViewer::initConfiguration() bool set_defaults = true; if(!loadSettingsFromDirectory("Default", set_defaults)) { - std::ostringstream msg; - msg << "Unable to load default settings file. The installation may be corrupted."; - OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); + OSMessageBox( + "Unable to load default settings file. The installation may be corrupted.", + LLStringUtil::null,OSMB_OK); return false; } @@ -2552,7 +2552,7 @@ bool LLAppViewer::initConfiguration() if(gSavedSettings.getBOOL("DisableCrashLogger")) { LL_WARNS() << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << LL_ENDL; - LLAppViewer::instance()->disableCrashlogger(); + disableCrashlogger(); } // Handle initialization from settings. @@ -2569,7 +2569,7 @@ bool LLAppViewer::initConfiguration() LL_INFOS() << msg.str() << LL_ENDL; OSMessageBox( - msg.str().c_str(), + msg.str(), LLStringUtil::null, OSMB_OK); @@ -2679,7 +2679,34 @@ bool LLAppViewer::initConfiguration() ll_init_fail_log(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "test_failures.log")); } + const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); + if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) + { + // Examining "Language" may not suffice -- see LLUI::getLanguage() + // logic. Unfortunately LLUI::getLanguage() doesn't yet do us much + // good because we haven't yet called LLUI::initClass(). + gDirUtilp->setSkinFolder(skinfolder->getValue().asString(), + gSavedSettings.getString("Language")); + } + + if (gSavedSettings.getBOOL("SpellCheck")) + { + std::list dict_list; + std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); + boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); + if (!dict_list.empty()) + { + LLSpellChecker::setUseSpellCheck(dict_list.front()); + dict_list.pop_front(); + LLSpellChecker::instance().setSecondaryDictionaries(dict_list); + } + } + // Handle slurl use. NOTE: Don't let SL-55321 reappear. + // This initial-SLURL logic, up through the call to + // sendURLToOtherInstance(), must precede LLSplashScreen::show() -- + // because if sendURLToOtherInstance() succeeds, we take a fast exit, + // SKIPPING the splash screen and everything else. // *FIX: This init code should be made more robust to prevent // the issue SL-55321 from returning. One thought is to allow @@ -2724,6 +2751,27 @@ bool LLAppViewer::initConfiguration() } } + // NextLoginLocation is set as a side effect of LLStartUp::setStartSLURL() + std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); + if ( !nextLoginLocation.empty() ) + { + LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "<getValue().asString()) - { - // Examining "Language" may not suffice -- see LLUI::getLanguage() - // logic. Unfortunately LLUI::getLanguage() doesn't yet do us much - // good because we haven't yet called LLUI::initClass(). - gDirUtilp->setSkinFolder(skinfolder->getValue().asString(), - gSavedSettings.getString("Language")); - } - - if (gSavedSettings.getBOOL("SpellCheck")) - { - std::list dict_list; - std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); - boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); - if (!dict_list.empty()) - { - LLSpellChecker::setUseSpellCheck(dict_list.front()); - dict_list.pop_front(); - LLSpellChecker::instance().setSecondaryDictionaries(dict_list); - } - } - - // Display splash screen. Must be after above check for previous // crash as this dialog is always frontmost. std::string splash_msg; @@ -2794,30 +2818,15 @@ bool LLAppViewer::initConfiguration() } LLStringUtil::truncate(gWindowTitle, 255); - //RN: if we received a URL, hand it off to the existing instance. - // don't call anotherInstanceRunning() when doing URL handoff, as - // it relies on checking a marker file which will not work when running - // out of different directories - - if (LLStartUp::getStartSLURL().isValid() && - (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) - { - if (sendURLToOtherInstance(LLStartUp::getStartSLURL().getSLURLString())) - { - // successfully handed off URL to existing instance, exit - return false; - } - } - // // Check for another instance of the app running + // This happens AFTER LLSplashScreen::show(). That may or may not be + // important. // if (mSecondInstance && !gSavedSettings.getBOOL("AllowMultipleViewers")) { - std::ostringstream msg; - msg << LLTrans::getString("MBAlreadyRunning"); OSMessageBox( - msg.str(), + LLTrans::getString("MBAlreadyRunning"), LLStringUtil::null, OSMB_OK); return false; @@ -2835,27 +2844,6 @@ bool LLAppViewer::initConfiguration() } } - // NextLoginLocation is set from the command line option - std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); - if ( !nextLoginLocation.empty() ) - { - LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "< Date: Tue, 7 May 2019 16:41:47 +0300 Subject: SL-10423 Detect potentially bad install --- indra/newview/llappviewer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c3663b12dd..d0fbf17d81 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2877,7 +2877,14 @@ bool LLAppViewer::initConfiguration() // keeps growing, necessitating a method all its own. void LLAppViewer::initStrings() { - LLTransUtil::parseStrings("strings.xml", default_trans_args); + std::string strings_file = "strings.xml"; + std::string strings_path_full = gDirUtilp->findSkinnedFilenameBaseLang(LLDir::XUI, strings_file); + if (strings_path_full.empty() || !LLFile::isfile(strings_path_full)) + { + // initial check to make sure files are there failed + LL_ERRS() << "Viewer failed to find localization and UI files. Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; + } + LLTransUtil::parseStrings(strings_file, default_trans_args); LLTransUtil::parseLanguageStrings("language_settings.xml"); // parseStrings() sets up the LLTrans substitution table. Add this one item. -- cgit v1.2.3 From 930bf680c2d184b8678a0c42a8d3a0d30e104643 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 3 Jun 2019 21:37:43 +0300 Subject: SL-10423 Dump path data when missing critical file --- indra/newview/llappviewer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index be5611899a..e201d56815 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2882,6 +2882,7 @@ void LLAppViewer::initStrings() if (strings_path_full.empty() || !LLFile::isfile(strings_path_full)) { // initial check to make sure files are there failed + gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); LL_ERRS() << "Viewer failed to find localization and UI files. Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; } LLTransUtil::parseStrings(strings_file, default_trans_args); -- cgit v1.2.3 From 19221d9ccf38a5b10e7e2ecefb1ad121f1fb51d7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 12 Jun 2019 16:17:37 +0300 Subject: SL-11402 Save last session image per grid --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e201d56815..24886b01fb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4505,7 +4505,7 @@ void LLAppViewer::saveFinalSnapshot() std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_LAST_FILENAME; + snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); mSavedFinalSnapshot = TRUE; -- cgit v1.2.3 From 04e67fa12d1dac368e2f88a04af4cd266b8b2063 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 12 Jun 2019 19:12:09 +0300 Subject: SL-11402 Last session image should be saved as png --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 24886b01fb..f3915b9210 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4507,7 +4507,7 @@ void LLAppViewer::saveFinalSnapshot() snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); mSavedFinalSnapshot = TRUE; } } -- cgit v1.2.3 From d72fcfba57c02f2577f3b4f3d132ddfa515dd894 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 13 Jun 2019 19:00:20 +0300 Subject: SL-11402 Resaving home image if file does not exist --- indra/newview/llappviewer.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f3915b9210..c8dcbb87c1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4507,8 +4507,35 @@ void LLAppViewer::saveFinalSnapshot() snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); + gViewerWindow->saveSnapshot(snap_filename, + gViewerWindow->getWindowWidthRaw(), + gViewerWindow->getWindowHeightRaw(), + FALSE, + TRUE, + LLSnapshotModel::SNAPSHOT_TYPE_COLOR, + LLSnapshotModel::SNAPSHOT_FORMAT_PNG); mSavedFinalSnapshot = TRUE; + + if (gAgent.isInHomeRegion()) + { + LLVector3d home; + if (gAgent.getHomePosGlobal(&home) && dist_vec(home, gAgent.getPositionGlobal()) < 10) + { + // We are at home position or close to it, see if we need to create home screenshot + // Notes: + // 1. It might be beneficial to also replace home if file is too old + // 2. This is far from best way/place to update screenshot since location might be not fully loaded, + // but we don't have many options + std::string snap_home = gDirUtilp->getLindenUserDir(); + snap_home += gDirUtilp->getDirDelimiter(); + snap_home += LLStartUp::getScreenHomeFilename(); + if (!gDirUtilp->fileExists(snap_home)) + { + // We are at home position yet no home image exist, fix it + LLFile::copy(snap_filename, snap_home); + } + } + } } } -- cgit v1.2.3