diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llfloaterabout.cpp | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llfloaterabout.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterabout.cpp | 186 |
1 files changed, 186 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp new file mode 100644 index 0000000..54168dc --- /dev/null +++ b/linden/indra/newview/llfloaterabout.cpp | |||
@@ -0,0 +1,186 @@ | |||
1 | /** | ||
2 | * @file llfloaterabout.cpp | ||
3 | * @author James Cook | ||
4 | * @brief The about box from Help->About | ||
5 | * | ||
6 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
7 | * | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #include "llviewerprecompiledheaders.h" | ||
30 | |||
31 | #include "llfloaterabout.h" | ||
32 | |||
33 | #include "llsys.h" | ||
34 | #include "llgl.h" | ||
35 | #include "llui.h" // for tr() | ||
36 | #include "v3dmath.h" | ||
37 | |||
38 | #include "llviewertexteditor.h" | ||
39 | #include "llviewercontrol.h" | ||
40 | #include "llagent.h" | ||
41 | #include "llviewerstats.h" | ||
42 | #include "llviewerregion.h" | ||
43 | #include "llversion.h" | ||
44 | #include "llviewerbuild.h" | ||
45 | #include "llvieweruictrlfactory.h" | ||
46 | #include "viewer.h" // for gViewerDigest | ||
47 | |||
48 | #include "llmozlib.h" | ||
49 | #include "llglheaders.h" | ||
50 | |||
51 | extern LLCPUInfo gSysCPU; | ||
52 | extern LLMemoryInfo gSysMemory; | ||
53 | extern LLOSInfo gSysOS; | ||
54 | extern U32 gPacketsIn; | ||
55 | |||
56 | ///---------------------------------------------------------------------------- | ||
57 | /// Local function declarations, constants, enums, and typedefs | ||
58 | ///---------------------------------------------------------------------------- | ||
59 | |||
60 | LLFloaterAbout* LLFloaterAbout::sInstance = NULL; | ||
61 | |||
62 | ///---------------------------------------------------------------------------- | ||
63 | /// Class LLFloaterAbout | ||
64 | ///---------------------------------------------------------------------------- | ||
65 | |||
66 | // Default constructor | ||
67 | LLFloaterAbout::LLFloaterAbout() | ||
68 | : LLFloater("floater_about", "FloaterAboutRect", "") | ||
69 | { | ||
70 | gUICtrlFactory->buildFloater(this, "floater_about.xml"); | ||
71 | |||
72 | // Support for changing product name. | ||
73 | LLString title("About "); | ||
74 | title += gSecondLife; | ||
75 | setTitle(title); | ||
76 | |||
77 | LLString support; | ||
78 | |||
79 | // Version string | ||
80 | LLString version = gSecondLife | ||
81 | + llformat(" %d.%d.%d (%d) %s %s", | ||
82 | LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, | ||
83 | __DATE__, __TIME__); | ||
84 | support.append(version); | ||
85 | support.append("\n\n"); | ||
86 | |||
87 | // Position | ||
88 | LLViewerRegion* region = gAgent.getRegion(); | ||
89 | if (region) | ||
90 | { | ||
91 | //XUI:translate | ||
92 | const LLVector3d &pos = gAgent.getPositionGlobal(); | ||
93 | LLString pos_text = llformat("You are at %.1f, %.1f, %.1f ", | ||
94 | pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]); | ||
95 | support.append(pos_text); | ||
96 | |||
97 | LLString region_text = llformat("in %s located at ", | ||
98 | gAgent.getRegion()->getName().c_str()); | ||
99 | support.append(region_text); | ||
100 | |||
101 | char buffer[MAX_STRING]; | ||
102 | gAgent.getRegion()->getHost().getHostName(buffer, MAX_STRING); | ||
103 | support.append(buffer); | ||
104 | support.append(" ("); | ||
105 | gAgent.getRegion()->getHost().getString(buffer, MAX_STRING); | ||
106 | support.append(buffer); | ||
107 | support.append(")\n\n"); | ||
108 | } | ||
109 | |||
110 | // CPU | ||
111 | support.append("CPU: "); | ||
112 | support.append( gSysCPU.getCPUStringTerse() ); | ||
113 | support.append("\n"); | ||
114 | |||
115 | U32 memory = gSysMemory.getPhysicalMemory() / 1024 / 1024; | ||
116 | // For some reason, the reported amount of memory is always wrong by one meg | ||
117 | memory++; | ||
118 | |||
119 | LLString mem_text = llformat("Memory: %u MB\n", memory ); | ||
120 | support.append(mem_text); | ||
121 | |||
122 | support.append("OS Version: "); | ||
123 | support.append( gSysOS.getOSString().c_str() ); | ||
124 | support.append("\n"); | ||
125 | |||
126 | support.append("Graphics Card Vendor: "); | ||
127 | support.append( (const char*) glGetString(GL_VENDOR) ); | ||
128 | support.append("\n"); | ||
129 | |||
130 | support.append("Graphics Card: "); | ||
131 | support.append( (const char*) glGetString(GL_RENDERER) ); | ||
132 | support.append("\n"); | ||
133 | |||
134 | support.append("OpenGL Version: "); | ||
135 | support.append( (const char*) glGetString(GL_VERSION) ); | ||
136 | support.append("\n"); | ||
137 | |||
138 | #if LL_LIBXUL_ENABLED | ||
139 | support.append("LLMozLib Version: "); | ||
140 | support.append( (const char*) LLMozLib::getInstance()->getVersion().c_str() ); | ||
141 | support.append("\n"); | ||
142 | #endif // LL_LIBXUL_ENABLED | ||
143 | |||
144 | if (gViewerStats | ||
145 | && gPacketsIn > 0) | ||
146 | { | ||
147 | LLString packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", | ||
148 | gViewerStats->mPacketsLostStat.getCurrent(), | ||
149 | F32(gPacketsIn), | ||
150 | 100.f*gViewerStats->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); | ||
151 | support.append(packet_loss); | ||
152 | support.append("\n"); | ||
153 | } | ||
154 | |||
155 | // MD5 digest of executable | ||
156 | support.append("Viewer Digest: "); | ||
157 | char viewer_digest_string[UUID_STR_LENGTH]; | ||
158 | gViewerDigest.toString( viewer_digest_string ); | ||
159 | support.append(viewer_digest_string); | ||
160 | |||
161 | // Fix views | ||
162 | childDisable("credits_editor"); | ||
163 | childDisable("support_editor"); | ||
164 | childSetText("support_editor", support); | ||
165 | |||
166 | center(); | ||
167 | |||
168 | sInstance = this; | ||
169 | } | ||
170 | |||
171 | // Destroys the object | ||
172 | LLFloaterAbout::~LLFloaterAbout() | ||
173 | { | ||
174 | sInstance = NULL; | ||
175 | } | ||
176 | |||
177 | // static | ||
178 | void LLFloaterAbout::show(void*) | ||
179 | { | ||
180 | if (!sInstance) | ||
181 | { | ||
182 | sInstance = new LLFloaterAbout(); | ||
183 | } | ||
184 | |||
185 | sInstance->open(); | ||
186 | } | ||