Merge branch 'master' of github-hazim:HazimGazov/Inertia

This commit is contained in:
Hazim Gazov
2010-07-03 18:13:25 +00:00
16 changed files with 206 additions and 44 deletions

View File

@@ -478,7 +478,7 @@ BOOL LLImageJ2C::validate(U8 *data, U32 file_size)
if ( res )
{
// Check to make sure that this instance has been initialized with data
if (!getData() || (0 == getDataSize()))
if (!getData() || (getDataSize() < 16))
{
setLastError("LLImageJ2C uninitialized");
res = FALSE;

View File

@@ -7,8 +7,8 @@ LLJ2cParser::LLJ2cParser(U8* data,int data_size)
if(data && data_size)
{
mData.resize(data_size);
memcpy(&(mData[0]), data, data_size);
//std::copy(data,data+data_size,mData.begin());
//memcpy(&(mData[0]), data, data_size);
std::copy(data,data+data_size,mData.begin());
}
mIter = mData.begin();
}
@@ -83,7 +83,8 @@ std::string LLImageMetaDataReader::ExtractEncodedComment(U8* data,int data_size)
//llinfos << "FOUND PAYLOAD" << llendl;
std::vector<U8> payload(128);
S32 i;
memcpy(&(payload[0]), &(comment[2]), 128);
//memcpy(&(payload[0]), &(comment[2]), 128);
std::copy(comment.begin()+2,comment.end(),payload.begin());
if (payload[2] == payload[127])
{
// emkdu.dll
@@ -114,6 +115,7 @@ std::string LLImageMetaDataReader::ExtractEncodedComment(U8* data,int data_size)
{
if (payload[i] == 0) break;
}
if(i < 4) break;
std::string result(payload.begin()+4,payload.begin()+i);
//llinfos << "FOUND COMMENT: " << result << llendl;
delete parser;

View File

@@ -10331,6 +10331,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>TemporaryUpload</key>
<map>
<key>Comment</key>
<string>Whether or not a upload is temporary</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>TerrainColorHeightRange</key>
<map>
<key>Comment</key>

View File

@@ -505,8 +505,12 @@ void LLPanelActiveSpeakers::refreshSpeakers()
// draw inactive speakers in gray
name_cell->setColor(LLColor4::grey4);
}
else
{
name_cell->setColor(LLColor4::black);
}
// <edit>
else if(speakerp->mType == LLSpeaker::SPEAKER_AGENT && speakerp->mID != gAgent.getID())
if(!mShowTextChatters && !(speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL) && speakerp->mID != gAgent.getID())
{
// let us check to see if they are actually in the sim
LLViewerRegion* regionp = gAgent.getRegion();
@@ -519,10 +523,6 @@ void LLPanelActiveSpeakers::refreshSpeakers()
}
}
// </edit>
else
{
name_cell->setColor(LLColor4::black);
}
std::string speaker_name;
if (speakerp->mDisplayName.empty())

View File

@@ -1203,13 +1203,15 @@ void LLFloaterAvatarList::sound_trigger_hook(LLMessageSystem* msg,void **)
}
}
// static
void LLFloaterAvatarList::onConfirmRadarChatKeys(S32 option, LLSD payload)
bool LLFloaterAvatarList::onConfirmRadarChatKeys(const LLSD& notification, const LLSD& response )
{
S32 option = LLNotification::getSelectedOption(notification, response);
if(option == 0) // yes
{
gSavedSettings.setBOOL("RadarChatKeys",TRUE);
LLFloaterAvatarList::getInstance()->sendKeys();
}
return false;
}
//static
void LLFloaterAvatarList::onClickSendKeys(void *userdata)

View File

@@ -265,7 +265,7 @@ private:
static void onCommitUpdateRate(LLUICtrl*, void *userdata);
static void onClickSendKeys(void *userdata);
static void onConfirmRadarChatKeys(S32 option, LLSD payload);
static bool onConfirmRadarChatKeys(const LLSD& notification, const LLSD& response );
static void callbackIdle(void *userdata);

View File

