Merge remote-tracking branch 'Liru/master'

This commit is contained in:
Damian Zhaoying
2013-09-17 23:43:37 -03:00
12 changed files with 128 additions and 261 deletions

View File

@@ -74,6 +74,7 @@
// menu includes
#include "llevent.h"
#include "llmemberlistener.h"
#include "llview.h"
#include "llselectmgr.h"
// Floater and UI
@@ -81,6 +82,8 @@
#include "lluictrlfactory.h"
#include "llscrollcontainer.h"
#include "lltexturectrl.h"
#include "llcombobox.h"
#include "llcheckboxctrl.h"
// Files and cache
#include "llcallbacklist.h"
@@ -185,13 +188,16 @@ class ColladaExportFloater
{
private:
typedef std::map<LLUUID, std::string> texture_list_t;
LLView* mExportBtn;
LLView* mFileName;
LLView* mTextureTypeCombo;
LLButton* mExportBtn;
LLButton* mBrowseBtn;
LLLineEditor* mFileName;
LLComboBox* mTextureTypeCombo;
LLCheckBoxCtrl* mTextureExportCheck;
DAESaver mSaver;
texture_list_t mTexturesToSave;
S32 mTotal;
S32 mIncluded;
S32 mNumTextures;
S32 mNumExportableTextures;
std::string mObjectName;
@@ -204,25 +210,16 @@ public:
{
mCommitCallbackRegistrar.add("ColladaExport.FilePicker", boost::bind(&ColladaExportFloater::onClickBrowse, this));
mCommitCallbackRegistrar.add("ColladaExport.Export", boost::bind(&ColladaExportFloater::onClickExport, this));
mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this, boost::bind(&LLUICtrl::getControlName, _1), _2));
mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this, _2));
mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this));
mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this));
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_dae_export.xml");
addSelectedObjects();
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Object Name"))
{
ctrl->setTextArg("[NAME]", mObjectName);
}
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Exportable Prims"))
{
ctrl->setTextArg("[COUNT]", llformat("%d", mSaver.mObjects.size()));
ctrl->setTextArg("[TOTAL]", llformat("%d", mTotal));
}
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Exportable Textures"))
{
ctrl->setTextArg("[COUNT]", llformat("%d", mNumExportableTextures));
ctrl->setTextArg("[TOTAL]", llformat("%d", mNumTextures));
}
childSetTextArg("Object Name", "[NAME]", mObjectName);
childSetTextArg("Exportable Prims", "[COUNT]", llformat("%d", mIncluded));
childSetTextArg("Exportable Prims", "[TOTAL]", llformat("%d", mTotal));
childSetTextArg("Exportable Textures", "[COUNT]", llformat("%d", mNumExportableTextures));
childSetTextArg("Exportable Textures", "[TOTAL]", llformat("%d", mNumTextures));
addTexturePreview();
}
@@ -236,13 +233,17 @@ public:
BOOL postBuild()
{
mFileName = getChildView("file name editor");
mExportBtn = getChildView("export button");
mTextureTypeCombo = getChildView("texture type combo");
mFileName = getChild<LLLineEditor>("file name editor");
mExportBtn = getChild<LLButton>("export button");
mBrowseBtn = getChild<LLButton>("browse button");
mTextureTypeCombo = getChild<LLComboBox>("texture type combo");
mTextureExportCheck = getChild<LLCheckBoxCtrl>("texture export check");
mTitleProgress = getString("texture_progress");
mExportBtn->setEnabled(FALSE);
mFileName->setEnabled(FALSE);
mTextureTypeCombo->setValue(gSavedSettings.getS32(mTextureTypeCombo->getControlName()));
onTextureExportCheck(getChildView("texture export check")->getValue());
onTextureExportCheck();
return TRUE;
}
@@ -252,14 +253,14 @@ public:
setTitle(mTitleProgress);
}
void onTextureExportCheck(const LLSD& value)
void onTextureExportCheck()
{
mTextureTypeCombo->setEnabled(value);
mTextureTypeCombo->setEnabled(mTextureExportCheck->get());
}
void onTextureTypeCombo(const std::string& control_name, const LLSD& value)
void onTextureTypeCombo()
{
gSavedSettings.setS32(control_name, value);
gSavedSettings.setS32(mTextureTypeCombo->getControlName(), mTextureTypeCombo->getValue());
}
void onClickBrowse()
@@ -275,7 +276,10 @@ public:
if (filepicker->hasFilename())
{
mFileName->setValue(filepicker->getFilename());
mExportBtn->setEnabled(TRUE);
if (mIncluded > 0)
{
mExportBtn->setEnabled(TRUE);
}
}
}
@@ -306,12 +310,14 @@ public:
mSaver.mOffset = -selection->getFirstRootObject()->getRenderPosition();
mObjectName = selection->getFirstRootNode()->mName;
mTotal = 0;
mIncluded = 0;
for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter)
{
mTotal++;
LLSelectNode* node = *iter;
if (!node->getObject()->getVolume() || !DAEExportUtil::canExportNode(node)) continue;
mIncluded++;
mSaver.add(node->getObject(), node->mName);
}

