diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
commit | 9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (patch) | |
tree | 4a505c1e0919af52800b3ffb3eaf135e7d6f9ce6 /indra/newview/llfloaterabout.cpp | |
parent | 351ebe9fcb76f3b99c2957004bb8493a904869ee (diff) |
merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
Diffstat (limited to 'indra/newview/llfloaterabout.cpp')
-rw-r--r-- | indra/newview/llfloaterabout.cpp | 132 |
1 files changed, 53 insertions, 79 deletions
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 810799d27c..9df0a96888 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -69,41 +69,35 @@ 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() { - 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. support_widget->setParseHTML(TRUE); @@ -112,15 +106,15 @@ LLFloaterAbout::LLFloaterAbout() 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")); + viewer_link_style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor")); // Version string - std::string version = LLAppViewer::instance()->getSecondLifeTitle() + std::string version = LLTrans::getString("SECOND_LIFE_VIEWER") + 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->appendColoredText(version, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor")); support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style); std::string support; @@ -142,7 +136,7 @@ LLFloaterAbout::LLFloaterAbout() 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")); + server_link_style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor")); const LLVector3d &pos = gAgent.getPositionGlobal(); LLUIString pos_text = getString("you_are_at"); @@ -150,8 +144,8 @@ LLFloaterAbout::LLFloaterAbout() 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; @@ -164,7 +158,7 @@ LLFloaterAbout::LLFloaterAbout() support.append(gLastVersionChannel); support.append("\n"); - support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); + support_widget->appendColoredText(support, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor")); support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style); support = "\n\n"; @@ -175,25 +169,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,23 +206,23 @@ 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(); @@ -236,7 +231,7 @@ LLFloaterAbout::LLFloaterAbout() LLMediaBase *media_source = mgr->createSourceFromMimeType("http", "text/html"); if (media_source) { - support.append("LLMozLib Version: "); + support.append(getString("LLMozLibVersion") + " "); support.append(media_source->getVersion()); support.append("\n"); mgr->destroySource(media_source); @@ -245,15 +240,13 @@ LLFloaterAbout::LLFloaterAbout() 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, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor")); // Fix views support_widget->setCursorPos(0); @@ -266,43 +259,24 @@ LLFloaterAbout::LLFloaterAbout() 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; } -static std::string get_viewer_release_notes_url() -{ - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; + static std::string get_viewer_release_notes_url() + { + std::ostringstream version; + version << LL_VERSION_MAJOR << "." + << LL_VERSION_MINOR << "." + << LL_VERSION_PATCH << "." + << LL_VERSION_BUILD; - LLSD query; - query["channel"] = gSavedSettings.getString("VersionChannelName"); - query["version"] = version.str(); + LLSD query; + query["channel"] = gSavedSettings.getString("VersionChannelName"); + query["version"] = version.str(); - std::ostringstream url; - url << RELEASE_NOTES_BASE_URL << LLURI::mapToQueryString(query); + std::ostringstream url; + url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query); - return url.str(); -} + return url.str(); + } |