@@ -58,6 +58,9 @@
#include "lluictrlfactory.h"
#include "llviewerimagelist.h"
#include "llstring.h"
// <edit>
#include "llviewercontrol.h"
// </edit>
//static
S32 LLFloaterImagePreview::sUploadAmount = 10;
@@ -131,6 +134,11 @@ BOOL LLFloaterImagePreview::postBuild()
if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF)
childEnable("lossless_check");
// <edit>
gSavedSettings.setBOOL("TemporaryUpload",FALSE);
childSetValue("temp_check",FALSE);
// </edit>
}
else
{

View File

@@ -810,10 +810,11 @@ BOOL LLFloaterMessageLog::onClickCloseCircuit(void* user_data)
return TRUE;
}
// static
void LLFloaterMessageLog::onConfirmCloseCircuit(S32 option, LLSD payload)
bool LLFloaterMessageLog::onConfirmCloseCircuit(const LLSD& notification, const LLSD& response )
{
LLCircuitData* cdp = gMessageSystem->mCircuitInfo.findCircuit(LLHost(payload["circuittoclose"].asString()));
if(!cdp) return;
S32 option = LLNotification::getSelectedOption(notification, response);
LLCircuitData* cdp = gMessageSystem->mCircuitInfo.findCircuit(LLHost(notification["payload"]["circuittoclose"].asString()));
if(!cdp) return false;
LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(cdp->getHost());
switch(option)
{
@@ -822,7 +823,7 @@ void LLFloaterMessageLog::onConfirmCloseCircuit(S32 option, LLSD payload)
gMessageSystem->sendReliable(cdp->getHost());
break;
case 2: // cancel
return;
return false;
break;
case 1: // no
default:
@@ -841,12 +842,15 @@ void LLFloaterMessageLog::onConfirmCloseCircuit(S32 option, LLSD payload)
payload["regionhost"] = myhost.getString();
LLNotifications::instance().add("GenericAlertYesCancel", args, payload, onConfirmRemoveRegion);
}
return false;
}
// static
void LLFloaterMessageLog::onConfirmRemoveRegion(S32 option, LLSD payload)
bool LLFloaterMessageLog::onConfirmRemoveRegion(const LLSD& notification, const LLSD& response )
{
S32 option = LLNotification::getSelectedOption(notification, response);
if(option == 0) // yes
LLWorld::getInstance()->removeRegion(LLHost(payload["regionhost"].asString()));
LLWorld::getInstance()->removeRegion(LLHost(notification["payload"]["regionhost"].asString()));
return false;
}
// static
void LLFloaterMessageLog::onClickFilterApply(void* user_data)

View File

@@ -61,8 +61,8 @@ public:
static void onCommitMessageLog(LLUICtrl* ctrl, void* user_data);
static void onCommitFilter(LLUICtrl* ctrl, void* user_data);
static BOOL onClickCloseCircuit(void* user_data);
static void onConfirmCloseCircuit(S32 option, LLSD payload);
static void onConfirmRemoveRegion(S32 option, LLSD payload);
static bool onConfirmCloseCircuit(const LLSD& notification, const LLSD& response );
static bool onConfirmRemoveRegion(const LLSD& notification, const LLSD& response );
static void onClickFilterApply(void* user_data);
void startApplyingFilter(std::string filter, BOOL force);
void stopApplyingFilter();

View File

@@ -2039,6 +2039,11 @@ BOOL LLFloaterSnapshot::postBuild()
sInstance->getRootView()->addChild(previewp);
sInstance->getRootView()->addChild(gSnapshotFloaterView);
// <edit>
gSavedSettings.setBOOL("TemporaryUpload",FALSE);
childSetValue("temp_check",FALSE);
// </edit>
Impl::sPreviewHandle = previewp->getHandle();
impl.updateControls(this);

View File