View File

@@ -127,73 +127,79 @@ void LLLogChat::saveHistory(std::string const& filename, std::string line)
}
}
const std::streamoff BUFFER_SIZE(4096);
static long const LOG_RECALL_BUFSIZ = 2048;
// Read a chunk of size from pos in ifstr and prepend it to data
// return that chunk's newline count
U32 read_chunk(llifstream& ifstr, const std::streamoff& pos, U32 size, std::string& data)
void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogLineType, std::string, void*), void* userdata)
{
char buffer[BUFFER_SIZE];
ifstr.seekg(pos);
ifstr.read(buffer, size);
data.insert(0, buffer, size);
return std::count(buffer, buffer + size, '\n');
}
void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogLineType,std::string,void*), void* userdata)
{
if(!filename.size())
bool filename_empty = filename.empty();
if (filename_empty)
{
llwarns << "Filename is Empty!" << llendl;
return ;
llwarns << "filename is empty!" << llendl;
}
llifstream ifstr(makeLogFileName(filename));
if (!ifstr.is_open())
{
callback(LOG_EMPTY,LLStringUtil::null,userdata);
}
else
else while(1) // So we can use break.
{
// The number of lines to return.
static const LLCachedControl<U32> lines("LogShowHistoryLines", 32);
ifstr.seekg(-1, std::ios_base::end);
if (!lines || !ifstr)
{
callback(LOG_EMPTY,LLStringUtil::null,userdata);
return;
}
if (lines == 0) break;
std::string data;
U32 nlines = 0;
if (ifstr.get() != '\n') // in case file doesn't end with a newline
{
data.push_back('\n');
++nlines;
}
// Open the log file.
LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "rb");
if (!fptr) break;
// Read BUFFER_SIZE byte chunks until we have enough endlines accumulated
for(std::streamoff pos = ifstr.tellg() - BUFFER_SIZE; nlines < lines+1; pos -= BUFFER_SIZE)
// Set pos to point to the last character of the file, if any.
if (fseek(fptr, 0, SEEK_END)) break;
long pos = ftell(fptr) - 1;
if (pos < 0) break;
char buffer[LOG_RECALL_BUFSIZ];
bool error = false;
int nlines = 0;
while (pos > 0 && nlines < lines)
{
if (pos > 0)
// Read the LOG_RECALL_BUFSIZ characters before pos.
size_t size = llmin(LOG_RECALL_BUFSIZ, pos);
pos -= size;
fseek(fptr, pos, SEEK_SET);
size_t len = fread(buffer, 1, size, fptr);
error = len != size;
if (error) break;
// Count the number of newlines in it and set pos to the beginning of the first line to return when we found enough.
for (char const* p = buffer + size - 1; p >= buffer; --p)
{
nlines += read_chunk(ifstr, pos, BUFFER_SIZE, data);
}
else // Ran out of file read the remaining from the start
{
nlines += read_chunk(ifstr, 0, pos + BUFFER_SIZE, data);
break;
if (*p == '\n')
{
if (++nlines == lines)
{
pos += p - buffer + 1;
break;
}
}
}
}
// Break data into lines
std::istringstream sstr(data);
for (std::string line; nlines > 0 && getline(sstr, line); --nlines)
if (error)
{
if (nlines <= lines)
{
callback(LOG_LINE, line, userdata);
}
fclose(fptr);
break;
}
callback(LOG_END,LLStringUtil::null,userdata);
// Set the file pointer at the first line to return.
fseek(fptr, pos, SEEK_SET);
// Read lines from the file one by one until we reach the end of the file.
while (fgets(buffer, LOG_RECALL_BUFSIZ, fptr))
{
size_t len = strlen(buffer);
if (buffer[len - 1] == '\n') // In case the log file doesn't end on a new-line (is that even possible?)
{
buffer[len - 1] = '\0';
}
callback(LOG_LINE, buffer, userdata);
}
fclose(fptr);
callback(LOG_END, LLStringUtil::null, userdata);
return;
}
callback(LOG_EMPTY, LLStringUtil::null, userdata);
}

