summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpreview.cpp3
-rw-r--r--indra/newview/llpreview.h3
-rw-r--r--indra/newview/llpreviewgesture.cpp11
-rw-r--r--indra/newview/llpreviewnotecard.cpp10
-rw-r--r--indra/newview/llpreviewscript.cpp12
-rw-r--r--indra/newview/llpreviewscript.h1
6 files changed, 29 insertions, 11 deletions
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp
index fb21b980dc..fc2de4844e 100644
--- a/indra/newview/llpreview.cpp
+++ b/indra/newview/llpreview.cpp
@@ -62,7 +62,8 @@ LLPreview::LLPreview(const LLSD& key)
mUserResized(FALSE),
mCloseAfterSave(FALSE),
mAssetStatus(PREVIEW_ASSET_UNLOADED),
- mDirty(TRUE)
+ mDirty(TRUE),
+ mSaveDialogShown(FALSE)
{
mAuxItem = new LLInventoryItem;
// don't necessarily steal focus on creation -- sometimes these guys pop up without user action
diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h
index 49c114720b..b41aa2be1a 100644
--- a/indra/newview/llpreview.h
+++ b/indra/newview/llpreview.h
@@ -121,7 +121,8 @@ protected:
// for LLInventoryObserver
virtual void changed(U32 mask);
BOOL mDirty;
-
+ BOOL mSaveDialogShown;
+
protected:
LLUUID mItemUUID;
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index ff9a70d05c..787bd68e58 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -234,9 +234,13 @@ BOOL LLPreviewGesture::canClose()
}
else
{
- // Bring up view-modal dialog: Save changes? Yes, No, Cancel
- LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(),
- boost::bind(&LLPreviewGesture::handleSaveChangesDialog, this, _1, _2) );
+ if(!mSaveDialogShown)
+ {
+ mSaveDialogShown = TRUE;
+ // Bring up view-modal dialog: Save changes? Yes, No, Cancel
+ LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(),
+ boost::bind(&LLPreviewGesture::handleSaveChangesDialog, this, _1, _2) );
+ }
return FALSE;
}
}
@@ -264,6 +268,7 @@ void LLPreviewGesture::onVisibilityChanged ( const LLSD& new_visibility )
bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const LLSD& response)
{
+ mSaveDialogShown = FALSE;
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch(option)
{
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 510d91839d..850c3b350d 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -153,9 +153,12 @@ BOOL LLPreviewNotecard::canClose()
}
else
{
- // Bring up view-modal dialog: Save changes? Yes, No, Cancel
- LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2));
-
+ if(!mSaveDialogShown)
+ {
+ mSaveDialogShown = TRUE;
+ // Bring up view-modal dialog: Save changes? Yes, No, Cancel
+ LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2));
+ }
return FALSE;
}
}
@@ -639,6 +642,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data
bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const LLSD& response)
{
+ mSaveDialogShown = FALSE;
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch(option)
{
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 3c5e2544bb..2476b6d6ed 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -376,7 +376,8 @@ LLScriptEdCore::LLScriptEdCore(
mLive(live),
mContainer(container),
mHasScriptData(FALSE),
- mScriptRemoved(FALSE)
+ mScriptRemoved(FALSE),
+ mSaveDialogShown(FALSE)
{
setFollowsAll();
setBorderVisible(FALSE);
@@ -855,8 +856,12 @@ BOOL LLScriptEdCore::canClose()
}
else
{
- // Bring up view-modal dialog: Save changes? Yes, No, Cancel
- LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2));
+ if(!mSaveDialogShown)
+ {
+ mSaveDialogShown = TRUE;
+ // Bring up view-modal dialog: Save changes? Yes, No, Cancel
+ LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2));
+ }
return FALSE;
}
}
@@ -869,6 +874,7 @@ void LLScriptEdCore::setEnableEditing(bool enable)
bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLSD& response )
{
+ mSaveDialogShown = FALSE;
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch( option )
{
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 8178bb9325..a185d85889 100644
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -167,6 +167,7 @@ private:
LLLiveLSLFile* mLiveFile;
LLUUID mAssociatedExperience;
BOOL mScriptRemoved;
+ BOOL mSaveDialogShown;
LLScriptEdContainer* mContainer; // parent view