summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewgesture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreviewgesture.cpp')
-rw-r--r--indra/newview/llpreviewgesture.cpp53
1 files changed, 31 insertions, 22 deletions
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index 84bdaafacf..2e061b235d 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -42,6 +42,10 @@
#include "llstring.h"
#include "lldir.h"
#include "llfloaterreg.h"
+#include "llinventorydefines.h"
+#include "llinventoryfunctions.h"
+#include "llinventorymodel.h"
+#include "llinventorymodelbackgroundfetch.h"
#include "llmultigesture.h"
#include "llnotificationsutil.h"
#include "llvfile.h"
@@ -56,7 +60,6 @@
#include "lldelayedgestureerror.h"
#include "llfloatergesture.h" // for some label constants
#include "llgesturemgr.h"
-#include "llinventorymodel.h"
#include "llkeyboard.h"
#include "lllineeditor.h"
#include "llradiogroup.h"
@@ -97,7 +100,7 @@ protected:
void LLInventoryGestureAvailable::done()
{
- for(item_ref_t::iterator it = mComplete.begin(); it != mComplete.end(); ++it)
+ for(uuid_vec_t::iterator it = mComplete.begin(); it != mComplete.end(); ++it)
{
LLPreviewGesture* preview = LLFloaterReg::findTypedInstance<LLPreviewGesture>("preview_gesture", *it);
if(preview)
@@ -131,14 +134,14 @@ LLPreviewGesture* LLPreviewGesture::show(const LLUUID& item_id, const LLUUID& ob
// Start speculative download of sounds and animations
const LLUUID animation_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_ANIMATION);
- gInventory.startBackgroundFetch(animation_folder_id);
+ LLInventoryModelBackgroundFetch::instance().start(animation_folder_id);
const LLUUID sound_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SOUND);
- gInventory.startBackgroundFetch(sound_folder_id);
+ LLInventoryModelBackgroundFetch::instance().start(sound_folder_id);
// this will call refresh when we have everything.
LLViewerInventoryItem* item = (LLViewerInventoryItem*)preview->getItem();
- if (item && !item->isComplete())
+ if (item && !item->isFinished())
{
LLInventoryGestureAvailable* observer;
observer = new LLInventoryGestureAvailable();
@@ -155,6 +158,12 @@ LLPreviewGesture* LLPreviewGesture::show(const LLUUID& item_id, const LLUUID& ob
return preview;
}
+void LLPreviewGesture::draw()
+{
+ // Skip LLPreview::draw() to avoid description update
+ LLFloater::draw();
+}
+
// virtual
BOOL LLPreviewGesture::handleKeyHere(KEY key, MASK mask)
{
@@ -263,7 +272,7 @@ BOOL LLPreviewGesture::canClose()
// virtual
void LLPreviewGesture::onClose(bool app_quitting)
{
- LLGestureManager::instance().stopGesture(mPreviewGesture);
+ LLGestureMgr::instance().stopGesture(mPreviewGesture);
}
// virtual
@@ -287,13 +296,13 @@ bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const L
switch(option)
{
case 0: // "Yes"
- LLGestureManager::instance().stopGesture(mPreviewGesture);
+ LLGestureMgr::instance().stopGesture(mPreviewGesture);
mCloseAfterSave = TRUE;
onClickSave(this);
break;
case 1: // "No"
- LLGestureManager::instance().stopGesture(mPreviewGesture);
+ LLGestureMgr::instance().stopGesture(mPreviewGesture);
mDirty = FALSE; // Force the dirty flag because user has clicked NO on confirm save dialog...
closeFloater();
break;
@@ -466,7 +475,7 @@ BOOL LLPreviewGesture::postBuild()
edit = getChild<LLLineEditor>("wait_time_editor");
edit->setEnabled(FALSE);
edit->setVisible(FALSE);
- edit->setPrevalidate(LLLineEditor::prevalidateFloat);
+ edit->setPrevalidate(LLTextValidate::validateFloat);
// edit->setKeystrokeCallback(onKeystrokeCommit, this);
edit->setCommitOnFocusLost(TRUE);
edit->setCommitCallback(onCommitWaitTime, this);
@@ -497,13 +506,11 @@ BOOL LLPreviewGesture::postBuild()
if (item)
{
- childSetCommitCallback("desc", LLPreview::onText, this);
childSetText("desc", item->getDescription());
- childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe);
+ childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe);
- childSetCommitCallback("name", LLPreview::onText, this);
childSetText("name", item->getName());
- childSetPrevalidate("name", &LLLineEditor::prevalidateASCIIPrintableNoPipe);
+ childSetPrevalidate("name", &LLTextValidate::validateASCIIPrintableNoPipe);
}
return LLPreview::postBuild();
@@ -641,7 +648,7 @@ void LLPreviewGesture::refresh()
LLPreview::refresh();
// If previewing or item is incomplete, all controls are disabled
LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
- bool is_complete = (item && item->isComplete()) ? true : false;
+ bool is_complete = (item && item->isFinished()) ? true : false;
if (mPreviewGesture || !is_complete)
{
@@ -780,7 +787,7 @@ void LLPreviewGesture::refresh()
mOptionsText->setText(optionstext);
- BOOL active = LLGestureManager::instance().isGestureActive(mItemUUID);
+ BOOL active = LLGestureMgr::instance().isGestureActive(mItemUUID);
mActiveCheck->set(active);
// Can only preview if there are steps
@@ -1077,6 +1084,8 @@ void LLPreviewGesture::saveIfNeeded()
}
else
{
+ LLPreview::onCommit();
+
// Every save gets a new UUID. Yup.
LLTransactionID tid;
LLAssetID asset_id;
@@ -1132,10 +1141,10 @@ void LLPreviewGesture::saveIfNeeded()
// If this gesture is active, then we need to update the in-memory
// active map with the new pointer.
- if (!delayedUpload && LLGestureManager::instance().isGestureActive(mItemUUID))
+ if (!delayedUpload && LLGestureMgr::instance().isGestureActive(mItemUUID))
{
// gesture manager now owns the pointer
- LLGestureManager::instance().replaceGesture(mItemUUID, gesture, asset_id);
+ LLGestureMgr::instance().replaceGesture(mItemUUID, gesture, asset_id);
// replaceGesture may deactivate other gestures so let the
// inventory know.
@@ -1696,13 +1705,13 @@ void LLPreviewGesture::onClickDelete(void* data)
void LLPreviewGesture::onCommitActive(LLUICtrl* ctrl, void* data)
{
LLPreviewGesture* self = (LLPreviewGesture*)data;
- if (!LLGestureManager::instance().isGestureActive(self->mItemUUID))
+ if (!LLGestureMgr::instance().isGestureActive(self->mItemUUID))
{
- LLGestureManager::instance().activateGesture(self->mItemUUID);
+ LLGestureMgr::instance().activateGesture(self->mItemUUID);
}
else
{
- LLGestureManager::instance().deactivateGesture(self->mItemUUID);
+ LLGestureMgr::instance().deactivateGesture(self->mItemUUID);
}
// Make sure the (active) label in the inventory gets updated.
@@ -1741,14 +1750,14 @@ void LLPreviewGesture::onClickPreview(void* data)
self->mPreviewBtn->setLabel(self->getString("stop_txt"));
// play it, and delete when done
- LLGestureManager::instance().playGesture(self->mPreviewGesture);
+ LLGestureMgr::instance().playGesture(self->mPreviewGesture);
self->refresh();
}
else
{
// Will call onDonePreview() below
- LLGestureManager::instance().stopGesture(self->mPreviewGesture);
+ LLGestureMgr::instance().stopGesture(self->mPreviewGesture);
self->refresh();
}