aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatersnapshot.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llfloatersnapshot.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloatersnapshot.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp
index 7cb92ff..3bc172c 100644
--- a/linden/indra/newview/llfloatersnapshot.cpp
+++ b/linden/indra/newview/llfloatersnapshot.cpp
@@ -2,6 +2,8 @@
2 * @file llfloatersnapshot.cpp 2 * @file llfloatersnapshot.cpp
3 * @brief Snapshot preview window, allowing saving, e-mailing, etc. 3 * @brief Snapshot preview window, allowing saving, e-mailing, etc.
4 * 4 *
5 * $LicenseInfo:firstyear=2004&license=viewergpl$
6 *
5 * Copyright (c) 2004-2007, Linden Research, Inc. 7 * Copyright (c) 2004-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -1138,7 +1141,8 @@ void LLFloaterSnapshot::Impl::onCommitResolution(LLUICtrl* ctrl, void* data)
1138 } 1141 }
1139 else if (width == -1 || height == -1) 1142 else if (width == -1 || height == -1)
1140 { 1143 {
1141 // leave width and height when entering custom value 1144 // load last custom value
1145 previewp->setSize(gSavedSettings.getS32("LastSnapshotWidth"), gSavedSettings.getS32("LastSnapshotHeight"));
1142 } 1146 }
1143 else 1147 else
1144 { 1148 {
@@ -1199,15 +1203,18 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat
1199 LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; 1203 LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
1200 if (view) 1204 if (view)
1201 { 1205 {
1206 S32 w = llfloor((F32)view->childGetValue("snapshot_width").asReal());
1207 S32 h = llfloor((F32)view->childGetValue("snapshot_height").asReal());
1208
1209 gSavedSettings.setS32("LastSnapshotWidth", w);
1210 gSavedSettings.setS32("LastSnapshotHeight", h);
1211
1202 LLSnapshotLivePreview* previewp = getPreviewView(view); 1212 LLSnapshotLivePreview* previewp = getPreviewView(view);
1203 if (previewp) 1213 if (previewp)
1204 { 1214 {
1205 S32 curw,curh; 1215 S32 curw,curh;
1206 previewp->getSize(curw, curh); 1216 previewp->getSize(curw, curh);
1207 1217
1208 S32 w = llfloor((F32)view->childGetValue("snapshot_width").asReal());
1209 S32 h = llfloor((F32)view->childGetValue("snapshot_height").asReal());
1210
1211 if (w != curw || h != curh) 1218 if (w != curw || h != curh)
1212 { 1219 {
1213 previewp->setSize(w,h); 1220 previewp->setSize(w,h);
@@ -1291,8 +1298,8 @@ BOOL LLFloaterSnapshot::postBuild()
1291 childSetValue("layer_types", "colors"); 1298 childSetValue("layer_types", "colors");
1292 childSetEnabled("layer_types", FALSE); 1299 childSetEnabled("layer_types", FALSE);
1293 1300
1294 childSetValue("snapshot_width", gViewerWindow->getWindowDisplayWidth()); 1301 childSetValue("snapshot_width", gSavedSettings.getS32("LastSnapshotWidth"));
1295 childSetValue("snapshot_height", gViewerWindow->getWindowDisplayHeight()); 1302 childSetValue("snapshot_height", gSavedSettings.getS32("LastSnapshotHeight"));
1296 1303
1297 childSetValue("freeze_frame_check", gSavedSettings.getBOOL("UseFreezeFrame")); 1304 childSetValue("freeze_frame_check", gSavedSettings.getBOOL("UseFreezeFrame"));
1298 childSetCommitCallback("freeze_frame_check", Impl::onCommitFreezeFrame, this); 1305 childSetCommitCallback("freeze_frame_check", Impl::onCommitFreezeFrame, this);
@@ -1345,16 +1352,15 @@ void LLFloaterSnapshot::draw()
1345 childSetEnabled("send_btn", previewp->getSnapshotUpToDate()); 1352 childSetEnabled("send_btn", previewp->getSnapshotUpToDate());
1346 } 1353 }
1347 1354
1348 //XUI:translate
1349 if (previewp->getSnapshotUpToDate()) 1355 if (previewp->getSnapshotUpToDate())
1350 { 1356 {
1351 LLString bytes_string; 1357 LLString bytes_string;
1352 gResMgr->getIntegerString(bytes_string, previewp->getDataSize()); 1358 gResMgr->getIntegerString(bytes_string, previewp->getDataSize());
1353 childSetTextArg("file_size_label", "[SIZE]", llformat("%s bytes", bytes_string.c_str())); 1359 childSetTextArg("file_size_label", "[SIZE]", bytes_string);
1354 } 1360 }
1355 else 1361 else
1356 { 1362 {
1357 childSetTextArg("file_size_label", "[SIZE]", "unknown"); 1363 childSetTextArg("file_size_label", "[SIZE]", childGetText("unknwon"));
1358 childSetColor("file_size_label", gColors.getColor( "LabelTextColor" )); 1364 childSetColor("file_size_label", gColors.getColor( "LabelTextColor" ));
1359 } 1365 }
1360 childSetEnabled("upload_btn", previewp->getSnapshotUpToDate()); 1366 childSetEnabled("upload_btn", previewp->getSnapshotUpToDate());
@@ -1363,7 +1369,7 @@ void LLFloaterSnapshot::draw()
1363 } 1369 }
1364 else 1370 else
1365 { 1371 {
1366 childSetTextArg("file_size_label", "[SIZE]", "unknown"); 1372 childSetTextArg("file_size_label", "[SIZE]", LLString("???"));
1367 childSetEnabled("upload_btn", FALSE); 1373 childSetEnabled("upload_btn", FALSE);
1368 childSetEnabled("send_btn", FALSE); 1374 childSetEnabled("send_btn", FALSE);
1369 childSetEnabled("save_btn", FALSE); 1375 childSetEnabled("save_btn", FALSE);