diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloaterabout.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfloaterabout.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterabout.cpp | 125 |
1 files changed, 99 insertions, 26 deletions
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp index 8e55cf8..a90edb4 100644 --- a/linden/indra/newview/llfloaterabout.cpp +++ b/linden/indra/newview/llfloaterabout.cpp | |||
@@ -39,6 +39,9 @@ | |||
39 | #include "llui.h" // for tr() | 39 | #include "llui.h" // for tr() |
40 | #include "v3dmath.h" | 40 | #include "v3dmath.h" |
41 | 41 | ||
42 | #include "llcurl.h" | ||
43 | #include "llimagej2c.h" | ||
44 | |||
42 | #include "llviewertexteditor.h" | 45 | #include "llviewertexteditor.h" |
43 | #include "llviewercontrol.h" | 46 | #include "llviewercontrol.h" |
44 | #include "llagent.h" | 47 | #include "llagent.h" |
@@ -47,6 +50,10 @@ | |||
47 | #include "llversionviewer.h" | 50 | #include "llversionviewer.h" |
48 | #include "llviewerbuild.h" | 51 | #include "llviewerbuild.h" |
49 | #include "lluictrlfactory.h" | 52 | #include "lluictrlfactory.h" |
53 | #include "lluri.h" | ||
54 | #include "llweb.h" | ||
55 | #include "llsecondlifeurls.h" | ||
56 | #include "lltrans.h" | ||
50 | #include "llappviewer.h" | 57 | #include "llappviewer.h" |
51 | #include "llglheaders.h" | 58 | #include "llglheaders.h" |
52 | #include "llmediamanager.h" | 59 | #include "llmediamanager.h" |
@@ -62,58 +69,94 @@ extern U32 gPacketsIn; | |||
62 | 69 | ||
63 | LLFloaterAbout* LLFloaterAbout::sInstance = NULL; | 70 | LLFloaterAbout* LLFloaterAbout::sInstance = NULL; |
64 | 71 | ||
72 | static std::string get_viewer_release_notes_url(); | ||
73 | |||
65 | ///---------------------------------------------------------------------------- | 74 | ///---------------------------------------------------------------------------- |
66 | /// Class LLFloaterAbout | 75 | /// Class LLFloaterAbout |
67 | ///---------------------------------------------------------------------------- | 76 | ///---------------------------------------------------------------------------- |
68 | 77 | ||
69 | // Default constructor | 78 | // Default constructor |
70 | LLFloaterAbout::LLFloaterAbout() | 79 | LLFloaterAbout::LLFloaterAbout() |
71 | : LLFloater("floater_about", "FloaterAboutRect", "") | 80 | : LLFloater(std::string("floater_about"), std::string("FloaterAboutRect"), LLStringUtil::null) |
72 | { | 81 | { |
73 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml"); | 82 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml"); |
74 | 83 | ||
75 | // Support for changing product name. | 84 | // Support for changing product name. |
76 | LLString title("About "); | 85 | std::string title("About "); |
77 | title += LLAppViewer::instance()->getSecondLifeTitle(); | 86 | title += LLAppViewer::instance()->getSecondLifeTitle(); |
78 | setTitle(title); | 87 | setTitle(title); |
79 | 88 | ||
80 | LLString support; | 89 | LLViewerTextEditor *support_widget = |
90 | getChild<LLViewerTextEditor>("support_editor", true); | ||
91 | |||
92 | LLViewerTextEditor *credits_widget = | ||
93 | getChild<LLViewerTextEditor>("credits_editor", true); | ||
94 | |||
95 | |||
96 | if (!support_widget || !credits_widget) | ||
97 | { | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | // For some reason, adding style doesn't work unless this is true. | ||
102 | support_widget->setParseHTML(TRUE); | ||
103 | |||
104 | // Text styles for release notes hyperlinks | ||
105 | LLStyleSP viewer_link_style(new LLStyle); | ||
106 | viewer_link_style->setVisible(true); | ||
107 | viewer_link_style->setFontName(LLStringUtil::null); | ||
108 | viewer_link_style->setLinkHREF(get_viewer_release_notes_url()); | ||
109 | viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); | ||
81 | 110 | ||
82 | // Version string | 111 | // Version string |
83 | LLString version = LLAppViewer::instance()->getSecondLifeTitle() | 112 | std::string version = LLAppViewer::instance()->getSecondLifeTitle() |
84 | + llformat(" %d.%d.%d (%d) %s %s (%s)", | 113 | + llformat(" %d.%d.%d (%d) %s %s (%s)\n", |
85 | LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, | 114 | LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, |
86 | __DATE__, __TIME__, | 115 | __DATE__, __TIME__, |
87 | gSavedSettings.getString("VersionChannelName").c_str()); | 116 | gSavedSettings.getString("VersionChannelName").c_str()); |
88 | support.append(version); | 117 | support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); |
118 | support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), FALSE, FALSE, &viewer_link_style); | ||
119 | |||
120 | std::string support; | ||
89 | support.append("\n\n"); | 121 | support.append("\n\n"); |
90 | 122 | ||
91 | // Position | 123 | // Position |
92 | LLViewerRegion* region = gAgent.getRegion(); | 124 | LLViewerRegion* region = gAgent.getRegion(); |
93 | if (region) | 125 | if (region) |
94 | { | 126 | { |
127 | LLStyleSP server_link_style(new LLStyle); | ||
128 | server_link_style->setVisible(true); | ||
129 | server_link_style->setFontName(LLStringUtil::null); | ||
130 | server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes")); | ||
131 | server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); | ||
132 | |||
95 | const LLVector3d &pos = gAgent.getPositionGlobal(); | 133 | const LLVector3d &pos = gAgent.getPositionGlobal(); |
96 | LLUIString pos_text = getUIString("you_are_at"); | 134 | LLUIString pos_text = getUIString("you_are_at"); |
97 | pos_text.setArg("[POSITION]", | 135 | pos_text.setArg("[POSITION]", |
98 | llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ])); | 136 | llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ])); |
99 | support.append(pos_text); | 137 | support.append(pos_text); |
100 | 138 | ||
101 | LLString region_text = llformat("in %s located at ", | 139 | std::string region_text = llformat("in %s located at ", |
102 | gAgent.getRegion()->getName().c_str()); | 140 | gAgent.getRegion()->getName().c_str()); |
103 | support.append(region_text); | 141 | support.append(region_text); |
104 | 142 | ||
105 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ | 143 | std::string buffer; |
106 | gAgent.getRegion()->getHost().getHostName(buffer, MAX_STRING); | 144 | buffer = gAgent.getRegion()->getHost().getHostName(); |
107 | support.append(buffer); | 145 | support.append(buffer); |
108 | support.append(" ("); | 146 | support.append(" ("); |
109 | gAgent.getRegion()->getHost().getString(buffer, MAX_STRING); | 147 | buffer = gAgent.getRegion()->getHost().getString(); |
110 | support.append(buffer); | 148 | support.append(buffer); |
111 | support.append(")\n"); | 149 | support.append(")\n"); |
112 | support.append(gLastVersionChannel); | 150 | support.append(gLastVersionChannel); |
113 | support.append("\n\n"); | 151 | support.append("\n"); |
152 | |||
153 | support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); | ||
154 | support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), FALSE, FALSE, &server_link_style); | ||
155 | |||
156 | support = "\n\n"; | ||
114 | } | 157 | } |
115 | 158 | ||
116 | //*NOTE: Do not translate text like GPU, Graphics Card, etc - | 159 | // *NOTE: Do not translate text like GPU, Graphics Card, etc - |
117 | // Most PC users that know what these mean will be used to the english versions, | 160 | // Most PC users that know what these mean will be used to the english versions, |
118 | // and this info sometimes gets sent to support | 161 | // and this info sometimes gets sent to support |
119 | 162 | ||
@@ -125,11 +168,11 @@ LLFloaterAbout::LLFloaterAbout() | |||
125 | U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024; | 168 | U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024; |
126 | // Moved hack adjustment to Windows memory size into llsys.cpp | 169 | // Moved hack adjustment to Windows memory size into llsys.cpp |
127 | 170 | ||
128 | LLString mem_text = llformat("Memory: %u MB\n", memory ); | 171 | std::string mem_text = llformat("Memory: %u MB\n", memory ); |
129 | support.append(mem_text); | 172 | support.append(mem_text); |
130 | 173 | ||
131 | support.append("OS Version: "); | 174 | support.append("OS Version: "); |
132 | support.append( LLAppViewer::instance()->getOSInfo().getOSString().c_str() ); | 175 | support.append( LLAppViewer::instance()->getOSInfo().getOSString() ); |
133 | support.append("\n"); | 176 | support.append("\n"); |
134 | 177 | ||
135 | support.append("Graphics Card Vendor: "); | 178 | support.append("Graphics Card Vendor: "); |
@@ -144,6 +187,16 @@ LLFloaterAbout::LLFloaterAbout() | |||
144 | support.append( (const char*) glGetString(GL_VERSION) ); | 187 | support.append( (const char*) glGetString(GL_VERSION) ); |
145 | support.append("\n"); | 188 | support.append("\n"); |
146 | 189 | ||
190 | support.append("\n"); | ||
191 | |||
192 | support.append("libcurl Version: "); | ||
193 | support.append( LLCurl::getVersionString() ); | ||
194 | support.append("\n"); | ||
195 | |||
196 | support.append("J2C Decoder Version: "); | ||
197 | support.append( LLImageJ2C::getEngineInfo() ); | ||
198 | support.append("\n"); | ||
199 | |||
147 | LLMediaManager *mgr = LLMediaManager::getInstance(); | 200 | LLMediaManager *mgr = LLMediaManager::getInstance(); |
148 | if (mgr) | 201 | if (mgr) |
149 | { | 202 | { |
@@ -151,7 +204,7 @@ LLFloaterAbout::LLFloaterAbout() | |||
151 | if (media_source) | 204 | if (media_source) |
152 | { | 205 | { |
153 | support.append("LLMozLib Version: "); | 206 | support.append("LLMozLib Version: "); |
154 | support.append((const char*) media_source->getVersion().c_str()); | 207 | support.append(media_source->getVersion()); |
155 | support.append("\n"); | 208 | support.append("\n"); |
156 | mgr->destroySource(media_source); | 209 | mgr->destroySource(media_source); |
157 | } | 210 | } |
@@ -159,7 +212,7 @@ LLFloaterAbout::LLFloaterAbout() | |||
159 | 212 | ||
160 | if (gPacketsIn > 0) | 213 | if (gPacketsIn > 0) |
161 | { | 214 | { |
162 | LLString packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", | 215 | std::string packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", |
163 | LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(), | 216 | LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(), |
164 | F32(gPacketsIn), | 217 | F32(gPacketsIn), |
165 | 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); | 218 | 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); |
@@ -167,17 +220,18 @@ LLFloaterAbout::LLFloaterAbout() | |||
167 | support.append("\n"); | 220 | support.append("\n"); |
168 | } | 221 | } |
169 | 222 | ||
223 | support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); | ||
224 | |||
170 | // Fix views | 225 | // Fix views |
171 | childDisable("credits_editor"); | 226 | support_widget->setCursorPos(0); |
227 | support_widget->setEnabled(FALSE); | ||
228 | support_widget->setTakesFocus(TRUE); | ||
229 | support_widget->setHandleEditKeysDirectly(TRUE); | ||
172 | 230 | ||
173 | LLTextEditor * support_widget = getChild<LLTextEditor>("support_editor", true); | 231 | credits_widget->setCursorPos(0); |
174 | if (support_widget) | 232 | credits_widget->setEnabled(FALSE); |
175 | { | 233 | credits_widget->setTakesFocus(TRUE); |
176 | support_widget->setEnabled( FALSE ); | 234 | credits_widget->setHandleEditKeysDirectly(TRUE); |
177 | support_widget->setTakesFocus( TRUE ); | ||
178 | support_widget->setText( support ); | ||
179 | support_widget->setHandleEditKeysDirectly( TRUE ); | ||
180 | } | ||
181 | 235 | ||
182 | center(); | 236 | center(); |
183 | 237 | ||
@@ -200,3 +254,22 @@ void LLFloaterAbout::show(void*) | |||
200 | 254 | ||
201 | sInstance->open(); /*Flawfinder: ignore*/ | 255 | sInstance->open(); /*Flawfinder: ignore*/ |
202 | } | 256 | } |
257 | |||
258 | |||
259 | static std::string get_viewer_release_notes_url() | ||
260 | { | ||
261 | std::ostringstream version; | ||
262 | version << LL_VERSION_MAJOR << "." | ||
263 | << LL_VERSION_MINOR << "." | ||
264 | << LL_VERSION_PATCH << "." | ||
265 | << LL_VERSION_BUILD; | ||
266 | |||
267 | LLSD query; | ||
268 | query["channel"] = gSavedSettings.getString("VersionChannelName"); | ||
269 | query["version"] = version.str(); | ||
270 | |||
271 | std::ostringstream url; | ||
272 | url << RELEASE_NOTES_BASE_URL << LLURI::mapToQueryString(query); | ||
273 | |||
274 | return url.str(); | ||
275 | } | ||