diff --git a/indra/newview/llpaneldirbrowser.cpp b/indra/newview/llpaneldirbrowser.cpp index 5dee332b3..19201c56d 100644 --- a/indra/newview/llpaneldirbrowser.cpp +++ b/indra/newview/llpaneldirbrowser.cpp @@ -107,13 +107,20 @@ LLPanelDirBrowser::LLPanelDirBrowser(const std::string& name, LLFloaterDirectory BOOL LLPanelDirBrowser::postBuild() { - childSetCommitCallback("results", onCommitList, this); + if (LLUICtrl* ctrl = findChild("results")) + ctrl->setCommitCallback(onCommitList, this); - childSetAction("< Prev", onClickPrev, this); - childHide("< Prev"); + if (LLButton* btn = findChild("< Prev")) + { + childSetAction("< Prev", onClickPrev, this); + btn->setVisible(false); + } - childSetAction("Next >", onClickNext, this); - childHide("Next >"); + if (LLButton* btn = findChild("Next >")) + { + childSetAction("Next >", onClickNext, this); + btn->setVisible(false); + } return TRUE; } @@ -136,7 +143,7 @@ void LLPanelDirBrowser::draw() if (mLastResultTimer.getElapsedTimeF32() > 0.5) { if (!mDidAutoSelect && - !childHasFocus("results")) + hasChild("results") && !childHasFocus("results")) { LLCtrlListInterface *list = childGetListInterface("results"); if (list) @@ -171,7 +178,8 @@ void LLPanelDirBrowser::nextPage() void LLPanelDirBrowser::prevPage() { mSearchStart -= mResultsPerPage; - childSetVisible("< Prev", mSearchStart > 0); + if (LLUICtrl* ctrl = findChild("< Prev")) + ctrl->setVisible(mSearchStart > 0); performQuery(); } @@ -180,14 +188,17 @@ void LLPanelDirBrowser::prevPage() void LLPanelDirBrowser::resetSearchStart() { mSearchStart = 0; - childHide("Next >"); - childHide("< Prev"); + if (LLUICtrl* ctrl = findChild("Next >")) + ctrl->setVisible(false); + if (LLUICtrl* ctrl = findChild("< Prev")) + ctrl->setVisible(false); } // protected void LLPanelDirBrowser::updateResultCount() { - LLScrollListCtrl* list = getChild("results"); + LLScrollListCtrl* list = findChild("results"); + if (!list) return; S32 result_count = list->getItemCount(); std::string result_text; @@ -218,7 +229,7 @@ void LLPanelDirBrowser::updateResultCount() } else { - childEnable("results"); + list->setEnabled(true); } } @@ -319,7 +330,7 @@ void LLPanelDirBrowser::updateMaturityCheckbox() void LLPanelDirBrowser::selectByUUID(const LLUUID& id) { - LLCtrlListInterface *list = childGetListInterface("results"); + LLScrollListCtrl* list = findChild("results"); if (!list) return; BOOL found = list->setCurrentByID(id); if (found) @@ -363,7 +374,7 @@ U32 LLPanelDirBrowser::getSelectedEventID() const void LLPanelDirBrowser::getSelectedInfo(LLUUID* id, S32 *type) { - LLCtrlListInterface *list = childGetListInterface("results"); + LLScrollListCtrl* list = findChild("results"); if (!list) return; LLSD id_sd = childGetValue("results"); @@ -379,7 +390,7 @@ void LLPanelDirBrowser::getSelectedInfo(LLUUID* id, S32 *type) void LLPanelDirBrowser::onCommitList(LLUICtrl* ctrl, void* data) { LLPanelDirBrowser* self = (LLPanelDirBrowser*)data; - LLCtrlListInterface *list = self->childGetListInterface("results"); + LLScrollListCtrl* list = self->findChild("results"); if (!list) return; // Start with everyone invisible @@ -515,7 +526,7 @@ void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**) self->mHaveSearchResults = TRUE; - LLCtrlListInterface *list = self->childGetListInterface("results"); + LLScrollListCtrl* list = self->findChild("results"); if (!list) return; if (!list->getCanSelect()) @@ -610,7 +621,7 @@ void LLPanelDirBrowser::processDirPlacesReply(LLMessageSystem* msg, void**) self->mHaveSearchResults = TRUE; - LLCtrlListInterface *list = self->childGetListInterface("results"); + LLScrollListCtrl* list = self->findChild("results"); if (!list) return; if (!list->getCanSelect()) @@ -696,7 +707,7 @@ void LLPanelDirBrowser::processDirEventsReply(LLMessageSystem* msg, void**) self->mHaveSearchResults = TRUE; - LLCtrlListInterface *list = self->childGetListInterface("results"); + LLScrollListCtrl* list = self->findChild("results"); if (!list) return; if (!list->getCanSelect()) @@ -835,7 +846,7 @@ void LLPanelDirBrowser::processDirGroupsReply(LLMessageSystem* msg, void**) self->mHaveSearchResults = TRUE; - LLCtrlListInterface *list = self->childGetListInterface("results"); + LLScrollListCtrl* list = self->findChild("results"); if (!list) return; if (!list->getCanSelect()) @@ -932,7 +943,7 @@ void LLPanelDirBrowser::processDirClassifiedReply(LLMessageSystem* msg, void**) self->mHaveSearchResults = TRUE; - LLCtrlListInterface *list = self->childGetListInterface("results"); + LLScrollListCtrl* list = self->findChild("results"); if (!list) return; if (!list->getCanSelect()) @@ -1005,7 +1016,7 @@ void LLPanelDirBrowser::processDirLandReply(LLMessageSystem *msg, void**) self->mHaveSearchResults = TRUE; - LLCtrlListInterface *list = self->childGetListInterface("results"); + LLScrollListCtrl* list = self->findChild("results"); if (!list) return; if (!list->getCanSelect()) @@ -1184,7 +1195,7 @@ LLSD LLPanelDirBrowser::createLandSale(const LLUUID& parcel_id, BOOL is_auction, void LLPanelDirBrowser::newClassified() { - LLCtrlListInterface *list = childGetListInterface("results"); + LLScrollListCtrl* list = findChild("results"); if (!list) return; if (mFloaterDirectory->mPanelClassifiedp) @@ -1212,8 +1223,6 @@ void LLPanelDirBrowser::newClassified() void LLPanelDirBrowser::setupNewSearch() { - LLScrollListCtrl* list = getChild("results"); - gDirBrowserInstances.removeData(mSearchID); // Make a new query ID mSearchID.generate(); @@ -1221,9 +1230,12 @@ void LLPanelDirBrowser::setupNewSearch() gDirBrowserInstances.addData(mSearchID, this); // ready the list for results - list->operateOnAll(LLCtrlListInterface::OP_DELETE); - list->setCommentText(LLTrans::getString("Searching")); - childDisable("results"); + if (LLScrollListCtrl* list = findChild("results")) + { + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + list->setCommentText(LLTrans::getString("Searching")); + list->setEnabled(false); + } mResultsReceived = 0; mHaveSearchResults = FALSE; diff --git a/indra/newview/llpaneldirevents.cpp b/indra/newview/llpaneldirevents.cpp index bded7d142..7f087d9dc 100644 --- a/indra/newview/llpaneldirevents.cpp +++ b/indra/newview/llpaneldirevents.cpp @@ -75,8 +75,6 @@ BOOL LLPanelDirEvents::postBuild() childSetAction("Today", onClickToday, this); - childSetCommitCallback("mature", onCommitMature, this); - childSetAction("Search", LLPanelDirBrowser::onClickSearchCore, this); setDefaultBtn("Search"); @@ -296,14 +294,6 @@ void LLPanelDirEvents::onForwardBtn(void* data) } -// static -void LLPanelDirEvents::onCommitMature(LLUICtrl* ctrl, void* data) -{ - // just perform another search - onClickSearchCore(data); -} - - // static void LLPanelDirEvents::onClickDelete(void *userdata) { diff --git a/indra/newview/llpaneldirevents.h b/indra/newview/llpaneldirevents.h index dce31b597..a74f1b3a4 100644 --- a/indra/newview/llpaneldirevents.h +++ b/indra/newview/llpaneldirevents.h @@ -61,7 +61,6 @@ protected: static void onBackBtn(void* data); static void onForwardBtn(void* data); static void onClickToday(void *userdata); - static void onCommitMature(LLUICtrl* ctrl, void* data); static void onClickSearch(void *data); static void onClickDelete(void *data); diff --git a/indra/newview/llpaneldirfind.cpp b/indra/newview/llpaneldirfind.cpp index 2ba9aac2c..a442a40a0 100644 --- a/indra/newview/llpaneldirfind.cpp +++ b/indra/newview/llpaneldirfind.cpp @@ -108,12 +108,16 @@ BOOL LLPanelDirFind::postBuild() LLPanelDirBrowser::postBuild(); childSetAction("back_btn", onClickBack, this); - childSetAction("home_btn", onClickHome, this); + if (hasChild("home_btn")) + childSetAction("home_btn", onClickHome, this); childSetAction("forward_btn", onClickForward, this); childSetAction("reload_btn", onClickRefresh, this); - childSetCommitCallback("search_editor", onCommitSearch, this); - childSetAction("search_btn", onClickSearch, this); - childSetAction("?", onClickHelp, this); + if (hasChild("search_editor")) + childSetCommitCallback("search_editor", onCommitSearch, this); + if (hasChild("search_btn")) + childSetAction("search_btn", onClickSearch, this); + if (hasChild("?")) + childSetAction("?", onClickHelp, this); // showcase doesn't have maturity flags -- it's all PG if (hasChild("incmature")) @@ -161,7 +165,8 @@ BOOL LLPanelDirFind::postBuild() navigateToDefaultPage(); } - childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL)); + if (LLUICtrl* ctrl = findChild("filter_gaming")) + ctrl->setVisible((gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL)); return TRUE; } @@ -257,7 +262,8 @@ void LLPanelDirFindAll::search(const std::string& search_text) void LLPanelDirFind::focus() { - childSetFocus("search_editor"); + if (hasChild("search_editor")) + childSetFocus("search_editor"); } void LLPanelDirFind::navigateToDefaultPage() @@ -291,17 +297,20 @@ void LLPanelDirFind::navigateToDefaultPage() start_url += "panel=" + getName() + "&"; } - BOOL inc_pg = childGetValue("incpg").asBoolean(); - BOOL inc_mature = childGetValue("incmature").asBoolean(); - BOOL inc_adult = childGetValue("incadult").asBoolean(); - if (!(inc_pg || inc_mature || inc_adult)) + if (hasChild("incmature")) { - // if nothing's checked, just go for pg; we don't notify in - // this case because it's a default page. - inc_pg = true; - } + bool inc_pg = childGetValue("incpg").asBoolean(); + bool inc_mature = childGetValue("incmature").asBoolean(); + bool inc_adult = childGetValue("incadult").asBoolean(); + if (!(inc_pg || inc_mature || inc_adult)) + { + // if nothing's checked, just go for pg; we don't notify in + // this case because it's a default page. + inc_pg = true; + } - start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true); + start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true); + } } llinfos << "default web search url: " << start_url << llendl; @@ -433,7 +442,7 @@ const std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_matur if (!gHippoGridManager->getConnectedGrid()->isSecondLife()) { substring = "[DICE]"; - url.replace(url.find(substring), substring.length(), childGetValue("filter_gaming").asBoolean() ? "y" : "n"); + url.replace(url.find(substring), substring.length(), (hasChild("filter_gaming") && childGetValue("filter_gaming").asBoolean()) ? "y" : "n"); } } } @@ -570,7 +579,8 @@ BOOL LLPanelDirFindAllOld::postBuild() childDisable("Search"); setDefaultBtn( "Search" ); - childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL_CLASSIC)); + if (LLUICtrl* ctrl = findChild("filter_gaming")) + ctrl->setVisible((gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL_CLASSIC)); return TRUE; } @@ -634,7 +644,7 @@ void LLPanelDirFindAllOld::onClickSearch(void *userdata) scope |= DFQ_INC_ADULT; } - if (self->childGetValue("filter_gaming").asBoolean()) + if (self->hasChild("filter_gaming") && self->childGetValue("filter_gaming").asBoolean()) { scope |= DFQ_FILTER_GAMING; } diff --git a/indra/newview/llpaneldirland.cpp b/indra/newview/llpaneldirland.cpp index 199426a6d..06b34570d 100644 --- a/indra/newview/llpaneldirland.cpp +++ b/indra/newview/llpaneldirland.cpp @@ -103,7 +103,6 @@ BOOL LLPanelDirLand::postBuild() childSetAction("Search", onClickSearchCore, this); setDefaultBtn("Search"); - childSetTextArg("land", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); childSetTextArg("pricecheck_symbol", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); childSetLabelArg("pricecheck", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 49b59720d..e45f0608a 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -69,7 +69,7 @@ BOOL LLPanelGroupTab::isVisibleByAgent(LLAgent* agentp) BOOL LLPanelGroupTab::postBuild() { // Hook up the help button callback. - LLButton* button = getChild("help_button"); + LLButton* button = findChild("help_button"); if (button) { button->setClickedCallback(boost::bind(&LLPanelGroupTab::onClickHelp,this)); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 20701dd6e..630a28128 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -515,7 +515,7 @@ BOOL LLPanelGroupSubTab::postBuild() delete icon; } - icon = getChild("power_all_have_icon",no_recurse); + icon = getChild("power_all_have_icon",no_recurse, false); if (icon && !icon->getImageName().empty()) { mActionIcons["full"] = icon->getImageName(); @@ -523,7 +523,7 @@ BOOL LLPanelGroupSubTab::postBuild() delete icon; } - icon = getChild("power_partial_icon",no_recurse); + icon = getChild("power_partial_icon",no_recurse, false); if (icon && !icon->getImageName().empty()) { mActionIcons["partial"] = icon->getImageName(); diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 2afff003e..705b96c93 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -97,7 +97,7 @@ BOOL LLPanelPlace::postBuild() mDescEditor = getChild("desc_editor"); mInfoEditor = getChild("info_editor"); - mLandTypeEditor = getChild("land_type_display"); + mLandTypeEditor = findChild("land_type_display"); mLocationDisplay = getChild("location_editor"); @@ -145,7 +145,8 @@ void LLPanelPlace::resetLocation() mNameEditor->setText( LLStringUtil::null ); mDescEditor->setText( LLStringUtil::null ); mInfoEditor->setText( LLStringUtil::null ); - mLandTypeEditor->setText( LLStringUtil::null ); + if (mLandTypeEditor) + mLandTypeEditor->setText(LLStringUtil::null); mLocationDisplay->setText( LLStringUtil::null ); } @@ -198,7 +199,8 @@ void LLPanelPlace::setLocationString(const std::string& location) void LLPanelPlace::setLandTypeString(const std::string& land_type) { - mLandTypeEditor->setText(land_type); + if (mLandTypeEditor) + mLandTypeEditor->setText(land_type); } void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason) diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 45de56e14..affd4bbce 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -126,7 +126,8 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name, } } } - childSetAction("Save",onClickSave,this); + if (hasChild("Save", true)) + childSetAction("Save",onClickSave,this); // only assert shape if not hosted in a multifloater if (!getHost()) @@ -135,18 +136,20 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name, setRect(curRect); } - childSetVisible("lock", FALSE); + if (LLUICtrl* ctrl = findChild("lock")) + ctrl->setVisible(false); - const LLInventoryItem* item = getItem(); - - childSetCommitCallback("desc", LLPreview::onText, this); - if (item) - childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); + if (hasChild("desc", true)) + { + childSetCommitCallback("desc", LLPreview::onText, this); + if (const LLInventoryItem* item = getItem()) + childSetText("desc", item->getDescription()); + childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); + } setTitle(title); - LLViewerTextEditor* editor = getChild("Notecard Editor"); + LLViewerTextEditor* editor = findChild("Notecard Editor"); if (editor) { @@ -166,7 +169,7 @@ LLPreviewNotecard::~LLPreviewNotecard() BOOL LLPreviewNotecard::postBuild() { - LLViewerTextEditor *ed = getChild("Notecard Editor"); + LLViewerTextEditor* ed = findChild("Notecard Editor"); if (ed) { ed->setNotecardInfo(mNotecardItemID, mObjectID); @@ -192,27 +195,27 @@ bool LLPreviewNotecard::saveItem(LLPointer* itemptr) void LLPreviewNotecard::setEnabled( BOOL enabled ) { + LLViewerTextEditor* editor = findChild("Notecard Editor"); - LLViewerTextEditor* editor = getChild("Notecard Editor"); - - childSetEnabled("Notecard Editor", enabled); - childSetVisible("lock", !enabled); - childSetEnabled("desc", enabled); - childSetEnabled("Save", enabled && editor && (!editor->isPristine())); + if (editor) + editor->setEnabled(enabled); + if (LLUICtrl* ctrl = findChild("lock")) + ctrl->setVisible(!enabled); + if (LLUICtrl* ctrl = findChild("desc")) + ctrl->setEnabled(enabled); + if (LLUICtrl* ctrl = findChild("Save")) + ctrl->setEnabled(enabled && editor && !editor->isPristine()); } void LLPreviewNotecard::draw() { + LLViewerTextEditor* editor = findChild("Notecard Editor"); + BOOL script_changed = editor && !editor->isPristine(); - - //childSetFocus("Save", FALSE); - - LLViewerTextEditor* editor = getChild("Notecard Editor"); - BOOL script_changed = !editor->isPristine(); - - childSetEnabled("Save", script_changed && getEnabled()); + if (LLUICtrl* ctrl = findChild("Save")) + ctrl->setEnabled(script_changed && getEnabled()); LLPreview::draw(); } @@ -228,7 +231,7 @@ BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask) if ('F' == key && (mask & MASK_CONTROL) && !(mask & (MASK_SHIFT | MASK_ALT))) { - LLFloaterSearchReplace::show(getChild("Notecard Editor")); + LLFloaterSearchReplace::show(findChild("Notecard Editor")); return TRUE; } @@ -238,9 +241,9 @@ BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask) // virtual BOOL LLPreviewNotecard::canClose() { - LLViewerTextEditor* editor = getChild("Notecard Editor"); + LLViewerTextEditor* editor = findChild("Notecard Editor"); - if(mForceClose || editor->isPristine()) + if (mForceClose || (editor && editor->isPristine())) { return TRUE; } @@ -255,9 +258,7 @@ BOOL LLPreviewNotecard::canClose() const LLInventoryItem* LLPreviewNotecard::getDragItem() { - LLViewerTextEditor* editor = getChild("Notecard Editor"); - - if(editor) + if (LLViewerTextEditor* editor = findChild("Notecard Editor")) { return editor->getDragItem(); } @@ -266,10 +267,9 @@ const LLInventoryItem* LLPreviewNotecard::getDragItem() bool LLPreviewNotecard::hasEmbeddedInventory() { - LLViewerTextEditor* editor = NULL; - editor = getChild("Notecard Editor"); - if (!editor) return false; - return editor->hasEmbeddedInventory(); + if (LLViewerTextEditor* editor = findChild("Notecard Editor")) + return editor->hasEmbeddedInventory(); + return false; } void LLPreviewNotecard::refreshFromInventory() @@ -280,15 +280,13 @@ void LLPreviewNotecard::refreshFromInventory() void LLPreviewNotecard::loadAsset() { - // request the asset. - const LLInventoryItem* item = getItem(); - LLViewerTextEditor* editor = getChild("Notecard Editor"); + LLViewerTextEditor* editor = findChild("Notecard Editor"); if (!editor) return; - - if(item) + // request the asset. + if (const LLInventoryItem* item = getItem()) { if (gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE) @@ -355,7 +353,8 @@ void LLPreviewNotecard::loadAsset() // You can always save in task inventory if(!mObjectUUID.isNull()) editor->setEnabled(TRUE); // - childSetVisible("lock", TRUE); + if (LLUICtrl* ctrl = findChild("lock")) + ctrl->setVisible(true); } } else @@ -391,22 +390,23 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, buffer[file_length] = 0; - LLViewerTextEditor* previewEditor = preview->getChild("Notecard Editor"); - - if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) + if (LLViewerTextEditor* previewEditor = preview->findChild("Notecard Editor")) { - if( !previewEditor->importBuffer( buffer, file_length+1 ) ) + if ((file_length > 19) && !strncmp(buffer, "Linden text version", 19)) { - llwarns << "Problem importing notecard" << llendl; + if (!previewEditor->importBuffer(buffer, file_length+1)) + { + llwarns << "Problem importing notecard" << llendl; + } + } + else + { + // Version 0 (just text, doesn't include version number) + previewEditor->setText(LLStringExplicit(buffer)); } - } - else - { - // Version 0 (just text, doesn't include version number) - previewEditor->setText(LLStringExplicit(buffer)); - } - previewEditor->makePristine(); + previewEditor->makePristine(); + } const LLInventoryItem* item = preview->getItem(); BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY, @@ -466,42 +466,37 @@ void LLPreviewNotecard::onClickSave(void* user_data) // static void LLPreviewNotecard::onClickGetItems(void* user_data) { - LLPreviewNotecard* preview = (LLPreviewNotecard*)user_data; - if(preview) + LLPreviewNotecard* preview = static_cast(user_data); + if (LLViewerTextEditor* editor = preview->findChild("Notecard Editor")) { - LLViewerTextEditor* editor = preview->getChild("Notecard Editor"); - if(editor) + std::vector > items = editor->getEmbeddedItems(); + if (items.size()) { - std::vector > items = editor->getEmbeddedItems(); - if(items.size()) + std::vector >::iterator iter = items.begin(); + std::vector >::iterator end = items.end(); + for ( ; iter != end; ++iter) { - const BOOL use_caps = FALSE; - - std::vector >::iterator iter = items.begin(); - std::vector >::iterator end = items.end(); - for( ; iter != end; ++iter) + LLInventoryItem* item = static_cast(*iter); + #if 0 //use_caps { - LLInventoryItem* item = static_cast(*iter); - if(use_caps) - { - copy_inventory_from_notecard(LLUUID::null, preview->getObjectID(), preview->getNotecardItemID(), item, 0); - } - else - { - // Only one item per message actually works - gMessageSystem->newMessageFast(_PREHASH_CopyInventoryFromNotecard); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_NotecardData); - gMessageSystem->addUUIDFast(_PREHASH_NotecardItemID, preview->getNotecardItemID()); - gMessageSystem->addUUIDFast(_PREHASH_ObjectID, preview->getObjectID()); - gMessageSystem->nextBlockFast(_PREHASH_InventoryData); - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getUUID()); - gMessageSystem->addUUIDFast(_PREHASH_FolderID, gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType()))); - gAgent.sendReliableMessage(); - } + copy_inventory_from_notecard(LLUUID::null, preview->getObjectID(), preview->getNotecardItemID(), item, 0); } + #else + { + // Only one item per message actually works + gMessageSystem->newMessageFast(_PREHASH_CopyInventoryFromNotecard); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gMessageSystem->nextBlockFast(_PREHASH_NotecardData); + gMessageSystem->addUUIDFast(_PREHASH_NotecardItemID, preview->getNotecardItemID()); + gMessageSystem->addUUIDFast(_PREHASH_ObjectID, preview->getObjectID()); + gMessageSystem->nextBlockFast(_PREHASH_InventoryData); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getUUID()); + gMessageSystem->addUUIDFast(_PREHASH_FolderID, gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType()))); + gAgent.sendReliableMessage(); + } + #endif } } } @@ -530,9 +525,9 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) } - LLViewerTextEditor* editor = getChild("Notecard Editor"); + LLViewerTextEditor* editor = findChild("Notecard Editor"); - if(!editor->isPristine()) + if (editor && !editor->isPristine()) { // We need to update the asset information LLTransactionID tid; @@ -602,8 +597,8 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) // static void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) { - LLSaveNotecardInfo* info = (LLSaveNotecardInfo*)user_data; - if(info && (0 == status)) + LLSaveNotecardInfo* info = static_cast(user_data); + if (0 == status) { if(info->mObjectUUID.isNull()) { @@ -647,8 +642,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data // Perform item copy to inventory if (info->mCopyItem.notNull()) { - LLViewerTextEditor* editor = info->mSelf->getChild("Notecard Editor"); - if (editor) + if (LLViewerTextEditor* editor = info->mSelf->findChild("Notecard Editor")) { editor->copyInventory(info->mCopyItem); } @@ -741,10 +735,10 @@ void LLPreviewNotecard::saveAs_continued(AIFilePicker* filepicker) if (!filepicker->hasFilename()) return; - LLViewerTextEditor* editor = getChild("Notecard Editor"); + LLViewerTextEditor* editor = findChild("Notecard Editor"); std::string buffer; - if (!editor->exportBuffer(buffer)) + if (editor && !editor->exportBuffer(buffer)) { // FIXME: Notify the user! return; @@ -782,7 +776,7 @@ LLUUID LLPreviewNotecard::getItemID() LLTextEditor* LLPreviewNotecard::getEditor() { - return getChild("Notecard Editor"); + return findChild("Notecard Editor"); } void LLPreviewNotecard::initMenu() @@ -823,183 +817,128 @@ void LLPreviewNotecard::initMenu() // static void LLPreviewNotecard::onSearchMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - LLFloaterSearchReplace::show(editor); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + LLFloaterSearchReplace::show(editor); } // static void LLPreviewNotecard::onUndoMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - editor->undo(); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + editor->undo(); } // static void LLPreviewNotecard::onRedoMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - editor->redo(); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + editor->redo(); } // static void LLPreviewNotecard::onCutMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - editor->cut(); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + editor->cut(); } // static void LLPreviewNotecard::onCopyMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - editor->copy(); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + editor->copy(); } // static void LLPreviewNotecard::onPasteMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - editor->paste(); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + editor->paste(); } // static void LLPreviewNotecard::onSelectAllMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - editor->selectAll(); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + editor->selectAll(); } // static void LLPreviewNotecard::onDeselectMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (self) - { - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (editor) - { - editor->deselect(); - } - } + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + editor->deselect(); } // static BOOL LLPreviewNotecard::enableUndoMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (!self) return FALSE; - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (!editor) return FALSE; - return editor->canUndo(); + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + return editor->canUndo(); + return false; } // static BOOL LLPreviewNotecard::enableRedoMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (!self) return FALSE; - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (!editor) return FALSE; - return editor->canRedo(); + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + return editor->canRedo(); + return false; } // static BOOL LLPreviewNotecard::enableCutMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (!self) return FALSE; - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (!editor) return FALSE; - return editor->canCut(); + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + return editor->canCut(); + return false; } // static BOOL LLPreviewNotecard::enableCopyMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (!self) return FALSE; - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (!editor) return FALSE; - return editor->canCopy(); + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + return editor->canCopy(); + return false; } // static BOOL LLPreviewNotecard::enablePasteMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (!self) return FALSE; - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (!editor) return FALSE; - return editor->canPaste(); + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + return editor->canPaste(); + return false; } // static BOOL LLPreviewNotecard::enableSelectAllMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (!self) return FALSE; - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (!editor) return FALSE; - return editor->canSelectAll(); + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + return editor->canSelectAll(); + return false; } // static BOOL LLPreviewNotecard::enableDeselectMenu(void* userdata) { - LLPreviewNotecard* self = (LLPreviewNotecard*)userdata; - if (!self) return FALSE; - LLViewerTextEditor* editor = self->getChild("Notecard Editor"); - if (!editor) return FALSE; - return editor->canDeselect(); + LLPreviewNotecard* self = static_cast(userdata); + if (LLViewerTextEditor* editor = self->findChild("Notecard Editor")) + return editor->canDeselect(); + return false; } // EOF diff --git a/indra/newview/skins/default/xui/en-us/floater_directory.xml b/indra/newview/skins/default/xui/en-us/floater_directory.xml index 02c9f2a83..3a3983bb1 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory.xml @@ -672,6 +672,7 @@ To buy direct, visit the land and click on the place name in the title bar. font="SansSerifSmall" height="16" initial_value="false" label="Adult content" left_delta="110" mouse_opaque="true" name="incadult" width="204" /> + - Simple Majority - 2/3 Majority - Unanimous + Simple Majority + 2/3 Majority + Unanimous