summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelsnapshotlocal.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-11-18 16:32:23 -0500
committerOz Linden <oz@lindenlab.com>2011-11-18 16:32:23 -0500
commitd145cbf37100d50ac6fc15c6009cb496615ed7fb (patch)
treede664b77132c7c0408b103766501ce86b66a83f2 /indra/newview/llpanelsnapshotlocal.cpp
parenteee556cfbb1bdd0bf35568632a96ce9f18d27262 (diff)
parent0c36f481f13493801788ef233b96a2bfe5a44060 (diff)
pull back 3.2.2 beta 2 fixes
Diffstat (limited to 'indra/newview/llpanelsnapshotlocal.cpp')
-rw-r--r--indra/newview/llpanelsnapshotlocal.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp
index eaa27b8d41..4a2614fa7d 100644
--- a/indra/newview/llpanelsnapshotlocal.cpp
+++ b/indra/newview/llpanelsnapshotlocal.cpp
@@ -34,6 +34,7 @@
#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model
#include "llpanelsnapshot.h"
#include "llviewercontrol.h" // gSavedSettings
+#include "llviewerwindow.h"
/**
* The panel provides UI for saving snapshot to a local folder.
@@ -58,14 +59,13 @@ private:
void onFormatComboCommit(LLUICtrl* ctrl);
void onQualitySliderCommit(LLUICtrl* ctrl);
- void onSend();
+ void onSaveFlyoutCommit(LLUICtrl* ctrl);
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal");
LLPanelSnapshotLocal::LLPanelSnapshotLocal()
{
- mCommitCallbackRegistrar.add("Local.Save", boost::bind(&LLPanelSnapshotLocal::onSend, this));
mCommitCallbackRegistrar.add("Local.Cancel", boost::bind(&LLPanelSnapshotLocal::cancel, this));
}
@@ -74,6 +74,7 @@ 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));
+ getChild<LLUICtrl>("save_btn")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onSaveFlyoutCommit, this, _1));
return LLPanelSnapshot::postBuild();
}
@@ -142,13 +143,25 @@ void LLPanelSnapshotLocal::onQualitySliderCommit(LLUICtrl* ctrl)
LLFloaterSnapshot::getInstance()->notify(info);
}
-void LLPanelSnapshotLocal::onSend()
+void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl)
{
+ if (ctrl->getValue().asString() == "save as")
+ {
+ gViewerWindow->resetSnapshotLoc();
+ }
+
LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance();
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")));
+ BOOL saved = LLFloaterSnapshot::saveLocal();
+ if (saved)
+ {
+ LLFloaterSnapshot::postSave();
+ goBack();
+ floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local")));
+ }
+ else
+ {
+ cancel();
+ }
}