View File

@@ -46,6 +46,7 @@
#include "llagent.h"
#include "llavataractions.h"
#include "llavatarpropertiesprocessor.h"
#include "llcallingcard.h"
#include "lldroptarget.h"
#include "llfloatergroupinfo.h"
@@ -183,56 +184,11 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType
if (pAvatarData && (mAvatarID == pAvatarData->avatar_id) && (pAvatarData->avatar_id != LLUUID::null))
{
LLStringUtil::format_map_t args;
U8 caption_index = 0;
std::string caption_text = getString("CaptionTextAcctInfo");
const char* ACCT_TYPE[] =
{
"AcctTypeResident",
"AcctTypeTrial",
"AcctTypeCharterMember",
"AcctTypeEmployee"
};
caption_index = llclamp(caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1));
args["[ACCTTYPE]"] = getString(ACCT_TYPE[caption_index]);
args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(pAvatarData);
args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(pAvatarData);
args["[AGEVERIFICATION]"] = " ";
std::string payment_text = " ";
const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3;
if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX)
{
if(pAvatarData->flags & AVATAR_TRANSACTED)
{
payment_text = "PaymentInfoUsed";
}
else if (pAvatarData->flags & AVATAR_IDENTIFIED)
{
payment_text = "PaymentInfoOnFile";
}
else
{
payment_text = "NoPaymentInfoOnFile";
}
args["[PAYMENTINFO]"] = getString(payment_text);
// Do not display age verification status at this time - Mostly because it /doesn't work/. -HgB
/*bool age_verified = (pAvatarData->flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy consideration
std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified";
args["[AGEVERIFICATION]"] = getString(age_text);
*/
args["[AGEVERIFICATION]"] = " ";
}
else
{
args["[PAYMENTINFO]"] = " ";
args["[AGEVERIFICATION]"] = " ";
}
LLStringUtil::format(caption_text, args);
childSetValue("acct", caption_text);
getChild<LLUICtrl>("acct")->setValue(getString("CaptionTextAcctInfo", args));
getChild<LLTextureCtrl>("img")->setImageAssetID(pAvatarData->image_id);

View File

@@ -5,15 +5,6 @@
<string name="CaptionTextAcctInfo">[ACCTTYPE]
[PAYMENTINFO]
[AGEVERIFICATION]</string>
<string name="AcctTypeResident">Einwohner</string>
<string name="AcctTypeTrial">Test</string>
<string name="AcctTypeCharterMember">Charta-Mitglied</string>
<string name="AcctTypeEmployee">Linden Lab-Mitarbeiter</string>
<string name="PaymentInfoUsed">Zahlungsinfo verwendet</string>
<string name="PaymentInfoOnFile">Zahlungsinfo archiviert</string>
<string name="NoPaymentInfoOnFile">Keine Zahlungsinfo archiviert</string>
<string name="AgeVerified">Altersgeprüft</string>
<string name="NotAgeVerified">Nicht altersgeprüft</string>
<button label="Kopiere Schlüssel" tool_tip="Schlüssel in die Zwischenablage kopieren" name="copy_key"/>
<button name="web_profile" label="Web Profil"/>

