Fix Issue 1413: Local Texture Default Texture Update Settings, Also fix the side issue of the More section not having visible ui at first.

Also I got fed up with the bad code and leaks so I did some refactoring of floaterlocalassetbrowse.*, but just a bit.
This commit is contained in:
Inusaito Sayori
2014-03-27 21:33:21 -04:00
parent 70e92a1cea
commit 039be1f8e9
3 changed files with 289 additions and 390 deletions

View File

@@ -1017,6 +1017,17 @@ Found in Advanced->Rendering->Info Displays</string>
<key>Value</key> <key>Value</key>
<boolean>1</boolean> <boolean>1</boolean>
</map> </map>
<key>LocalBitmapUpdate</key>
<map>
<key>Comment</key>
<string>Default setting for whether local textures should update or not upon change, changed by toggling on or off.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>InstantMessageLogPathAnyAccount</key> <key>InstantMessageLogPathAnyAccount</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -72,6 +72,8 @@ this feature is still a work in progress.
#include "llvovolume.h" #include "llvovolume.h"
#include "llface.h" #include "llface.h"
/* static pointer to self, wai? oh well. */
static FloaterLocalAssetBrowser* sLFInstance = NULL;
/*=======================================*/ /*=======================================*/
/* Instantiating manager class */ /* Instantiating manager class */
@@ -79,7 +81,7 @@ this feature is still a work in progress.
/*=======================================*/ /*=======================================*/
LocalAssetBrowser* gLocalBrowser; LocalAssetBrowser* gLocalBrowser;
LocalAssetBrowserTimer* gLocalBrowserTimer; LocalAssetBrowserTimer* gLocalBrowserTimer;
std::vector<LocalBitmap*> LocalAssetBrowser::loaded_bitmaps; std::vector<LocalBitmap> LocalAssetBrowser::loaded_bitmaps;
bool LocalAssetBrowser::mLayerUpdated; bool LocalAssetBrowser::mLayerUpdated;
bool LocalAssetBrowser::mSculptUpdated; bool LocalAssetBrowser::mSculptUpdated;
@@ -93,43 +95,43 @@ bool LocalAssetBrowser::mSculptUpdated;
LocalBitmap::LocalBitmap(std::string fullpath) LocalBitmap::LocalBitmap(std::string fullpath)
{ {
this->valid = false; valid = false;
if ( gDirUtilp->fileExists(fullpath) ) if ( gDirUtilp->fileExists(fullpath) )
{ {
/* taking care of basic properties */ /* taking care of basic properties */
this->id.generate(); id.generate();
this->filename = fullpath; filename = fullpath;
this->linkstatus = LINK_OFF; keep_updating = gSavedSettings.getBOOL("LocalBitmapUpdate");
this->keep_updating = false; linkstatus = keep_updating ? LINK_ON : LINK_OFF;
this->shortname = gDirUtilp->getBaseFileName(this->filename, true); shortname = gDirUtilp->getBaseFileName(filename, true);
this->bitmap_type = TYPE_TEXTURE; bitmap_type = TYPE_TEXTURE;
this->sculpt_dirty = false; sculpt_dirty = false;
this->volume_dirty = false; volume_dirty = false;
this->valid = false; valid = false;
/* taking care of extension type now to avoid switch madness */ /* taking care of extension type now to avoid switch madness */
std::string temp_exten = gDirUtilp->getExtension(this->filename); std::string temp_exten = gDirUtilp->getExtension(filename);
if (temp_exten == "bmp") { this->extension = IMG_EXTEN_BMP; } if (temp_exten == "bmp") extension = IMG_EXTEN_BMP;
else if (temp_exten == "tga") { this->extension = IMG_EXTEN_TGA; } else if (temp_exten == "tga") extension = IMG_EXTEN_TGA;
else if (temp_exten == "jpg" || temp_exten == "jpeg") { this->extension = IMG_EXTEN_JPG; } else if (temp_exten == "jpg" || temp_exten == "jpeg") extension = IMG_EXTEN_JPG;
else if (temp_exten == "png") { this->extension = IMG_EXTEN_PNG; } else if (temp_exten == "png") extension = IMG_EXTEN_PNG;
else { return; } // no valid extension. else return; // no valid extension.
/* getting file's last modified */ /* getting file's last modified */
llstat temp_stat; llstat temp_stat;
LLFile::stat(this->filename, &temp_stat); LLFile::stat(filename, &temp_stat);
std::time_t time = temp_stat.st_mtime; std::time_t time = temp_stat.st_mtime;
this->last_modified = asctime( localtime(&time) ); last_modified = asctime( localtime(&time) );
/* checking if the bitmap is valid && decoding if it is */ /* checking if the bitmap is valid && decoding if it is */
LLImageRaw* raw_image = new LLImageRaw(); LLPointer<LLImageRaw> raw_image = new LLImageRaw;
if ( this->decodeSelf(raw_image) ) if (decodeSelf(raw_image))
{ {
/* creating a shell LLViewerTexture and fusing raw image into it */ /* creating a shell LLViewerTexture and fusing raw image into it */
LLViewerFetchedTexture* viewer_image = new LLViewerFetchedTexture( "file://"+this->filename, this->id, LOCAL_USE_MIPMAPS ); LLViewerFetchedTexture* viewer_image = new LLViewerFetchedTexture( "file://"+filename, id, LOCAL_USE_MIPMAPS );
viewer_image->createGLTexture( LOCAL_DISCARD_LEVEL, raw_image ); viewer_image->createGLTexture( LOCAL_DISCARD_LEVEL, raw_image );
viewer_image->setCachedRawImage(-1,raw_image); viewer_image->setCachedRawImage(-1,raw_image);
@@ -140,7 +142,7 @@ LocalBitmap::LocalBitmap(std::string fullpath)
gTextureList.addImage(viewer_image); gTextureList.addImage(viewer_image);
/* filename is valid, bitmap is decoded and valid, i can haz liftoff! */ /* filename is valid, bitmap is decoded and valid, i can haz liftoff! */
this->valid = true; valid = true;
} }
} }
} }
@@ -152,60 +154,64 @@ LocalBitmap::~LocalBitmap()
/* [maintenence functions] */ /* [maintenence functions] */
void LocalBitmap::updateSelf() void LocalBitmap::updateSelf()
{ {
if ( this->linkstatus == LINK_ON || this->linkstatus == LINK_UPDATING ) if (linkstatus == LINK_ON || linkstatus == LINK_UPDATING)
{ {
/* making sure file still exists */ /* making sure file still exists */
if ( !gDirUtilp->fileExists(this->filename) ) { this->linkstatus = LINK_BROKEN; return; } if (!gDirUtilp->fileExists(filename))
{
linkstatus = LINK_BROKEN;
return;
}
/* exists, let's check if it's lastmod has changed */ /* exists, let's check if it's lastmod has changed */
llstat temp_stat; llstat temp_stat;
LLFile::stat(this->filename, &temp_stat); LLFile::stat(filename, &temp_stat);
std::time_t temp_time = temp_stat.st_mtime; std::time_t temp_time = temp_stat.st_mtime;
LLSD new_last_modified = asctime( localtime(&temp_time) ); LLSD new_last_modified = asctime( localtime(&temp_time) );
if ( this->last_modified.asString() == new_last_modified.asString() ) { return; } if (last_modified.asString() == new_last_modified.asString()) return;
/* here we update the image */ /* here we update the image */
LLImageRaw* new_imgraw = new LLImageRaw(); LLPointer<LLImageRaw> new_imgraw = new LLImageRaw;
if (!decodeSelf(new_imgraw))
if ( !decodeSelf(new_imgraw) ) { this->linkstatus = LINK_UPDATING; return; } {
else { this->linkstatus = LINK_ON; } linkstatus = LINK_UPDATING;
return;
LLViewerFetchedTexture* image = gTextureList.findImage(this->id); }
if (!image->forSculpt())
{ image->createGLTexture( LOCAL_DISCARD_LEVEL, new_imgraw ); }
else else
{ image->setCachedRawImage(-1,new_imgraw); } {
linkstatus = LINK_ON;
}
LLViewerFetchedTexture* image = gTextureList.findImage(id);
if (!image->forSculpt())
image->createGLTexture(LOCAL_DISCARD_LEVEL, new_imgraw);
else
image->setCachedRawImage(-1,new_imgraw);
/* finalizing by updating lastmod to current */ /* finalizing by updating lastmod to current */
this->last_modified = new_last_modified; last_modified = new_last_modified;
/* setting unit property to reflect that it has been changed */ /* setting unit property to reflect that it has been changed */
switch (this->bitmap_type) switch (bitmap_type)
{ {
case TYPE_TEXTURE:
{ break; }
case TYPE_SCULPT: case TYPE_SCULPT:
{ {
/* sets a bool to run through all visible sculpts in one go, and update the ones necessary. */ /* sets a bool to run through all visible sculpts in one go, and update the ones necessary. */
this->sculpt_dirty = true; sculpt_dirty = true;
this->volume_dirty = true; volume_dirty = true;
gLocalBrowser->setSculptUpdated( true ); gLocalBrowser->setSculptUpdated( true );
break; break;
} }
case TYPE_LAYER: case TYPE_LAYER:
{ {
/* sets a bool to rebake layers after the iteration is done with */ /* sets a bool to rebake layers after the iteration is done with */
gLocalBrowser->setLayerUpdated( true ); gLocalBrowser->setLayerUpdated( true );
break; break;
} }
case TYPE_TEXTURE:
default: default:
{ break; } break;
} }
} }
@@ -213,51 +219,47 @@ void LocalBitmap::updateSelf()
bool LocalBitmap::decodeSelf(LLImageRaw* rawimg) bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
{ {
switch (this->extension) switch (extension)
{ {
case IMG_EXTEN_BMP: case IMG_EXTEN_BMP:
{ {
LLPointer<LLImageBMP> bmp_image = new LLImageBMP; LLPointer<LLImageBMP> bmp_image = new LLImageBMP;
if ( !bmp_image->load(filename) ) { break; } if (!bmp_image->load(filename)) break;
if ( !bmp_image->decode(rawimg, 0.0f) ) { break; } if (!bmp_image->decode(rawimg, 0.0f)) break;
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
rawimg->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
return true;
}
case IMG_EXTEN_TGA: case IMG_EXTEN_TGA:
{ {
LLPointer<LLImageTGA> tga_image = new LLImageTGA; LLPointer<LLImageTGA> tga_image = new LLImageTGA;
if ( !tga_image->load(filename) ) { break; } if (!tga_image->load(filename)) break;
if ( !tga_image->decode(rawimg) ) { break; } if (!tga_image->decode(rawimg)) break;
if (( tga_image->getComponents() != 3) &&
if( ( tga_image->getComponents() != 3) && ( tga_image->getComponents() != 4) )
( tga_image->getComponents() != 4) ) { break; } break;
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
rawimg->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
return true;
}
case IMG_EXTEN_JPG: case IMG_EXTEN_JPG:
{ {
LLPointer<LLImageJPEG> jpeg_image = new LLImageJPEG; LLPointer<LLImageJPEG> jpeg_image = new LLImageJPEG;
if ( !jpeg_image->load(filename) ) { break; } if (!jpeg_image->load(filename)) break;
if ( !jpeg_image->decode(rawimg, 0.0f) ) { break; } if (!jpeg_image->decode(rawimg, 0.0f)) break;
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
rawimg->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
return true;
}
case IMG_EXTEN_PNG: case IMG_EXTEN_PNG:
{ {
LLPointer<LLImagePNG> png_image = new LLImagePNG; LLPointer<LLImagePNG> png_image = new LLImagePNG;
if ( !png_image->load(filename) ) { break; } if ( !png_image->load(filename) ) break;
if ( !png_image->decode(rawimg, 0.0f) ) { break; } if ( !png_image->decode(rawimg, 0.0f) ) break;
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
rawimg->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
return true;
}
default: default:
break; break;
} }
@@ -266,54 +268,55 @@ bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
void LocalBitmap::setUpdateBool() void LocalBitmap::setUpdateBool()
{ {
if ( this->linkstatus != LINK_BROKEN ) if (linkstatus != LINK_BROKEN)
{ {
if ( !this->keep_updating ) if (!keep_updating)
{ {
this->linkstatus = LINK_ON; linkstatus = LINK_ON;
this->keep_updating = true; keep_updating = true;
} }
else else
{ {
this->linkstatus = LINK_OFF; linkstatus = LINK_OFF;
this->keep_updating = false; keep_updating = false;
} }
} }
else else
{ {
this->keep_updating = false; keep_updating = false;
} }
gSavedSettings.setBOOL("LocalBitmapUpdate", keep_updating);
} }
void LocalBitmap::setType( S32 type ) void LocalBitmap::setType( S32 type )
{ {
this->bitmap_type = type; bitmap_type = type;
} }
/* [information query functions] */ /* [information query functions] */
std::string LocalBitmap::getShortName() std::string LocalBitmap::getShortName()
{ {
return this->shortname; return shortname;
} }
std::string LocalBitmap::getFileName() std::string LocalBitmap::getFileName()
{ {
return this->filename; return filename;
} }
LLUUID LocalBitmap::getID() LLUUID LocalBitmap::getID()
{ {
return this->id; return id;
} }
LLSD LocalBitmap::getLastModified() LLSD LocalBitmap::getLastModified()
{ {
return this->last_modified; return last_modified;
} }
std::string LocalBitmap::getLinkStatus() std::string LocalBitmap::getLinkStatus()
{ {
switch(this->linkstatus) switch(linkstatus)
{ {
case LINK_ON: case LINK_ON:
return "On"; return "On";
@@ -334,22 +337,17 @@ std::string LocalBitmap::getLinkStatus()
bool LocalBitmap::getUpdateBool() bool LocalBitmap::getUpdateBool()
{ {
return this->keep_updating; return keep_updating;
} }
bool LocalBitmap::getIfValidBool() bool LocalBitmap::getIfValidBool()
{ {
return this->valid; return valid;
}
LocalBitmap* LocalBitmap::getThis()
{
return this;
} }
S32 LocalBitmap::getType() S32 LocalBitmap::getType()
{ {
return this->bitmap_type; return bitmap_type;
} }
std::vector<LLFace*> LocalBitmap::getFaceUsesThis(LLDrawable* drawable) std::vector<LLFace*> LocalBitmap::getFaceUsesThis(LLDrawable* drawable)
@@ -360,8 +358,8 @@ std::vector<LLFace*> LocalBitmap::getFaceUsesThis(LLDrawable* drawable)
{ {
LLFace* newface = drawable->getFace(face_iter); LLFace* newface = drawable->getFace(face_iter);
if ( this->id == newface->getTexture()->getID() ) if (id == newface->getTexture()->getID())
{ matching_faces.push_back(newface); } matching_faces.push_back(newface);
} }
return matching_faces; return matching_faces;
@@ -389,10 +387,10 @@ std::vector<affected_object> LocalBitmap::getUsingObjects(bool seek_by_type, boo
if ( obj && obj->mDrawable ) if ( obj && obj->mDrawable )
{ {
/* looking for textures */ /* looking for textures */
if ( seek_textures || ( seek_by_type && this->bitmap_type == TYPE_TEXTURE ) ) if (seek_textures || (seek_by_type && bitmap_type == TYPE_TEXTURE))
{ {
std::vector<LLFace*> affected_faces = this->getFaceUsesThis( obj->mDrawable ); std::vector<LLFace*> affected_faces = getFaceUsesThis(obj->mDrawable);
if ( !affected_faces.empty() ) if (!affected_faces.empty())
{ {
shell.face_list = affected_faces; shell.face_list = affected_faces;
obj_relevant = true; obj_relevant = true;
@@ -400,22 +398,18 @@ std::vector<affected_object> LocalBitmap::getUsingObjects(bool seek_by_type, boo
} }
/* looking for sculptmaps */ /* looking for sculptmaps */
if ( ( seek_sculptmaps || ( seek_by_type && this->bitmap_type == TYPE_SCULPT ) ) if ((seek_sculptmaps || (seek_by_type && bitmap_type == TYPE_SCULPT))
&& obj->isSculpted() && obj->getVolume() && obj->isSculpted() && obj->getVolume()
&& this->id == obj->getVolume()->getParams().getSculptID() && id == obj->getVolume()->getParams().getSculptID())
)
{ {
shell.local_sculptmap = true; shell.local_sculptmap = true;
obj_relevant = true; obj_relevant = true;
} }
} }
if (obj_relevant) if (obj_relevant) affected_vector.push_back(shell);
{ affected_vector.push_back(shell); }
} }
return affected_vector; return affected_vector;
} }
@@ -423,15 +417,15 @@ void LocalBitmap::getDebugInfo()
{ {
/* debug function: dumps everything human readable into llinfos */ /* debug function: dumps everything human readable into llinfos */
llinfos << "===[local bitmap debug]===" << "\n" llinfos << "===[local bitmap debug]===" << "\n"
<< "path: " << this->filename << "\n" << "path: " << filename << "\n"
<< "name: " << this->shortname << "\n" << "name: " << shortname << "\n"
<< "extension: " << this->extension << "\n" << "extension: " << extension << "\n"
<< "uuid: " << this->id << "\n" << "uuid: " << id << "\n"
<< "last modified: " << this->last_modified << "\n" << "last modified: " << last_modified << "\n"
<< "link status: " << this->getLinkStatus() << "\n" << "link status: " << getLinkStatus() << "\n"
<< "keep updated: " << this->keep_updating << "\n" << "keep updated: " << keep_updating << "\n"
<< "type: " << this->bitmap_type << "\n" << "type: " << bitmap_type << "\n"
<< "is valid: " << this->valid << "\n" << "is valid: " << valid << "\n"
<< "==========================" << llendl; << "==========================" << llendl;
} }
@@ -447,8 +441,8 @@ void LocalBitmap::getDebugInfo()
LocalAssetBrowser::LocalAssetBrowser() LocalAssetBrowser::LocalAssetBrowser()
{ {
this->mLayerUpdated = false; mLayerUpdated = false;
this->mSculptUpdated = false; mSculptUpdated = false;
} }
LocalAssetBrowser::~LocalAssetBrowser() LocalAssetBrowser::~LocalAssetBrowser()
@@ -472,17 +466,15 @@ void LocalAssetBrowser::AddBitmap_continued(AIFilePicker* filepicker)
std::vector<std::string> const& filenames(filepicker->getFilenames()); std::vector<std::string> const& filenames(filepicker->getFilenames());
for(std::vector<std::string>::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) for(std::vector<std::string>::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename)
{ {
LocalBitmap* unit = new LocalBitmap(*filename); LocalBitmap unit(*filename);
if (unit.getIfValidBool())
if ( unit->getIfValidBool() )
{ {
loaded_bitmaps.push_back( unit ); loaded_bitmaps.push_back(unit);
change_happened = true; change_happened = true;
} }
} }
if ( change_happened ) if (change_happened) onChangeHappened();
{ onChangeHappened(); }
} }
void LocalAssetBrowser::DelBitmap( std::vector<LLScrollListItem*> delete_vector, S32 column ) void LocalAssetBrowser::DelBitmap( std::vector<LLScrollListItem*> delete_vector, S32 column )
@@ -498,34 +490,26 @@ void LocalAssetBrowser::DelBitmap( std::vector<LLScrollListItem*> delete_vector,
for (local_list_iter iter = loaded_bitmaps.begin(); for (local_list_iter iter = loaded_bitmaps.begin();
iter != loaded_bitmaps.end();) iter != loaded_bitmaps.end();)
{ {
LocalBitmap* unit = (*iter)->getThis(); if ((*iter).getID() == id)
if ( unit->getID() == id )
{ {
LLViewerFetchedTexture* image = gTextureList.findImage(id); LLViewerFetchedTexture* image = gTextureList.findImage(id);
gTextureList.deleteImage( image ); gTextureList.deleteImage( image );
image->unref(); image->unref();
iter = loaded_bitmaps.erase(iter); iter = loaded_bitmaps.erase(iter);
delete unit;
unit = NULL;
change_happened = true; change_happened = true;
} }
else else
{ iter++; } ++iter;
} }
} }
} }
if ( change_happened ) if (change_happened) onChangeHappened();
{ onChangeHappened(); }
} }
void LocalAssetBrowser::onUpdateBool(LLUUID id) void LocalAssetBrowser::onUpdateBool(LLUUID id)
{ {
LocalBitmap* unit = GetBitmapUnit( id ); if (LocalBitmap* unit = GetBitmapUnit(id))
if ( unit )
{ {
unit->setUpdateBool(); unit->setUpdateBool();
PingTimer(); PingTimer();
@@ -534,32 +518,22 @@ void LocalAssetBrowser::onUpdateBool(LLUUID id)
void LocalAssetBrowser::onSetType(LLUUID id, S32 type) void LocalAssetBrowser::onSetType(LLUUID id, S32 type)
{ {
LocalBitmap* unit = GetBitmapUnit( id ); if (LocalBitmap* unit = GetBitmapUnit(id)) unit->setType(type);
if ( unit )
{ unit->setType(type); }
} }
LocalBitmap* LocalAssetBrowser::GetBitmapUnit(LLUUID id) LocalBitmap* LocalAssetBrowser::GetBitmapUnit(LLUUID id)
{ {
local_list_iter iter = loaded_bitmaps.begin(); for (local_list_iter iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); ++iter)
for (; iter != loaded_bitmaps.end(); iter++) if ((*iter).getID() == id)
{ return &(*iter);
if ( (*iter)->getID() == id )
{
return (*iter)->getThis();
}
}
return NULL; return NULL;
} }
bool LocalAssetBrowser::IsDoingUpdates() bool LocalAssetBrowser::IsDoingUpdates()
{ {
local_list_iter iter = loaded_bitmaps.begin(); for (local_list_iter iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); iter++)
for (; iter != loaded_bitmaps.end(); iter++)
{ {
if ( (*iter)->getUpdateBool() ) if ((*iter).getUpdateBool()) return true; /* if at least one unit in the list needs updates - we need a timer. */
{ return true; } /* if at least one unit in the list needs updates - we need a timer. */
} }
return false; return false;
@@ -572,7 +546,7 @@ bool LocalAssetBrowser::IsDoingUpdates()
void LocalAssetBrowser::onChangeHappened() void LocalAssetBrowser::onChangeHappened()
{ {
/* own floater update */ /* own floater update */
FloaterLocalAssetBrowser::UpdateBitmapScrollList(); if (sLFInstance) sLFInstance->UpdateBitmapScrollList();
/* texturepicker related */ /* texturepicker related */
const LLView::child_list_t* child_list = gFloaterView->getChildList(); const LLView::child_list_t* child_list = gFloaterView->getChildList();
@@ -599,44 +573,37 @@ void LocalAssetBrowser::onChangeHappened()
void LocalAssetBrowser::PingTimer() void LocalAssetBrowser::PingTimer()
{ {
if ( !loaded_bitmaps.empty() && IsDoingUpdates() ) if (!loaded_bitmaps.empty() && IsDoingUpdates())
{ {
if (!gLocalBrowserTimer) if (!gLocalBrowserTimer)
{ gLocalBrowserTimer = new LocalAssetBrowserTimer(); } gLocalBrowserTimer = new LocalAssetBrowserTimer();
if (!gLocalBrowserTimer->isRunning())
if ( !gLocalBrowserTimer->isRunning() ) gLocalBrowserTimer->start();
{ gLocalBrowserTimer->start(); }
} }
else if (gLocalBrowserTimer && gLocalBrowserTimer->isRunning())
else
{ {
if (gLocalBrowserTimer) gLocalBrowserTimer->stop();
{
if ( gLocalBrowserTimer->isRunning() )
{ gLocalBrowserTimer->stop(); }
}
} }
} }
/* This function refills the texture picker floater's scrolllist with the updated contents of bitmaplist */ /* This function refills the texture picker floater's scrolllist with the updated contents of bitmaplist */
void LocalAssetBrowser::UpdateTextureCtrlList(LLScrollListCtrl* ctrl) void LocalAssetBrowser::UpdateTextureCtrlList(LLScrollListCtrl* ctrl)
{ {
if ( ctrl ) // checking again in case called externally for some silly reason. if (ctrl) // checking again in case called externally for some silly reason.
{ {
ctrl->clearRows(); ctrl->clearRows();
if ( !loaded_bitmaps.empty() ) if ( !loaded_bitmaps.empty() )
{ {
local_list_iter iter = loaded_bitmaps.begin(); for (local_list_iter iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); ++iter)
for ( ; iter != loaded_bitmaps.end(); iter++ )
{ {
LLSD element; LLSD element;
element["columns"][0]["column"] = "unit_name"; element["columns"][0]["column"] = "unit_name";
element["columns"][0]["type"] = "text"; element["columns"][0]["type"] = "text";
element["columns"][0]["value"] = (*iter)->shortname; element["columns"][0]["value"] = (*iter).shortname;
element["columns"][1]["column"] = "unit_id_HIDDEN"; element["columns"][1]["column"] = "unit_id_HIDDEN";
element["columns"][1]["type"] = "text"; element["columns"][1]["type"] = "text";
element["columns"][1]["value"] = (*iter)->id; element["columns"][1]["value"] = (*iter).id;
ctrl->addElement(element); ctrl->addElement(element);
} }
@@ -644,73 +611,58 @@ void LocalAssetBrowser::UpdateTextureCtrlList(LLScrollListCtrl* ctrl)
} }
} }
void LocalAssetBrowser::PerformTimedActions(void) void LocalAssetBrowser::PerformTimedActions()
{ {
// perform checking if updates are needed && update if so. // perform checking if updates are needed && update if so.
local_list_iter iter; for (local_list_iter iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); ++iter)
for (iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); iter++)
{ (*iter)->updateSelf(); }
// one or more sculpts have been updated, refreshing them.
if ( mSculptUpdated )
{ {
LocalAssetBrowser::local_list_iter iter; (*iter).updateSelf();
for(iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); iter++) // one or more sculpts have been updated, refreshing them.
if (mSculptUpdated && (*iter).sculpt_dirty)
{ {
if ( (*iter)->sculpt_dirty ) PerformSculptUpdates(*iter);
{ (*iter).sculpt_dirty = false;
PerformSculptUpdates( (*iter)->getThis() );
(*iter)->sculpt_dirty = false;
}
} }
mSculptUpdated = false;
} }
mSculptUpdated = false;
// one of the layer bitmaps has been updated, we need to rebake. // one of the layer bitmaps has been updated, we need to rebake.
if ( mLayerUpdated ) if (mLayerUpdated)
{ {
if (isAgentAvatarValid()) if (isAgentAvatarValid())
{
gAgentAvatarp->forceBakeAllTextures(SLAM_FOR_DEBUG); gAgentAvatarp->forceBakeAllTextures(SLAM_FOR_DEBUG);
}
mLayerUpdated = false; mLayerUpdated = false;
} }
} }
void LocalAssetBrowser::PerformSculptUpdates(LocalBitmap* unit) void LocalAssetBrowser::PerformSculptUpdates(LocalBitmap& unit)
{ {
/* looking for sculptmap using objects only */ /* looking for sculptmap using objects only */
std::vector<affected_object> object_list = unit->getUsingObjects(false, false, true); std::vector<affected_object> object_list = unit.getUsingObjects(false, false, true);
if (object_list.empty()) { return; } if (object_list.empty()) { return; }
for( std::vector<affected_object>::iterator iter = object_list.begin(); for( std::vector<affected_object>::iterator iter = object_list.begin();
iter != object_list.end(); iter++ ) iter != object_list.end(); iter++ )
{ {
affected_object aobj = *iter; affected_object aobj = *iter;
if ( aobj.object ) if (aobj.object)
{ {
if ( !aobj.local_sculptmap ) { continue; } // should never get here. only in case of misuse. if (!aobj.local_sculptmap) continue; // should never get here. only in case of misuse.
// update code [begin] // update code [begin]
if ( unit->volume_dirty ) if (unit.volume_dirty)
{ {
LLImageRaw* rawimage = gTextureList.findImage( unit->getID() )->getCachedRawImage(); LLImageRaw* rawimage = gTextureList.findImage(unit.getID())->getCachedRawImage();
aobj.object->getVolume()->sculpt(rawimage->getWidth(), rawimage->getHeight(), aobj.object->getVolume()->sculpt(rawimage->getWidth(), rawimage->getHeight(), rawimage->getComponents(), rawimage->getData(), 0);
rawimage->getComponents(), rawimage->getData(), 0); unit.volume_dirty = false;
unit->volume_dirty = false;
} }
// tell affected drawable it's got updated // tell affected drawable it's got updated
aobj.object->mDrawable->getVOVolume()->setSculptChanged( true ); aobj.object->mDrawable->getVOVolume()->setSculptChanged(true);
aobj.object->mDrawable->getVOVolume()->markForUpdate( true ); aobj.object->mDrawable->getVOVolume()->markForUpdate(true);
// update code [end] // update code [end]
} }
} }
} }
/*==================================================*/ /*==================================================*/
@@ -722,36 +674,6 @@ void LocalAssetBrowser::PerformSculptUpdates(LocalBitmap* unit)
Destroyed when the floater is closed. Destroyed when the floater is closed.
*/ */
// Floater Globals
FloaterLocalAssetBrowser* FloaterLocalAssetBrowser::sLFInstance = NULL;
// widgets:
LLButton* mAddBtn;
LLButton* mDelBtn;
LLButton* mMoreBtn;
LLButton* mLessBtn;
LLButton* mUploadBtn;
LLScrollListCtrl* mBitmapList;
LLTextureCtrl* mTextureView;
LLCheckBoxCtrl* mUpdateChkBox;
LLLineEditor* mPathTxt;
LLLineEditor* mUUIDTxt;
LLLineEditor* mNameTxt;
LLTextBox* mLinkTxt;
LLTextBox* mTimeTxt;
LLComboBox* mTypeComboBox;
LLTextBox* mCaptionPathTxt;
LLTextBox* mCaptionUUIDTxt;
LLTextBox* mCaptionLinkTxt;
LLTextBox* mCaptionNameTxt;
LLTextBox* mCaptionTimeTxt;
FloaterLocalAssetBrowser::FloaterLocalAssetBrowser() FloaterLocalAssetBrowser::FloaterLocalAssetBrowser()
: LLFloater(std::string("local_bitmap_browser_floater")) : LLFloater(std::string("local_bitmap_browser_floater"))
{ {
@@ -791,12 +713,15 @@ FloaterLocalAssetBrowser::FloaterLocalAssetBrowser()
mDelBtn->setEnabled( false ); mDelBtn->setEnabled( false );
mUploadBtn->setEnabled( false ); mUploadBtn->setEnabled( false );
// Initialize visibility
FloaterResize(true);
// setting button callbacks: // setting button callbacks:
mAddBtn->setClickedCallback( onClickAdd, this); mAddBtn->setClickedCallback(boost::bind(&FloaterLocalAssetBrowser::onClickAdd, this));
mDelBtn->setClickedCallback( onClickDel, this); mDelBtn->setClickedCallback(boost::bind(&FloaterLocalAssetBrowser::onClickDel, this));
mMoreBtn->setClickedCallback( onClickMore, this); mMoreBtn->setClickedCallback(boost::bind(&FloaterLocalAssetBrowser::FloaterResize, this, true));
mLessBtn->setClickedCallback( onClickLess, this); mLessBtn->setClickedCallback(boost::bind(&FloaterLocalAssetBrowser::FloaterResize, this, false));
mUploadBtn->setClickedCallback( onClickUpload, this); mUploadBtn->setClickedCallback(boost::bind(&FloaterLocalAssetBrowser::onClickUpload, this));
// combo callback // combo callback
mTypeComboBox->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onCommitTypeCombo,this)); mTypeComboBox->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onCommitTypeCombo,this));
@@ -806,48 +731,35 @@ FloaterLocalAssetBrowser::FloaterLocalAssetBrowser()
// checkbox callbacks // checkbox callbacks
mUpdateChkBox->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onClickUpdateChkbox,this)); mUpdateChkBox->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onClickUpdateChkbox,this));
} }
void FloaterLocalAssetBrowser::show(void*) void FloaterLocalAssetBrowser::show(void*)
{ {
if (!sLFInstance) if (!sLFInstance)
sLFInstance = new FloaterLocalAssetBrowser(); sLFInstance = new FloaterLocalAssetBrowser();
sLFInstance->open(); sLFInstance->open();
sLFInstance->UpdateBitmapScrollList(); sLFInstance->UpdateBitmapScrollList();
} }
FloaterLocalAssetBrowser::~FloaterLocalAssetBrowser() FloaterLocalAssetBrowser::~FloaterLocalAssetBrowser()
{ {
sLFInstance=NULL; sLFInstance = NULL;
} }
void FloaterLocalAssetBrowser::onClickAdd(void* userdata) void FloaterLocalAssetBrowser::onClickAdd()
{ {
gLocalBrowser->AddBitmap(); gLocalBrowser->AddBitmap();
} }
void FloaterLocalAssetBrowser::onClickDel(void* userdata) void FloaterLocalAssetBrowser::onClickDel()
{ {
gLocalBrowser->DelBitmap( sLFInstance->mBitmapList->getAllSelected() ); gLocalBrowser->DelBitmap(mBitmapList->getAllSelected());
} }
/* what stopped me from using a single button and simply changing it's label void FloaterLocalAssetBrowser::onClickUpload()
is the fact that i'd need to hardcode the button labels here, and that is griff. */
void FloaterLocalAssetBrowser::onClickMore(void* userdata)
{
FloaterResize(true);
}
void FloaterLocalAssetBrowser::onClickLess(void* userdata)
{
FloaterResize(false);
}
void FloaterLocalAssetBrowser::onClickUpload(void* userdata)
{ {
std::string filename = gLocalBrowser->GetBitmapUnit( std::string filename = gLocalBrowser->GetBitmapUnit(
(LLUUID)sLFInstance->mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID) )->getFileName(); (LLUUID)mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID) )->getFileName();
if ( !filename.empty() ) if ( !filename.empty() )
{ {
@@ -879,71 +791,59 @@ void FloaterLocalAssetBrowser::onCommitTypeCombo()
{ {
std::string temp_str = mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID); std::string temp_str = mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID);
if ( !temp_str.empty() ) if (!temp_str.empty())
{ {
S32 selection = sLFInstance->mTypeComboBox->getCurrentIndex(); S32 selection = mTypeComboBox->getCurrentIndex();
gLocalBrowser->onSetType( (LLUUID)temp_str, selection ); gLocalBrowser->onSetType((LLUUID)temp_str, selection);
} }
} }
void FloaterLocalAssetBrowser::FloaterResize(bool expand) void FloaterLocalAssetBrowser::FloaterResize(bool expand)
{ {
sLFInstance->mMoreBtn->setVisible(!expand); mMoreBtn->setVisible(!expand);
sLFInstance->mLessBtn->setVisible(expand); mLessBtn->setVisible(expand);
sLFInstance->mTextureView->setVisible(expand); mTextureView->setVisible(expand);
sLFInstance->mUpdateChkBox->setVisible(expand); mUpdateChkBox->setVisible(expand);
sLFInstance->mCaptionPathTxt->setVisible(expand); mCaptionPathTxt->setVisible(expand);
sLFInstance->mCaptionUUIDTxt->setVisible(expand); mCaptionUUIDTxt->setVisible(expand);
sLFInstance->mCaptionLinkTxt->setVisible(expand); mCaptionLinkTxt->setVisible(expand);
sLFInstance->mCaptionNameTxt->setVisible(expand); mCaptionNameTxt->setVisible(expand);
sLFInstance->mCaptionTimeTxt->setVisible(expand); mCaptionTimeTxt->setVisible(expand);
sLFInstance->mTypeComboBox->setVisible(expand); mTypeComboBox->setVisible(expand);
sLFInstance->mTimeTxt->setVisible(expand); mTimeTxt->setVisible(expand);
sLFInstance->mPathTxt->setVisible(expand); mPathTxt->setVisible(expand);
sLFInstance->mUUIDTxt->setVisible(expand); mUUIDTxt->setVisible(expand);
sLFInstance->mLinkTxt->setVisible(expand); mLinkTxt->setVisible(expand);
sLFInstance->mNameTxt->setVisible(expand); mNameTxt->setVisible(expand);
if(expand)
{
sLFInstance->reshape(LF_FLOATER_EXPAND_WIDTH, LF_FLOATER_HEIGHT);
sLFInstance->setResizeLimits(LF_FLOATER_EXPAND_WIDTH, LF_FLOATER_HEIGHT);
sLFInstance->UpdateRightSide();
}
else
{
sLFInstance->reshape(LF_FLOATER_CONTRACT_WIDTH, LF_FLOATER_HEIGHT);
sLFInstance->setResizeLimits(LF_FLOATER_CONTRACT_WIDTH, LF_FLOATER_HEIGHT);
}
reshape(expand ? LF_FLOATER_EXPAND_WIDTH : LF_FLOATER_CONTRACT_WIDTH, LF_FLOATER_HEIGHT);
setResizeLimits(expand ? LF_FLOATER_EXPAND_WIDTH : LF_FLOATER_CONTRACT_WIDTH, LF_FLOATER_HEIGHT);
if (expand) UpdateRightSide();
} }
void FloaterLocalAssetBrowser::UpdateBitmapScrollList() void FloaterLocalAssetBrowser::UpdateBitmapScrollList()
{ {
if ( !sLFInstance ) { return; } mBitmapList->clearRows();
sLFInstance->mBitmapList->clearRows();
if (!gLocalBrowser->loaded_bitmaps.empty()) if (!gLocalBrowser->loaded_bitmaps.empty())
{ {
LocalAssetBrowser::local_list_iter iter; LocalAssetBrowser::local_list_iter iter;
for(iter = gLocalBrowser->loaded_bitmaps.begin(); iter != gLocalBrowser->loaded_bitmaps.end(); iter++) for(iter = gLocalBrowser->loaded_bitmaps.begin(); iter != gLocalBrowser->loaded_bitmaps.end(); iter++)
{ {
LLSD element; LLSD element;
element["columns"][BITMAPLIST_COL_NAME]["column"] = "bitmap_name"; element["columns"][BITMAPLIST_COL_NAME]["column"] = "bitmap_name";
element["columns"][BITMAPLIST_COL_NAME]["type"] = "text"; element["columns"][BITMAPLIST_COL_NAME]["type"] = "text";
element["columns"][BITMAPLIST_COL_NAME]["value"] = (*iter)->getShortName(); element["columns"][BITMAPLIST_COL_NAME]["value"] = (*iter).getShortName();
element["columns"][BITMAPLIST_COL_ID]["column"] = "bitmap_uuid"; element["columns"][BITMAPLIST_COL_ID]["column"] = "bitmap_uuid";
element["columns"][BITMAPLIST_COL_ID]["type"] = "text"; element["columns"][BITMAPLIST_COL_ID]["type"] = "text";
element["columns"][BITMAPLIST_COL_ID]["value"] = (*iter)->getID(); element["columns"][BITMAPLIST_COL_ID]["value"] = (*iter).getID();
sLFInstance->mBitmapList->addElement(element); mBitmapList->addElement(element);
} }
} }
sLFInstance->onChooseBitmapList(); onChooseBitmapList();
} }
void FloaterLocalAssetBrowser::UpdateRightSide() void FloaterLocalAssetBrowser::UpdateRightSide()
@@ -951,47 +851,45 @@ void FloaterLocalAssetBrowser::UpdateRightSide()
/* /*
Since i'm not keeping a bool on if the floater is expanded or not, i'll Since i'm not keeping a bool on if the floater is expanded or not, i'll
just check if one of the widgets that shows when the floater is expanded is visible. just check if one of the widgets that shows when the floater is expanded is visible.
Also obviously before updating - checking if something IS actually selected :o Also obviously before updating - checking if something IS actually selected :o
*/ */
if (!mTextureView->getVisible()) return;
if ( !sLFInstance->mTextureView->getVisible() ) { return; } if (!mBitmapList->getAllSelected().empty())
if ( !sLFInstance->mBitmapList->getAllSelected().empty() )
{ {
LocalBitmap* unit = gLocalBrowser->GetBitmapUnit( LLUUID(sLFInstance->mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID)) ); LocalBitmap* unit = gLocalBrowser->GetBitmapUnit( LLUUID(mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID)) );
if ( unit ) if ( unit )
{ {
sLFInstance->mTextureView->setImageAssetID( unit->getID() ); mTextureView->setImageAssetID(unit->getID());
sLFInstance->mUpdateChkBox->set( unit->getUpdateBool() ); mUpdateChkBox->set(unit->getUpdateBool());
sLFInstance->mPathTxt->setText( unit->getFileName() ); mPathTxt->setText(unit->getFileName());
sLFInstance->mUUIDTxt->setText( unit->getID().asString() ); mUUIDTxt->setText(unit->getID().asString());
sLFInstance->mNameTxt->setText( unit->getShortName() ); mNameTxt->setText(unit->getShortName());
sLFInstance->mTimeTxt->setText( unit->getLastModified().asString() ); mTimeTxt->setText(unit->getLastModified().asString());
sLFInstance->mLinkTxt->setText( unit->getLinkStatus() ); mLinkTxt->setText(unit->getLinkStatus());
sLFInstance->mTypeComboBox->selectNthItem( unit->getType() ); mTypeComboBox->selectNthItem(unit->getType());
sLFInstance->mTextureView->setEnabled(true); mTextureView->setEnabled(true);
sLFInstance->mUpdateChkBox->setEnabled(true); mUpdateChkBox->setEnabled(true);
sLFInstance->mTypeComboBox->setEnabled(true); mTypeComboBox->setEnabled(true);
} }
} }
else else
{ {
sLFInstance->mTextureView->setImageAssetID( NO_IMAGE ); mTextureView->setImageAssetID(NO_IMAGE);
sLFInstance->mTextureView->setEnabled( false ); mTextureView->setEnabled(false);
sLFInstance->mUpdateChkBox->set( false ); mUpdateChkBox->set(false);
sLFInstance->mUpdateChkBox->setEnabled( false ); mUpdateChkBox->setEnabled(false);
sLFInstance->mTypeComboBox->selectFirstItem(); mTypeComboBox->selectFirstItem();
sLFInstance->mTypeComboBox->setEnabled( false ); mTypeComboBox->setEnabled(false);
sLFInstance->mPathTxt->setText( LLStringExplicit("None") ); mPathTxt->setText(LLStringExplicit("None"));
sLFInstance->mUUIDTxt->setText( LLStringExplicit("None") ); mUUIDTxt->setText(LLStringExplicit("None"));
sLFInstance->mNameTxt->setText( LLStringExplicit("None") ); mNameTxt->setText(LLStringExplicit("None"));
sLFInstance->mLinkTxt->setText( LLStringExplicit("None") ); mLinkTxt->setText(LLStringExplicit("None"));
sLFInstance->mTimeTxt->setText( LLStringExplicit("None") ); mTimeTxt->setText(LLStringExplicit("None"));
} }
} }

