diff options
Diffstat (limited to 'indra/newview/llfloatersnapshot.cpp')
-rwxr-xr-x | indra/newview/llfloatersnapshot.cpp | 81 |
1 files changed, 38 insertions, 43 deletions
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index ea385d7baf..3d5b297fbe 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -44,7 +44,6 @@ #include "lltoolfocus.h" #include "lltoolmgr.h" #include "llwebprofile.h" -#include "llwebsharing.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -360,10 +359,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); -#if 0 - floater->getChildView("share_to_web")->setVisible( gSavedSettings.getBOOL("SnapshotSharingEnabled")); -#endif - floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat")); enableAspectRatioCheckbox(floater, !floater->impl.mAspectRatioCheckOff); setAspectRatioCheckboxValue(floater, gSavedSettings.getBOOL("KeepAspectForSnapshot")); @@ -379,13 +374,13 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) if (width_ctrl->getValue().asInteger() == 0) { S32 w = gViewerWindow->getWindowWidthRaw(); - lldebugs << "Initializing width spinner (" << width_ctrl->getName() << "): " << w << llendl; + LL_DEBUGS() << "Initializing width spinner (" << width_ctrl->getName() << "): " << w << LL_ENDL; width_ctrl->setValue(w); } if (height_ctrl->getValue().asInteger() == 0) { S32 h = gViewerWindow->getWindowHeightRaw(); - lldebugs << "Initializing height spinner (" << height_ctrl->getName() << "): " << h << llendl; + LL_DEBUGS() << "Initializing height spinner (" << height_ctrl->getName() << "): " << h << LL_ENDL; height_ctrl->setValue(h); } @@ -420,7 +415,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; LLLocale locale(LLLocale::USER_LOCALE); std::string bytes_string; @@ -484,7 +479,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) info["have-snapshot"] = got_snap; current_panel->updateControls(info); } - lldebugs << "finished updating controls" << llendl; + LL_DEBUGS() << "finished updating controls" << LL_ENDL; } // static @@ -531,7 +526,7 @@ void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp, if (previewp) { BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot"); - lldebugs << "updating " << (autosnap ? "snapshot" : "thumbnail") << llendl; + LL_DEBUGS() << "updating " << (autosnap ? "snapshot" : "thumbnail") << LL_ENDL; previewp->updateSnapshot(autosnap, update_thumbnail, autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); } } @@ -544,7 +539,7 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data) if (previewp && view) { view->impl.setStatus(Impl::STATUS_READY); - lldebugs << "updating snapshot" << llendl; + LL_DEBUGS() << "updating snapshot" << LL_ENDL; previewp->updateSnapshot(TRUE); } } @@ -621,7 +616,7 @@ void LLFloaterSnapshot::Impl::applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL previewp->getSize(w, h) ; updateSpinners(view, previewp, w, h, TRUE); // may change w and h - lldebugs << "updating thumbnail" << llendl; + LL_DEBUGS() << "updating thumbnail" << LL_ENDL; previewp->setSize(w, h) ; previewp->updateSnapshot(FALSE, TRUE); checkAutoSnapshot(previewp, TRUE); @@ -757,7 +752,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL if (width == 0 || height == 0) { // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } else if (width == -1 || height == -1) @@ -767,7 +762,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL LLPanelSnapshot* spanel = getActivePanel(view); if (spanel) { - lldebugs << "Loading typed res from panel " << spanel->getName() << llendl; + LL_DEBUGS() << "Loading typed res from panel " << spanel->getName() << LL_ENDL; new_width = spanel->getTypedPreviewWidth(); new_height = spanel->getTypedPreviewHeight(); @@ -780,8 +775,8 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL } else { - lldebugs << "No custom res chosen, setting preview res from window: " - << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + LL_DEBUGS() << "No custom res chosen, setting preview res from window: " + << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; new_width = gViewerWindow->getWindowWidthRaw(); new_height = gViewerWindow->getWindowHeightRaw(); } @@ -792,7 +787,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL else { // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL; previewp->setSize(width, height); } @@ -820,11 +815,11 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL // hide old preview as the aspect ratio could be wrong checkAutoSnapshot(previewp, FALSE); - lldebugs << "updating thumbnail" << llendl; + LL_DEBUGS() << "updating thumbnail" << LL_ENDL; getPreviewView(view)->updateSnapshot(FALSE, TRUE); if(do_update) { - lldebugs << "Will update controls" << llendl; + LL_DEBUGS() << "Will update controls" << LL_ENDL; updateControls(view); setNeedRefresh(view, true); } @@ -867,7 +862,7 @@ void LLFloaterSnapshot::Impl::onImageFormatChange(LLFloaterSnapshot* view) if (view) { gSavedSettings.setS32("SnapshotFormat", getImageFormat(view)); - lldebugs << "image format changed, updating snapshot" << llendl; + LL_DEBUGS() << "image format changed, updating snapshot" << LL_ENDL; getPreviewView(view)->updateSnapshot(TRUE); updateControls(view); setNeedRefresh(view, false); // we're refreshing @@ -950,7 +945,7 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 { bool need_refresh = false; - lldebugs << "applyCustomResolution(" << w << ", " << h << ")" << llendl; + LL_DEBUGS() << "applyCustomResolution(" << w << ", " << h << ")" << LL_ENDL; if (!view) return; LLSnapshotLivePreview* previewp = getPreviewView(view); @@ -968,7 +963,7 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 previewp->setSize(w,h); checkAutoSnapshot(previewp, FALSE); - lldebugs << "applied custom resolution, updating thumbnail" << llendl; + LL_DEBUGS() << "applied custom resolution, updating thumbnail" << LL_ENDL; previewp->updateSnapshot(FALSE, TRUE); comboSetCustom(view, "profile_size_combo"); comboSetCustom(view, "postcard_size_combo"); @@ -1032,12 +1027,6 @@ LLFloaterSnapshot::~LLFloaterSnapshot() BOOL LLFloaterSnapshot::postBuild() { - // Kick start Web Sharing, to fetch its config data if it needs to. - if (gSavedSettings.getBOOL("SnapshotSharingEnabled")) - { - LLWebSharing::instance().init(); - } - mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn"); childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this); mRefreshLabel = getChild<LLUICtrl>("refresh_lbl"); @@ -1186,7 +1175,7 @@ void LLFloaterSnapshot::onOpen(const LLSD& key) LLSnapshotLivePreview* preview = LLFloaterSnapshot::Impl::getPreviewView(this); if(preview) { - lldebugs << "opened, updating snapshot" << llendl; + LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL; preview->updateSnapshot(TRUE); } focusFirstItem(FALSE); @@ -1263,14 +1252,14 @@ S32 LLFloaterSnapshot::notify(const LLSD& info) //static void LLFloaterSnapshot::update() { - LLFloaterSnapshot* inst = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* inst = findInstance(); LLFloaterSocial* floater_social = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social"); if (!inst && !floater_social) return; BOOL changed = FALSE; - lldebugs << "npreviews: " << LLSnapshotLivePreview::sList.size() << llendl; + LL_DEBUGS() << "npreviews: " << LLSnapshotLivePreview::sList.size() << LL_ENDL; for (std::set<LLSnapshotLivePreview*>::iterator iter = LLSnapshotLivePreview::sList.begin(); iter != LLSnapshotLivePreview::sList.end(); ++iter) { @@ -1279,7 +1268,7 @@ void LLFloaterSnapshot::update() if (inst && changed) { - lldebugs << "changed" << llendl; + LL_DEBUGS() << "changed" << LL_ENDL; inst->impl.updateControls(inst); } } @@ -1291,12 +1280,18 @@ LLFloaterSnapshot* LLFloaterSnapshot::getInstance() } // static +LLFloaterSnapshot* LLFloaterSnapshot::findInstance() +{ + return LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); +} + +// static void LLFloaterSnapshot::saveTexture() { - lldebugs << "saveTexture" << llendl; + LL_DEBUGS() << "saveTexture" << LL_ENDL; // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1315,9 +1310,9 @@ void LLFloaterSnapshot::saveTexture() // static BOOL LLFloaterSnapshot::saveLocal() { - lldebugs << "saveLocal" << llendl; + LL_DEBUGS() << "saveLocal" << LL_ENDL; // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1337,7 +1332,7 @@ BOOL LLFloaterSnapshot::saveLocal() void LLFloaterSnapshot::preUpdate() { // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (instance) { // Disable the send/post/save buttons until snapshot is ready. @@ -1352,7 +1347,7 @@ void LLFloaterSnapshot::preUpdate() void LLFloaterSnapshot::postUpdate() { // FIXME: duplicated code - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (instance) { // Enable the send/post/save buttons. @@ -1373,7 +1368,7 @@ void LLFloaterSnapshot::postUpdate() // static void LLFloaterSnapshot::postSave() { - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1399,7 +1394,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData() { // FIXME: May not work for textures. - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1416,7 +1411,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData() LLPointer<LLImageFormatted> img = previewp->getFormattedImage(); if (!img.get()) { - llwarns << "Empty snapshot image data" << llendl; + LL_WARNS() << "Empty snapshot image data" << LL_ENDL; llassert(img.get() != NULL); } @@ -1426,7 +1421,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData() // static const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal() { - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (!instance) { llassert(instance != NULL); @@ -1446,7 +1441,7 @@ const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal() // static void LLFloaterSnapshot::setAgentEmail(const std::string& email) { - LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + LLFloaterSnapshot* instance = findInstance(); if (instance) { LLSideTrayPanelContainer* panel_container = instance->getChild<LLSideTrayPanelContainer>("panel_container"); |