Upload code cleansing
I found our upload classes were in need of a tune up while researching Issue 896: Animation upload setting causes viewer crash So I started working to clean up llfloaterbvhpreview which lead me to llfloaternamedesc and the rest of our upload floaters I ended up pulling the sound upload hack out of LLFloaterNameDesc and into LLFloaterSoundPreview and moving LLFloaterAnimPreview into llfloaternamedesc.* Updated llviewermenufile.cpp a bit Removed setUploadAmount from LLFloaterImagePreview and LLFloaterBvhPreview as its purpose is served by LLGlobalEconomy::getPriceUpload and the hippogridmanager too. Fixed an issue with floater_animation_anim_preview.xml using [AMOUNT] instead of [UPLOADFEE] for its label. I'd say this might fix Issue 896, I certainly can't reproduce the crash I was having when testing for it anymore.
This commit is contained in:
@@ -172,7 +172,6 @@ set(viewer_SOURCE_FILES
|
||||
llflexibleobject.cpp
|
||||
llfloaterabout.cpp
|
||||
llfloateractivespeakers.cpp
|
||||
llfloateranimpreview.cpp
|
||||
llfloaterauction.cpp
|
||||
llfloateravatarinfo.cpp
|
||||
llfloateravatarlist.cpp
|
||||
@@ -677,7 +676,6 @@ set(viewer_HEADER_FILES
|
||||
llflexibleobject.h
|
||||
llfloaterabout.h
|
||||
llfloateractivespeakers.h
|
||||
llfloateranimpreview.h
|
||||
llfloaterauction.h
|
||||
llfloateravatarinfo.h
|
||||
llfloateravatarlist.h
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* @file llfloateranimpreview.cpp
|
||||
* @brief LLFloaterAnimPreview class implementation
|
||||
*
|
||||
* Copyright (c) 2012, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
|
||||
LLFloaterAnimPreview::LLFloaterAnimPreview(LLSD const& filename) : LLFloaterNameDesc(filename)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLFloaterAnimPreview::postBuild()
|
||||
{
|
||||
if (!LLFloaterNameDesc::postBuild())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/**
|
||||
* @file llfloateranimpreview.h
|
||||
* @brief LLFloaterAnimPreview class definition
|
||||
*
|
||||
* Copyright (c) 2012, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERANIMPREVIEW_H
|
||||
#define LL_LLFLOATERANIMPREVIEW_H
|
||||
|
||||
#include "llfloaternamedesc.h"
|
||||
|
||||
class LLFloaterAnimPreview : public LLFloaterNameDesc {
|
||||
public:
|
||||
LLFloaterAnimPreview(LLSD const& filename);
|
||||
virtual BOOL postBuild(void);
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERANIMPREVIEW_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,10 +3,9 @@
|
||||
* @brief LLFloaterBvhPreview class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -92,22 +91,21 @@ public:
|
||||
|
||||
void onBtnPlay();
|
||||
void onBtnStop();
|
||||
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
|
||||
static void onSliderMove(LLUICtrl*, void*);
|
||||
static void onCommitBaseAnim(LLUICtrl*, void*);
|
||||
static void onCommitLoop(LLUICtrl*, void*);
|
||||
static void onCommitLoopIn(LLUICtrl*, void*);
|
||||
static void onCommitLoopOut(LLUICtrl*, void*);
|
||||
static BOOL validateLoopIn(LLUICtrl*, void*);
|
||||
static BOOL validateLoopOut(LLUICtrl*, void*);
|
||||
static void onCommitName(LLUICtrl*, void*);
|
||||
static void onCommitHandPose(LLUICtrl*, void*);
|
||||
static void onCommitEmote(LLUICtrl*, void*);
|
||||
static void onCommitPriority(LLUICtrl*, void*);
|
||||
static void onCommitEaseIn(LLUICtrl*, void*);
|
||||
static void onCommitEaseOut(LLUICtrl*, void*);
|
||||
static BOOL validateEaseIn(LLUICtrl*, void*);
|
||||
static BOOL validateEaseOut(LLUICtrl*, void*);
|
||||
void onSliderMove();
|
||||
void onCommitBaseAnim();
|
||||
void onCommitLoop();
|
||||
void onCommitLoopIn();
|
||||
void onCommitLoopOut();
|
||||
bool validateLoopIn(const LLSD& data);
|
||||
bool validateLoopOut(const LLSD& data);
|
||||
void onCommitName();
|
||||
void onCommitHandPose();
|
||||
void onCommitEmote();
|
||||
void onCommitPriority();
|
||||
void onCommitEaseIn();
|
||||
void onCommitEaseOut();
|
||||
bool validateEaseIn(const LLSD& data);
|
||||
bool validateEaseOut(const LLSD& data);
|
||||
static void onBtnOK(void*);
|
||||
static void onSaveComplete(const LLUUID& asset_uuid,
|
||||
LLAssetType::EType type,
|
||||
@@ -129,14 +127,10 @@ protected:
|
||||
LLRectf mPreviewImageRect;
|
||||
LLAssetID mMotionID;
|
||||
LLTransactionID mTransactionID;
|
||||
BOOL mEnabled;
|
||||
BOOL mInWorld;
|
||||
LLAnimPauseRequest mPauseRequest;
|
||||
|
||||
std::map<std::string, LLUUID> mIDList;
|
||||
|
||||
static S32 sUploadAmount;
|
||||
|
||||
//<edit>
|
||||
void* mItem;
|
||||
//</edit>
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief LLFloaterImagePreview class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -60,15 +59,9 @@
|
||||
#include "llviewershadermgr.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llstring.h"
|
||||
// <edit>
|
||||
#include "llviewercontrol.h"
|
||||
// </edit>
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
//static
|
||||
S32 LLFloaterImagePreview::sUploadAmount = 10;
|
||||
|
||||
const S32 PREVIEW_BORDER_WIDTH = 2;
|
||||
const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
|
||||
const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
|
||||
@@ -79,20 +72,11 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 300;
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFloaterImagePreview()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) :
|
||||
LLFloaterNameDesc(filename),
|
||||
mAvatarPreview(NULL),
|
||||
mSculptedPreview(NULL),
|
||||
mLastMouseX(0),
|
||||
mLastMouseY(0),
|
||||
mImagep(NULL)
|
||||
{
|
||||
loadImage(mFilenameAndPath);
|
||||
}
|
||||
|
||||
// <edit>
|
||||
LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename, void* item) :
|
||||
LLFloaterNameDesc(filename, item),
|
||||
// </edit>
|
||||
|
||||
mAvatarPreview(NULL),
|
||||
mSculptedPreview(NULL),
|
||||
mLastMouseX(0),
|
||||
@@ -101,7 +85,6 @@ LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename, void*
|
||||
{
|
||||
loadImage(mFilenameAndPath);
|
||||
}
|
||||
// </edit>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// postBuild()
|
||||
@@ -114,7 +97,6 @@ BOOL LLFloaterImagePreview::postBuild()
|
||||
}
|
||||
|
||||
childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
|
||||
childSetAction("ok_btn", onBtnOK, this);
|
||||
|
||||
LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo");
|
||||
if (iface)
|
||||
@@ -129,7 +111,7 @@ BOOL LLFloaterImagePreview::postBuild()
|
||||
PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
|
||||
mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
|
||||
|
||||
childHide("bad_image_text");
|
||||
getChildView("bad_image_text")->setVisible(FALSE);
|
||||
|
||||
if (mRawImagep.notNull() && gAgent.getRegion() != NULL)
|
||||
{
|
||||
@@ -140,7 +122,7 @@ BOOL LLFloaterImagePreview::postBuild()
|
||||
mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f);
|
||||
|
||||
if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF)
|
||||
childEnable("lossless_check");
|
||||
getChildView("lossless_check")->setEnabled(TRUE);
|
||||
|
||||
// <edit>
|
||||
gSavedSettings.setBOOL("TemporaryUpload",FALSE);
|
||||
@@ -151,11 +133,13 @@ BOOL LLFloaterImagePreview::postBuild()
|
||||
{
|
||||
mAvatarPreview = NULL;
|
||||
mSculptedPreview = NULL;
|
||||
childShow("bad_image_text");
|
||||
childDisable("clothing_type_combo");
|
||||
childDisable("ok_btn");
|
||||
getChildView("bad_image_text")->setVisible(TRUE);
|
||||
getChildView("clothing_type_combo")->setEnabled(FALSE);
|
||||
getChildView("ok_btn")->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -169,7 +153,6 @@ LLFloaterImagePreview::~LLFloaterImagePreview()
|
||||
mRawImagep = NULL;
|
||||
mAvatarPreview = NULL;
|
||||
mSculptedPreview = NULL;
|
||||
|
||||
mImagep = NULL ;
|
||||
}
|
||||
|
||||
@@ -352,7 +335,6 @@ void LLFloaterImagePreview::draw()
|
||||
bool LLFloaterImagePreview::loadImage(const std::string& src_filename)
|
||||
{
|
||||
std::string exten = gDirUtilp->getExtension(src_filename);
|
||||
|
||||
U32 codec = LLImageBase::getCodecFromExtension(exten);
|
||||
|
||||
LLPointer<LLImageRaw> raw_image = new LLImageRaw;
|
||||
@@ -771,7 +753,6 @@ BOOL LLImagePreviewAvatar::render()
|
||||
LLVertexBuffer::unbind();
|
||||
avatarp->updateLOD();
|
||||
|
||||
|
||||
if (avatarp->mDrawable.notNull())
|
||||
{
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
|
||||
@@ -918,7 +899,6 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
|
||||
BOOL LLImagePreviewSculpted::render()
|
||||
{
|
||||
mNeedsUpdate = FALSE;
|
||||
|
||||
LLGLSUIDefault def;
|
||||
LLGLDisable no_blend(GL_BLEND);
|
||||
LLGLEnable cull(GL_CULL_FACE);
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief LLFloaterImagePreview class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -115,9 +114,8 @@ protected:
|
||||
class LLFloaterImagePreview : public LLFloaterNameDesc
|
||||
{
|
||||
public:
|
||||
LLFloaterImagePreview(const std::string& filename);
|
||||
// <edit>
|
||||
LLFloaterImagePreview(const std::string& filename, void* item);
|
||||
LLFloaterImagePreview(const std::string& filename, void* item = NULL);
|
||||
// </edit>
|
||||
virtual ~LLFloaterImagePreview();
|
||||
|
||||
@@ -129,7 +127,6 @@ public:
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
||||
static void onMouseCaptureLostImagePreview(LLMouseHandler*);
|
||||
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
|
||||
|
||||
void clearAllPreviewTextures();
|
||||
|
||||
@@ -146,8 +143,6 @@ protected:
|
||||
LLRect mPreviewRect;
|
||||
LLRectf mPreviewImageRect;
|
||||
LLPointer<LLViewerTexture> mImagep ;
|
||||
|
||||
static S32 sUploadAmount;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERIMAGEPREVIEW_H
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief LLFloaterNameDesc class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -70,31 +69,16 @@ const S32 PREF_BUTTON_HEIGHT = 16;
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFloaterNameDesc()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename )
|
||||
: LLFloater(std::string("Name/Description Floater"))
|
||||
{
|
||||
LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& filename, void* item )
|
||||
: LLFloater(std::string("Name/Description Floater")),
|
||||
// <edit>
|
||||
mItem = NULL;
|
||||
mItem(item),
|
||||
// </edit>
|
||||
mFilenameAndPath = filename;
|
||||
mFilename = gDirUtilp->getBaseFileName(filename, false);
|
||||
// SL-5521 Maintain capitalization of filename when making the inventory item. JC
|
||||
//LLStringUtil::toLower(mFilename);
|
||||
mIsAudio = FALSE;
|
||||
}
|
||||
|
||||
// <edit>
|
||||
LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename, void* item )
|
||||
: LLFloater(std::string("Name/Description Floater"))
|
||||
mIsAudio(FALSE)
|
||||
{
|
||||
mItem = item;
|
||||
mFilenameAndPath = filename;
|
||||
mFilename = gDirUtilp->getBaseFileName(filename, false);
|
||||
// SL-5521 Maintain capitalization of filename when making the inventory item. JC
|
||||
//LLStringUtil::toLower(mFilename);
|
||||
mIsAudio = FALSE;
|
||||
mFilenameAndPath = filename.asString();
|
||||
mFilename = gDirUtilp->getBaseFileName(mFilenameAndPath, false);
|
||||
}
|
||||
// </edit>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// postBuild()
|
||||
@@ -109,11 +93,6 @@ BOOL LLFloaterNameDesc::postBuild()
|
||||
LLStringUtil::stripNonprintable(asset_name);
|
||||
LLStringUtil::trim(asset_name);
|
||||
|
||||
std::string exten = gDirUtilp->getExtension(asset_name);
|
||||
if (exten == "wav")
|
||||
{
|
||||
mIsAudio = TRUE;
|
||||
}
|
||||
asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion
|
||||
|
||||
setTitle(mFilename);
|
||||
@@ -128,8 +107,8 @@ BOOL LLFloaterNameDesc::postBuild()
|
||||
|
||||
r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );
|
||||
|
||||
childSetCommitCallback("name_form", doCommit, this);
|
||||
childSetValue("name_form", LLSD(asset_name));
|
||||
getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this));
|
||||
getChild<LLUICtrl>("name_form")->setValue(LLSD(asset_name));
|
||||
|
||||
LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form");
|
||||
if (NameEditor)
|
||||
@@ -142,7 +121,7 @@ BOOL LLFloaterNameDesc::postBuild()
|
||||
y -= PREVIEW_LINE_HEIGHT;
|
||||
|
||||
r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );
|
||||
childSetCommitCallback("description_form", doCommit, this);
|
||||
getChild<LLUICtrl>("description_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this));
|
||||
LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form");
|
||||
if (DescEditor)
|
||||
{
|
||||
@@ -153,14 +132,10 @@ BOOL LLFloaterNameDesc::postBuild()
|
||||
y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);
|
||||
|
||||
// Cancel button
|
||||
childSetAction("cancel_btn", onBtnCancel, this);
|
||||
getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this));
|
||||
|
||||
getChild<LLUICtrl>("ok_btn")->setLabelArg("[UPLOADFEE]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
|
||||
|
||||
// OK button
|
||||
childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
|
||||
if (exten == "wav")
|
||||
{
|
||||
childSetAction("ok_btn", onBtnOK, this);
|
||||
}
|
||||
setDefaultBtn("ok_btn");
|
||||
|
||||
return TRUE;
|
||||
@@ -182,45 +157,99 @@ void LLFloaterNameDesc::onCommit()
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
//-----------------------------------------------------------------------------
|
||||
// onCommit()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLFloaterNameDesc::doCommit( class LLUICtrl *, void* userdata )
|
||||
void LLFloaterNameDesc::doCommit()
|
||||
{
|
||||
LLFloaterNameDesc* self = (LLFloaterNameDesc*) userdata;
|
||||
self->onCommit();
|
||||
onCommit();
|
||||
}
|
||||
|
||||
// static
|
||||
//-----------------------------------------------------------------------------
|
||||
// onBtnOK()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLFloaterNameDesc::onBtnOK( void* userdata )
|
||||
void LLFloaterNameDesc::onBtnOK()
|
||||
{
|
||||
LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata;
|
||||
|
||||
fp->childDisable("ok_btn"); // don't allow inadvertent extra uploads
|
||||
getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads
|
||||
|
||||
LLAssetStorage::LLStoreAssetCallback callback = NULL;
|
||||
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass).
|
||||
void *nruserdata = NULL;
|
||||
std::string display_name = LLStringUtil::null;
|
||||
upload_new_resource(fp->mFilenameAndPath, // file
|
||||
fp->childGetValue("name_form").asString(),
|
||||
fp->childGetValue("description_form").asString(),
|
||||
upload_new_resource(mFilenameAndPath, // file
|
||||
getChild<LLUICtrl>("name_form")->getValue().asString(),
|
||||
getChild<LLUICtrl>("description_form")->getValue().asString(),
|
||||
0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
|
||||
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
|
||||
display_name, callback, expected_upload_cost, nruserdata);
|
||||
fp->close(false);
|
||||
close(false);
|
||||
}
|
||||
|
||||
// static
|
||||
//-----------------------------------------------------------------------------
|
||||
// onBtnCancel()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLFloaterNameDesc::onBtnCancel( void* userdata )
|
||||
void LLFloaterNameDesc::onBtnCancel()
|
||||
{
|
||||
LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata;
|
||||
fp->close(false);
|
||||
close(false);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFloaterSoundPreview()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& filename, void* item )
|
||||
: LLFloaterNameDesc(filename, item)
|
||||
{
|
||||
mIsAudio = TRUE;
|
||||
}
|
||||
|
||||
BOOL LLFloaterSoundPreview::postBuild()
|
||||
{
|
||||
if (!LLFloaterNameDesc::postBuild())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFloaterAnimPreview()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& filename, void* item )
|
||||
: LLFloaterNameDesc(filename, item)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLFloaterAnimPreview::postBuild()
|
||||
{
|
||||
if (!LLFloaterNameDesc::postBuild())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFloaterScriptPreview()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& filename, void* item )
|
||||
: LLFloaterNameDesc(filename, item)
|
||||
{
|
||||
mIsText = TRUE;
|
||||
}
|
||||
|
||||
BOOL LLFloaterScriptPreview::postBuild()
|
||||
{
|
||||
if (!LLFloaterNameDesc::postBuild())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief LLFloaterNameDesc class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -44,29 +43,49 @@ class LLRadioGroup;
|
||||
class LLFloaterNameDesc : public LLFloater
|
||||
{
|
||||
public:
|
||||
LLFloaterNameDesc(const std::string& filename);
|
||||
// <edit>
|
||||
LLFloaterNameDesc(const std::string& filename, void* item);
|
||||
LLFloaterNameDesc(const LLSD& filename, void* item = NULL);
|
||||
// </edit>
|
||||
virtual ~LLFloaterNameDesc();
|
||||
virtual BOOL postBuild();
|
||||
|
||||
static void doCommit(class LLUICtrl *, void* userdata);
|
||||
void onBtnOK();
|
||||
void onBtnCancel();
|
||||
void doCommit();
|
||||
|
||||
protected:
|
||||
virtual void onCommit();
|
||||
|
||||
protected:
|
||||
BOOL mIsAudio;
|
||||
bool mIsText;
|
||||
|
||||
std::string mFilenameAndPath;
|
||||
std::string mFilename;
|
||||
|
||||
// <edit>
|
||||
void* mItem;
|
||||
// </edit>
|
||||
};
|
||||
|
||||
static void onBtnOK(void*);
|
||||
static void onBtnCancel(void*);
|
||||
class LLFloaterSoundPreview : public LLFloaterNameDesc
|
||||
{
|
||||
public:
|
||||
LLFloaterSoundPreview(const LLSD& filename, void* item = NULL );
|
||||
virtual BOOL postBuild();
|
||||
};
|
||||
|
||||
class LLFloaterAnimPreview : public LLFloaterNameDesc
|
||||
{
|
||||
public:
|
||||
LLFloaterAnimPreview(const LLSD& filename, void* item = NULL );
|
||||
virtual BOOL postBuild();
|
||||
};
|
||||
|
||||
class LLFloaterScriptPreview : public LLFloaterNameDesc
|
||||
{
|
||||
public:
|
||||
LLFloaterScriptPreview(const LLSD& filename, void* item = NULL );
|
||||
virtual BOOL postBuild();
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERNAMEDESC_H
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "statemachine/aifilepicker.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llfloaterimagepreview.h"
|
||||
#include "llfloatermodelpreview.h"
|
||||
@@ -217,7 +216,7 @@ bool AIFileUpload::is_valid(std::string const& filename, ELoadFilter type)
|
||||
// No extension
|
||||
LLSD args;
|
||||
args["FILE"] = short_name;
|
||||
LLNotifications::instance().add("NoFileExtension", args);
|
||||
LLNotificationsUtil::add("NoFileExtension", args);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -260,7 +259,7 @@ bool AIFileUpload::is_valid(std::string const& filename, ELoadFilter type)
|
||||
LLSD args;
|
||||
args["EXTENSION"] = ext;
|
||||
args["VALIDS"] = valid_extensions;
|
||||
LLNotifications::instance().add("InvalidFileExtension", args);
|
||||
LLNotificationsUtil::add("InvalidFileExtension", args);
|
||||
return false;
|
||||
}
|
||||
}//end else (non-null extension)
|
||||
@@ -279,7 +278,7 @@ bool AIFileUpload::is_valid(std::string const& filename, ELoadFilter type)
|
||||
llinfos << error_msg << ": " << filename << llendl;
|
||||
LLSD args;
|
||||
args["FILE"] = filename;
|
||||
LLNotifications::instance().add( error_msg, args );
|
||||
LLNotificationsUtil::add( error_msg, args );
|
||||
return false;
|
||||
}
|
||||
}//end if a wave/sound file
|
||||
@@ -331,9 +330,7 @@ class LLFileUploadSound : public view_listener_t, public AIFileUpload
|
||||
// Inherited from AIFileUpload.
|
||||
/*virtual*/ void handle_event(std::string const& filename)
|
||||
{
|
||||
LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
|
||||
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_sound_preview.xml");
|
||||
floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() ));
|
||||
LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterSoundPreview(LLSD(filename)), "floater_sound_preview.xml");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -349,20 +346,34 @@ class LLFileUploadAnim : public view_listener_t, public AIFileUpload
|
||||
// Inherited from AIFileUpload.
|
||||
/*virtual*/ void handle_event(std::string const& filename)
|
||||
{
|
||||
int len = filename.size();
|
||||
if (len >= 5 && filename.substr(len - 5, 5) == ".anim")
|
||||
if (filename.rfind(".anim") != std::string::npos)
|
||||
{
|
||||
LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename);
|
||||
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_anim_preview.xml");
|
||||
floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
|
||||
LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterAnimPreview(LLSD(filename)), "floater_animation_anim_preview.xml");
|
||||
}
|
||||
else
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterBvhPreview(filename), "floater_animation_bvh_preview.xml");
|
||||
LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterBvhPreview(LLSD(filename)), "floater_animation_bvh_preview.xml");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* Singu TODO? LL made a class to upload scripts, but never actually hooked everything up, it'd be nice for us to offer such a thing.
|
||||
class LLFileUploadScript : public view_listener_t, public AIFileUpload
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
start_filepicker(FFLOAD_SCRIPT, "script");
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Inherited from AIFileUpload.
|
||||
virtual void handle_event(std::string const& filename)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterScriptPreview(LLSD(filename)), "floater_script_preview.xml");
|
||||
}
|
||||
};*/
|
||||
|
||||
class LLFileUploadBulk : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
@@ -386,13 +397,13 @@ class LLFileUploadBulk : public view_listener_t
|
||||
const char* notification_type = expected_upload_cost ? "BulkTemporaryUpload" : "BulkTemporaryUploadFree";
|
||||
LLSD args;
|
||||
args["UPLOADCOST"] = gHippoGridManager->getConnectedGrid()->getUploadFee();
|
||||
LLNotifications::instance().add(notification_type, args, LLSD(), onConfirmBulkUploadTemp);
|
||||
LLNotificationsUtil::add(notification_type, args, LLSD(), onConfirmBulkUploadTemp);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool onConfirmBulkUploadTemp(const LLSD& notification, const LLSD& response )
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
bool enabled;
|
||||
if (option == 0) // yes
|
||||
enabled = true;
|
||||
@@ -446,7 +457,7 @@ class LLFileUploadBulk : public view_listener_t
|
||||
void upload_error(const std::string& error_message, const std::string& label, const std::string& filename, const LLSD& args)
|
||||
{
|
||||
llwarns << error_message << llendl;
|
||||
LLNotifications::instance().add(label, args);
|
||||
LLNotificationsUtil::add(label, args);
|
||||
if(LLFile::remove(filename) == -1)
|
||||
{
|
||||
lldebugs << "unable to remove temp file" << llendl;
|
||||
@@ -1361,6 +1372,7 @@ void init_menu_file()
|
||||
(new LLFileUploadImage())->registerListener(gMenuHolder, "File.UploadImage");
|
||||
(new LLFileUploadSound())->registerListener(gMenuHolder, "File.UploadSound");
|
||||
(new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim");
|
||||
//(new LLFileUploadScript())->registerListener(gMenuHolder, "File.UploadScript"); // Singu TODO?
|
||||
(new LLFileUploadModel())->registerListener(gMenuHolder, "File.UploadModel");
|
||||
(new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk");
|
||||
(new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow");
|
||||
|
||||
@@ -55,12 +55,10 @@
|
||||
#include "llagentcamera.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llfloaterbump.h"
|
||||
#include "llfloaterbuycurrency.h"
|
||||
#include "llfloaterbuyland.h"
|
||||
#include "llfloaterchat.h"
|
||||
#include "llfloaterimagepreview.h"
|
||||
#include "llfloaterland.h"
|
||||
#include "llfloaterregioninfo.h"
|
||||
#include "llfloaterlandholdings.h"
|
||||
@@ -6522,9 +6520,6 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
|
||||
|
||||
LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL;
|
||||
|
||||
LLFloaterImagePreview::setUploadAmount(upload_cost);
|
||||
LLFloaterBvhPreview::setUploadAmount(upload_cost);
|
||||
|
||||
std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee();
|
||||
gMenuHolder->childSetLabelArg("Upload Image", "[UPLOADFEE]", fee);
|
||||
gMenuHolder->childSetLabelArg("Upload Sound", "[UPLOADFEE]", fee);
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<button
|
||||
follows="left|bottom"
|
||||
height="22"
|
||||
label="Upload ([AMOUNT])"
|
||||
label="Upload ([UPLOADFEE])"
|
||||
layout="topleft"
|
||||
left="45"
|
||||
name="ok_btn"
|
||||
|
||||
Reference in New Issue
Block a user