master
Eli Linden 2010-03-05 11:08:30 -08:00
commit 5eb5602220
20 changed files with 273 additions and 74 deletions

View File

@ -65,6 +65,27 @@ LLWorkerThread::~LLWorkerThread()
// ~LLQueuedThread() will be called here
}
//called only in destructor.
void LLWorkerThread::clearDeleteList()
{
// Delete any workers in the delete queue (should be safe - had better be!)
if (!mDeleteList.empty())
{
llwarns << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size()
<< " entries in delete list." << llendl;
mDeleteMutex->lock();
for (delete_list_t::iterator iter = mDeleteList.begin(); iter != mDeleteList.end(); ++iter)
{
(*iter)->mRequestHandle = LLWorkerThread::nullHandle();
(*iter)->clearFlags(LLWorkerClass::WCF_HAVE_WORK);
delete *iter ;
}
mDeleteList.clear() ;
mDeleteMutex->unlock() ;
}
}
// virtual
S32 LLWorkerThread::update(U32 max_time_ms)
{
@ -320,7 +341,20 @@ bool LLWorkerClass::checkWork(bool aborting)
if (mRequestHandle != LLWorkerThread::nullHandle())
{
LLWorkerThread::WorkRequest* workreq = (LLWorkerThread::WorkRequest*)mWorkerThread->getRequest(mRequestHandle);
llassert_always(workreq);
if(!workreq)
{
if(mWorkerThread->isQuitting() || mWorkerThread->isStopped()) //the mWorkerThread is not running
{
mRequestHandle = LLWorkerThread::nullHandle();
clearFlags(WCF_HAVE_WORK);
return true ;
}
else
{
llassert_always(workreq);
}
}
LLQueuedThread::status_t status = workreq->getStatus();
if (status == LLWorkerThread::STATUS_ABORTED)
{

View File

@ -80,6 +80,9 @@ public:
S32 mParam;
};
protected:
void clearDeleteList() ;
private:
typedef std::list<LLWorkerClass*> delete_list_t;
delete_list_t mDeleteList;

View File

@ -216,6 +216,7 @@ public:
void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
void setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
LLPointer<LLUIImage> getImageOverlay() { return mImageOverlay; }
LLFontGL::HAlign getImageOverlayHAlign() const { return mImageOverlayAlignment; }
void autoResize(); // resize with label of current btn state
void resize(LLUIString label); // resize with label input

View File

@ -703,19 +703,12 @@ void LLComboBox::onListMouseUp()
void LLComboBox::onItemSelected(const LLSD& data)
{
const std::string name = mList->getSelectedItemLabel();
setValue(data);
S32 cur_id = getCurrentIndex();
mLastSelectedIndex = cur_id;
if (cur_id != -1)
if (mAllowTextEntry && mLastSelectedIndex != -1)
{
setLabel(name);
if (mAllowTextEntry)
{
gFocusMgr.setKeyboardFocus(mTextEntry);
mTextEntry->selectAll();
}
gFocusMgr.setKeyboardFocus(mTextEntry);
mTextEntry->selectAll();
}
// hiding the list reasserts the old value stored in the text editor/dropdown button
@ -1069,3 +1062,33 @@ BOOL LLComboBox::selectItemRange( S32 first, S32 last )
{
return mList->selectItemRange(first, last);
}
static LLDefaultChildRegistry::Register<LLIconsComboBox> register_icons_combo_box("icons_combo_box");
LLIconsComboBox::Params::Params()
: icon_column("icon_column", ICON_COLUMN),
label_column("label_column", LABEL_COLUMN)
{}
LLIconsComboBox::LLIconsComboBox(const LLIconsComboBox::Params& p)
: LLComboBox(p),
mIconColumnIndex(p.icon_column),
mLabelColumnIndex(p.label_column)
{}
void LLIconsComboBox::setValue(const LLSD& value)
{
BOOL found = mList->selectByValue(value);
if (found)
{
LLScrollListItem* item = mList->getFirstSelected();
if (item)
{
mButton->setImageOverlay(mList->getSelectedItemLabel(mIconColumnIndex), mButton->getImageOverlayHAlign());
setLabel(mList->getSelectedItemLabel(mLabelColumnIndex));
}
mLastSelectedIndex = mList->getFirstSelectedIndex();
}
}

View File

@ -221,6 +221,7 @@ protected:
LLPointer<LLUIImage> mArrowImage;
LLUIString mLabel;
BOOL mHasAutocompletedText;
S32 mLastSelectedIndex;
private:
BOOL mAllowTextEntry;
@ -230,6 +231,36 @@ private:
commit_callback_t mPrearrangeCallback;
commit_callback_t mTextEntryCallback;
commit_callback_t mSelectionCallback;
S32 mLastSelectedIndex;
};
// A combo box with icons for the list of items.
class LLIconsComboBox
: public LLComboBox
{
public:
struct Params
: public LLInitParam::Block<Params, LLComboBox::Params>
{
Optional<S32> icon_column,
label_column;
Params();
};
/*virtual*/ void setValue(const LLSD& value);
private:
enum EColumnIndex
{
ICON_COLUMN = 0,
LABEL_COLUMN
};
friend class LLUICtrlFactory;
LLIconsComboBox(const Params&);
virtual ~LLIconsComboBox() {};
S32 mIconColumnIndex;
S32 mLabelColumnIndex;
};
#endif

View File

@ -630,7 +630,9 @@ void LLScrollListCtrl::calcColumnWidths()
LLScrollListCell* cellp = (*iter)->getColumn(column->mIndex);
if (!cellp) continue;
column->mMaxContentWidth = llmax(LLFontGL::getFontSansSerifSmall()->getWidth(cellp->getValue().asString()) + mColumnPadding + COLUMN_TEXT_PADDING, column->mMaxContentWidth);
// get text value width only for text cells
column->mMaxContentWidth = cellp->isText() ?
llmax(LLFontGL::getFontSansSerifSmall()->getWidth(cellp->getValue().asString()) + mColumnPadding + COLUMN_TEXT_PADDING, column->mMaxContentWidth) : column->mMaxContentWidth;
}
max_item_width += column->mMaxContentWidth;

View File

@ -4334,7 +4334,7 @@
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>home</string>
<string>last</string>
</map>
<key>LoginPage</key>
<map>

View File

@ -5845,15 +5845,22 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
mesgsys->getUUIDFast(_PREHASH_WearableData, _PREHASH_TextureID, texture_id, texture_block);
mesgsys->getU8Fast(_PREHASH_WearableData, _PREHASH_TextureIndex, texture_index, texture_block);
if (texture_id.notNull()
&& (S32)texture_index < BAKED_NUM_INDICES
if ((S32)texture_index < BAKED_NUM_INDICES
&& gAgentQueryManager.mActiveCacheQueries[texture_index] == query_id)
{
//llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl;
avatarp->setCachedBakedTexture(LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)texture_index), texture_id);
//avatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id );
gAgentQueryManager.mActiveCacheQueries[texture_index] = 0;
num_results++;
if (texture_id.notNull())
{
//llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl;
avatarp->setCachedBakedTexture(LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)texture_index), texture_id);
//avatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id );
gAgentQueryManager.mActiveCacheQueries[texture_index] = 0;
num_results++;
}
else
{
// no cache of this bake. request upload.
avatarp->requestLayerSetUpload((EBakedTextureIndex)texture_index);
}
}
}

