Skip to content

Commit 7346931

Browse files
committed
Revert OCD commit tick.
Revert "Appease VS2010 warning and make ui code more consistent with the modern standard in daeexport.cpp" This reverts commit cb6dec6.
1 parent 132574f commit 7346931

2 files changed

Lines changed: 37 additions & 31 deletions

File tree

indra/newview/daeexport.cpp

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@
7474
// menu includes
7575
#include "llevent.h"
7676
#include "llmemberlistener.h"
77+
#include "llview.h"
7778
#include "llselectmgr.h"
7879

7980
// Floater and UI
8081
#include "llfloater.h"
8182
#include "lluictrlfactory.h"
8283
#include "llscrollcontainer.h"
8384
#include "lltexturectrl.h"
85+
#include "llcombobox.h"
86+
#include "llcheckboxctrl.h"
8487

8588
// Files and cache
8689
#include "llcallbacklist.h"
@@ -185,13 +188,16 @@ class ColladaExportFloater
185188
{
186189
private:
187190
typedef std::map<LLUUID, std::string> texture_list_t;
188-
LLView* mExportBtn;
189-
LLView* mFileName;
190-
LLView* mTextureTypeCombo;
191+
LLButton* mExportBtn;
192+
LLButton* mBrowseBtn;
193+
LLLineEditor* mFileName;
194+
LLComboBox* mTextureTypeCombo;
195+
LLCheckBoxCtrl* mTextureExportCheck;
191196

192197
DAESaver mSaver;
193198
texture_list_t mTexturesToSave;
194199
S32 mTotal;
200+
S32 mIncluded;
195201
S32 mNumTextures;
196202
S32 mNumExportableTextures;
197203
std::string mObjectName;
@@ -204,25 +210,16 @@ class ColladaExportFloater
204210
{
205211
mCommitCallbackRegistrar.add("ColladaExport.FilePicker", boost::bind(&ColladaExportFloater::onClickBrowse, this));
206212
mCommitCallbackRegistrar.add("ColladaExport.Export", boost::bind(&ColladaExportFloater::onClickExport, this));
207-
mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this, boost::bind(&LLUICtrl::getControlName, _1), _2));
208-
mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this, _2));
213+
mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this));
214+
mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this));
209215
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_dae_export.xml");
210216

211217
addSelectedObjects();
212-
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Object Name"))
213-
{
214-
ctrl->setTextArg("[NAME]", mObjectName);
215-
}
216-
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Exportable Prims"))
217-
{
218-
ctrl->setTextArg("[COUNT]", llformat("%d", mSaver.mObjects.size()));
219-
ctrl->setTextArg("[TOTAL]", llformat("%d", mTotal));
220-
}
221-
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Exportable Textures"))
222-
{
223-
ctrl->setTextArg("[COUNT]", llformat("%d", mNumExportableTextures));
224-
ctrl->setTextArg("[TOTAL]", llformat("%d", mNumTextures));
225-
}
218+
childSetTextArg("Object Name", "[NAME]", mObjectName);
219+
childSetTextArg("Exportable Prims", "[COUNT]", llformat("%d", mIncluded));
220+
childSetTextArg("Exportable Prims", "[TOTAL]", llformat("%d", mTotal));
221+
childSetTextArg("Exportable Textures", "[COUNT]", llformat("%d", mNumExportableTextures));
222+
childSetTextArg("Exportable Textures", "[TOTAL]", llformat("%d", mNumTextures));
226223
addTexturePreview();
227224
}
228225

@@ -236,13 +233,17 @@ class ColladaExportFloater
236233

