diff options
author | Aimee Linden <aimee@lindenlab.com> | 2010-06-15 14:49:55 +0100 |
---|---|---|
committer | Aimee Linden <aimee@lindenlab.com> | 2010-06-15 14:49:55 +0100 |
commit | 3819343f5ae1edba523928e86ae7addf2596dad1 (patch) | |
tree | b671462f287e622cc5e3358810adc67b960d8cfa | |
parent | b3fc9c79f559c84893dede3ce643ac0dfd1f3d65 (diff) |
Backed out changeset 6d51a12cb2d8 which accidentally included some unrelated work.
-rw-r--r-- | indra/llcommon/lldate.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 79 |
2 files changed, 41 insertions, 61 deletions
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index a7ef28b431..de7f2ead74 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -248,27 +248,8 @@ bool LLDate::fromStream(std::istream& s) s >> fractional; seconds_since_epoch += fractional; } - - c = s.peek(); // check for offset - if (c == '+' || c == '-') - { - S32 offset_sign = (c == '+') ? 1 : -1; - S32 offset_hours = 0; - S32 offset_minutes = 0; - S32 offset_in_seconds = 0; - - s >> offset_hours; - - c = s.get(); // skip the colon a get the minutes if there are any - if (c == ':') - { - s >> offset_minutes; - } - - offset_in_seconds = (offset_hours * 60 + offset_sign * offset_minutes) * 60; - seconds_since_epoch -= offset_in_seconds; - } - else if (c != 'Z') { return false; } // skip the Z + c = s.get(); // skip the Z + if (c != 'Z') { return false; } mSecondsSinceEpoch = seconds_since_epoch; return true; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 129dd55e48..00981d3c25 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -164,6 +164,8 @@ public: void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); LLFloaterPostcard* savePostcard(); + void confirmSavingTexture(bool set_as_profile_pic = false); + bool onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic); void saveTexture(bool set_as_profile_pic = false); BOOL saveLocal(); void saveWeb(std::string url); @@ -979,6 +981,27 @@ void profile_pic_upload_callback(const LLUUID& uuid) floater->setAsProfilePic(uuid); } +void LLSnapshotLivePreview::confirmSavingTexture(bool set_as_profile_pic) +{ + LLSD args; + args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), + boost::bind(&LLSnapshotLivePreview::onSavingTextureConfirmed, this, _1, _2, set_as_profile_pic)); +} + +bool LLSnapshotLivePreview::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + saveTexture(set_as_profile_pic); + } + + return false; +} + + void LLSnapshotLivePreview::saveTexture(bool set_as_profile_pic) { // gen a new uuid for this asset @@ -1157,9 +1180,6 @@ public: static void onCommitSnapshotFormat(LLUICtrl* ctrl, void* data); static void onCommitCustomResolution(LLUICtrl *ctrl, void* data); static void onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type); - static void confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic = false); - static void onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic); - static void checkCloseOnKeep(LLFloaterSnapshot* view); static void onCommitProfilePic(LLFloaterSnapshot* view); static void showAdvanced(LLFloaterSnapshot* view, const BOOL visible); static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ; @@ -1699,7 +1719,13 @@ public: void LLFloaterSnapshot::Impl::onCommitProfilePic(LLFloaterSnapshot* view) { - confirmSavingTexture(view, true); + //first save to harddrive + LLSnapshotLivePreview* previewp = getPreviewView(view); + + if(previewp) + { + previewp->confirmSavingTexture(true); + } } void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type) @@ -1713,17 +1739,14 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh if (type == LLSnapshotLivePreview::SNAPSHOT_WEB) { previewp->saveWeb(view->getString("share_to_web_url")); - checkCloseOnKeep(view); } else if (type == LLSnapshotLivePreview::SNAPSHOT_LOCAL) { previewp->saveLocal(); - checkCloseOnKeep(view); } else if (type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) { - // uploads and then calls checkCloseOnKeep() on confirmation from user - confirmSavingTexture(view); + previewp->confirmSavingTexture(); } else if (type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) { @@ -1736,40 +1759,16 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh gSnapshotFloaterView->addChild(floater); view->addDependentFloater(floater, FALSE); } - checkCloseOnKeep(view); } - } -} - -void LLFloaterSnapshot::Impl::confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic) -{ - LLSD args; - args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); - LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), - boost::bind(&onSavingTextureConfirmed, _1, _2, view, set_as_profile_pic)); -} - -void LLFloaterSnapshot::Impl::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - if (option == 0) - { - LLSnapshotLivePreview* previewp = getPreviewView(view); - previewp->saveTexture(set_as_profile_pic); - checkCloseOnKeep(view); - } -} -void LLFloaterSnapshot::Impl::checkCloseOnKeep(LLFloaterSnapshot* view) -{ - if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) - { - view->closeFloater(); - } - else - { - checkAutoSnapshot(getPreviewView(view)); + if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) + { + view->closeFloater(); + } + else + { + checkAutoSnapshot(previewp); + } } } |