View File

@@ -98,7 +98,7 @@ class LocalBitmap
{ {
public: public:
LocalBitmap(std::string filename); LocalBitmap(std::string filename);
virtual ~LocalBitmap(void); virtual ~LocalBitmap();
friend class LocalAssetBrowser; friend class LocalAssetBrowser;
public: /* [enums, typedefs, etc] */ public: /* [enums, typedefs, etc] */
@@ -127,23 +127,22 @@ class LocalBitmap
}; };
public: /* [information query functions] */ public: /* [information query functions] */
std::string getShortName(void); std::string getShortName();
std::string getFileName(void); std::string getFileName();
LLUUID getID(void); LLUUID getID();
LLSD getLastModified(void); LLSD getLastModified();
std::string getLinkStatus(void); std::string getLinkStatus();
bool getUpdateBool(void); bool getUpdateBool();
void setType( S32 ); void setType( S32 );
bool getIfValidBool(void); bool getIfValidBool();
S32 getType(void); S32 getType();
void getDebugInfo(void); void getDebugInfo();
private: /* [maintenence functions] */ private: /* [maintenence functions] */
void updateSelf(void); void updateSelf();
bool decodeSelf(LLImageRaw* rawimg); bool decodeSelf(LLImageRaw* rawimg);
void setUpdateBool(void); void setUpdateBool();
LocalBitmap* getThis(void);
std::vector<LLFace*> getFaceUsesThis(LLDrawable*); std::vector<LLFace*> getFaceUsesThis(LLDrawable*);
std::vector<affected_object> getUsingObjects(bool seek_by_type = true, std::vector<affected_object> getUsingObjects(bool seek_by_type = true,
bool seek_textures = false, bool seek_sculptmaps = false); bool seek_textures = false, bool seek_sculptmaps = false);
@@ -184,7 +183,7 @@ class LocalAssetBrowser
static void UpdateTextureCtrlList(LLScrollListCtrl*); static void UpdateTextureCtrlList(LLScrollListCtrl*);
static void setLayerUpdated(bool toggle) { mLayerUpdated = toggle; } static void setLayerUpdated(bool toggle) { mLayerUpdated = toggle; }
static void setSculptUpdated(bool toggle) { mSculptUpdated = toggle; } static void setSculptUpdated(bool toggle) { mSculptUpdated = toggle; }
static void AddBitmap(void); static void AddBitmap();
static void AddBitmap_continued(AIFilePicker* filepicker); static void AddBitmap_continued(AIFilePicker* filepicker);
static void DelBitmap( std::vector<LLScrollListItem*>, S32 column = BITMAPLIST_COL_ID ); static void DelBitmap( std::vector<LLScrollListItem*>, S32 column = BITMAPLIST_COL_ID );
@@ -194,18 +193,18 @@ class LocalAssetBrowser
the latter - each time the button's pressed. */ the latter - each time the button's pressed. */
private: private:
static void onChangeHappened(void); static void onChangeHappened();
static void onUpdateBool(LLUUID); static void onUpdateBool(LLUUID);
static void onSetType(LLUUID, S32); static void onSetType(LLUUID, S32);
static LocalBitmap* GetBitmapUnit(LLUUID); static LocalBitmap* GetBitmapUnit(LLUUID);
static bool IsDoingUpdates(void); static bool IsDoingUpdates();
static void PingTimer(void); static void PingTimer();
static void PerformTimedActions(void); static void PerformTimedActions();
static void PerformSculptUpdates(LocalBitmap*); static void PerformSculptUpdates(LocalBitmap&);
protected: protected:
static std::vector<LocalBitmap*> loaded_bitmaps; static std::vector<LocalBitmap> loaded_bitmaps;
typedef std::vector<LocalBitmap*>::iterator local_list_iter; typedef std::vector<LocalBitmap>::iterator local_list_iter;
static bool mLayerUpdated; static bool mLayerUpdated;
static bool mSculptUpdated; static bool mSculptUpdated;
}; };
@@ -226,16 +225,12 @@ public:
virtual ~FloaterLocalAssetBrowser(); virtual ~FloaterLocalAssetBrowser();
static void show(void*); static void show(void*);
private: private:
/* Widget related callbacks */ /* Widget related callbacks */
// Button callback declarations // Button callback declarations
static void onClickAdd(void* userdata); void onClickAdd();
static void onClickDel(void* userdata); void onClickDel();
static void onClickMore(void* userdata); void onClickUpload();
static void onClickLess(void* userdata);
static void onClickUpload(void* userdata);
// ScrollList callback declarations // ScrollList callback declarations
void onChooseBitmapList(); void onChooseBitmapList();
@@ -271,17 +266,12 @@ private:
LLTextBox* mCaptionNameTxt; LLTextBox* mCaptionNameTxt;
LLTextBox* mCaptionTimeTxt; LLTextBox* mCaptionTimeTxt;
/* static pointer to self, wai? oh well. */
static FloaterLocalAssetBrowser* sLFInstance;
// non-widget functions // non-widget functions
static void FloaterResize(bool expand); void FloaterResize(bool expand);
static void UpdateRightSide(void); void UpdateRightSide();
public: public:
static void UpdateBitmapScrollList(void); void UpdateBitmapScrollList();
}; };
/*==================================================*/ /*==================================================*/