View File

@ -1516,7 +1516,7 @@ bool LLAppViewer::cleanup()
LLAvatarIconIDCache::getInstance()->save();
llinfos << "Shutting down Threads" << llendflush;
// Let threads finish
LLTimer idleTimer;
idleTimer.reset();
@ -1530,19 +1530,26 @@ bool LLAppViewer::cleanup()
pending += LLVFSThread::updateClass(0);
pending += LLLFSThread::updateClass(0);
F64 idle_time = idleTimer.getElapsedTimeF64();
if (!pending || idle_time >= max_idle_time)
if(!pending)
{
break ; //done
}
else if(idle_time >= max_idle_time)
{
llwarns << "Quitting with pending background tasks." << llendl;
break;
}
}
// Delete workers first
// shotdown all worker threads before deleting them in case of co-dependencies
sTextureCache->shutdown();
sTextureFetch->shutdown();
sImageDecodeThread->shutdown();
sTextureFetch->shutDownTextureCacheThread() ;
sTextureFetch->shutDownImageDecodeThread() ;
delete sTextureCache;
sTextureCache = NULL;
delete sTextureFetch;

View File

@ -242,6 +242,12 @@ void LLFloaterMediaSettings::onBtnApply( void* userdata )
sInstance->commitFields();
sInstance->apply();
sInstance->mInitialValues.clear();
sInstance->mPanelMediaSettingsGeneral->getValues( sInstance->mInitialValues );
sInstance->mPanelMediaSettingsSecurity->getValues( sInstance->mInitialValues );
sInstance->mPanelMediaSettingsPermissions->getValues( sInstance->mInitialValues );
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -537,10 +537,10 @@ void LLFloaterPreference::onOpen(const LLSD& key)
{
childSetText("maturity_desired_textbox", maturity_combo->getSelectedItemLabel());
childSetVisible("maturity_desired_combobox", false);
// Display selected maturity icons.
onChangeMaturity();
}
// Display selected maturity icons.
onChangeMaturity();
// Enabled/disabled popups, might have been changed by user actions
// while preferences floater was closed.

