diff options
Diffstat (limited to 'indra/newview/llpreviewgesture.cpp')
-rw-r--r-- | indra/newview/llpreviewgesture.cpp | 209 |
1 files changed, 104 insertions, 105 deletions
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 544ff8b5dc..05faf17bdc 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -137,12 +137,12 @@ void LLPreviewGesture::draw() } // virtual -BOOL LLPreviewGesture::handleKeyHere(KEY key, MASK mask) +bool LLPreviewGesture::handleKeyHere(KEY key, MASK mask) { if(('S' == key) && (MASK_CONTROL == (mask & MASK_CONTROL))) { saveIfNeeded(); - return TRUE; + return true; } return LLPreview::handleKeyHere(key, mask); @@ -150,13 +150,13 @@ BOOL LLPreviewGesture::handleKeyHere(KEY key, MASK mask) // virtual -BOOL LLPreviewGesture::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, +bool LLPreviewGesture::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { - BOOL handled = TRUE; + bool handled = true; switch(cargo_type) { case DAD_ANIMATION: @@ -199,7 +199,7 @@ BOOL LLPreviewGesture::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, sound->mSoundName = item->getName(); } updateLabel(line); - mDirty = TRUE; + mDirty = true; refresh(); } *accept = ACCEPT_YES_COPY_MULTI; @@ -225,23 +225,23 @@ BOOL LLPreviewGesture::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // virtual -BOOL LLPreviewGesture::canClose() +bool LLPreviewGesture::canClose() { if(!mDirty || mForceClose) { - return TRUE; + return true; } else { if(!mSaveDialogShown) { - mSaveDialogShown = TRUE; + 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; + return false; } } @@ -268,19 +268,19 @@ void LLPreviewGesture::onVisibilityChanged ( const LLSD& new_visibility ) bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const LLSD& response) { - mSaveDialogShown = FALSE; + mSaveDialogShown = false; S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: // "Yes" LLGestureMgr::instance().stopGesture(mPreviewGesture); - mCloseAfterSave = TRUE; + mCloseAfterSave = true; onClickSave(this); break; case 1: // "No" LLGestureMgr::instance().stopGesture(mPreviewGesture); - mDirty = FALSE; // Force the dirty flag because user has clicked NO on confirm save dialog... + mDirty = false; // Force the dirty flag because user has clicked NO on confirm save dialog... closeFloater(); break; @@ -313,7 +313,7 @@ LLPreviewGesture::LLPreviewGesture(const LLSD& key) mSaveBtn(NULL), mPreviewBtn(NULL), mPreviewGesture(NULL), - mDirty(FALSE) + mDirty(false) { NONE_LABEL = LLTrans::getString("---"); SHIFT_LABEL = LLTrans::getString("KBShift"); @@ -336,7 +336,7 @@ LLPreviewGesture::~LLPreviewGesture() } -BOOL LLPreviewGesture::postBuild() +bool LLPreviewGesture::postBuild() { setVisibleCallback(boost::bind(&LLPreviewGesture::onVisibilityChanged, this, _2)); @@ -353,20 +353,20 @@ BOOL LLPreviewGesture::postBuild() edit = getChild<LLLineEditor>("trigger_editor"); edit->setKeystrokeCallback(onKeystrokeCommit, this); edit->setCommitCallback(onCommitSetDirty, this); - edit->setCommitOnFocusLost(TRUE); - edit->setIgnoreTab(TRUE); + edit->setCommitOnFocusLost(true); + edit->setIgnoreTab(true); mTriggerEditor = edit; text = getChild<LLTextBox>("replace_text"); - text->setEnabled(FALSE); + text->setEnabled(false); mReplaceText = text; edit = getChild<LLLineEditor>("replace_editor"); - edit->setEnabled(FALSE); + edit->setEnabled(false); edit->setKeystrokeCallback(onKeystrokeCommit, this); edit->setCommitCallback(onCommitSetDirty, this); - edit->setCommitOnFocusLost(TRUE); - edit->setIgnoreTab(TRUE); + edit->setCommitOnFocusLost(true); + edit->setIgnoreTab(true); mReplaceEditor = edit; combo = getChild<LLComboBox>( "modifier_combo"); @@ -384,22 +384,22 @@ BOOL LLPreviewGesture::postBuild() btn = getChild<LLButton>( "add_btn"); btn->setClickedCallback(onClickAdd, this); - btn->setEnabled(FALSE); + btn->setEnabled(false); mAddBtn = btn; btn = getChild<LLButton>( "up_btn"); btn->setClickedCallback(onClickUp, this); - btn->setEnabled(FALSE); + btn->setEnabled(false); mUpBtn = btn; btn = getChild<LLButton>( "down_btn"); btn->setClickedCallback(onClickDown, this); - btn->setEnabled(FALSE); + btn->setEnabled(false); mDownBtn = btn; btn = getChild<LLButton>( "delete_btn"); btn->setClickedCallback(onClickDelete, this); - btn->setEnabled(FALSE); + btn->setEnabled(false); mDeleteBtn = btn; list = getChild<LLScrollListCtrl>("step_list"); @@ -410,47 +410,47 @@ BOOL LLPreviewGesture::postBuild() mOptionsText = getChild<LLTextBox>("options_text"); combo = getChild<LLComboBox>( "animation_list"); - combo->setVisible(FALSE); + combo->setVisible(false); combo->setCommitCallback(onCommitAnimation, this); mAnimationCombo = combo; LLRadioGroup* group; group = getChild<LLRadioGroup>("animation_trigger_type"); - group->setVisible(FALSE); + group->setVisible(false); group->setCommitCallback(onCommitAnimationTrigger, this); mAnimationRadio = group; combo = getChild<LLComboBox>( "sound_list"); - combo->setVisible(FALSE); + combo->setVisible(false); combo->setCommitCallback(onCommitSound, this); mSoundCombo = combo; edit = getChild<LLLineEditor>("chat_editor"); - edit->setVisible(FALSE); + edit->setVisible(false); edit->setCommitCallback(onCommitChat, this); //edit->setKeystrokeCallback(onKeystrokeCommit, this); - edit->setCommitOnFocusLost(TRUE); - edit->setIgnoreTab(TRUE); + edit->setCommitOnFocusLost(true); + edit->setIgnoreTab(true); mChatEditor = edit; check = getChild<LLCheckBoxCtrl>( "wait_anim_check"); - check->setVisible(FALSE); + check->setVisible(false); check->setCommitCallback(onCommitWait, this); mWaitAnimCheck = check; check = getChild<LLCheckBoxCtrl>( "wait_time_check"); - check->setVisible(FALSE); + check->setVisible(false); check->setCommitCallback(onCommitWait, this); mWaitTimeCheck = check; edit = getChild<LLLineEditor>("wait_time_editor"); - edit->setEnabled(FALSE); - edit->setVisible(FALSE); + edit->setEnabled(false); + edit->setVisible(false); edit->setPrevalidate(LLTextValidate::validateFloat); // edit->setKeystrokeCallback(onKeystrokeCommit, this); - edit->setCommitOnFocusLost(TRUE); + edit->setCommitOnFocusLost(true); edit->setCommitCallback(onCommitWaitTime, this); - edit->setIgnoreTab(TRUE); + edit->setIgnoreTab(true); mWaitTimeEditor = edit; // Buttons at the bottom @@ -616,43 +616,42 @@ void LLPreviewGesture::refresh() LLPreview::refresh(); // If previewing or item is incomplete, all controls are disabled LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem(); - bool is_complete = (item && item->isFinished()) ? true : false; + bool is_complete = item && item->isFinished(); if (mPreviewGesture || !is_complete) { - - getChildView("desc")->setEnabled(FALSE); - //mDescEditor->setEnabled(FALSE); - mTriggerEditor->setEnabled(FALSE); - mReplaceText->setEnabled(FALSE); - mReplaceEditor->setEnabled(FALSE); - mModifierCombo->setEnabled(FALSE); - mKeyCombo->setEnabled(FALSE); - mLibraryList->setEnabled(FALSE); - mAddBtn->setEnabled(FALSE); - mUpBtn->setEnabled(FALSE); - mDownBtn->setEnabled(FALSE); - mDeleteBtn->setEnabled(FALSE); - mStepList->setEnabled(FALSE); - mOptionsText->setEnabled(FALSE); - mAnimationCombo->setEnabled(FALSE); - mAnimationRadio->setEnabled(FALSE); - mSoundCombo->setEnabled(FALSE); - mChatEditor->setEnabled(FALSE); - mWaitAnimCheck->setEnabled(FALSE); - mWaitTimeCheck->setEnabled(FALSE); - mWaitTimeEditor->setEnabled(FALSE); - mActiveCheck->setEnabled(FALSE); - mSaveBtn->setEnabled(FALSE); + getChildView("desc")->setEnabled(false); + //mDescEditor->setEnabled(false); + mTriggerEditor->setEnabled(false); + mReplaceText->setEnabled(false); + mReplaceEditor->setEnabled(false); + mModifierCombo->setEnabled(false); + mKeyCombo->setEnabled(false); + mLibraryList->setEnabled(false); + mAddBtn->setEnabled(false); + mUpBtn->setEnabled(false); + mDownBtn->setEnabled(false); + mDeleteBtn->setEnabled(false); + mStepList->setEnabled(false); + mOptionsText->setEnabled(false); + mAnimationCombo->setEnabled(false); + mAnimationRadio->setEnabled(false); + mSoundCombo->setEnabled(false); + mChatEditor->setEnabled(false); + mWaitAnimCheck->setEnabled(false); + mWaitTimeCheck->setEnabled(false); + mWaitTimeEditor->setEnabled(false); + mActiveCheck->setEnabled(false); + mSaveBtn->setEnabled(false); // Make sure preview button is enabled, so we can stop it - mPreviewBtn->setEnabled(TRUE); + mPreviewBtn->setEnabled(true); return; } - BOOL modifiable = item->getPermissions().allowModifyBy(gAgent.getID()); + bool modifiable = item->getPermissions().allowModifyBy(gAgent.getID()); getChildView("desc")->setEnabled(modifiable); - mTriggerEditor->setEnabled(TRUE); + mTriggerEditor->setEnabled(true); mLibraryList->setEnabled(modifiable); mStepList->setEnabled(modifiable); mOptionsText->setEnabled(modifiable); @@ -663,27 +662,27 @@ void LLPreviewGesture::refresh() mWaitAnimCheck->setEnabled(modifiable); mWaitTimeCheck->setEnabled(modifiable); mWaitTimeEditor->setEnabled(modifiable); - mActiveCheck->setEnabled(TRUE); + mActiveCheck->setEnabled(true); const std::string& trigger = mTriggerEditor->getText(); - BOOL have_trigger = !trigger.empty(); + bool have_trigger = !trigger.empty(); const std::string& replace = mReplaceEditor->getText(); - BOOL have_replace = !replace.empty(); + bool have_replace = !replace.empty(); LLScrollListItem* library_item = mLibraryList->getFirstSelected(); - BOOL have_library = (library_item != NULL); + bool have_library = (library_item != NULL); LLScrollListItem* step_item = mStepList->getFirstSelected(); S32 step_index = mStepList->getFirstSelectedIndex(); S32 step_count = mStepList->getItemCount(); - BOOL have_step = (step_item != NULL); + bool have_step = (step_item != NULL); mReplaceText->setEnabled(have_trigger || have_replace); mReplaceEditor->setEnabled(have_trigger || have_replace); - mModifierCombo->setEnabled(TRUE); - mKeyCombo->setEnabled(TRUE); + mModifierCombo->setEnabled(true); + mKeyCombo->setEnabled(true); mAddBtn->setEnabled(modifiable && have_library); mUpBtn->setEnabled(modifiable && have_step && step_index > 0); @@ -691,13 +690,13 @@ void LLPreviewGesture::refresh() mDeleteBtn->setEnabled(modifiable && have_step); // Assume all not visible - mAnimationCombo->setVisible(FALSE); - mAnimationRadio->setVisible(FALSE); - mSoundCombo->setVisible(FALSE); - mChatEditor->setVisible(FALSE); - mWaitAnimCheck->setVisible(FALSE); - mWaitTimeCheck->setVisible(FALSE); - mWaitTimeEditor->setVisible(FALSE); + mAnimationCombo->setVisible(false); + mAnimationRadio->setVisible(false); + mSoundCombo->setVisible(false); + mChatEditor->setVisible(false); + mWaitAnimCheck->setVisible(false); + mWaitTimeCheck->setVisible(false); + mWaitTimeEditor->setVisible(false); std::string optionstext; @@ -713,8 +712,8 @@ void LLPreviewGesture::refresh() { LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step; optionstext = getString("step_anim"); - mAnimationCombo->setVisible(TRUE); - mAnimationRadio->setVisible(TRUE); + mAnimationCombo->setVisible(true); + mAnimationRadio->setVisible(true); mAnimationRadio->setSelectedIndex((anim_step->mFlags & ANIM_FLAG_STOP) ? 1 : 0); mAnimationCombo->setCurrentByID(anim_step->mAnimAssetID); break; @@ -723,7 +722,7 @@ void LLPreviewGesture::refresh() { LLGestureStepSound* sound_step = (LLGestureStepSound*)step; optionstext = getString("step_sound"); - mSoundCombo->setVisible(TRUE); + mSoundCombo->setVisible(true); mSoundCombo->setCurrentByID(sound_step->mSoundAssetID); break; } @@ -731,7 +730,7 @@ void LLPreviewGesture::refresh() { LLGestureStepChat* chat_step = (LLGestureStepChat*)step; optionstext = getString("step_chat"); - mChatEditor->setVisible(TRUE); + mChatEditor->setVisible(true); mChatEditor->setText(chat_step->mChatText); break; } @@ -739,11 +738,11 @@ void LLPreviewGesture::refresh() { LLGestureStepWait* wait_step = (LLGestureStepWait*)step; optionstext = getString("step_wait"); - mWaitAnimCheck->setVisible(TRUE); + mWaitAnimCheck->setVisible(true); mWaitAnimCheck->set(wait_step->mFlags & WAIT_FLAG_ALL_ANIM); - mWaitTimeCheck->setVisible(TRUE); + mWaitTimeCheck->setVisible(true); mWaitTimeCheck->set(wait_step->mFlags & WAIT_FLAG_TIME); - mWaitTimeEditor->setVisible(TRUE); + mWaitTimeEditor->setVisible(true); std::string buffer = llformat("%.1f", (double)wait_step->mWaitSeconds); mWaitTimeEditor->setText(buffer); break; @@ -755,7 +754,7 @@ void LLPreviewGesture::refresh() mOptionsText->setText(optionstext); - BOOL active = LLGestureMgr::instance().isGestureActive(mItemUUID); + bool active = LLGestureMgr::instance().isGestureActive(mItemUUID); mActiveCheck->set(active); // Can only preview if there are steps @@ -791,7 +790,7 @@ void LLPreviewGesture::initDefaultGesture() mStepList->selectFirstItem(); // this is *new* content, so we are dirty - mDirty = TRUE; + mDirty = true; } @@ -824,7 +823,7 @@ void LLPreviewGesture::loadAsset() // window if the download gets stalled. LLUUID* item_idp = new LLUUID(mItemUUID); - const BOOL high_priority = TRUE; + const bool high_priority = true; gAssetStorage->getAssetData(asset_id, LLAssetType::AT_GESTURE, onLoadComplete, @@ -856,7 +855,7 @@ void LLPreviewGesture::onLoadComplete(const LLUUID& asset_uuid, LLMultiGesture* gesture = new LLMultiGesture(); LLDataPackerAsciiBuffer dp(&buffer[0], size+1); - BOOL ok = gesture->deserialize(dp); + bool ok = gesture->deserialize(dp); if (ok) { @@ -865,7 +864,7 @@ void LLPreviewGesture::onLoadComplete(const LLUUID& asset_uuid, self->mStepList->selectFirstItem(); - self->mDirty = FALSE; + self->mDirty = false; self->refresh(); self->refreshFromItem(); // to update description and title } @@ -1143,7 +1142,7 @@ void LLPreviewGesture::saveIfNeeded() LLLineEditor* descEditor = getChild<LLLineEditor>("desc"); LLSaveInfo* info = new LLSaveInfo(mItemUUID, mObjectUUID, descEditor->getText(), tid); - gAssetStorage->storeAssetData(tid, LLAssetType::AT_GESTURE, onSaveComplete, info, FALSE); + gAssetStorage->storeAssetData(tid, LLAssetType::AT_GESTURE, onSaveComplete, info, false); } } @@ -1196,7 +1195,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, new_item->setDescription(info->mDesc); new_item->setTransactionID(info->mTransactionID); new_item->setAssetUUID(asset_uuid); - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } @@ -1342,7 +1341,7 @@ void LLPreviewGesture::onCommitKeyorModifier() mKeyCombo->setEnabledByValue(LLKeyboard::stringFromKey(KEY_F10), mModifierCombo->getSimple() != CTRL_LABEL); mModifierCombo->setEnabledByValue(CTRL_LABEL, mKeyCombo->getSimple() != LLKeyboard::stringFromKey(KEY_F10)); - mDirty = TRUE; + mDirty = true; refresh(); } @@ -1361,7 +1360,7 @@ void LLPreviewGesture::updateLabel(LLScrollListItem* item) void LLPreviewGesture::onCommitSetDirty(LLUICtrl* ctrl, void* data) { LLPreviewGesture* self = (LLPreviewGesture*)data; - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } @@ -1420,7 +1419,7 @@ void LLPreviewGesture::onCommitAnimation(LLUICtrl* ctrl, void* data) // Update the UI label in the list updateLabel(step_item); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } } @@ -1451,7 +1450,7 @@ void LLPreviewGesture::onCommitAnimationTrigger(LLUICtrl* ctrl, void *data) // Update the UI label in the list updateLabel(step_item); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } } @@ -1477,7 +1476,7 @@ void LLPreviewGesture::onCommitSound(LLUICtrl* ctrl, void* data) // Update the UI label in the list updateLabel(step_item); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } } @@ -1501,7 +1500,7 @@ void LLPreviewGesture::onCommitChat(LLUICtrl* ctrl, void* data) // Update the UI label in the list updateLabel(step_item); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } @@ -1537,7 +1536,7 @@ void LLPreviewGesture::onCommitWait(LLUICtrl* ctrl, void* data) // Update the UI label in the list updateLabel(step_item); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } @@ -1552,7 +1551,7 @@ void LLPreviewGesture::onCommitWaitTime(LLUICtrl* ctrl, void* data) LLGestureStep* step = (LLGestureStep*)step_item->getUserdata(); if (step->getType() != STEP_WAIT) return; - self->mWaitTimeCheck->set(TRUE); + self->mWaitTimeCheck->set(true); onCommitWait(ctrl, data); } @@ -1585,7 +1584,7 @@ void LLPreviewGesture::onClickAdd(void* data) } self->addStep( (EStepType)library_item_index ); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } @@ -1626,7 +1625,7 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type ) mLibraryList->deselectAllItems(); mStepList->deselectAllItems(); - step_item->setSelected(TRUE); + step_item->setSelected(true); return step_item; } @@ -1686,7 +1685,7 @@ void LLPreviewGesture::onClickUp(void* data) if (selected_index > 0) { self->mStepList->swapWithPrevious(selected_index); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } } @@ -1703,7 +1702,7 @@ void LLPreviewGesture::onClickDown(void* data) if (selected_index < count-1) { self->mStepList->swapWithNext(selected_index); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } } @@ -1723,7 +1722,7 @@ void LLPreviewGesture::onClickDelete(void* data) self->mStepList->deleteSingleItem(selected_index); - self->mDirty = TRUE; + self->mDirty = true; self->refresh(); } } |