aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatersnapshot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloatersnapshot.cpp')
-rw-r--r--linden/indra/newview/llfloatersnapshot.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp
index 61ae4c2..6cf6ae1 100644
--- a/linden/indra/newview/llfloatersnapshot.cpp
+++ b/linden/indra/newview/llfloatersnapshot.cpp
@@ -921,9 +921,10 @@ LLFloaterPostcard* LLSnapshotLivePreview::savePostcard()
921 return NULL; 921 return NULL;
922 } 922 }
923 LLFloaterPostcard* floater = LLFloaterPostcard::showFromSnapshot(jpg, mViewerImage[mCurImageIndex], image_scale, mPosTakenGlobal); 923 LLFloaterPostcard* floater = LLFloaterPostcard::showFromSnapshot(jpg, mViewerImage[mCurImageIndex], image_scale, mPosTakenGlobal);
924 // relinquish lifetime of viewerimage and jpeg image to postcard floater 924 // relinquish lifetime of jpeg image to postcard floater
925 mViewerImage[mCurImageIndex] = NULL;
926 mFormattedImage = NULL; 925 mFormattedImage = NULL;
926 mDataSize = 0;
927 updateSnapshot(FALSE, FALSE);
927 928
928 return floater; 929 return floater;
929} 930}
@@ -968,11 +969,19 @@ void LLSnapshotLivePreview::saveTexture()
968 } 969 }
969 970
970 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_SNAPSHOT_COUNT ); 971 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_SNAPSHOT_COUNT );
972
973 mDataSize = 0;
971} 974}
972 975
973BOOL LLSnapshotLivePreview::saveLocal() 976BOOL LLSnapshotLivePreview::saveLocal()
974{ 977{
975 BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage); 978 BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage);
979
980 // Relinquish image memory. Save button will be disabled as a side-effect.
981 mFormattedImage = NULL;
982 mDataSize = 0;
983 updateSnapshot(FALSE, FALSE);
984
976 if(success) 985 if(success)
977 { 986 {
978 gViewerWindow->playSnapshotAnimAndSound(); 987 gViewerWindow->playSnapshotAnimAndSound();
@@ -1252,14 +1261,14 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
1252 BOOL got_bytes = previewp && previewp->getDataSize() > 0; 1261 BOOL got_bytes = previewp && previewp->getDataSize() > 0;
1253 BOOL got_snap = previewp->getSnapshotUpToDate(); 1262 BOOL got_snap = previewp->getSnapshotUpToDate();
1254 1263
1255 floater->childSetEnabled("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_bytes && got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE); 1264 floater->childSetEnabled("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE);
1256 floater->childSetEnabled("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_bytes && got_snap); 1265 floater->childSetEnabled("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap);
1257 floater->childSetEnabled("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL && got_bytes && got_snap); 1266 floater->childSetEnabled("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL && got_snap);
1258 1267
1259 LLLocale locale(LLLocale::USER_LOCALE); 1268 LLLocale locale(LLLocale::USER_LOCALE);
1260 std::string bytes_string; 1269 std::string bytes_string;
1261 LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); 1270 LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
1262 floater->childSetTextArg("file_size_label", "[SIZE]", got_snap ? bytes_string : got_bytes ? floater->getString("unknown") : std::string("???")); 1271 floater->childSetTextArg("file_size_label", "[SIZE]", got_snap ? bytes_string : floater->getString("unknown"));
1263 floater->childSetColor("file_size_label", 1272 floater->childSetColor("file_size_label",
1264 shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD 1273 shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD
1265 && got_bytes 1274 && got_bytes
@@ -1389,6 +1398,8 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data)
1389 { 1398 {
1390 checkAutoSnapshot(previewp); 1399 checkAutoSnapshot(previewp);
1391 } 1400 }
1401
1402 updateControls(view);
1392 } 1403 }
1393} 1404}
1394 1405