diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-06-13 14:59:28 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-06-13 14:59:28 -0700 |
commit | 5e60392c273f0c9c5efa765a05414c618381780a (patch) | |
tree | d1eedbb1dfa86e66532a6d8746b7a81e5a444d3a /indra/newview/llpreviewnotecard.cpp | |
parent | 0f3c3563b0861e8ea82b201aab8343d99f993bbc (diff) | |
parent | 100ebbab2437de7f5d124a0d7b8279a7a7b57656 (diff) |
Merge branch 'develop' of github.com:secondlife/viewer into roxie/webrtc-voice
Diffstat (limited to 'indra/newview/llpreviewnotecard.cpp')
-rw-r--r-- | indra/newview/llpreviewnotecard.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index aa04540536..620b7c8b2d 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -82,14 +82,14 @@ LLPreviewNotecard::~LLPreviewNotecard() delete mLiveFile; } -BOOL LLPreviewNotecard::postBuild() +bool LLPreviewNotecard::postBuild() { mEditor = getChild<LLViewerTextEditor>("Notecard Editor"); mEditor->setNotecardInfo(mItemUUID, mObjectID, getKey()); mEditor->makePristine(); childSetAction("Save", onClickSave, this); - getChildView("lock")->setVisible( FALSE); + getChildView("lock")->setVisible( false); childSetAction("Delete", onClickDelete, this); getChildView("Delete")->setEnabled(false); @@ -102,7 +102,7 @@ BOOL LLPreviewNotecard::postBuild() if (item) { getChild<LLUICtrl>("desc")->setValue(item->getDescription()); - BOOL source_library = mObjectUUID.isNull() && gInventory.isObjectDescendentOf(item->getUUID(), gInventory.getLibraryRootFolderID()); + bool source_library = mObjectUUID.isNull() && gInventory.isObjectDescendentOf(item->getUUID(), gInventory.getLibraryRootFolderID()); getChildView("Delete")->setEnabled(!source_library); } getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); @@ -116,7 +116,7 @@ bool LLPreviewNotecard::saveItem() return saveIfNeeded(item); } -void LLPreviewNotecard::setEnabled( BOOL enabled ) +void LLPreviewNotecard::setEnabled(bool enabled) { LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); @@ -131,7 +131,7 @@ void LLPreviewNotecard::setEnabled( BOOL enabled ) void LLPreviewNotecard::draw() { LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); - BOOL changed = !editor->isPristine(); + bool changed = !editor->isPristine(); getChildView("Save")->setEnabled(changed && getEnabled()); @@ -139,35 +139,35 @@ void LLPreviewNotecard::draw() } // virtual -BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask) +bool LLPreviewNotecard::handleKeyHere(KEY key, MASK mask) { if(('S' == key) && (MASK_CONTROL == (mask & MASK_CONTROL))) { saveIfNeeded(); - return TRUE; + return true; } return LLPreview::handleKeyHere(key, mask); } // virtual -BOOL LLPreviewNotecard::canClose() +bool LLPreviewNotecard::canClose() { LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); if(mForceClose || editor->isPristine()) { - 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(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2)); } - return FALSE; + return false; } } @@ -239,10 +239,10 @@ void LLPreviewNotecard::loadAsset() if(item) { LLPermissions perm(item->getPermissions()); - BOOL is_owner = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); - BOOL allow_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); - BOOL allow_modify = canModify(mObjectUUID, item); - BOOL source_library = mObjectUUID.isNull() && gInventory.isObjectDescendentOf(mItemUUID, gInventory.getLibraryRootFolderID()); + bool is_owner = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); + bool allow_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); + bool allow_modify = canModify(mObjectUUID, item); + bool source_library = mObjectUUID.isNull() && gInventory.isObjectDescendentOf(mItemUUID, gInventory.getLibraryRootFolderID()); if (allow_copy || gAgent.isGodlike()) { @@ -251,7 +251,7 @@ void LLPreviewNotecard::loadAsset() { editor->setText(LLStringUtil::null); editor->makePristine(); - editor->setEnabled(TRUE); + editor->setEnabled(true); mAssetStatus = PREVIEW_ASSET_LOADED; } else @@ -272,7 +272,7 @@ void LLPreviewNotecard::loadAsset() mAssetID.setNull(); editor->setText(getString("no_object")); editor->makePristine(); - editor->setEnabled(FALSE); + editor->setEnabled(false); mAssetStatus = PREVIEW_ASSET_LOADED; return; } @@ -294,7 +294,7 @@ void LLPreviewNotecard::loadAsset() item->getType(), &onLoadComplete, (void*)user_data, - TRUE); + true); mAssetStatus = PREVIEW_ASSET_LOADING; } } @@ -303,20 +303,20 @@ void LLPreviewNotecard::loadAsset() mAssetID.setNull(); editor->setText(getString("not_allowed")); editor->makePristine(); - editor->setEnabled(FALSE); + editor->setEnabled(false); mAssetStatus = PREVIEW_ASSET_LOADED; } if(!allow_modify) { - editor->setEnabled(FALSE); - getChildView("lock")->setVisible( TRUE); - getChildView("Edit")->setEnabled(FALSE); + editor->setEnabled(false); + getChildView("lock")->setVisible( true); + getChildView("Edit")->setEnabled(false); } if((allow_modify || is_owner) && !source_library) { - getChildView("Delete")->setEnabled(TRUE); + getChildView("Delete")->setEnabled(true); } } else if (mObjectUUID.notNull() && mItemUUID.notNull()) @@ -347,7 +347,7 @@ void LLPreviewNotecard::loadAsset() { editor->setText(LLStringUtil::null); editor->makePristine(); - editor->setEnabled(TRUE); + editor->setEnabled(true); // Don't set asset status here; we may not have set the item id yet // (e.g. when this gets called initially) //mAssetStatus = PREVIEW_ASSET_LOADED; @@ -393,7 +393,7 @@ void LLPreviewNotecard::onLoadComplete(const LLUUID& asset_uuid, } previewEditor->makePristine(); - BOOL modifiable = preview->canModify(preview->mObjectID, preview->getItem()); + bool modifiable = preview->canModify(preview->mObjectID, preview->getItem()); preview->setEnabled(modifiable); preview->syncExternal(); preview->mAssetStatus = PREVIEW_ASSET_LOADED; @@ -593,13 +593,13 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem, bool sync) LLSaveNotecardInfo* info = new LLSaveNotecardInfo(this, mItemUUID, mObjectUUID, tid, copyitem); - S32 size = buffer.length() + 1; + S32 size = static_cast<S32>(buffer.length()) + 1; file.write((U8*)buffer.c_str(), size); gAssetStorage->storeAssetData(tid, LLAssetType::AT_NOTECARD, &onSaveComplete, (void*)info, - FALSE); + false); return true; } else // !gAssetStorage @@ -659,7 +659,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->setAssetUUID(asset_uuid); new_item->setTransactionID(info->mTransactionID); - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } @@ -725,17 +725,17 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const LLSD& response) { - mSaveDialogShown = FALSE; + mSaveDialogShown = false; S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: // "Yes" - mCloseAfterSave = TRUE; + mCloseAfterSave = true; LLPreviewNotecard::onClickSave((void*)this); break; case 1: // "No" - mForceClose = TRUE; + mForceClose = true; closeFloater(); break; @@ -764,7 +764,7 @@ bool LLPreviewNotecard::handleConfirmDeleteDialog(const LLSD& notification, cons if (item != NULL) { const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - gInventory.changeItemParent(item, trash_id, FALSE); + gInventory.changeItemParent(item, trash_id, false); } } else @@ -782,7 +782,7 @@ bool LLPreviewNotecard::handleConfirmDeleteDialog(const LLSD& notification, cons } // close floater, ignore unsaved changes - mForceClose = TRUE; + mForceClose = true; closeFloater(); return false; } |