summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterabout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterabout.cpp')
-rw-r--r--indra/newview/llfloaterabout.cpp151
1 files changed, 50 insertions, 101 deletions
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 810799d27c..caa10e9452 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -42,7 +42,7 @@
#include "llcurl.h"
#include "llimagej2c.h"
-#include "audioengine.h"
+#include "llaudioengine.h"
#include "llviewertexteditor.h"
#include "llviewercontrol.h"
@@ -58,9 +58,10 @@
#include "lltrans.h"
#include "llappviewer.h"
#include "llglheaders.h"
-#include "llmediamanager.h"
#include "llwindow.h"
+#include "llbutton.h"
+
#if LL_WINDOWS
#include "lldxhardware.h"
#endif
@@ -69,61 +70,49 @@ extern LLCPUInfo gSysCPU;
extern LLMemoryInfo gSysMemory;
extern U32 gPacketsIn;
-///----------------------------------------------------------------------------
-/// Local function declarations, constants, enums, and typedefs
-///----------------------------------------------------------------------------
-
-LLFloaterAbout* LLFloaterAbout::sInstance = NULL;
-
static std::string get_viewer_release_notes_url();
+
///----------------------------------------------------------------------------
/// Class LLFloaterAbout
///----------------------------------------------------------------------------
// Default constructor
-LLFloaterAbout::LLFloaterAbout()
-: LLFloater(std::string("floater_about"), std::string("FloaterAboutRect"), LLStringUtil::null)
+LLFloaterAbout::LLFloaterAbout(const LLSD& key)
+: LLFloater(key)
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");
+ //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");
+
+}
- // Support for changing product name.
- std::string title("About ");
- title += LLAppViewer::instance()->getSecondLifeTitle();
- setTitle(title);
+// Destroys the object
+LLFloaterAbout::~LLFloaterAbout()
+{
+}
+BOOL LLFloaterAbout::postBuild()
+{
+ center();
LLViewerTextEditor *support_widget =
getChild<LLViewerTextEditor>("support_editor", true);
LLViewerTextEditor *credits_widget =
getChild<LLViewerTextEditor>("credits_editor", true);
-
- if (!support_widget || !credits_widget)
- {
- return;
- }
-
- // For some reason, adding style doesn't work unless this is true.
+ // make sure that we handle hyperlinks in the About text
support_widget->setParseHTML(TRUE);
- // Text styles for release notes hyperlinks
- LLStyleSP viewer_link_style(new LLStyle);
- viewer_link_style->setVisible(true);
- viewer_link_style->setFontName(LLStringUtil::null);
- viewer_link_style->setLinkHREF(get_viewer_release_notes_url());
- viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
-
// Version string
- std::string version = LLAppViewer::instance()->getSecondLifeTitle()
+ std::string version = LLTrans::getString("APP_NAME")
+ llformat(" %d.%d.%d (%d) %s %s (%s)\n",
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
__DATE__, __TIME__,
gSavedSettings.getString("VersionChannelName").c_str());
- support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
- support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);
std::string support;
+ support.append(version);
+ support.append("[" + get_viewer_release_notes_url() + " " +
+ LLTrans::getString("ReleaseNotes") + "]");
support.append("\n\n");
#if LL_MSVC
@@ -138,20 +127,14 @@ LLFloaterAbout::LLFloaterAbout()
LLViewerRegion* region = gAgent.getRegion();
if (region)
{
- LLStyleSP server_link_style(new LLStyle);
- server_link_style->setVisible(true);
- server_link_style->setFontName(LLStringUtil::null);
- server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
- server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
-
const LLVector3d &pos = gAgent.getPositionGlobal();
LLUIString pos_text = getString("you_are_at");
pos_text.setArg("[POSITION]",
llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
support.append(pos_text);
- std::string region_text = llformat("in %s located at ",
- gAgent.getRegion()->getName().c_str());
+ LLUIString region_text = getString ("in_region") + " ";
+ region_text.setArg("[REGION]", llformat ("%s", gAgent.getRegion()->getName().c_str()));
support.append(region_text);
std::string buffer;
@@ -163,11 +146,9 @@ LLFloaterAbout::LLFloaterAbout()
support.append(")\n");
support.append(gLastVersionChannel);
support.append("\n");
-
- support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
- support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);
-
- support = "\n\n";
+ support.append("[" + LLWeb::escapeURL(region->getCapability("ServerReleaseNotes")) +
+ " " + LLTrans::getString("ReleaseNotes") + "]");
+ support.append("\n\n");
}
// *NOTE: Do not translate text like GPU, Graphics Card, etc -
@@ -175,25 +156,26 @@ LLFloaterAbout::LLFloaterAbout()
// and this info sometimes gets sent to support
// CPU
- support.append("CPU: ");
+ support.append(getString("CPU") + " ");
support.append( gSysCPU.getCPUString() );
support.append("\n");
U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
// Moved hack adjustment to Windows memory size into llsys.cpp
- std::string mem_text = llformat("Memory: %u MB\n", memory );
- support.append(mem_text);
+ LLStringUtil::format_map_t args;
+ args["[MEM]"] = llformat ("%u", memory);
+ support.append(getString("Memory", args) + "\n");
- support.append("OS Version: ");
+ support.append(getString("OSVersion") + " ");
support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
support.append("\n");
- support.append("Graphics Card Vendor: ");
+ support.append(getString("GraphicsCardVendor") + " ");
support.append( (const char*) glGetString(GL_VENDOR) );
support.append("\n");
- support.append("Graphics Card: ");
+ support.append(getString("GraphicsCard") + " ");
support.append( (const char*) glGetString(GL_RENDERER) );
support.append("\n");
@@ -211,81 +193,48 @@ LLFloaterAbout::LLFloaterAbout()
getWindow()->setCursor(UI_CURSOR_ARROW);
#endif
- support.append("OpenGL Version: ");
+ support.append(getString("OpenGLVersion") + " ");
support.append( (const char*) glGetString(GL_VERSION) );
support.append("\n");
support.append("\n");
- support.append("libcurl Version: ");
+ support.append(getString("LibCurlVersion") + " ");
support.append( LLCurl::getVersionString() );
support.append("\n");
- support.append("J2C Decoder Version: ");
+ support.append(getString("J2CDecoderVersion") + " ");
support.append( LLImageJ2C::getEngineInfo() );
support.append("\n");
- support.append("Audio Driver Version: ");
+ support.append(getString("AudioDriverVersion") + " ");
bool want_fullname = true;
- support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : "(none)" );
+ support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : getString("none") );
support.append("\n");
- LLMediaManager *mgr = LLMediaManager::getInstance();
- if (mgr)
- {
- LLMediaBase *media_source = mgr->createSourceFromMimeType("http", "text/html");
- if (media_source)
- {
- support.append("LLMozLib Version: ");
- support.append(media_source->getVersion());
- support.append("\n");
- mgr->destroySource(media_source);
- }
- }
+ // TODO: Implement media plugin version query
+
+ support.append(getString("LLQtWebkitVersion") + " ");
+ support.append("\n");
if (gPacketsIn > 0)
{
- std::string packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)",
- LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(),
- F32(gPacketsIn),
- 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
- support.append(packet_loss);
- support.append("\n");
+ args["[LOST]"] = llformat ("%.0f", LLViewerStats::getInstance()->mPacketsLostStat.getCurrent());
+ args["[IN]"] = llformat ("%.0f", F32(gPacketsIn));
+ args["[PCT]"] = llformat ("%.1f", 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
+ support.append(getString ("PacketsLost", args) + "\n");
}
- support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
+ support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
// Fix views
support_widget->setCursorPos(0);
support_widget->setEnabled(FALSE);
- support_widget->setTakesFocus(TRUE);
- support_widget->setHandleEditKeysDirectly(TRUE);
credits_widget->setCursorPos(0);
credits_widget->setEnabled(FALSE);
- credits_widget->setTakesFocus(TRUE);
- credits_widget->setHandleEditKeysDirectly(TRUE);
-
- center();
-
- sInstance = this;
-}
-
-// Destroys the object
-LLFloaterAbout::~LLFloaterAbout()
-{
- sInstance = NULL;
-}
-
-// static
-void LLFloaterAbout::show(void*)
-{
- if (!sInstance)
- {
- sInstance = new LLFloaterAbout();
- }
- sInstance->open(); /*Flawfinder: ignore*/
+ return TRUE;
}
@@ -302,7 +251,7 @@ static std::string get_viewer_release_notes_url()
query["version"] = version.str();
std::ostringstream url;
- url << RELEASE_NOTES_BASE_URL << LLURI::mapToQueryString(query);
+ url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query);
- return url.str();
+ return LLWeb::escapeURL(url.str());
}