View File

@ -1299,7 +1299,10 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t
bool mature = is_cf_mature(c_info->flags);
childSetValue("content_type", mature ? mature_str : pg_str);
childSetValue("auto_renew", is_cf_auto_renew(c_info->flags));
std::string auto_renew_str = is_cf_auto_renew(c_info->flags) ?
getString("auto_renew_on") : getString("auto_renew_off");
childSetValue("auto_renew", auto_renew_str);
price_str.setArg("[PRICE]", llformat("%d", c_info->price_for_listing));
childSetValue("price_for_listing", LLSD(price_str));
@ -1321,8 +1324,12 @@ void LLPanelClassifiedInfo::resetData()
setClassifiedId(LLUUID::null);
setSnapshotId(LLUUID::null);
mPosGlobal.clearVec();
childSetValue("category", LLStringUtil::null);
childSetValue("content_type", LLStringUtil::null);
childSetText("category", LLStringUtil::null);
childSetText("content_type", LLStringUtil::null);
childSetText("click_through_text", LLStringUtil::null);
childSetText("price_for_listing", LLStringUtil::null);
childSetText("auto_renew", LLStringUtil::null);
childSetText("creation_date", LLStringUtil::null);
childSetText("click_through_text", LLStringUtil::null);
}
@ -1689,7 +1696,8 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t
setPosGlobal(c_info->pos_global);
setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global));
getChild<LLComboBox>("category")->setCurrentByIndex(c_info->category + 1);
// *HACK see LLPanelClassifiedEdit::sendUpdate()
getChild<LLComboBox>("category")->setCurrentByIndex(c_info->category - 1);
getChild<LLComboBox>("category")->resetDirty();
bool mature = is_cf_mature(c_info->flags);
@ -1698,6 +1706,7 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t
getChild<LLComboBox>("content_type")->setCurrentByIndex(mature ? CB_ITEM_MATURE : CB_ITEM_PG);
childSetValue("auto_renew", auto_renew);
childSetValue("price_for_listing", c_info->price_for_listing);
childSetEnabled("price_for_listing", isNew());
resetDirty();
setInfoLoaded(true);
@ -1756,6 +1765,7 @@ void LLPanelClassifiedEdit::resetControls()
getChild<LLComboBox>("content_type")->setCurrentByIndex(0);
childSetValue("auto_renew", false);
childSetValue("price_for_listing", MINIMUM_PRICE_FOR_LISTING);
childSetEnabled("price_for_listing", TRUE);
}
bool LLPanelClassifiedEdit::canClose()
@ -1792,7 +1802,9 @@ void LLPanelClassifiedEdit::sendUpdate()
c_data.agent_id = gAgent.getID();
c_data.classified_id = getClassifiedId();
c_data.category = getCategory();
// *HACK
// Categories on server start with 1 while combo-box index starts with 0
c_data.category = getCategory() + 1;
c_data.name = getClassifiedName();
c_data.description = getDescription();
c_data.parcel_id = getParcelId();
@ -1807,7 +1819,7 @@ void LLPanelClassifiedEdit::sendUpdate()
U32 LLPanelClassifiedEdit::getCategory()
{
LLComboBox* cat_cb = getChild<LLComboBox>("category");
return cat_cb->getCurrentIndex() + 1;
return cat_cb->getCurrentIndex();
}
U8 LLPanelClassifiedEdit::getFlags()