View File

@@ -2,11 +2,11 @@
<floater name="Collada Export" title="Collada Export" width="600" height="260" can_close="true" can_minimize="true">
<string name="texture_progress">Collada Export: Saving textures ([COUNT] remaining)</string>
<text name="file name" follows="bottom|left" left="10" bottom="-48" height="20">File Name:</text>
<line_editor name="file name editor" follows="bottom|left" left_delta="60" bottom_delta="4" width="360" height="20" enabled="false"/>
<line_editor name="file name editor" follows="bottom|left" left_delta="60" bottom_delta="4" width="360" height="20"/>
<button name="browse button" label="Browse" follows="bottom|left" left_delta="363" bottom_delta="0" width="80" height="20">
<button.commit_callback function="ColladaExport.FilePicker"/>
</button>
<button name="export button" label="Export" follows="bottom|left" left_delta="83" bottom_delta="0" width="80" height="20" enabled="false">
<button name="export button" label="Export" follows="bottom|left" left_delta="83" bottom_delta="0" width="80" height="20">
<button.commit_callback function="ColladaExport.Export"/>
</button>
<panel border="true" left="10" bottom_delta="-88" height="80" width="200" follows="bottom|left" name="object info panel">

View File

@@ -9,33 +9,6 @@
[PAYMENTINFO]
[AGEVERIFICATION]
</string>
<string name="AcctTypeResident">
Resident
</string>
<string name="AcctTypeTrial">
Trial
</string>
<string name="AcctTypeCharterMember">
Charter Member
</string>
<string name="AcctTypeEmployee">
Linden Lab Employee
</string>
<string name="PaymentInfoUsed">
Payment Info Used
</string>
<string name="PaymentInfoOnFile">
Payment Info On File
</string>
<string name="NoPaymentInfoOnFile">
No Payment Info On File
</string>
<string name="AgeVerified">
Age-verified
</string>
<string name="NotAgeVerified">
Not Age-verified
</string>
<button bottom="-24" follows="left|top" halign="right" height="16" label="Copy Key:" left="4" font="SansSerifSmall" tool_tip="Copy key to clipboard" name="copy_key" width="70"/>
<name_editor bevel_style="in" border_style="line"
border_thickness="1" bottom="-24" enabled="false" follows="left|top"

View File

@@ -3205,10 +3205,21 @@ The
<string name="Stomach">Stomach</string>
<string name="Left Pec">Left Pec</string>
<string name="Right Pec">Right Pec</string>
<string name="Neck">Neck</string>
<string name="Root">Root</string>
<string name="Invalid Attachment">Invalid Attachment Point</string>
<string name="Neck">Neck</string>
<string name="Root">Root</string>
<string name="Invalid Attachment">Invalid Attachment Point</string>
<!-- Account types, see LLAvatarPropertiesProcessor -->
<string name="AcctTypeResident">Resident</string>
<string name="AcctTypeTrial">Trial</string>
<string name="AcctTypeCharterMember">Charter Member</string>
<string name="AcctTypeEmployee">Linden Lab Employee</string>
<string name="PaymentInfoUsed">Payment Info Used</string>
<string name="PaymentInfoOnFile">Payment Info On File</string>
<string name="NoPaymentInfoOnFile">No Payment Info On File</string>
<string name="AgeVerified">Age-verified</string>
<string name="NotAgeVerified">Not Age-verified</string>
<!-- HUD Position -->
<string name="Center 2">Center 2</string>
<string name="Top Right">Top Right</string>

View File

@@ -7,33 +7,6 @@
[PAYMENTINFO]
[AGEVERIFICATION]
</string>
<string name="AcctTypeResident">
Residente
</string>
<string name="AcctTypeTrial">
Prueba
</string>
<string name="AcctTypeCharterMember">
Miembro Fundador
</string>
<string name="AcctTypeEmployee">
Empleado de Linden Lab
</string>
<string name="PaymentInfoUsed">
Información de Pago utilizada
</string>
<string name="PaymentInfoOnFile">
Información de Pago en Archivo
</string>
<string name="NoPaymentInfoOnFile">
Sin Información de Pago
</string>
<string name="AgeVerified">
Edad Verificada
</string>
<string name="NotAgeVerified">
Edad No Verificada
</string>
<button label="Copiar Key:" tool_tip="Copyiar key al portapapeles" name="copy_key"/>
<name_editor name="avatar_key"/>
<button name="web_profile" label="Perfil Web"/>