@@ -62,6 +62,7 @@
#include "llassettype.h"
#include "llinventorytype.h"
#include "llbvhloader.h"
#include "lllocalinventory.h"
// </edit>
@@ -310,6 +311,51 @@ class LLFileUploadAnim : public view_listener_t
class LLFileUploadBulk : public view_listener_t
{
static bool onConfirmBulkUploadTemp(const LLSD& notification, const LLSD& response )
{
S32 option = LLNotification::getSelectedOption(notification, response);
BOOL enabled;
if(option == 0) // yes
enabled = TRUE;
else if(option == 1) //no
enabled = FALSE;
else //cancel
return false;
LLFilePicker& picker = LLFilePicker::instance();
if (picker.getMultipleOpenFiles())
{
//const std::string& filename = picker.getFirstFile();
std::string filename;
while(!(filename = picker.getNextFile()).empty())
{
std::string name = gDirUtilp->getBaseFileName(filename, true);
std::string asset_name = name;
LLStringUtil::replaceNonstandardASCII( asset_name, '?' );
LLStringUtil::replaceChar(asset_name, '|', '?');
LLStringUtil::stripNonprintable(asset_name);
LLStringUtil::trim(asset_name);
std::string display_name = LLStringUtil::null;
LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
void *userdata = NULL;
gSavedSettings.setBOOL("TemporaryUpload",enabled);
upload_new_resource(filename, asset_name, asset_name, 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
display_name,
callback, expected_upload_cost, userdata);
}
}
else
{
llinfos << "Couldn't import objects from file" << llendl;
gSavedSettings.setBOOL("TemporaryUpload",FALSE);
}
return false;
}
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
if( gAgent.cameraMouselook() )
@@ -326,11 +372,20 @@ class LLFileUploadBulk : public view_listener_t
// If an upload fails, refund the user for that one
//
// Also fix single upload to charge first, then refund
// <edit>
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
LLSD args;
std::string msg = "Would you like to bulk upload the files as temporary files?\nOnly textures will upload as temporary on Agni and Aditi.";
if(expected_upload_cost)
msg.append(llformat("\nWARNING: Each upload costs L$%d if it's not temporary.",expected_upload_cost));
args["MESSAGE"] = msg;
LLNotifications::instance().add("GenericAlertYesNoCancel", args, LLSD(), onConfirmBulkUploadTemp);
/* moved to the callback for the above
LLFilePicker& picker = LLFilePicker::instance();
if (picker.getMultipleOpenFiles())
{
// <edit>
//const std::string& filename = picker.getFirstFile();
std::string filename;
while(!(filename = picker.getNextFile()).empty())
@@ -362,6 +417,7 @@ class LLFileUploadBulk : public view_listener_t
{
llinfos << "Couldn't import objects from file" << llendl;
}
*/
return true;
}
};
@@ -1008,7 +1064,49 @@ void upload_new_resource(const std::string& src_filename, std::string name,
LLFilePicker::instance().reset();
}
}
// <edit>
void temp_upload_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLResourceData* data = (LLResourceData*)user_data;
if(result >= 0)
{
LLUUID item_id;
item_id.generate();
LLPermissions* perms = new LLPermissions();
perms->set(LLPermissions::DEFAULT);
perms->setOwnerAndGroup(LLUUID::null, LLUUID::null, LLUUID::null, false);
perms->setMaskBase(0);
perms->setMaskEveryone(0);
perms->setMaskGroup(0);
perms->setMaskNext(0);
perms->setMaskOwner(0);
LLViewerInventoryItem* item = new LLViewerInventoryItem(
item_id,
gLocalInventoryRoot,
*perms,
uuid,
(LLAssetType::EType)data->mAssetInfo.mType,
(LLInventoryType::EType)data->mInventoryType,
data->mAssetInfo.getName(),
data->mAssetInfo.getDescription(),
LLSaleInfo::DEFAULT,
0,
0);
LLLocalInventory::addItem(item);
}
else
{
LLSD args;
args["FILE"] = LLInventoryType::lookupHumanReadable(data->mInventoryType);
args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
LLNotifications::instance().add("CannotUploadReason", args);
}
LLUploadDialog::modalUploadFinished();
delete data;
}
// <edit>
void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLResourceData* data = (LLResourceData*)user_data;
@@ -1190,7 +1288,11 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl;
lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl;
std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
if (!url.empty())
// <edit>
BOOL temporary = gSavedSettings.getBOOL("TemporaryUpload");
gSavedSettings.setBOOL("TemporaryUpload",FALSE);
if (!url.empty() && !temporary)
// </edit>
{
llinfos << "New Agent Inventory via capability" << llendl;
LLSD body;
@@ -1212,19 +1314,23 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
}
else
{
llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl;
// check for adequate funds
// TODO: do this check on the sim
if (LLAssetType::AT_SOUND == asset_type ||
LLAssetType::AT_TEXTURE == asset_type ||
LLAssetType::AT_ANIMATION == asset_type)
// <edit>
if(!temporary)
{
S32 balance = gStatusBar->getBalance();
if (balance < expected_upload_cost)
llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl;
// check for adequate funds
// TODO: do this check on the sim
if (LLAssetType::AT_SOUND == asset_type ||
LLAssetType::AT_TEXTURE == asset_type ||
LLAssetType::AT_ANIMATION == asset_type)
{
// insufficient funds, bail on this upload
LLFloaterBuyCurrency::buyCurrency("Uploading costs", expected_upload_cost);
return;
S32 balance = gStatusBar->getBalance();
if (balance < expected_upload_cost)
{
// insufficient funds, bail on this upload
LLFloaterBuyCurrency::buyCurrency("Uploading costs", expected_upload_cost);
return;
}
}
}
@@ -1240,16 +1346,21 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
data->mAssetInfo.setName(name);
data->mAssetInfo.setDescription(desc);
data->mPreferredLocation = destination_folder_type;
LLAssetStorage::LLStoreAssetCallback asset_callback = &upload_done_callback;
// <edit>
LLAssetStorage::LLStoreAssetCallback asset_callback = temporary ? &temp_upload_callback : &upload_done_callback;
// </edit>
if (callback)
{
asset_callback = callback;
}
// <edit>
gAssetStorage->storeAssetData(data->mAssetInfo.mTransactionID, data->mAssetInfo.mType,
asset_callback,
(void*)data,
FALSE);
temporary,
TRUE,
temporary);
// </edit>
}
}