View File

@ -750,6 +750,7 @@ LLTextureCache::LLTextureCache(bool threaded)
LLTextureCache::~LLTextureCache()
{
clearDeleteList() ;
}
//////////////////////////////////////////////////////////////////////////////
@ -1574,6 +1575,11 @@ bool LLTextureCache::readComplete(handle_t handle, bool abort)
{
worker = iter->second;
complete = worker->complete();
if(!complete && abort)
{
abortRequest(handle, true) ;
}
}
if (worker && (complete || abort))
{

View File

@ -431,11 +431,11 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
// << " Desired=" << mDesiredDiscard << llendl;
llassert_always(!haveWork());
lockWorkMutex();
if (mCacheReadHandle != LLTextureCache::nullHandle())
if (mCacheReadHandle != LLTextureCache::nullHandle() && mFetcher->mTextureCache)
{
mFetcher->mTextureCache->readComplete(mCacheReadHandle, true);
}
if (mCacheWriteHandle != LLTextureCache::nullHandle())
if (mCacheWriteHandle != LLTextureCache::nullHandle() && mFetcher->mTextureCache)
{
mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true);
}
@ -1429,6 +1429,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
LLTextureFetch::~LLTextureFetch()
{
clearDeleteList() ;
// ~LLQueuedThread() called here
}
@ -1737,6 +1739,26 @@ S32 LLTextureFetch::update(U32 max_time_ms)
return res;
}
//called in the MAIN thread after the TextureCacheThread shuts down.
void LLTextureFetch::shutDownTextureCacheThread()
{
if(mTextureCache)
{
llassert_always(mTextureCache->isQuitting() || mTextureCache->isStopped()) ;
mTextureCache = NULL ;
}
}
//called in the MAIN thread after the ImageDecodeThread shuts down.
void LLTextureFetch::shutDownImageDecodeThread()
{
if(mImageDecodeThread)
{
llassert_always(mImageDecodeThread->isQuitting() || mImageDecodeThread->isStopped()) ;
mImageDecodeThread = NULL ;
}
}
// WORKER THREAD
void LLTextureFetch::startThread()
{

View File

@ -58,6 +58,8 @@ public:
~LLTextureFetch();
/*virtual*/ S32 update(U32 max_time_ms);
void shutDownTextureCacheThread() ; //called in the main thread after the TextureCacheThread shuts down.
void shutDownImageDecodeThread() ; //called in the main thread after the ImageDecodeThread shuts down.
bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
S32 w, S32 h, S32 c, S32 discard, bool needs_aux);

View File

@ -1292,19 +1292,23 @@ BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32
}
//-----------------------------------------------------------------------------
// virtual
// requestLayerSetUploads()
//-----------------------------------------------------------------------------
void LLVOAvatarSelf::requestLayerSetUploads()
{
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex;
BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index));
if (!layer_baked && mBakedTextureDatas[i].mTexLayerSet)
{
mBakedTextureDatas[i].mTexLayerSet->requestUpload();
}
requestLayerSetUpload((EBakedTextureIndex)i);
}
}
void LLVOAvatarSelf::requestLayerSetUpload(LLVOAvatarDefines::EBakedTextureIndex i)
{
ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex;
bool layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index));
if (!layer_baked && mBakedTextureDatas[i].mTexLayerSet)
{
mBakedTextureDatas[i].mTexLayerSet->requestUpload();
}
}

View File

@ -222,6 +222,7 @@ protected:
//--------------------------------------------------------------------
public:
void requestLayerSetUploads();
void requestLayerSetUpload(LLVOAvatarDefines::EBakedTextureIndex i);
void requestLayerSetUpdate(LLVOAvatarDefines::ETextureIndex i);
LLTexLayerSet* getLayerSet(LLVOAvatarDefines::ETextureIndex index) const;

