Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into Cupcake

This commit is contained in:
Drake Arconis
2013-03-20 08:31:21 -04:00
11 changed files with 215 additions and 263 deletions

View File

@@ -107,13 +107,20 @@ LLPanelDirBrowser::LLPanelDirBrowser(const std::string& name, LLFloaterDirectory
BOOL LLPanelDirBrowser::postBuild()
{
childSetCommitCallback("results", onCommitList, this);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("results"))
ctrl->setCommitCallback(onCommitList, this);
childSetAction("< Prev", onClickPrev, this);
childHide("< Prev");
if (LLButton* btn = findChild<LLButton>("< Prev"))
{
childSetAction("< Prev", onClickPrev, this);
btn->setVisible(false);
}
childSetAction("Next >", onClickNext, this);
childHide("Next >");
if (LLButton* btn = findChild<LLButton>("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<LLUICtrl>("< 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<LLUICtrl>("Next >"))
ctrl->setVisible(false);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("< Prev"))
ctrl->setVisible(false);
}
// protected
void LLPanelDirBrowser::updateResultCount()
{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("results");
LLScrollListCtrl* list = findChild<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("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<LLScrollListCtrl>("results");
if (!list) return;
if (mFloaterDirectory->mPanelClassifiedp)
@@ -1212,8 +1223,6 @@ void LLPanelDirBrowser::newClassified()
void LLPanelDirBrowser::setupNewSearch()
{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("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<LLScrollListCtrl>("results"))
{
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
list->setCommentText(LLTrans::getString("Searching"));
list->setEnabled(false);
}
mResultsReceived = 0;
mHaveSearchResults = FALSE;

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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<LLUICtrl>("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<LLUICtrl>("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;
}

View File

@@ -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());

View File

@@ -69,7 +69,7 @@ BOOL LLPanelGroupTab::isVisibleByAgent(LLAgent* agentp)
BOOL LLPanelGroupTab::postBuild()
{
// Hook up the help button callback.
LLButton* button = getChild<LLButton>("help_button");
LLButton* button = findChild<LLButton>("help_button");
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroupTab::onClickHelp,this));

View File

@@ -515,7 +515,7 @@ BOOL LLPanelGroupSubTab::postBuild()
delete icon;
}
icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse);
icon = getChild<LLIconCtrl>("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<LLIconCtrl>("power_partial_icon",no_recurse);
icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse, false);
if (icon && !icon->getImageName().empty())
{
mActionIcons["partial"] = icon->getImageName();

View File

@@ -97,7 +97,7 @@ BOOL LLPanelPlace::postBuild()
mDescEditor = getChild<LLTextEditor>("desc_editor");
mInfoEditor = getChild<LLTextBox>("info_editor");
mLandTypeEditor = getChild<LLTextBox>("land_type_display");
mLandTypeEditor = findChild<LLTextBox>("land_type_display");
mLocationDisplay = getChild<LLTextBox>("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)

View File

@@ -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<LLUICtrl>("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<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
@@ -166,7 +169,7 @@ LLPreviewNotecard::~LLPreviewNotecard()
BOOL LLPreviewNotecard::postBuild()
{
LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* ed = findChild<LLViewerTextEditor>("Notecard Editor");
if (ed)
{
ed->setNotecardInfo(mNotecardItemID, mObjectID);
@@ -192,27 +195,27 @@ bool LLPreviewNotecard::saveItem(LLPointer<LLInventoryItem>* itemptr)
void LLPreviewNotecard::setEnabled( BOOL enabled )
{
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("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<LLUICtrl>("lock"))
ctrl->setVisible(!enabled);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("desc"))
ctrl->setEnabled(enabled);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Save"))
ctrl->setEnabled(enabled && editor && !editor->isPristine());
}
void LLPreviewNotecard::draw()
{
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
BOOL script_changed = editor && !editor->isPristine();
//childSetFocus("Save", FALSE);
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
BOOL script_changed = !editor->isPristine();
childSetEnabled("Save", script_changed && getEnabled());
if (LLUICtrl* ctrl = findChild<LLUICtrl>("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<LLViewerTextEditor>("Notecard Editor"));
LLFloaterSearchReplace::show(findChild<LLViewerTextEditor>("Notecard Editor"));
return TRUE;
}
@@ -238,9 +241,9 @@ BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask)
// virtual
BOOL LLPreviewNotecard::canClose()
{
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if(editor)
if (LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor"))
{
return editor->getDragItem();
}
@@ -266,10 +267,9 @@ const LLInventoryItem* LLPreviewNotecard::getDragItem()
bool LLPreviewNotecard::hasEmbeddedInventory()
{
LLViewerTextEditor* editor = NULL;
editor = getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return false;
return editor->hasEmbeddedInventory();
if (LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("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()
// <edit> You can always save in task inventory
if(!mObjectUUID.isNull()) editor->setEnabled(TRUE);
// </edit>
childSetVisible("lock", TRUE);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("lock"))
ctrl->setVisible(true);
}
}
else
@@ -391,22 +390,23 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
buffer[file_length] = 0;
LLViewerTextEditor* previewEditor = preview->getChild<LLViewerTextEditor>("Notecard Editor");
if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) )
if (LLViewerTextEditor* previewEditor = preview->findChild<LLViewerTextEditor>("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<LLPreviewNotecard*>(user_data);
if (LLViewerTextEditor* editor = preview->findChild<LLViewerTextEditor>("Notecard Editor"))
{
LLViewerTextEditor* editor = preview->getChild<LLViewerTextEditor>("Notecard Editor");
if(editor)
std::vector<LLPointer<LLInventoryItem> > items = editor->getEmbeddedItems();
if (items.size())
{
std::vector<LLPointer<LLInventoryItem> > items = editor->getEmbeddedItems();
if(items.size())
std::vector<LLPointer<LLInventoryItem> >::iterator iter = items.begin();
std::vector<LLPointer<LLInventoryItem> >::iterator end = items.end();
for ( ; iter != end; ++iter)
{
const BOOL use_caps = FALSE;
std::vector<LLPointer<LLInventoryItem> >::iterator iter = items.begin();
std::vector<LLPointer<LLInventoryItem> >::iterator end = items.end();
for( ; iter != end; ++iter)
LLInventoryItem* item = static_cast<LLInventoryItem*>(*iter);
#if 0 //use_caps
{
LLInventoryItem* item = static_cast<LLInventoryItem*>(*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<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("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<LLSaveNotecardInfo*>(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<LLViewerTextEditor>("Notecard Editor");
if (editor)
if (LLViewerTextEditor* editor = info->mSelf->findChild<LLViewerTextEditor>("Notecard Editor"))
{
editor->copyInventory(info->mCopyItem);
}
@@ -741,10 +735,10 @@ void LLPreviewNotecard::saveAs_continued(AIFilePicker* filepicker)
if (!filepicker->hasFilename())
return;
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
return findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
LLFloaterSearchReplace::show(editor);
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
LLFloaterSearchReplace::show(editor);
}
// static
void LLPreviewNotecard::onUndoMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->undo();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->undo();
}
// static
void LLPreviewNotecard::onRedoMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->redo();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->redo();
}
// static
void LLPreviewNotecard::onCutMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->cut();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->cut();
}
// static
void LLPreviewNotecard::onCopyMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->copy();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->copy();
}
// static
void LLPreviewNotecard::onPasteMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->paste();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->paste();
}
// static
void LLPreviewNotecard::onSelectAllMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->selectAll();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->selectAll();
}
// static
void LLPreviewNotecard::onDeselectMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->deselect();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->deselect();
}
// static
BOOL LLPreviewNotecard::enableUndoMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canUndo();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canRedo();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canCut();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canCopy();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canPaste();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canSelectAll();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("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<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canDeselect();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canDeselect();
return false;
}
// EOF

View File

@@ -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" />
<check_box name="filter_gaming" label="Hide Gaming" control_name="FilterGamingGroups" follows="right|top" bottom="-46" left_delta="110"/>
<scroll_list background_visible="true" bottom="-513" column_padding="0" draw_border="true"
draw_heading="true"
follows="left|top|right|bottom" height="464" left="4" mouse_opaque="true"

View File

@@ -103,9 +103,9 @@ vote on open proposals, and view old proposals.
mouse_opaque="true" name="majority"
text_disabled_color="0.67647, 0.76275, 0.93529, 0.45"
tool_tip="Majority of total votes needed to win." width="107">
Simple Majority
2/3 Majority
Unanimous
<radio_item follows="all" bottom="-18" left_delta="2">Simple Majority</radio_item>
<radio_item follows="all" bottom_delta="-9">2/3 Majority</radio_item>
<radio_item follows="all" bottom_delta="-10">Unanimous</radio_item>
</radio_group>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-72" drop_shadow_visible="true" follows="left|top"