From 8df23895091fcbaad712d1011e66cbff58b19a8d Mon Sep 17 00:00:00 2001 From: Hazim Gazov Date: Mon, 3 May 2010 16:32:04 -0300 Subject: [PATCH] hopefully this fixes everything --- indra/newview/llfloaterimagepreview.cpp | 11 ++ indra/newview/llfloaterimagepreview.h | 3 + indra/newview/llfloaternamedesc.cpp | 16 +++ indra/newview/llfloaternamedesc.h | 7 ++ indra/newview/llinventorybridge.cpp | 112 +++++++++++++++--- indra/newview/llloginhandler.cpp | 36 +++--- indra/newview/llviewernetwork.cpp | 80 +++++++++++++ .../default/xui/en-us/floater_inventory.xml | 4 + .../default/xui/en-us/menu_inventory.xml | 17 +++ 9 files changed, 250 insertions(+), 36 deletions(-) diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 24b9929ee..9225afb0d 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -83,6 +83,17 @@ LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) : loadImage(mFilenameAndPath); } +// +LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename, void* item) : + LLFloaterNameDesc(filename, item) +{ + mLastMouseX = 0; + mLastMouseY = 0; + mImagep = NULL ; + loadImage(mFilenameAndPath); +} +// + //----------------------------------------------------------------------------- // postBuild() //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index 6a4de3d3c..003e57917 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -107,6 +107,9 @@ class LLFloaterImagePreview : public LLFloaterNameDesc { public: LLFloaterImagePreview(const std::string& filename); + // + LLFloaterImagePreview(const std::string& filename, void* item); + // virtual ~LLFloaterImagePreview(); virtual BOOL postBuild(); diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index acfcfab44..0e7a4403a 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -71,6 +71,9 @@ const S32 PREF_BUTTON_HEIGHT = 16; LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename ) : LLFloater(std::string("Name/Description Floater")) { + // + mItem = NULL; + // mFilenameAndPath = filename; mFilename = gDirUtilp->getBaseFileName(filename, false); // SL-5521 Maintain capitalization of filename when making the inventory item. JC @@ -78,6 +81,19 @@ LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename ) mIsAudio = FALSE; } +// +LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename, void* item ) + : LLFloater(std::string("Name/Description Floater")) +{ + 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; +} +// + //----------------------------------------------------------------------------- // postBuild() //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h index 6aa19eba4..4febf390b 100644 --- a/indra/newview/llfloaternamedesc.h +++ b/indra/newview/llfloaternamedesc.h @@ -45,6 +45,9 @@ class LLFloaterNameDesc : public LLFloater { public: LLFloaterNameDesc(const std::string& filename); + // + LLFloaterNameDesc(const std::string& filename, void* item); + // virtual ~LLFloaterNameDesc(); virtual BOOL postBuild(); @@ -57,6 +60,10 @@ protected: std::string mFilenameAndPath; std::string mFilename; + + // + void* mItem; + // static void onBtnOK(void*); static void onBtnCancel(void*); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 459ac2f07..4dbfa3511 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -923,24 +923,6 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model, { restoreItem(); } - else if("open hex" == action) - { - LLInventoryItem* item = model->getItem(mUUID); - if(!item) return; -#if OPENSIM_RULES!=1 - if(item->getCreatorUUID() != gAgentID) return; -#endif /* OPENSIM_RULES!=1 */ - DOFloaterHex::show(mUUID); - } - else if("open text" == action) - { - LLInventoryItem* item = model->getItem(mUUID); - if(!item) return; -#if OPENSIM_RULES!=1 - if(item->getCreatorUUID() != gAgentID) return; -#endif /* OPENSIM_RULES!=1 */ - HGFloaterTextEditor::show(mUUID); - } else if ("copy_uuid" == action) { // Single item only @@ -970,6 +952,100 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model, folder_view_itemp->getListener()->pasteFromClipboard(); return; } + // + else if("open hex" == action) + { + LLInventoryItem* item = model->getItem(mUUID); + if(!item) return; + DOFloaterHex::show(mUUID); + } + else if("open text" == action) + { + LLInventoryItem* item = model->getItem(mUUID); + if(!item) return; + HGFloaterTextEditor::show(mUUID); + } + else if ("rez" == action) + { + LLInventoryItem* item = model->getItem(mUUID); + if(!item) return; + LLViewerRegion* regionp = gAgent.getRegion(); + if (!regionp) + { + llwarns << "Couldn't find region to rez object" << llendl; + return; + } + + //llinfos << "Rezzing object" << llendl; + make_ui_sound("UISndObjectRezIn"); + + if (regionp + && (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX)) + { + LLFirstUse::useSandbox(); + } + + BOOL remove_from_inventory = !item->getPermissions().allowCopyBy(gAgent.getID()); + + LLVector3 rezpos = gAgent.getPositionAgent() + (gAgent.getAtAxis() * 5.0f); + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RezObject); + + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID()); + + msg->nextBlock("RezData"); + // if it's being rezzed from task inventory, we need to enable + // saving it back into the task inventory. + // *FIX: We can probably compress this to a single byte, since I + // think folderid == mSourceID. This will be a later + // optimization. + msg->addUUIDFast(_PREHASH_FromTaskID, LLUUID::null); + msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE); + msg->addVector3Fast(_PREHASH_RayStart, rezpos); + msg->addVector3Fast(_PREHASH_RayEnd, rezpos); + msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null); + msg->addBOOLFast(_PREHASH_RayEndIsIntersection, FALSE); + msg->addBOOLFast(_PREHASH_RezSelected, true); + msg->addBOOLFast(_PREHASH_RemoveItem, remove_from_inventory); + + // deal with permissions slam logic + pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); + + LLUUID folder_id = item->getParentUUID(); + msg->nextBlockFast(_PREHASH_InventoryData); + item->packMessage(msg); + + msg->sendReliable(regionp->getHost()); + } + else if("reupload" == action) + { + LLInventoryItem* item = model->getItem(mUUID); + if(!item) return; + + LLFilePicker& picker = LLFilePicker::instance(); + std::string filename; + + switch(item->getType()) + { + case LLAssetType::AT_TEXTURE: + if(!picker.getOpenFile(LLFilePicker::FFLOAD_IMAGE)) + return; + filename = picker.getFirstFile(); + if(!filename.empty()) + { + LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename, item); + LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_image_preview.xml"); + } + break; + default: + break; + } + } + // } void LLItemBridge::selectItem() diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp index 0d5484a35..78192bafc 100644 --- a/indra/newview/llloginhandler.cpp +++ b/indra/newview/llloginhandler.cpp @@ -78,76 +78,76 @@ void LLLoginHandler::parse(const LLSD& queryMap) EGridInfo grid_choice = GRID_INFO_NONE; if (queryMap["grid"].asString() == "aditi") { - grid_choice = GRID_INFO_ADITI; + grid_choice = GRID_INFO_ADITI; } else if (queryMap["grid"].asString() == "agni") { - grid_choice = GRID_INFO_AGNI; + grid_choice = GRID_INFO_AGNI; } else if (queryMap["grid"].asString() == "siva") { - grid_choice = GRID_INFO_SIVA; + grid_choice = GRID_INFO_SIVA; } else if (queryMap["grid"].asString() == "damballah") { - grid_choice = GRID_INFO_DAMBALLAH; + grid_choice = GRID_INFO_DAMBALLAH; } else if (queryMap["grid"].asString() == "durga") { - grid_choice = GRID_INFO_DURGA; + grid_choice = GRID_INFO_DURGA; } else if (queryMap["grid"].asString() == "shakti") { - grid_choice = GRID_INFO_SHAKTI; + grid_choice = GRID_INFO_SHAKTI; } else if (queryMap["grid"].asString() == "soma") { - grid_choice = GRID_INFO_SOMA; + grid_choice = GRID_INFO_SOMA; } else if (queryMap["grid"].asString() == "ganga") { - grid_choice = GRID_INFO_GANGA; + grid_choice = GRID_INFO_GANGA; } else if (queryMap["grid"].asString() == "vaak") { - grid_choice = GRID_INFO_VAAK; + grid_choice = GRID_INFO_VAAK; } else if (queryMap["grid"].asString() == "uma") { - grid_choice = GRID_INFO_UMA; + grid_choice = GRID_INFO_UMA; } else if (queryMap["grid"].asString() == "mohini") { - grid_choice = GRID_INFO_MOHINI; + grid_choice = GRID_INFO_MOHINI; } else if (queryMap["grid"].asString() == "yami") { - grid_choice = GRID_INFO_YAMI; + grid_choice = GRID_INFO_YAMI; } else if (queryMap["grid"].asString() == "nandi") { - grid_choice = GRID_INFO_NANDI; + grid_choice = GRID_INFO_NANDI; } else if (queryMap["grid"].asString() == "mitra") { - grid_choice = GRID_INFO_MITRA; + grid_choice = GRID_INFO_MITRA; } else if (queryMap["grid"].asString() == "radha") { - grid_choice = GRID_INFO_RADHA; + grid_choice = GRID_INFO_RADHA; } else if (queryMap["grid"].asString() == "ravi") { - grid_choice = GRID_INFO_RAVI; + grid_choice = GRID_INFO_RAVI; } else if (queryMap["grid"].asString() == "aruna") { - grid_choice = GRID_INFO_ARUNA; + grid_choice = GRID_INFO_ARUNA; } if(grid_choice != GRID_INFO_NONE) { - LLViewerLogin::getInstance()->setGridChoice((EGridInfo)grid_choice); + LLViewerLogin::getInstance()->setGridChoice(grid_choice); } std::string startLocation = queryMap["location"].asString(); diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 43b1a4aa9..04c2816ef 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -55,6 +55,86 @@ static LLGridData gGridInfo[GRID_INFO_COUNT] = "util.agni.lindenlab.com", "https://login.agni.lindenlab.com/cgi-bin/login.cgi", "https://secondlife.com/helpers/" }, + { "Aruna", + "util.aruna.lindenlab.com", + "https://login.aruna.lindenlab.com/cgi-bin/login.cgi", + "http://aruna-secondlife.webdev.lindenlab.com/helpers/" }, + { "Bharati", + "util.bharati.lindenlab.com", + "https://login.bharati.lindenlab.com/cgi-bin/login.cgi", + "http://bharati-secondlife.webdev.lindenlab.com/helpers/" }, + { "Chandra", + "util.chandra.lindenlab.com", + "https://login.chandra.lindenlab.com/cgi-bin/login.cgi", + "http://chandra-secondlife.webdev.lindenlab.com/helpers/" }, + { "Damballah", + "util.damballah.lindenlab.com", + "https://login.damballah.lindenlab.com/cgi-bin/login.cgi", + "http://damballah-secondlife.webdev.lindenlab.com/helpers/" }, + { "Danu", + "util.danu.lindenlab.com", + "https://login.danu.lindenlab.com/cgi-bin/login.cgi", + "http://danu-secondlife.webdev.lindenlab.com/helpers/" }, + { "Durga", + "util.durga.lindenlab.com", + "https://login.durga.lindenlab.com/cgi-bin/login.cgi", + "http://durga-secondlife.webdev.lindenlab.com/helpers/" }, + { "Ganga", + "util.ganga.lindenlab.com", + "https://login.ganga.lindenlab.com/cgi-bin/login.cgi", + "http://ganga-secondlife.webdev.lindenlab.com/helpers/" }, + { "Mitra", + "util.mitra.lindenlab.com", + "https://login.mitra.lindenlab.com/cgi-bin/login.cgi", + "http://mitra-secondlife.webdev.lindenlab.com/helpers/" }, + { "Mohini", + "util.mohini.lindenlab.com", + "https://login.mohini.lindenlab.com/cgi-bin/login.cgi", + "http://mohini-secondlife.webdev.lindenlab.com/helpers/" }, + { "Nandi", + "util.nandi.lindenlab.com", + "https://login.nandi.lindenlab.com/cgi-bin/login.cgi", + "http://nandi-secondlife.webdev.lindenlab.com/helpers/" }, + { "Parvati", + "util.parvati.lindenlab.com", + "https://login.parvati.lindenlab.com/cgi-bin/login.cgi", + "http://parvati-secondlife.webdev.lindenlab.com/helpers/" }, + { "Radha", + "util.radha.lindenlab.com", + "https://login.radha.lindenlab.com/cgi-bin/login.cgi", + "http://radha-secondlife.webdev.lindenlab.com/helpers/" }, + { "Ravi", + "util.ravi.lindenlab.com", + "https://login.ravi.lindenlab.com/cgi-bin/login.cgi", + "http://ravi-secondlife.webdev.lindenlab.com/helpers/" }, + { "Siva", + "util.siva.lindenlab.com", + "https://login.siva.lindenlab.com/cgi-bin/login.cgi", + "http://siva-secondlife.webdev.lindenlab.com/helpers/" }, + { "Shakti", + "util.shakti.lindenlab.com", + "https://login.shakti.lindenlab.com/cgi-bin/login.cgi", + "http://shakti-secondlife.webdev.lindenlab.com/helpers/" }, + { "Skanda", + "util.skanda.lindenlab.com", + "https://login.skanda.lindenlab.com/cgi-bin/login.cgi", + "http://skanda-secondlife.webdev.lindenlab.com/helpers/" }, + { "Soma", + "util.soma.lindenlab.com", + "https://login.soma.lindenlab.com/cgi-bin/login.cgi", + "http://soma-secondlife.webdev.lindenlab.com/helpers/" }, + { "Uma", + "util.uma.lindenlab.com", + "https://login.uma.lindenlab.com/cgi-bin/login.cgi", + "http://uma-secondlife.webdev.lindenlab.com/helpers/" }, + { "Vaak", + "util.vaak.lindenlab.com", + "https://login.vaak.lindenlab.com/cgi-bin/login.cgi", + "http://vaak-secondlife.webdev.lindenlab.com/helpers/" }, + { "Yami", + "util.yami.lindenlab.com", + "https://login.yami.lindenlab.com/cgi-bin/login.cgi", + "http://yami-secondlife.webdev.lindenlab.com/helpers/" }, { "Local", "localhost", "https://login.dmz.lindenlab.com/cgi-bin/login.cgi", diff --git a/indra/newview/skins/default/xui/en-us/floater_inventory.xml b/indra/newview/skins/default/xui/en-us/floater_inventory.xml index ed91425d3..4de856988 100644 --- a/indra/newview/skins/default/xui/en-us/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_inventory.xml @@ -56,6 +56,10 @@ name="Empty Trash" width="128"> + + + + + + + + + + + + + + + +