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.cpp42
1 files changed, 18 insertions, 24 deletions
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index ac08fd23a4..04827e3a78 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -260,11 +260,9 @@ BOOL LLPreviewGesture::canClose()
}
}
-// virtual
-void LLPreviewGesture::onClose(bool app_quitting)
+void LLPreviewGesture::onClose()
{
- gGestureManager.stopGesture(mPreviewGesture);
- LLPreview::onClose(app_quitting);
+ LLGestureManager::instance().stopGesture(mPreviewGesture);
}
// virtual
@@ -273,18 +271,11 @@ void LLPreviewGesture::onUpdateSucceeded()
refresh();
}
-// virtual
-void LLPreviewGesture::setMinimized(BOOL minimize)
+void LLPreviewGesture::onVisibilityChange ( const LLSD& new_visibility )
{
- if (minimize != isMinimized())
+ if (new_visibility.asBoolean())
{
- LLFloater::setMinimized(minimize);
-
- // We're being restored
- if (!minimize)
- {
- refresh();
- }
+ refresh();
}
}
@@ -295,13 +286,13 @@ bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const L
switch(option)
{
case 0: // "Yes"
- gGestureManager.stopGesture(mPreviewGesture);
+ LLGestureManager::instance().stopGesture(mPreviewGesture);
mCloseAfterSave = TRUE;
onClickSave(this);
break;
case 1: // "No"
- gGestureManager.stopGesture(mPreviewGesture);
+ LLGestureManager::instance().stopGesture(mPreviewGesture);
mDirty = FALSE; // Force the dirty flag because user has clicked NO on confirm save dialog...
closeFloater();
break;
@@ -363,6 +354,9 @@ LLPreviewGesture::~LLPreviewGesture()
BOOL LLPreviewGesture::postBuild()
{
+ mCloseSignal.connect(boost::bind(&LLPreviewGesture::onClose, this));
+ mVisibleSignal.connect(boost::bind(&LLPreviewGesture::onVisibilityChange, this, _2));
+
LLLineEditor* edit;
LLComboBox* combo;
LLButton* btn;
@@ -778,7 +772,7 @@ void LLPreviewGesture::refresh()
mOptionsText->setText(optionstext);
- BOOL active = gGestureManager.isGestureActive(mItemUUID);
+ BOOL active = LLGestureManager::instance().isGestureActive(mItemUUID);
mActiveCheck->set(active);
// Can only preview if there are steps
@@ -1130,10 +1124,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 && gGestureManager.isGestureActive(mItemUUID))
+ if (!delayedUpload && LLGestureManager::instance().isGestureActive(mItemUUID))
{
// gesture manager now owns the pointer
- gGestureManager.replaceGesture(mItemUUID, gesture, asset_id);
+ LLGestureManager::instance().replaceGesture(mItemUUID, gesture, asset_id);
// replaceGesture may deactivate other gestures so let the
// inventory know.
@@ -1694,13 +1688,13 @@ void LLPreviewGesture::onClickDelete(void* data)
void LLPreviewGesture::onCommitActive(LLUICtrl* ctrl, void* data)
{
LLPreviewGesture* self = (LLPreviewGesture*)data;
- if (!gGestureManager.isGestureActive(self->mItemUUID))
+ if (!LLGestureManager::instance().isGestureActive(self->mItemUUID))
{
- gGestureManager.activateGesture(self->mItemUUID);
+ LLGestureManager::instance().activateGesture(self->mItemUUID);
}
else
{
- gGestureManager.deactivateGesture(self->mItemUUID);
+ LLGestureManager::instance().deactivateGesture(self->mItemUUID);
}
// Make sure the (active) label in the inventory gets updated.
@@ -1739,14 +1733,14 @@ void LLPreviewGesture::onClickPreview(void* data)
self->mPreviewBtn->setLabel(self->getString("stop_txt"));
// play it, and delete when done
- gGestureManager.playGesture(self->mPreviewGesture);
+ LLGestureManager::instance().playGesture(self->mPreviewGesture);
self->refresh();
}
else
{
// Will call onDonePreview() below
- gGestureManager.stopGesture(self->mPreviewGesture);
+ LLGestureManager::instance().stopGesture(self->mPreviewGesture);
self->refresh();
}