View File

@@ -57,6 +57,10 @@ Try saving image as 24 bit Targa (.tga).
follows="bottom|left" font="SansSerifSmall" height="16"
initial_value="false" label="Use lossless compression" left="10"
left_delta="2" name="lossless_check" width="280" />
<check_box bottom="37" control_name="TemporaryUpload" enabled="true"
follows="bottom|left" font="SansSerifSmall" height="16"
initial_value="false" label="Temporary (Free)"
left_delta="155" name="temp_check" width="280" tooltip="Sets the asset to be temporary, meaning its free, but in return, only good for a short time before it ceases to exist." />
<button bottom="10" follows="bottom|right" height="20" label="Cancel" left="165"
name="cancel_btn" width="125" />
<button bottom="10" follows="bottom|left" height="20" label="Upload (L$[AMOUNT])"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater bottom="-300" can_close="true" can_drag_on_left="false" can_minimize="false"
can_resize="false" follows="left|top" height="526" name="Snapshot"
can_resize="false" follows="left|top" height="546" name="Snapshot"
rect_control="FloaterSnapshotRect" title="Snapshot Preview" width="215">
<text bottom_delta="-40" follows="top|left" height="15" left="10" name="type_label"
width="195">
@@ -165,6 +165,9 @@
left="10" name="freeze_frame_check" />
<check_box bottom_delta="-20" follows="left|top" label="Auto-refresh" left="10"
name="auto_snapshot_check" />
<check_box bottom_delta="-20" follows="left|top" control_name="TemporaryUpload" enabled="true"
initial_value="false" label="Temporary Image (Free)" left="10"
name="temp_check" tooltip="Sets the asset to be temporary, meaning its free, but in return, only good for a short time before it ceases to exist." />
<string name="unknown">
unknown
</string>

View File

@@ -334,7 +334,7 @@
<on_check control="ShowMiniMap" />
</menu_item_check>
<menu_item_check bottom="-273" enabled="true" height="19" label="Radar" left="0"
mouse_opaque="true" name="Radar" shortcut="control|alt|shift|R" width="211">
mouse_opaque="true" name="Radar" shortcut="control|shift|A" width="211">
<on_click function="View.ToggleAvatarList" userdata="radar" />
<on_check control="ShowRadar" />
</menu_item_check>
@@ -349,7 +349,7 @@
<menu_item_separator bottom="-300" enabled="true" height="8" label="-----------" left="0"
mouse_opaque="true" name="separator100" width="211" />
<menu_item_check bottom="-300" enabled="false" height="20" label="Area Search" left="0"
mouse_opaque="true" name="Area Search" shortcut="control|shift|A" width="155">
mouse_opaque="true" name="Area Search" width="155">
<on_click function="ShowFloater" userdata="areasearch" />
<on_check function="FloaterVisible" userdata="areasearch" />
</menu_item_check>

View File

@@ -146,6 +146,18 @@ No tutorial is currently available.
yestext="Yes"/>
</notification>
<notification
icon="alertmodal.tga"
name="GenericAlertYesNoCancel"
type="alertmodal">
[MESSAGE]
<usetemplate
name="yesnocancelbuttons"
notext="No"
yestext="Yes"
canceltext="Cancel"/>
</notification>
<notification
icon="alertmodal.tga"
name="BadInstallation"

View File

@@ -211,19 +211,19 @@
<key>url</key>
<uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-darwin-20100226.tar.bz2</uri>
</map>
<key>linux</key>
<key>linux</key>
<map>
<key>md5sum</key>
<string>d58ac1a8396ac983b67cc3e3541457e3</string>
<string>4db3d74e40d149eeec06f4d97a609bb1</string>
<key>url</key>
<uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-linux-20100222a.tar.bz2</uri>
</map>
<uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-linux-20100624.tar.bz2</uri>
</map>
<key>windows</key>
<map>
<key>md5sum</key>
<string>ed53511382d0fd9fec59a9f6544d9672</string>
<string>eb4a503020a0573e7303f9066109fdcc</string>
<key>url</key>
<uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-windows-20091029.tar.bz2</uri>
<uri>http://modularsystems.sl/libraries/boost-1.39.0-windows-20100318.tar.bz2</uri>
</map>
</map>
</map>