From 7346931f7f6f72abc089b9bd7e29250696124f87 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 17 Sep 2013 04:59:25 +0200 Subject: [PATCH 1/6] Revert OCD commit tick. Revert "Appease VS2010 warning and make ui code more consistent with the modern standard in daeexport.cpp" This reverts commit cb6dec62ec5e9a2bd09750b425b34871093e7c2a. --- indra/newview/daeexport.cpp | 64 ++++++++++--------- .../default/xui/en-us/floater_dae_export.xml | 4 +- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 1e71bf61b..6beff624b 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -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 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("Object Name")) - { - ctrl->setTextArg("[NAME]", mObjectName); - } - if (LLUICtrl* ctrl = findChild("Exportable Prims")) - { - ctrl->setTextArg("[COUNT]", llformat("%d", mSaver.mObjects.size())); - ctrl->setTextArg("[TOTAL]", llformat("%d", mTotal)); - } - if (LLUICtrl* ctrl = findChild("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("file name editor"); + mExportBtn = getChild("export button"); + mBrowseBtn = getChild("browse button"); + mTextureTypeCombo = getChild("texture type combo"); + mTextureExportCheck = getChild("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); } @@ -808,7 +814,7 @@ bool DAESaver::saveDAE(std::string filename) v4adapt verts(face->mPositions); v4adapt norms(face->mNormals); - LLVector2* newCoord = NULL; + LLVector2* newCoord; if (applyTexCoord) { diff --git a/indra/newview/skins/default/xui/en-us/floater_dae_export.xml b/indra/newview/skins/default/xui/en-us/floater_dae_export.xml index 8d01c4ee0..51f8fd80c 100644 --- a/indra/newview/skins/default/xui/en-us/floater_dae_export.xml +++ b/indra/newview/skins/default/xui/en-us/floater_dae_export.xml @@ -2,11 +2,11 @@ Collada Export: Saving textures ([COUNT] remaining) File Name: - + - From 3f1d05b8397a09c0275598b51298568edf80ee2f Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 17 Sep 2013 05:04:44 +0200 Subject: [PATCH 2/6] Re-apply warning fix after the previous revert --- indra/newview/daeexport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 6beff624b..0938bd1cb 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -814,7 +814,7 @@ bool DAESaver::saveDAE(std::string filename) v4adapt verts(face->mPositions); v4adapt norms(face->mNormals); - LLVector2* newCoord; + LLVector2* newCoord = NULL; if (applyTexCoord) { From 08654cc859980ff9444842cea4ec8ce49a4d684a Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Tue, 17 Sep 2013 01:25:05 -0400 Subject: [PATCH 3/6] Fixed profile floater not displaying custom account type strings from server --- indra/newview/llpanelavatar.cpp | 54 ++----------------- .../skins/default/xui/en-us/panel_avatar.xml | 27 ---------- .../skins/default/xui/en-us/strings.xml | 17 ++++-- 3 files changed, 19 insertions(+), 79 deletions(-) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 4cda01c3b..2c6e5a057 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -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("acct")->setValue(getString("CaptionTextAcctInfo", args)); getChild("img")->setImageAssetID(pAvatarData->image_id); diff --git a/indra/newview/skins/default/xui/en-us/panel_avatar.xml b/indra/newview/skins/default/xui/en-us/panel_avatar.xml index 284576ba1..9c59c900e 100644 --- a/indra/newview/skins/default/xui/en-us/panel_avatar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_avatar.xml @@ -9,33 +9,6 @@ [PAYMENTINFO] [AGEVERIFICATION] - - Resident - - - Trial - - - Charter Member - - - Linden Lab Employee - - - Payment Info Used - - - Payment Info On File - - - No Payment Info On File - - - Age-verified - - - Not Age-verified -