diff options
Diffstat (limited to 'indra/newview/llpanelgroupnotices.cpp')
-rw-r--r-- | indra/newview/llpanelgroupnotices.cpp | 87 |
1 files changed, 40 insertions, 47 deletions
diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 3b7e4075c6..483c6876ed 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -89,11 +89,9 @@ public: LLGroupDropTarget(const Params&); ~LLGroupDropTarget() {}; - void doDrop(EDragAndDropType cargo_type, void* cargo_data); - // // LLView functionality - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + virtual bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, @@ -114,23 +112,18 @@ LLGroupDropTarget::LLGroupDropTarget(const LLGroupDropTarget::Params& p) mGroupID(p.group_id) {} -void LLGroupDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) -{ - LL_INFOS() << "LLGroupDropTarget::doDrop()" << LL_ENDL; -} - -BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, +bool LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { - BOOL handled = FALSE; + bool handled = false; if (!gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND)) { *accept = ACCEPT_NO; - return TRUE; + return true; } if(getParent()) @@ -138,7 +131,7 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // check if inside //LLRect parent_rect = mParentView->getRect(); //getRect().set(0, parent_rect.getHeight(), parent_rect.getWidth(), 0); - handled = TRUE; + handled = true; // check the type switch(cargo_type) @@ -237,18 +230,18 @@ LLPanelGroupNotices::~LLPanelGroupNotices() } -BOOL LLPanelGroupNotices::isVisibleByAgent(LLAgent* agentp) +bool LLPanelGroupNotices::isVisibleByAgent(LLAgent* agentp) { return mAllowEdit && agentp->hasPowerInGroup(mGroupID, GP_NOTICES_SEND | GP_NOTICES_RECEIVE); } -BOOL LLPanelGroupNotices::postBuild() +bool LLPanelGroupNotices::postBuild() { - bool recurse = true; + constexpr bool recurse = true; mNoticesList = getChild<LLScrollListCtrl>("notice_list",recurse); - mNoticesList->setCommitOnSelectionChange(TRUE); + mNoticesList->setCommitOnSelectionChange(true); mNoticesList->setCommitCallback(onSelectNotice, this); mNoticesList->sortByColumn("date", false); @@ -264,29 +257,29 @@ BOOL LLPanelGroupNotices::postBuild() mCreateMessage = getChild<LLTextEditor>("create_message",recurse); mCreateInventoryName = getChild<LLLineEditor>("create_inventory_name",recurse); - mCreateInventoryName->setTabStop(FALSE); - mCreateInventoryName->setEnabled(FALSE); + mCreateInventoryName->setTabStop(false); + mCreateInventoryName->setEnabled(false); mCreateInventoryIcon = getChild<LLIconCtrl>("create_inv_icon",recurse); - mCreateInventoryIcon->setVisible(FALSE); + mCreateInventoryIcon->setVisible(false); mBtnSendMessage = getChild<LLButton>("send_notice",recurse); mBtnSendMessage->setClickedCallback(onClickSendMessage, this); mBtnRemoveAttachment = getChild<LLButton>("remove_attachment",recurse); mBtnRemoveAttachment->setClickedCallback(onClickRemoveAttachment, this); - mBtnRemoveAttachment->setEnabled(FALSE); + mBtnRemoveAttachment->setEnabled(false); // View mViewSubject = getChild<LLLineEditor>("view_subject",recurse); mViewMessage = getChild<LLTextEditor>("view_message",recurse); mViewInventoryName = getChild<LLLineEditor>("view_inventory_name",recurse); - mViewInventoryName->setTabStop(FALSE); - mViewInventoryName->setEnabled(FALSE); + mViewInventoryName->setTabStop(false); + mViewInventoryName->setEnabled(false); mViewInventoryIcon = getChild<LLIconCtrl>("view_inv_icon",recurse); - mViewInventoryIcon->setVisible(FALSE); + mViewInventoryIcon->setVisible(false); mBtnOpenAttachment = getChild<LLButton>("open_attachment",recurse); mBtnOpenAttachment->setClickedCallback(onClickOpenAttachment, this); @@ -315,15 +308,15 @@ void LLPanelGroupNotices::activate() mPrevSelectedNotice = LLUUID(); - BOOL can_send = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND); - BOOL can_receive = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_RECEIVE); + bool can_send = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND); + bool can_receive = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_RECEIVE); mPanelViewNotice->setEnabled(can_receive); mPanelCreateNotice->setEnabled(can_send); // Always disabled to stop direct editing of attachment names - mCreateInventoryName->setEnabled(FALSE); - mViewInventoryName->setEnabled(FALSE); + mCreateInventoryName->setEnabled(false); + mViewInventoryName->setEnabled(false); // If we can receive notices, grab them right away. if (can_receive) @@ -336,10 +329,10 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item) { mInventoryItem = inv_item; - BOOL item_is_multi = FALSE; + bool item_is_multi = false; if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) { - item_is_multi = TRUE; + item_is_multi = true; }; std::string icon_name = LLInventoryIcon::getIconName(inv_item->getType(), @@ -348,13 +341,13 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item) item_is_multi ); mCreateInventoryIcon->setValue(icon_name); - mCreateInventoryIcon->setVisible(TRUE); + mCreateInventoryIcon->setVisible(true); std::stringstream ss; ss << " " << mInventoryItem->getName(); mCreateInventoryName->setText(ss.str()); - mBtnRemoveAttachment->setEnabled(TRUE); + mBtnRemoveAttachment->setEnabled(true); } void LLPanelGroupNotices::onClickRemoveAttachment(void* data) @@ -362,8 +355,8 @@ void LLPanelGroupNotices::onClickRemoveAttachment(void* data) LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; self->mInventoryItem = NULL; self->mCreateInventoryName->clear(); - self->mCreateInventoryIcon->setVisible(FALSE); - self->mBtnRemoveAttachment->setEnabled(FALSE); + self->mCreateInventoryIcon->setVisible(false); + self->mBtnRemoveAttachment->setEnabled(false); } //static @@ -373,7 +366,7 @@ void LLPanelGroupNotices::onClickOpenAttachment(void* data) self->mInventoryOffer->forceResponse(IOR_ACCEPT); self->mInventoryOffer = NULL; - self->mBtnOpenAttachment->setEnabled(FALSE); + self->mBtnOpenAttachment->setEnabled(false); } void LLPanelGroupNotices::onClickSendMessage(void* data) @@ -443,7 +436,7 @@ void LLPanelGroupNotices::onClickNewMessage(void* data) self->mCreateSubject->clear(); self->mCreateMessage->clear(); if (self->mInventoryItem) onClickRemoveAttachment(self); - self->mNoticesList->deselectAllItems(TRUE); // TRUE == don't commit on chnage + self->mNoticesList->deselectAllItems(true); // true == don't commit on chnage } void LLPanelGroupNotices::refreshNotices() @@ -509,13 +502,13 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) std::string subj; std::string name; U32 timestamp; - BOOL has_attachment; + bool has_attachment; U8 asset_type; S32 i=0; S32 count = msg->getNumberOfBlocks("Data"); - mNoticesList->setEnabled(TRUE); + mNoticesList->setEnabled(true); //save sort state and set unsorted state to prevent unnecessary //sorting while adding notices @@ -529,7 +522,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) { // Only one entry, the dummy entry. mNoticesList->setCommentText(mNoNoticesStr); - mNoticesList->setEnabled(FALSE); + mNoticesList->setEnabled(false); return; } @@ -635,19 +628,19 @@ void LLPanelGroupNotices::showNotice(const std::string& subject, LLInventoryType::IT_TEXTURE); mViewInventoryIcon->setValue(icon_name); - mViewInventoryIcon->setVisible(TRUE); + mViewInventoryIcon->setVisible(true); std::stringstream ss; ss << " " << inventory_name; mViewInventoryName->setText(ss.str()); - mBtnOpenAttachment->setEnabled(TRUE); + mBtnOpenAttachment->setEnabled(true); } else { mViewInventoryName->clear(); - mViewInventoryIcon->setVisible(FALSE); - mBtnOpenAttachment->setEnabled(FALSE); + mViewInventoryIcon->setVisible(false); + mBtnOpenAttachment->setEnabled(false); } } @@ -655,14 +648,14 @@ void LLPanelGroupNotices::arrangeNoticeView(ENoticeView view_type) { if (CREATE_NEW_NOTICE == view_type) { - mPanelCreateNotice->setVisible(TRUE); - mPanelViewNotice->setVisible(FALSE); + mPanelCreateNotice->setVisible(true); + mPanelViewNotice->setVisible(false); } else { - mPanelCreateNotice->setVisible(FALSE); - mPanelViewNotice->setVisible(TRUE); - mBtnOpenAttachment->setEnabled(FALSE); + mPanelCreateNotice->setVisible(false); + mPanelViewNotice->setVisible(true); + mBtnOpenAttachment->setEnabled(false); } } void LLPanelGroupNotices::setGroupID(const LLUUID& id) |