summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterabout.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2014-03-10 20:34:43 -0400
committerMonty Brandenberg <monty@lindenlab.com>2014-03-10 20:34:43 -0400
commit9c29000ba2f8192985ad0bf20889739ad12dd569 (patch)
tree3670a18100453ef589a04d40da5aa314b99f5d11 /indra/newview/llfloaterabout.cpp
parent71e237a3f79cd90b432205460fe6e5c6b536d9db (diff)
parentcb91708332b8b8ddfe27808602ec5f43f11c24c2 (diff)
Merge. Refresh from viewer-release after 3.7.3 release.
Diffstat (limited to 'indra/newview/llfloaterabout.cpp')
-rwxr-xr-xindra/newview/llfloaterabout.cpp181
1 files changed, 4 insertions, 177 deletions
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index fea8e34729..4331a63346 100755
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -70,8 +70,6 @@
extern LLMemoryInfo gSysMemory;
extern U32 gPacketsIn;
-static std::string get_viewer_release_notes_url();
-
///----------------------------------------------------------------------------
/// Class LLServerReleaseNotesURLFetcher
///----------------------------------------------------------------------------
@@ -108,8 +106,6 @@ public:
static LLSD getInfo();
void onClickCopyToClipboard();
- void updateServerReleaseNotesURL(const std::string& url);
-
private:
void setSupportText(const std::string& server_release_notes_url);
};
@@ -219,107 +215,9 @@ BOOL LLFloaterAbout::postBuild()
return TRUE;
}
-// static
LLSD LLFloaterAbout::getInfo()
{
- // The point of having one method build an LLSD info block and the other
- // construct the user-visible About string is to ensure that the same info
- // is available to a getInfo() caller as to the user opening
- // LLFloaterAbout.
- LLSD info;
- LLSD version;
- version.append(LLVersionInfo::getMajor());
- version.append(LLVersionInfo::getMinor());
- version.append(LLVersionInfo::getPatch());
- version.append(LLVersionInfo::getBuild());
- info["VIEWER_VERSION"] = version;
- info["VIEWER_VERSION_STR"] = LLVersionInfo::getVersion();
- info["BUILD_DATE"] = __DATE__;
- info["BUILD_TIME"] = __TIME__;
- info["CHANNEL"] = LLVersionInfo::getChannel();
-
- info["VIEWER_RELEASE_NOTES_URL"] = get_viewer_release_notes_url();
-
-#if LL_MSVC
- info["COMPILER"] = "MSVC";
- info["COMPILER_VERSION"] = _MSC_VER;
-#elif LL_GNUC
- info["COMPILER"] = "GCC";
- info["COMPILER_VERSION"] = GCC_VERSION;
-#endif
-
- // Position
- LLViewerRegion* region = gAgent.getRegion();
- if (region)
- {
- LLVector3d pos = gAgent.getPositionGlobal();
- info["POSITION"] = ll_sd_from_vector3d(pos);
- info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos));
- info["REGION"] = gAgent.getRegion()->getName();
- info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName();
- info["HOSTIP"] = gAgent.getRegion()->getHost().getString();
- info["SERVER_VERSION"] = gLastVersionChannel;
- LLSLURL slurl;
- LLAgentUI::buildSLURL(slurl);
- info["SLURL"] = slurl.getSLURLString();
- }
-
- // CPU
- info["CPU"] = gSysCPU.getCPUString();
- info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB() / 1024);
- // Moved hack adjustment to Windows memory size into llsys.cpp
- info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString();
- info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR));
- info["GRAPHICS_CARD"] = (const char*)(glGetString(GL_RENDERER));
-
-#if LL_WINDOWS
- LLSD driver_info = gDXHardware.getDisplayInfo();
- if (driver_info.has("DriverVersion"))
- {
- info["GRAPHICS_DRIVER_VERSION"] = driver_info["DriverVersion"];
- }
-#endif
-
- info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION));
- info["LIBCURL_VERSION"] = LLCurl::getVersionString();
- info["J2C_VERSION"] = LLImageJ2C::getEngineInfo();
- bool want_fullname = true;
- info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD();
- if(LLVoiceClient::getInstance()->voiceEnabled())
- {
- LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion();
- std::ostringstream version_string;
- version_string << version.serverType << " " << version.serverVersion << std::endl;
- info["VOICE_VERSION"] = version_string.str();
- }
- else
- {
- info["VOICE_VERSION"] = LLTrans::getString("NotConnected");
- }
-
- // TODO: Implement media plugin version query
- info["QT_WEBKIT_VERSION"] = "4.7.1 (version number hard-coded)";
-
- if (gPacketsIn > 0)
- {
- info["PACKETS_LOST"] = LLViewerStats::getInstance()->mPacketsLostStat.getCurrent();
- info["PACKETS_IN"] = F32(gPacketsIn);
- info["PACKETS_PCT"] = 100.f*info["PACKETS_LOST"].asReal() / info["PACKETS_IN"].asReal();
- }
-
- return info;
-}
-
-static std::string get_viewer_release_notes_url()
-{
- // return a URL to the release notes for this viewer, such as:
- // http://wiki.secondlife.com/wiki/Release_Notes/Second Life Beta Viewer/2.1.0.123456
- std::string url = LLTrans::getString("RELEASE_NOTES_BASE_URL");
- if (! LLStringUtil::endsWith(url, "/"))
- url += "/";
- url += LLVersionInfo::getChannel() + "/";
- url += LLVersionInfo::getVersion();
- return LLWeb::escapeURL(url);
+ return LLAppViewer::instance()->getViewerInfo();
}
class LLFloaterAboutListener: public LLEventAPI
@@ -356,93 +254,22 @@ void LLFloaterAbout::onClickCopyToClipboard()
support_widget->deselect();
}
-void LLFloaterAbout::updateServerReleaseNotesURL(const std::string& url)
-{
- setSupportText(url);
-}
-
void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url)
{
#if LL_WINDOWS
getWindow()->incBusyCount();
getWindow()->setCursor(UI_CURSOR_ARROW);
#endif
- LLSD info(getInfo());
#if LL_WINDOWS
getWindow()->decBusyCount();
getWindow()->setCursor(UI_CURSOR_ARROW);
#endif
- if (LLStringUtil::startsWith(server_release_notes_url, "http")) // it's an URL
- {
- info["SERVER_RELEASE_NOTES_URL"] = "[" + LLWeb::escapeURL(server_release_notes_url) + " " + LLTrans::getString("ReleaseNotes") + "]";
- }
- else
- {
- info["SERVER_RELEASE_NOTES_URL"] = server_release_notes_url;
- }
-
LLViewerTextEditor *support_widget =
getChild<LLViewerTextEditor>("support_editor", true);
- std::ostringstream support;
-
- // Render the LLSD from getInfo() as a format_map_t
- LLStringUtil::format_map_t args;
-
- // allow the "Release Notes" URL label to be localized
- args["ReleaseNotes"] = LLTrans::getString("ReleaseNotes");
-
- for (LLSD::map_const_iterator ii(info.beginMap()), iend(info.endMap());
- ii != iend; ++ii)
- {
- if (! ii->second.isArray())
- {
- // Scalar value
- if (ii->second.isUndefined())
- {
- args[ii->first] = getString("none");
- }
- else
- {
- // don't forget to render value asString()
- args[ii->first] = ii->second.asString();
- }
- }
- else
- {
- // array value: build KEY_0, KEY_1 etc. entries
- for (LLSD::Integer n(0), size(ii->second.size()); n < size; ++n)
- {
- args[STRINGIZE(ii->first << '_' << n)] = ii->second[n].asString();
- }
- }
- }
-
- // Now build the various pieces
- support << getString("AboutHeader", args);
- if (info.has("REGION"))
- {
- support << "\n\n" << getString("AboutPosition", args);
- }
- support << "\n\n" << getString("AboutSystem", args);
- support << "\n";
- if (info.has("GRAPHICS_DRIVER_VERSION"))
- {
- support << "\n" << getString("AboutDriver", args);
- }
- support << "\n" << getString("AboutLibs", args);
- if (info.has("COMPILER"))
- {
- support << "\n" << getString("AboutCompiler", args);
- }
- if (info.has("PACKETS_IN"))
- {
- support << '\n' << getString("AboutTraffic", args);
- }
-
support_widget->clear();
- support_widget->appendText(support.str(),
+ support_widget->appendText(LLAppViewer::instance()->getViewerInfoString(),
FALSE,
LLStyle::Params()
.color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
@@ -489,9 +316,9 @@ void LLServerReleaseNotesURLFetcher::completedHeader(U32 status, const std::stri
std::string location = content["location"].asString();
if (location.empty())
{
- location = floater_about->getString("ErrorFetchingServerReleaseNotesURL");
+ location = LLTrans::getString("ErrorFetchingServerReleaseNotesURL");
}
- floater_about->updateServerReleaseNotesURL(location);
+ LLAppViewer::instance()->setServerReleaseNotesURL(location);
}
}