summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-11-03 18:03:36 +0200
committerVadim ProductEngine <vsavchuk@productengine.com>2011-11-03 18:03:36 +0200
commit41e6455f7404b001696f8fe54e4353c80059c6e5 (patch)
tree9fd8c947644f0ab457aa9f6db9b6444dee88542d /indra/newview
parentce05b9f7e5347c28780b399efa70992cb7bf5229 (diff)
STORM-1580 WIP Updated texture upload progress according to the spec.
By the way, fixed displaying upload cost.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llassetuploadresponders.cpp10
-rw-r--r--indra/newview/llfloatersnapshot.cpp36
-rw-r--r--indra/newview/llpanelsnapshot.cpp1
-rw-r--r--indra/newview/llpanelsnapshotinventory.cpp2
-rw-r--r--indra/newview/llpanelsnapshotoptions.cpp10
-rw-r--r--indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml2
6 files changed, 41 insertions, 20 deletions
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 966f5b941e..40a4d665f8 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -78,6 +78,8 @@ void on_new_single_inventory_upload_complete(
const LLSD& server_response,
S32 upload_price)
{
+ bool success = false;
+
if ( upload_price > 0 )
{
// this upload costed us L$, update our balance
@@ -152,6 +154,7 @@ void on_new_single_inventory_upload_complete(
gInventory.updateItem(item);
gInventory.notifyObservers();
+ success = true;
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
@@ -175,6 +178,13 @@ void on_new_single_inventory_upload_complete(
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();
+
+ // Let the Snapshot floater know we have finished uploading a snapshot to inventory.
+ LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot");
+ if (asset_type == LLAssetType::AT_TEXTURE && floater_snapshot)
+ {
+ floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", success).with("msg", "inventory")));
+ }
}
LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data,
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 3df715e24b..128d50a061 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1105,8 +1105,8 @@ public:
static void onCommitCustomResolution(LLUICtrl *ctrl, void* data);
#endif
static void applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h);
- static void onSnapshotUploadFinished(LLSideTrayPanelContainer* panel_container, bool status);
- static void onSendingPostcardFinished(LLSideTrayPanelContainer* panel_container, bool status);
+ static void onSnapshotUploadFinished(bool status);
+ static void onSendingPostcardFinished(bool status);
static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ;
static BOOL checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value);
@@ -1505,10 +1505,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
}
- // FIXME: move this to the panel code
- S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
- floater->getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost));
-
// Update displayed image resolution.
LLTextBox* image_res_tb = floater->getChild<LLTextBox>("image_res_text");
image_res_tb->setVisible(got_snap);
@@ -1842,6 +1838,10 @@ void LLFloaterSnapshot::Impl::setFinished(LLFloaterSnapshot* floater, bool finis
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);
+
+ LLSideTrayPanelContainer* panel_container = floater->getChild<LLSideTrayPanelContainer>("panel_container");
+ panel_container->openPreviousPanel();
+ panel_container->getCurrentPanel()->onOpen(LLSD());
}
}
@@ -2240,17 +2240,15 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32
}
// static
-void LLFloaterSnapshot::Impl::onSnapshotUploadFinished(LLSideTrayPanelContainer* panel_container, bool status)
+void LLFloaterSnapshot::Impl::onSnapshotUploadFinished(bool status)
{
- panel_container->openPreviousPanel();
setStatus(STATUS_FINISHED, status, "profile");
}
// static
-void LLFloaterSnapshot::Impl::onSendingPostcardFinished(LLSideTrayPanelContainer* panel_container, bool status)
+void LLFloaterSnapshot::Impl::onSendingPostcardFinished(bool status)
{
- panel_container->openPreviousPanel();
setStatus(STATUS_FINISHED, status, "postcard");
}
@@ -2338,9 +2336,8 @@ BOOL LLFloaterSnapshot::postBuild()
childSetCommitCallback("texture_size_combo", Impl::onCommitResolution, this);
childSetCommitCallback("local_size_combo", Impl::onCommitResolution, this);
- LLSideTrayPanelContainer* panel_container = getChild<LLSideTrayPanelContainer>("panel_container");
- LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, panel_container, _1));
- LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, panel_container, _1));
+ LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1));
+ LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1));
sThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
@@ -2398,15 +2395,13 @@ void LLFloaterSnapshot::draw()
previewp->drawPreviewRect(offset_x, offset_y) ;
+ // Draw progress indicators on top of the preview.
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();
- }
+ const LLRect& r = getThumbnailPlaceholderRect();
+ LLUI::translate((F32) r.mLeft, (F32) r.mBottom);
+ sThumbnailPlaceholder->draw();
gGL.popUIMatrix();
}
}
@@ -2424,6 +2419,9 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
gSnapshotFloaterView->setEnabled(TRUE);
gSnapshotFloaterView->setVisible(TRUE);
gSnapshotFloaterView->adjustToFitScreen(this, FALSE);
+
+ // Initialize default tab.
+ getChild<LLSideTrayPanelContainer>("panel_container")->getCurrentPanel()->onOpen(LLSD());
}
void LLFloaterSnapshot::onClose(bool app_quitting)
diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp
index 893f1ca43c..35627ababe 100644
--- a/indra/newview/llpanelsnapshot.cpp
+++ b/indra/newview/llpanelsnapshot.cpp
@@ -127,6 +127,7 @@ void LLPanelSnapshot::goBack()
if (parent)
{
parent->openPreviousPanel();
+ parent->getCurrentPanel()->onOpen(LLSD());
}
}
diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index c781138f88..d517d3811d 100644
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -27,6 +27,7 @@
#include "llviewerprecompiledheaders.h"
#include "llcombobox.h"
+#include "lleconomy.h"
#include "llsidetraypanelcontainer.h"
#include "llspinctrl.h"
@@ -86,6 +87,7 @@ void LLPanelSnapshotInventory::onOpen(const LLSD& key)
#if 0
getChild<LLComboBox>(getImageSizeComboName())->selectNthItem(0); // FIXME? has no effect
#endif
+ getChild<LLUICtrl>("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
updateCustomResControls();
LLPanelSnapshot::onOpen(key);
}
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 8e5ff282b3..df904b6836 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -26,6 +26,7 @@
#include "llviewerprecompiledheaders.h"
+#include "lleconomy.h"
#include "llpanel.h"
#include "llsidetraypanelcontainer.h"
@@ -41,6 +42,7 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
+ /*virtual*/ void onOpen(const LLSD& key);
private:
void openPanel(const std::string& panel_name);
@@ -60,6 +62,13 @@ LLPanelSnapshotOptions::LLPanelSnapshotOptions()
mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this));
}
+// virtual
+void LLPanelSnapshotOptions::onOpen(const LLSD& key)
+{
+ S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+ getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost));
+}
+
void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
{
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
@@ -70,6 +79,7 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
}
parent->openPanel(panel_name);
+ parent->getCurrentPanel()->onOpen(LLSD());
LLFloaterSnapshot::postPanelSwitch();
}
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index cb243fbc5b..5db9587de6 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -50,7 +50,7 @@
top_pad="10"
type="string"
word_wrap="true">
- Saving an image to your inventory costs L$TBD. To save your image as a texture select one of the square formats.
+ Saving an image to your inventory costs L$[UPLOAD_COST]. To save your image as a texture select one of the square formats.
</text>
<combo_box
follows="top|left|right"