237234
BOOL postBuild()
238235
{
239-
mFileName = getChildView("file name editor");
240-
mExportBtn = getChildView("export button");
241-
mTextureTypeCombo = getChildView("texture type combo");
236+
mFileName = getChild<LLLineEditor>("file name editor");
237+
mExportBtn = getChild<LLButton>("export button");
238+
mBrowseBtn = getChild<LLButton>("browse button");
239+
mTextureTypeCombo = getChild<LLComboBox>("texture type combo");
240+
mTextureExportCheck = getChild<LLCheckBoxCtrl>("texture export check");
242241
mTitleProgress = getString("texture_progress");
243242

243+
mExportBtn->setEnabled(FALSE);
244+
mFileName->setEnabled(FALSE);
244245
mTextureTypeCombo->setValue(gSavedSettings.getS32(mTextureTypeCombo->getControlName()));
245-
onTextureExportCheck(getChildView("texture export check")->getValue());
246+
onTextureExportCheck();
246247
return TRUE;
247248
}
248249

@@ -252,14 +253,14 @@ class ColladaExportFloater
252253
setTitle(mTitleProgress);
253254
}
254255

255-
void onTextureExportCheck(const LLSD& value)
256+
void onTextureExportCheck()
256257
{
257-
mTextureTypeCombo->setEnabled(value);
258+
mTextureTypeCombo->setEnabled(mTextureExportCheck->get());
258259
}
259260

260-
void onTextureTypeCombo(const std::string& control_name, const LLSD& value)
261+
void onTextureTypeCombo()
261262
{
262-
gSavedSettings.setS32(control_name, value);
263+
gSavedSettings.setS32(mTextureTypeCombo->getControlName(), mTextureTypeCombo->getValue());
263264
}
264265

265266
void onClickBrowse()
@@ -275,7 +276,10 @@ class ColladaExportFloater
275276
if (filepicker->hasFilename())
276277
{
277278
mFileName->setValue(filepicker->getFilename());
278-
mExportBtn->setEnabled(TRUE);
279+
if (mIncluded > 0)
280+
{
281+
mExportBtn->setEnabled(TRUE);
282+
}
279283
}
280284
}
281285

@@ -306,12 +310,14 @@ class ColladaExportFloater
306310
mSaver.mOffset = -selection->getFirstRootObject()->getRenderPosition();
307311
mObjectName = selection->getFirstRootNode()->mName;
308312
mTotal = 0;
313+
mIncluded = 0;
309314

310315
for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter)
311316
{
312317
mTotal++;
313318
LLSelectNode* node = *iter;
314319
if (!node->getObject()->getVolume() || !DAEExportUtil::canExportNode(node)) continue;
320+
mIncluded++;
315321
mSaver.add(node->getObject(), node->mName);
316322
}
317323

@@ -808,7 +814,7 @@ bool DAESaver::saveDAE(std::string filename)
808814
v4adapt verts(face->mPositions);
809815
v4adapt norms(face->mNormals);
810816

811-
LLVector2* newCoord = NULL;
817+
LLVector2* newCoord;
812818

813819
if (applyTexCoord)
814820
{

indra/newview/skins/default/xui/en-us/floater_dae_export.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<floater name="Collada Export" title="Collada Export" width="600" height="260" can_close="true" can_minimize="true">
33
<string name="texture_progress">Collada Export: Saving textures ([COUNT] remaining)</string>
44
<text name="file name" follows="bottom|left" left="10" bottom="-48" height="20">File Name:</text>
5-
<line_editor name="file name editor" follows="bottom|left" left_delta="60" bottom_delta="4" width="360" height="20" enabled="false"/>
5+
<line_editor name="file name editor" follows="bottom|left" left_delta="60" bottom_delta="4" width="360" height="20"/>
66
<button name="browse button" label="Browse" follows="bottom|left" left_delta="363" bottom_delta="0" width="80" height="20">
77
<button.commit_callback function="ColladaExport.FilePicker"/>
88
</button>
9-
<button name="export button" label="Export" follows="bottom|left" left_delta="83" bottom_delta="0" width="80" height="20" enabled="false">
9+
<button name="export button" label="Export" follows="bottom|left" left_delta="83" bottom_delta="0" width="80" height="20">
1010
<button.commit_callback function="ColladaExport.Export"/>
1111
</button>
1212
<panel border="true" left="10" bottom_delta="-88" height="80" width="200" follows="bottom|left" name="object info panel">

0 commit comments

Comments
 (0)