diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 127 | ||||
-rw-r--r-- | indra/newview/llfloatersnapshot.h | 4 | ||||
-rw-r--r-- | indra/newview/llpanelpostprogress.cpp | 59 | ||||
-rw-r--r-- | indra/newview/llpanelpostresult.cpp | 90 | ||||
-rw-r--r-- | indra/newview/llpanelsnapshot.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llpanelsnapshot.h | 7 | ||||
-rw-r--r-- | indra/newview/llpanelsnapshotinventory.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llpanelsnapshotlocal.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llpanelsnapshotpostcard.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llpanelsnapshotprofile.cpp | 23 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_snapshot.xml | 90 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_post_progress.xml | 55 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_post_result.xml | 78 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_snapshot_options.xml | 64 |
15 files changed, 314 insertions, 385 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 63b05f5a1d..ff9cf3199e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -392,8 +392,6 @@ set(viewer_SOURCE_FILES llpanelplaceprofile.cpp llpanelplaces.cpp llpanelplacestab.cpp - llpanelpostprogress.cpp - llpanelpostresult.cpp llpanelprimmediacontrols.cpp llpanelprofile.cpp llpanelprofileview.cpp diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 08ca1e8cea..3df715e24b 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -86,7 +86,7 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -LLRect LLFloaterSnapshot::sThumbnailPlaceholderRect; +LLUICtrl* LLFloaterSnapshot::sThumbnailPlaceholder = NULL; LLSnapshotFloaterView* gSnapshotFloaterView = NULL; const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f; @@ -1063,10 +1063,18 @@ void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& meta class LLFloaterSnapshot::Impl { public: + typedef enum e_status + { + STATUS_READY, + STATUS_WORKING, + STATUS_FINISHED + } EStatus; + Impl() : mAvatarPauseHandles(), mLastToolset(NULL), - mAspectRatioCheckOff(false) + mAspectRatioCheckOff(false), + mStatus(STATUS_READY) { } ~Impl() @@ -1114,6 +1122,8 @@ public: static void updateControls(LLFloaterSnapshot* floater); static void updateLayout(LLFloaterSnapshot* floater); static void updateResolutionTextEntry(LLFloaterSnapshot* floater); + static void setStatus(EStatus status, bool ok = true, const std::string& msg = LLStringUtil::null); + EStatus getStatus() const { return mStatus; } private: static LLSnapshotLivePreview::ESnapshotType getTypeIndex(const std::string& id); @@ -1122,6 +1132,9 @@ private: static void comboSetCustom(LLFloaterSnapshot *floater, const std::string& comboname); static void checkAutoSnapshot(LLSnapshotLivePreview* floater, BOOL update_thumbnail = FALSE); static void checkAspectRatio(LLFloaterSnapshot *view, S32 index) ; + static void setWorking(LLFloaterSnapshot* floater, bool working); + static void setFinished(LLFloaterSnapshot* floater, bool finished, bool ok = true, const std::string& msg = LLStringUtil::null); + public: std::vector<LLAnimPauseRequest> mAvatarPauseHandles; @@ -1129,6 +1142,7 @@ public: LLToolset* mLastToolset; LLHandle<LLView> mPreviewHandle; bool mAspectRatioCheckOff ; + EStatus mStatus; }; // static @@ -1576,6 +1590,29 @@ void LLFloaterSnapshot::Impl::updateResolutionTextEntry(LLFloaterSnapshot* float } // static +void LLFloaterSnapshot::Impl::setStatus(EStatus status, bool ok, const std::string& msg) +{ + LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance(); + switch (status) + { + case STATUS_READY: + setWorking(floater, false); + setFinished(floater, false); + break; + case STATUS_WORKING: + setWorking(floater, true); + setFinished(floater, false); + break; + case STATUS_FINISHED: + setWorking(floater, false); + setFinished(floater, true, ok, msg); + break; + } + + floater->impl.mStatus = status; +} + +// static void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp, BOOL update_thumbnail) { if (previewp) @@ -1770,6 +1807,44 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde return ; } +// static +void LLFloaterSnapshot::Impl::setWorking(LLFloaterSnapshot* floater, bool working) +{ + LLUICtrl* working_lbl = floater->getChild<LLUICtrl>("working_lbl"); + working_lbl->setVisible(working); + floater->getChild<LLUICtrl>("working_indicator")->setVisible(working); + + if (working) + { + const std::string panel_name = getActivePanel(floater, false)->getName(); + const std::string prefix = panel_name.substr(std::string("panel_snapshot_").size()); + std::string progress_text = floater->getString(prefix + "_" + "progress_str"); + working_lbl->setValue(progress_text); + } + + // All controls should be disable while posting. + floater->setCtrlsEnabled(!working); + LLPanelSnapshot* active_panel = getActivePanel(floater); + if (active_panel) + { + active_panel->setCtrlsEnabled(!working); + } +} + +// static +void LLFloaterSnapshot::Impl::setFinished(LLFloaterSnapshot* floater, bool finished, bool ok, const std::string& msg) +{ + floater->getChild<LLUICtrl>("succeeded_panel")->setVisible(finished && ok); + floater->getChild<LLUICtrl>("failed_panel")->setVisible(finished && !ok); + + if (finished) + { + LLUICtrl* finished_lbl = floater->getChild<LLUICtrl>(ok ? "succeeded_lbl" : "failed_lbl"); + std::string result_text = floater->getString(msg + "_" + (ok ? "succeeded_str" : "failed_str")); + finished_lbl->setValue(result_text); + } +} + static std::string lastSnapshotWidthName(S32 shot_type) { switch (shot_type) @@ -2167,14 +2242,16 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 // static void LLFloaterSnapshot::Impl::onSnapshotUploadFinished(LLSideTrayPanelContainer* panel_container, bool status) { - panel_container->openPanel("panel_post_result", LLSD().with("post-result", status).with("post-type", "profile")); + panel_container->openPreviousPanel(); + setStatus(STATUS_FINISHED, status, "profile"); } // static void LLFloaterSnapshot::Impl::onSendingPostcardFinished(LLSideTrayPanelContainer* panel_container, bool status) { - panel_container->openPanel("panel_post_result", LLSD().with("post-result", status).with("post-type", "postcard")); + panel_container->openPreviousPanel(); + setStatus(STATUS_FINISHED, status, "postcard"); } ///---------------------------------------------------------------------------- @@ -2265,8 +2342,7 @@ BOOL LLFloaterSnapshot::postBuild() LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, panel_container, _1)); LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, panel_container, _1)); - // remember preview rect - sThumbnailPlaceholderRect = getChild<LLUICtrl>("thumbnail_placeholder")->getRect(); + sThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder"); // create preview window LLRect full_screen_rect = getRootView()->getRect(); @@ -2307,18 +2383,32 @@ void LLFloaterSnapshot::draw() { if(previewp->getThumbnailImage()) { - LLRect& thumbnail_rect = sThumbnailPlaceholderRect; + bool working = impl.getStatus() == Impl::STATUS_WORKING; + const LLRect& thumbnail_rect = getThumbnailPlaceholderRect(); S32 offset_x = thumbnail_rect.mLeft + (thumbnail_rect.getWidth() - previewp->getThumbnailWidth()) / 2 ; S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ; glMatrixMode(GL_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); + LLColor4 color = working ? LLColor4::grey4 : LLColor4::white; gl_draw_scaled_image(offset_x, offset_y, previewp->getThumbnailWidth(), previewp->getThumbnailHeight(), - previewp->getThumbnailImage(), LLColor4::white % alpha); + previewp->getThumbnailImage(), color % alpha); previewp->drawPreviewRect(offset_x, offset_y) ; + + if (working) + { + gGL.pushUIMatrix(); + { + const LLRect& r = getThumbnailPlaceholderRect(); + //gGL.translateUI((F32) r.mLeft, (F32) r.mBottom, 0.f); + LLUI::translate((F32) r.mLeft, (F32) r.mBottom); + sThumbnailPlaceholder->draw(); + } + gGL.popUIMatrix(); + } } } } @@ -2377,6 +2467,24 @@ S32 LLFloaterSnapshot::notify(const LLSD& info) return 1; } + if (info.has("set-ready")) + { + impl.setStatus(Impl::STATUS_READY); + return 1; + } + + if (info.has("set-working")) + { + impl.setStatus(Impl::STATUS_WORKING); + return 1; + } + + if (info.has("set-finished")) + { + LLSD data = info["set-finished"]; + impl.setStatus(Impl::STATUS_FINISHED, data["ok"].asBoolean(), data["msg"].asString()); + return 1; + } return 0; } @@ -2425,7 +2533,6 @@ void LLFloaterSnapshot::saveTexture() } previewp->saveTexture(); - instance->postSave(); } // static @@ -2447,7 +2554,6 @@ void LLFloaterSnapshot::saveLocal() } previewp->saveLocal(); - instance->postSave(); } // static @@ -2483,6 +2589,7 @@ void LLFloaterSnapshot::postSave() } instance->impl.updateControls(instance); + instance->impl.setStatus(Impl::STATUS_WORKING); } // static diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index de69824ad0..2c79c749d6 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -67,10 +67,10 @@ public: static const LLVector3d& getPosTakenGlobal(); static void setAgentEmail(const std::string& email); - static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholderRect; } + static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholder->getRect(); } private: - static LLRect sThumbnailPlaceholderRect; + static LLUICtrl* sThumbnailPlaceholder; class Impl; Impl& impl; diff --git a/indra/newview/llpanelpostprogress.cpp b/indra/newview/llpanelpostprogress.cpp deleted file mode 100644 index 9b7de2cb23..0000000000 --- a/indra/newview/llpanelpostprogress.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file llpanelpostprogress.cpp - * @brief Displays progress of publishing a snapshot. - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the termsllpanelpostprogress of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterreg.h" -#include "llpanel.h" -#include "llsidetraypanelcontainer.h" - -/** - * Displays progress of publishing a snapshot. - */ -class LLPanelPostProgress -: public LLPanel -{ - LOG_CLASS(LLPanelPostProgress); - -public: - /*virtual*/ void onOpen(const LLSD& key); -}; - -static LLRegisterPanelClassWrapper<LLPanelPostProgress> panel_class("llpanelpostprogress"); - -// virtual -void LLPanelPostProgress::onOpen(const LLSD& key) -{ - if (key.has("post-type")) - { - std::string progress_text = getString(key["post-type"].asString() + "_" + "progress_str"); - getChild<LLTextBox>("progress_lbl")->setText(progress_text); - } - else - { - llwarns << "Invalid key" << llendl; - } -} diff --git a/indra/newview/llpanelpostresult.cpp b/indra/newview/llpanelpostresult.cpp deleted file mode 100644 index 2b937d83b9..0000000000 --- a/indra/newview/llpanelpostresult.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file llpanelpostresult.cpp - * @brief Result of publishing a snapshot (success/failure). - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterreg.h" -#include "llpanel.h" -#include "llsidetraypanelcontainer.h" - -/** - * Displays snapshot publishing result. - */ -class LLPanelPostResult -: public LLPanel -{ - LOG_CLASS(LLPanelPostResult); - -public: - LLPanelPostResult(); - - /*virtual*/ void onOpen(const LLSD& key); -private: - void onBack(); - void onClose(); -}; - -static LLRegisterPanelClassWrapper<LLPanelPostResult> panel_class("llpanelpostresult"); - -LLPanelPostResult::LLPanelPostResult() -{ - mCommitCallbackRegistrar.add("Snapshot.Result.Back", boost::bind(&LLPanelPostResult::onBack, this)); - mCommitCallbackRegistrar.add("Snapshot.Result.Close", boost::bind(&LLPanelPostResult::onClose, this)); -} - - -// virtual -void LLPanelPostResult::onOpen(const LLSD& key) -{ - if (key.isMap() && key.has("post-result") && key.has("post-type")) - { - bool ok = key["post-result"].asBoolean(); - std::string type = key["post-type"].asString(); - std::string result_text = getString(type + "_" + (ok ? "succeeded_str" : "failed_str")); - getChild<LLTextBox>("result_lbl")->setText(result_text); - } - else - { - llwarns << "Invalid key" << llendl; - } -} - -void LLPanelPostResult::onBack() -{ - LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); - if (!parent) - { - llwarns << "Cannot find panel container" << llendl; - return; - } - - parent->openPreviousPanel(); -} - -void LLPanelPostResult::onClose() -{ - LLFloaterReg::hideInstance("snapshot"); -} diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index e89e62c750..893f1ca43c 100644 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -35,6 +35,19 @@ // newview #include "llsidetraypanelcontainer.h" +// virtual +BOOL LLPanelSnapshot::postBuild() +{ + updateControls(LLSD()); + return TRUE; +} + +// virtual +void LLPanelSnapshot::onOpen(const LLSD& key) +{ + setCtrlsEnabled(true); +} + LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; @@ -107,3 +120,18 @@ void LLPanelSnapshot::updateImageQualityLevel() getChild<LLTextBox>("image_quality_level")->setTextArg("[QLVL]", quality_lvl); } + +void LLPanelSnapshot::goBack() +{ + LLSideTrayPanelContainer* parent = getParentContainer(); + if (parent) + { + parent->openPreviousPanel(); + } +} + +void LLPanelSnapshot::cancel() +{ + goBack(); + LLFloaterSnapshot::getInstance()->notify(LLSD().with("set-ready", true)); +} diff --git a/indra/newview/llpanelsnapshot.h b/indra/newview/llpanelsnapshot.h index a227317d2f..eaa0bc42c6 100644 --- a/indra/newview/llpanelsnapshot.h +++ b/indra/newview/llpanelsnapshot.h @@ -37,6 +37,9 @@ class LLSideTrayPanelContainer; class LLPanelSnapshot: public LLPanel { public: + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + virtual std::string getWidthSpinnerName() const = 0; virtual std::string getHeightSpinnerName() const = 0; virtual std::string getAspectRatioCBName() const = 0; @@ -48,11 +51,13 @@ public: virtual LLSpinCtrl* getHeightSpinner(); virtual void enableAspectRatioCheckbox(BOOL enable); virtual LLFloaterSnapshot::ESnapshotFormat getImageFormat() const; - virtual void updateControls(const LLSD& info) {} ///< Update controls from saved settings + virtual void updateControls(const LLSD& info) = 0; ///< Update controls from saved settings protected: LLSideTrayPanelContainer* getParentContainer(); void updateImageQualityLevel(); + void goBack(); ///< Switch to the default (Snapshot Options) panel + void cancel(); }; #endif // LL_LLPANELSNAPSHOT_H diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp index 6419c37494..c781138f88 100644 --- a/indra/newview/llpanelsnapshotinventory.cpp +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -60,7 +60,6 @@ private: void onCustomResolutionCommit(LLUICtrl* ctrl); void onKeepAspectRatioCommit(LLUICtrl* ctrl); void onSend(); - void onCancel(); }; static LLRegisterPanelClassWrapper<LLPanelSnapshotInventory> panel_class("llpanelsnapshotinventory"); @@ -68,7 +67,7 @@ static LLRegisterPanelClassWrapper<LLPanelSnapshotInventory> panel_class("llpane LLPanelSnapshotInventory::LLPanelSnapshotInventory() { mCommitCallbackRegistrar.add("Inventory.Save", boost::bind(&LLPanelSnapshotInventory::onSend, this)); - mCommitCallbackRegistrar.add("Inventory.Cancel", boost::bind(&LLPanelSnapshotInventory::onCancel, this)); + mCommitCallbackRegistrar.add("Inventory.Cancel", boost::bind(&LLPanelSnapshotInventory::cancel, this)); } // virtual @@ -78,7 +77,7 @@ BOOL LLPanelSnapshotInventory::postBuild() getChild<LLUICtrl>(getWidthSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onCustomResolutionCommit, this, _1)); getChild<LLUICtrl>(getHeightSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onCustomResolutionCommit, this, _1)); getChild<LLUICtrl>(getAspectRatioCBName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onKeepAspectRatioCommit, this, _1)); - return TRUE; + return LLPanelSnapshot::postBuild(); } // virtual @@ -88,6 +87,7 @@ void LLPanelSnapshotInventory::onOpen(const LLSD& key) getChild<LLComboBox>(getImageSizeComboName())->selectNthItem(0); // FIXME? has no effect #endif updateCustomResControls(); + LLPanelSnapshot::onOpen(key); } void LLPanelSnapshotInventory::updateCustomResControls() @@ -132,21 +132,6 @@ void LLPanelSnapshotInventory::onKeepAspectRatioCommit(LLUICtrl* ctrl) void LLPanelSnapshotInventory::onSend() { - // Switch to upload progress display. - LLSideTrayPanelContainer* parent = getParentContainer(); - if (parent) - { - parent->openPanel("panel_post_progress", LLSD().with("post-type", "inventory")); - } - LLFloaterSnapshot::saveTexture(); -} - -void LLPanelSnapshotInventory::onCancel() -{ - LLSideTrayPanelContainer* parent = getParentContainer(); - if (parent) - { - parent->openPreviousPanel(); - } + LLFloaterSnapshot::postSave(); } diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 5dc32d228f..b67c4ec673 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -64,7 +64,6 @@ private: void onKeepAspectRatioCommit(LLUICtrl* ctrl); void onQualitySliderCommit(LLUICtrl* ctrl); void onSend(); - void onCancel(); }; static LLRegisterPanelClassWrapper<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal"); @@ -72,7 +71,7 @@ static LLRegisterPanelClassWrapper<LLPanelSnapshotLocal> panel_class("llpanelsna LLPanelSnapshotLocal::LLPanelSnapshotLocal() { mCommitCallbackRegistrar.add("Local.Save", boost::bind(&LLPanelSnapshotLocal::onSend, this)); - mCommitCallbackRegistrar.add("Local.Cancel", boost::bind(&LLPanelSnapshotLocal::onCancel, this)); + mCommitCallbackRegistrar.add("Local.Cancel", boost::bind(&LLPanelSnapshotLocal::cancel, this)); } // virtual @@ -85,15 +84,14 @@ BOOL LLPanelSnapshotLocal::postBuild() getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onQualitySliderCommit, this, _1)); getChild<LLUICtrl>("local_format_combo")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onFormatComboCommit, this, _1)); - updateControls(LLSD()); - - return TRUE; + return LLPanelSnapshot::postBuild(); } // virtual void LLPanelSnapshotLocal::onOpen(const LLSD& key) { updateCustomResControls(); + LLPanelSnapshot::onOpen(key); } // virtual @@ -195,15 +193,11 @@ void LLPanelSnapshotLocal::onQualitySliderCommit(LLUICtrl* ctrl) void LLPanelSnapshotLocal::onSend() { - LLFloaterSnapshot::saveLocal(); - onCancel(); -} + LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance(); -void LLPanelSnapshotLocal::onCancel() -{ - LLSideTrayPanelContainer* parent = getParentContainer(); - if (parent) - { - parent->openPreviousPanel(); - } + floater->notify(LLSD().with("set-working", true)); + LLFloaterSnapshot::saveLocal(); + LLFloaterSnapshot::postSave(); + goBack(); + floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local"))); } diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp index c2b83d5c19..9f3f6d7cb6 100644 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -76,7 +76,6 @@ private: void onQualitySliderCommit(LLUICtrl* ctrl); void onTabButtonPress(S32 btn_idx); void onSend(); - void onCancel(); bool mHasFirstMsgFocus; }; @@ -87,7 +86,7 @@ LLPanelSnapshotPostcard::LLPanelSnapshotPostcard() : mHasFirstMsgFocus(false) { mCommitCallbackRegistrar.add("Postcard.Send", boost::bind(&LLPanelSnapshotPostcard::onSend, this)); - mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::onCancel, this)); + mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::cancel, this)); mCommitCallbackRegistrar.add("Postcard.Message", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 0)); mCommitCallbackRegistrar.add("Postcard.Settings", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 1)); @@ -118,9 +117,7 @@ BOOL LLPanelSnapshotPostcard::postBuild() getChild<LLButton>("message_btn")->setToggleState(TRUE); - updateControls(LLSD()); - - return TRUE; + return LLPanelSnapshot::postBuild(); } // virtual @@ -128,6 +125,7 @@ void LLPanelSnapshotPostcard::onOpen(const LLSD& key) { gSavedSettings.setS32("SnapshotFormat", getImageFormat()); updateCustomResControls(); + LLPanelSnapshot::onOpen(key); } // virtual @@ -212,17 +210,11 @@ void LLPanelSnapshotPostcard::sendPostcard() postcard["subject"] = subject; postcard["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString(); LLPostCard::send(LLFloaterSnapshot::getImageData(), postcard); - LLFloaterSnapshot::postSave(); // Give user feedback of the event. gViewerWindow->playSnapshotAnimAndSound(); - // Switch to upload progress display. - LLSideTrayPanelContainer* parent = getParentContainer(); - if (parent) - { - parent->openPanel("panel_post_progress", LLSD().with("post-type", "postcard")); - } + LLFloaterSnapshot::postSave(); } void LLPanelSnapshotPostcard::onMsgFormFocusRecieved() @@ -325,12 +317,3 @@ void LLPanelSnapshotPostcard::onSend() // Send postcard. sendPostcard(); } - -void LLPanelSnapshotPostcard::onCancel() -{ - LLSideTrayPanelContainer* parent = getParentContainer(); - if (parent) - { - parent->openPreviousPanel(); - } -} diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp index 80a379a5a0..33237fd84f 100644 --- a/indra/newview/llpanelsnapshotprofile.cpp +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -62,7 +62,6 @@ private: void updateCustomResControls(); ///< Enable/disable custom resolution controls (spinners and checkbox) void onSend(); - void onCancel(); void onResolutionComboCommit(LLUICtrl* ctrl); void onCustomResolutionCommit(LLUICtrl* ctrl); void onKeepAspectRatioCommit(LLUICtrl* ctrl); @@ -73,7 +72,7 @@ static LLRegisterPanelClassWrapper<LLPanelSnapshotProfile> panel_class("llpanels LLPanelSnapshotProfile::LLPanelSnapshotProfile() { mCommitCallbackRegistrar.add("PostToProfile.Send", boost::bind(&LLPanelSnapshotProfile::onSend, this)); - mCommitCallbackRegistrar.add("PostToProfile.Cancel", boost::bind(&LLPanelSnapshotProfile::onCancel, this)); + mCommitCallbackRegistrar.add("PostToProfile.Cancel", boost::bind(&LLPanelSnapshotProfile::cancel, this)); } // virtual @@ -83,13 +82,15 @@ BOOL LLPanelSnapshotProfile::postBuild() getChild<LLUICtrl>(getWidthSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshotProfile::onCustomResolutionCommit, this, _1)); getChild<LLUICtrl>(getHeightSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshotProfile::onCustomResolutionCommit, this, _1)); getChild<LLUICtrl>(getAspectRatioCBName())->setCommitCallback(boost::bind(&LLPanelSnapshotProfile::onKeepAspectRatioCommit, this, _1)); - return TRUE; + + return LLPanelSnapshot::postBuild(); } // virtual void LLPanelSnapshotProfile::onOpen(const LLSD& key) { updateCustomResControls(); + LLPanelSnapshot::onOpen(key); } // virtual @@ -119,22 +120,6 @@ void LLPanelSnapshotProfile::onSend() LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); LLFloaterSnapshot::postSave(); - - // Switch to upload progress display. - LLSideTrayPanelContainer* parent = getParentContainer(); - if (parent) - { - parent->openPanel("panel_post_progress", LLSD().with("post-type", "profile")); - } -} - -void LLPanelSnapshotProfile::onCancel() -{ - LLSideTrayPanelContainer* parent = getParentContainer(); - if (parent) - { - parent->openPreviousPanel(); - } } void LLPanelSnapshotProfile::onResolutionComboCommit(LLUICtrl* ctrl) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index bc48561196..22d6ba5bdb 100644 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -17,6 +17,54 @@ name="unknown"> unknown </floater.string> + <string + name="postcard_progress_str"> + Sending Email + </string> + <string + name="profile_progress_str"> + Posting + </string> + <string + name="inventory_progress_str"> + Saving to Inventory + </string> + <string + name="local_progress_str"> + Saving to Computer + </string> + <string + name="profile_succeeded_str"> + Your Profile Feed has been updated! + </string> + <string + name="postcard_succeeded_str"> + Email Sent! + </string> + <string + name="inventory_succeeded_str"> + Saved to Inventory! + </string> + <string + name="local_succeeded_str"> + Saved to Computer! + </string> + <string + name="profile_failed_str"> + Failed to update your Profile Feed. + </string> + <string + name="postcard_failed_str"> + Failed to send email. + </string> + <string + name="inventory_failed_str"> + Failed to save to inventory. + </string> + <string + name="local_failed_str"> + Failed to save to computer. + </string> <view_border bevel_style="in" follows="left|top" @@ -65,8 +113,34 @@ name="thumbnail_placeholder" top="50" follows="left|top" - left="10" - /> + left="10"> + <loading_indicator + follows="left|top" + height="48" + layout="topleft" + name="working_indicator" + left="101" + top="46" + visible="false" + width="48" /> + <text + follows="left|top|right" + font="SansSerifBold" + height="14" + layout="topleft" + left="5" + length="1" + halign="center" + name="working_lbl" + right="-5" + top="98" + translate="false" + type="string" + visible="false" + width="130"> + Working + </text> + </ui_ctrl> <view_border bevel_style="in" height="21" @@ -146,18 +220,6 @@ layout="topleft" name="panel_snapshot_local" filename="panel_snapshot_local.xml" /> - <panel - class="llpanelpostprogress" - follows="all" - layout="topleft" - name="panel_post_progress" - filename="panel_post_progress.xml" /> - <panel - class="llpanelpostresult" - follows="all" - layout="topleft" - name="panel_post_result" - filename="panel_post_result.xml" /> </panel_container> <panel height="295" diff --git a/indra/newview/skins/default/xui/en/panel_post_progress.xml b/indra/newview/skins/default/xui/en/panel_post_progress.xml deleted file mode 100644 index 418e6e7527..0000000000 --- a/indra/newview/skins/default/xui/en/panel_post_progress.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="380" - layout="topleft" - name="panel_post_progress" - width="490"> - <string - name="postcard_progress_str"> - Sending Email - </string> - <string - name="profile_progress_str"> - Posting - </string> - <string - name="inventory_progress_str"> - Saving to Inventory - </string> - <string - name="local_progress_str"> - Saving to Computer - </string> - <view_border - follows="left|top" - height="110" - layout="topleft" - left="40" - name="rect" - top="120" - width="190" - /> - <loading_indicator - follows="left|top" - height="40" - left_delta="75" - layout="topleft" - top_delta="20" - width="40" - /> - <text - follows="top|left" - font="SansSerifLargeBold" - halign="center" - height="20" - layout="topleft" - left_delta="-75" - length="1" - name="progress_lbl" - translate="false" - type="string" - top_pad="10" - width="190"> - Working - </text> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_post_result.xml b/indra/newview/skins/default/xui/en/panel_post_result.xml deleted file mode 100644 index 4a64b8469b..0000000000 --- a/indra/newview/skins/default/xui/en/panel_post_result.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="380" - layout="topleft" - name="panel_post_result" - width="490"> - <string - name="profile_succeeded_str"> - Your Profile Feed has been updated! - </string> - <string - name="postcard_succeeded_str"> - Email Sent! - </string> - <string - name="inventory_succeeded_str"> - Saved to Inventory! - </string> - <string - name="local_succeeded_str"> - Saved to Computer! - </string> - <string - name="profile_failed_str"> - Failed to update your Profile Feed. - </string> - <string - name="postcard_failed_str"> - Failed to send email. - </string> - <string - name="inventory_failed_str"> - Failed to save to inventory. - </string> - <string - name="local_failed_str"> - Failed to save to computer. - </string> - <text - follows="top|left|right" - font="SansSerif" - halign="center" - height="30" - layout="topleft" - left="20" - length="1" - name="result_lbl" - right="-20" - type="string" - top="100" - word_wrap="true"> - Result - </text> - <button - follows="left|top" - height="22" - label="Done, Close This Window" - layout="topleft" - left="10" - name="close_btn" - top_pad="10" - width="160"> - <commit_callback - function="Snapshot.Result.Close" /> - </button> - <button - follows="right|top" - height="22" - label="Main Menu" - layout="topleft" - name="back_btn" - right="-10" - top_delta="0" - width="80"> - <commit_callback - function="Snapshot.Result.Back" /> - </button> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index e6324f8923..6fb17ed6a6 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -77,4 +77,68 @@ <button.commit_callback function="Snapshot.SaveToComputer" /> </button> + <panel + background_visible="true" + bg_alpha_color="0.9 1 0.9 1" + bottom="-10" + follows="left|bottom|right" + font="SansSerifLarge" + halign="center" + height="20" + layout="topleft" + left_delta="0" + length="1" + name="succeeded_panel" + right="-10" + type="string" + visible="false"> + <text + follows="all" + font="SansSerif" + halign="center" + height="18" + layout="topleft" + left="1" + length="1" + name="succeeded_lbl" + right="-1" + text_color="0.2 0.5 0.2 1" + top="4" + translate="false" + type="string"> + Succeeded + </text> + </panel> + <panel + background_visible="true" + bg_alpha_color="1 0.9 0.9 1" + bottom="-10" + follows="left|bottom|right" + font="SansSerifLarge" + halign="center" + height="20" + layout="topleft" + left_delta="0" + length="1" + name="failed_panel" + right="-10" + type="string" + visible="false"> + <text + follows="all" + font="SansSerif" + halign="center" + height="18" + layout="topleft" + left="1" + length="1" + name="failed_lbl" + right="-1" + text_color="0.5 0.2 0.2 1" + top="4" + translate="false" + type="string"> + Failed + </text> + </panel> </panel> |