View File

@ -29,6 +29,14 @@
<panel.string
name="date_fmt">
[mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt]
</panel.string>
<panel.string
name="auto_renew_on">
Enabled
</panel.string>
<panel.string
name="auto_renew_off">
Disabled
</panel.string>
<button
follows="top|right"
@ -127,7 +135,7 @@
bg_visible="false"
follows="left|top"
h_pad="0"
height="25"
height="30"
layout="topleft"
left="10"
name="classified_location"
@ -246,21 +254,21 @@
animate="false"
name="descr_stack"
layout="topleft"
follows="top|left"
follows="all"
orientation="vertical"
left="10"
top_pad="5"
width="290"
height="250">
height="215">
<layout_panel
auto_resize="false"
name="clickthrough_layout_panel"
layout="topleft"
follows="top|left"
follows="all"
left="0"
top="0"
width="290"
height="26"
height="16"
user_resize="false">
<text
follows="left|top"
@ -294,28 +302,37 @@
auto_resize="false"
name="price_layout_panel"
layout="topleft"
follows="top|left"
follows="all"
left="0"
top="0"
width="290"
height="26"
height="16"
user_resize="false">
<check_box
enabled="false"
<text
follows="left|top"
font.style="BOLD"
height="10"
layout="topleft"
left="0"
name="auto_renew_label"
text_color="white"
top="0"
value="Auto renew:"
width="140" />
<text
height="16"
label="Auto renew each week"
layout="topleft"
follows="top|left"
left="0"
left_pad="0"
name="auto_renew"
top="0"
v_pad="0"
width="290" />
top_pad="-10"
value="Enabled"
width="150" />
</layout_panel>
<layout_panel
name="descr_layout_panel"
layout="topleft"
follows="top|left"
follows="all"
left="0"
top="0"
width="290"
@ -337,7 +354,7 @@
allow_html="true"
allow_scroll="true"
bg_visible="false"
follows="left|top|right"
follows="all"
h_pad="0"
height="200"
layout="topleft"
@ -345,8 +362,8 @@
max_length="1023"
name="classified_desc"
read_only="true"
top_pad="5"
width="290"
top_pad="7"
width="280"
v_pad="0"
value="[description]"
word_wrap="true" />

View File

@ -171,27 +171,48 @@
width="100">
Rating:
</text>
<combo_box
<icons_combo_box
follows="left|top"
height="20"
label="Moderate"
layout="topleft"
left_delta="100"
name="access_combo"
top_delta="0"
width="85">
<combo_box.item
width="105">
<icons_combo_box.drop_down_button
image_overlay="Parcel_M_Light"
image_overlay_alignment="left"
imgoverlay_label_space="3"
pad_left="3"/>
<icons_combo_box.item
label="Adult"
name="Adult"
value="42" />
<combo_box.item
value="42">
<item.columns
halign="center"
type="icon"
value="Parcel_R_Light"
width="20"/>
</icons_combo_box.item>
<icons_combo_box.item
label="Moderate"
name="Mature"
value="21" />
<combo_box.item
value="21">
<item.columns
halign="center"
type="icon"
value="Parcel_M_Light"
width="20"/>
</icons_combo_box.item>
<icons_combo_box.item
label="General"
name="PG"
value="13" />
</combo_box>
value="13">
<item.columns
halign="center"
type="icon"
value="Parcel_PG_Light"
width="20"/>
</icons_combo_box.item>
</icons_combo_box>
<button
enabled="false"
follows="left|top"

View File

@ -21,7 +21,7 @@
<panel.string name="buycurrencylabel">
[AMT] L$
</panel.string>
<button label="" label_selected="" name="buycurrency" tool_tip="Mon solde"/>
<button label="" label_selected="" name="buycurrency" right="-250" tool_tip="Mon solde"/>
<button label="Acheter" name="buyL" tool_tip="Cliquez pour acheter plus de L$"/>
<text name="TimeText" tool_tip="Heure actuelle (Pacifique)">
00h00 PST