View File

@@ -3745,7 +3745,18 @@ Where tag = tag string to match. Removes bot's matching the tag.
<string name="Right Pec">Pectoral Derecho</string>
<string name="Neck">Cuello</string>
<string name="Root">Base</string>
<string name="Invalid Attachment">Punto de anexión inválido</string>
<string name="Invalid Attachment">Punto de anexión inválido</string>
<!-- Account types, see LLAvatarPropertiesProcessor -->
<string name="AcctTypeResident">Resident</string>
<string name="AcctTypeTrial">Trial</string>
<string name="AcctTypeCharterMember">Charter Member</string>
<string name="AcctTypeEmployee">Linden Lab Employee</string>
<string name="PaymentInfoUsed">Payment Info Used</string>
<string name="PaymentInfoOnFile">Payment Info On File</string>
<string name="NoPaymentInfoOnFile">No Payment Info On File</string>
<string name="AgeVerified">Age-verified</string>
<string name="NotAgeVerified">Not Age-verified</string>
<!-- HUD Position -->
<string name="Center 2">Centro 2</string>

View File

@@ -7,36 +7,6 @@
[PAYMENTINFO]
[AGEVERIFICATION]
</string>
<string name="AcctTypeResident">
Résident
</string>
<string name="AcctTypeTrial">
Essai
</string>
<string name="AcctTypeCharterMember">
Membre originaire
</string>
<string name="AcctTypeEmployee">
Employé(e) de Linden Lab
</string>
<string name="PaymentInfoUsed">
Infos de paiement utilisées
</string>
<string name="PaymentInfoOnFile">
Infos de paiement enregistrées
</string>
<string name="NoPaymentInfoOnFile">
Aucune info de paiement
</string>
<string name="AgeVerified">
Âge vérifié
</string>
<string name="NotAgeVerified">
Âge non vérifié
</string>
<text name="Name:">
Nom:
</text>
<text name="online_yes" width="151">
Actuellement connecté(e)
</text>

View File

@@ -2,36 +2,6 @@
<panel name="Panel Avatar" width="495">
<tab_container name="tab" width="484">
<panel label="2nd Life" name="2nd Life" width="483">
<string name="AcctTypeResident">
Residente
</string>
<string name="AcctTypeTrial">
Teste
</string>
<string name="AcctTypeCharterMember">
Estatuto do membro
</string>
<string name="AcctTypeEmployee">
Contratado da Linden Lab.
</string>
<string name="PaymentInfoUsed">
Infor. de pagamento utilizadas
</string>
<string name="PaymentInfoOnFile">
Infor. de pagamento no arquivo.
</string>
<string name="NoPaymentInfoOnFile">
Sem infor. de pagamento no arquivo
</string>
<string name="AgeVerified">
Idade Verificada
</string>
<string name="NotAgeVerified">
Idade não Verificada
</string>
<text name="Name:">
Nome:
</text>
<text name="online_yes" width="176">
Atualmente Online
</text>

View File

@@ -49,7 +49,7 @@ LLFilePicker LLFilePicker::sInstance;
#define AO_FILTER L"Animation Override (*.ao)\0*.ao\0"
#define BLACKLIST_FILTER L"Asset Blacklist (*.blacklist)\0*.blacklist\0"
// </edit>
#define ANIM_FILTER L"Animations (*.bvh; *.anim)\0*.bvh\0*.anim\0"
#define ANIM_FILTER L"Animations (*.bvh; *.anim)\0*.bvh;*.anim\0"
#define COLLADA_FILTER L"Scene (*.dae)\0*.dae\0"
#ifdef _CORY_TESTING
#define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0"