summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewnotecard.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-05 08:40:49 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-05 08:40:49 -0400
commit22a47eee84dbaa5c731c000c6013ca558bd15892 (patch)
tree8b3128fdb91731d95025b86701431826c441c5ba /indra/newview/llpreviewnotecard.cpp
parenta6b85244a6f943a4598ff9b7b8a3343eb1e0d11e (diff)
parent7ac4c3b56e5246fceaa73e7c9c665d3c04827d6c (diff)
Merge branch 'release/luau-scripting' into lua-resultset
Diffstat (limited to 'indra/newview/llpreviewnotecard.cpp')
-rw-r--r--indra/newview/llpreviewnotecard.cpp66
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;
}