diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fba611aa40..729bc73488 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3710,6 +3710,17 @@ Value 1 + EnableGestureSounds + + Comment + Play sounds from gestures + Persist + 1 + Type + Boolean + Value + 1 + EnableMouselook Comment diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index d2f76572dc..9b64a8b5f5 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -49,6 +49,7 @@ #include "llassetuploadresponders.h" #include "llnearbychatbar.h" #include "llnotificationmanager.h" +#include "llselectmgr.h" #define phoenix_bridge_name "#LSL<->Client Bridge v0.12" #define phoenix_folder_name "#Phoenix" @@ -192,11 +193,12 @@ void FSLSLBridge :: initBridge() void FSLSLBridge :: startCreation() { - //are we already in conversation with a bridge? - if (mpBridge != NULL) - { - return; - } + ////are we already in conversation with a bridge? + ////must have already received a URL call from a bridge. + //if (mpBridge != NULL) + //{ + // return; + //} //if bridge object doesn't exist - create and attach it, update script. LLUUID catID = findFSCategory(); @@ -326,7 +328,7 @@ FSLSLBridgeRezCallback :: ~FSLSLBridgeRezCallback() void FSLSLBridgeRezCallback :: fire(const LLUUID& inv_item) { - if ((FSLSLBridge::instance().getBridge() != NULL) || inv_item.isNull() || !FSLSLBridge::instance().bridgeCreating()) + if ((FSLSLBridge::instance().getBridge() != NULL) || inv_item.isNull() || !FSLSLBridge::instance().getBridgeCreating()) return; //detach from default and put on the right point @@ -350,7 +352,7 @@ FSLSLBridgeScriptCallback :: ~FSLSLBridgeScriptCallback() void FSLSLBridgeScriptCallback::fire(const LLUUID& inv_item) { - if (inv_item.isNull() || !FSLSLBridge::instance().bridgeCreating()) + if (inv_item.isNull() || !FSLSLBridge::instance().getBridgeCreating()) return; LLViewerInventoryItem* item = gInventory.getItem(inv_item); @@ -366,28 +368,25 @@ void FSLSLBridgeScriptCallback::fire(const LLUUID& inv_item) //caps import std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgent"); std::string isMono = "lsl2"; //could also be "mono" - if (!url.empty()) + if (!url.empty() && obj != NULL) { const std::string fName = prepUploadFile(); LLLiveLSLEditor::uploadAssetViaCapsStatic(url, fName, obj->getID(), inv_item, isMono, true); + llinfos << "updating script ID for bridge" << llendl; + FSLSLBridge::instance().mScriptItemID = inv_item; } else { //can't complete bridge creation - detach and remove object, remove script + //try to clean up and go away. Fail. LLVOAvatarSelf::detachAttachmentIntoInventory(FSLSLBridge::instance().getBridge()->getUUID()); - - LLViewerInventoryItem* bridgeItem = FSLSLBridge::instance().getBridge(); - gInventory.purgeObject(bridgeItem->getUUID()); - bridgeItem->removeFromServer(); - + FSLSLBridge::instance().cleanUpBridge(); + //also clean up script remains gInventory.purgeObject(item->getUUID()); - item->removeFromServer(); - gInventory.notifyObservers(); + return; } - llinfos << "updating script ID for bridge" << llendl; - FSLSLBridge::instance().mScriptItemID = inv_item; } std::string FSLSLBridgeScriptCallback::prepUploadFile() @@ -419,19 +418,45 @@ void FSLSLBridge :: checkBridgeScriptName(std::string fileName) { //this is our script upload LLViewerObject* obj = gAgentAvatarp->getWornAttachment(mpBridge->getUUID()); - - registerVOInventoryListener(obj, NULL); + if (obj == NULL) + { + //something happened to our object. Try to fail gracefully. + cleanUpBridge(); + return; + } + //registerVOInventoryListener(obj, NULL); obj->saveScript(gInventory.getItem(mScriptItemID), TRUE, false); - requestVOInventory(); + FSLSLBridgeCleanupTimer *objTimer = new FSLSLBridgeCleanupTimer((F32)1.0); + objTimer->startTimer(); + //obj->doInventoryCallback(); + //requestVOInventory(); } } -void FSLSLBridge :: inventoryChanged(LLViewerObject* object, LLInventoryObject::object_list_t* inventory_objects, S32 serial_num, void* queue) + +BOOL FSLSLBridgeCleanupTimer::tick() +{ + FSLSLBridge::instance().finishBridge(); + stopTimer(); + return TRUE; +} + +void FSLSLBridge :: cleanUpBridge() +{ + //something unexpected went wrong. Try to clean up and not crash. + reportToNearbyChat("Bridge object not found. Can't proceed with creation, exiting."); + gInventory.purgeObject(mpBridge->getUUID()); + gInventory.notifyObservers(); + mpBridge = NULL; + mBridgeCreating = false; +} + +void FSLSLBridge :: finishBridge() { //announce yourself reportToNearbyChat("Bridge created."); mBridgeCreating = false; - removeVOInventoryListener(); + //removeVOInventoryListener(); cleanUpBridgeFolder(); } // diff --git a/indra/newview/fslslbridge.h b/indra/newview/fslslbridge.h index 9093726551..51ddfaab9c 100644 --- a/indra/newview/fslslbridge.h +++ b/indra/newview/fslslbridge.h @@ -33,18 +33,20 @@ #include "fslslbridgerequest.h" #include "llviewerinventory.h" #include "llinventoryobserver.h" +#include "lleventtimer.h" // //-TT Client LSL Bridge File // -class FSLSLBridge : public LLSingleton, public LLHTTPClient::Responder, public LLVOInventoryListener +class FSLSLBridge : public LLSingleton, public LLHTTPClient::Responder //, public LLVOInventoryListener { static const U8 BRIDGE_POINT = 127; friend class FSLSLBridgeScriptCallback; friend class FSLSLBridgeRezCallback; friend class FSLSLBridgeInventoryObserver; + friend class FSLSLBridgeCleanupTimer; public: FSLSLBridge(); @@ -56,12 +58,17 @@ public: void initBridge(); void recreateBridge(); void processAttach(LLViewerObject *object, const LLViewerJointAttachment *attachment); - bool bridgeCreating() {return mBridgeCreating; }; + void startCreation(); + + bool getBridgeCreating() {return mBridgeCreating; }; + void setBridgeCreating(bool status) { mBridgeCreating = status; }; + void setBridge(LLViewerInventoryItem* item) { mpBridge = item; }; LLViewerInventoryItem* getBridge() { return mpBridge; }; + void checkBridgeScriptName(std::string fileName); - void startCreation(); std::string currentFullName() { return mCurrentFullName; } + void finishBridge(); protected: @@ -89,6 +96,7 @@ protected: void cleanUpBridgeFolder(); void setupBridge(LLViewerObject *object); void initCreationStep(); + void cleanUpBridge(); }; @@ -124,4 +132,14 @@ protected: }; +class FSLSLBridgeCleanupTimer : public LLEventTimer +{ +public: + FSLSLBridgeCleanupTimer(F32 period) : LLEventTimer(period) {} + BOOL tick(); + void startTimer() { mEventTimer.start(); } + void stopTimer() { mEventTimer.stop(); } + +}; + #endif // FS_LSLBRIDGE_H diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a897dd3a39..ad1699d774 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -322,6 +322,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.VoiceSetKey", boost::bind(&LLFloaterPreference::onClickSetKey, this)); mCommitCallbackRegistrar.add("Pref.EditMediaLists", boost::bind(&LLFloaterPreference::onClickSetKey, this)); mCommitCallbackRegistrar.add("Pref.VoiceSetMiddleMouse", boost::bind(&LLFloaterPreference::onClickSetMiddleMouse, this)); + mCommitCallbackRegistrar.add("Pref.SetSounds", boost::bind(&LLFloaterPreference::onClickSetSounds, this)); // mCommitCallbackRegistrar.add("Pref.ClickSkipDialogs", boost::bind(&LLFloaterPreference::onClickSkipDialogs, this)); // mCommitCallbackRegistrar.add("Pref.ClickResetDialogs", boost::bind(&LLFloaterPreference::onClickResetDialogs, this)); mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); @@ -1364,6 +1365,14 @@ void LLFloaterPreference::onClickSetMiddleMouse() p2t_line_editor->setValue(advanced_preferences->getString("middle_mouse")); } } + +void LLFloaterPreference::onClickSetSounds() +{ + // Disable Enable gesture sounds checkbox if the master sound is disabled + // or if sound effects are disabled. + getChild("gesture_audio_play_btn")->setEnabled(!gSavedSettings.getBOOL("MuteSounds")); +} + /* void LLFloaterPreference::onClickSkipDialogs() { diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index a9dcde1941..770e1466d4 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -134,6 +134,7 @@ public: void onClickSetKey(); void setKey(KEY key); void onClickSetMiddleMouse(); + void onClickSetSounds(); // void onClickSkipDialogs(); // void onClickResetDialogs(); void onClickEnablePopup(); diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 011aa47e31..e71f1d6657 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -28,6 +28,8 @@ #include "lltranslate.h" +#include + #include "llbufferstream.h" #include "llui.h" #include "llversioninfo.h" @@ -76,7 +78,9 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std //static void LLTranslate::getTranslateUrl(std::string &translate_url, const std::string &from_lang, const std::string &to_lang, const std::string &mesg) { - std::string escaped_mesg = curl_escape(mesg.c_str(), mesg.size()); + char * curl_str = curl_escape(mesg.c_str(), mesg.size()); + std::string const escaped_mesg(curl_str); + curl_free(curl_str); translate_url = m_GoogleURL + escaped_mesg + m_GoogleLangSpec diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0b3d715833..1fd65d1f2a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4808,6 +4808,9 @@ void process_sound_trigger(LLMessageSystem *msg, void **) if (pPeoplePanel) pPeoplePanel->requestRadarChannelAlertSync(); } + + // Don't play sounds from gestures if they are not enabled. + if (!gSavedSettings.getBOOL("EnableGestureSounds")) return; gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global); } diff --git a/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml index f18a5ceb94..17739fd8e6 100644 --- a/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml @@ -14,21 +14,23 @@ - + - - + + + + - + + top_pad="35"> Voice Chat Settings @@ -82,7 +82,7 @@ KC: I used view_border's around text_editor's due to text render issues with bor left_delta="3" bottom_delta="2" height="16" - width="310" + right="-86" h_pad="0" v_pad="0" allow_scroll="false" @@ -98,7 +98,7 @@ KC: I used view_border's around text_editor's due to text render issues with bor layout="topleft" follows="top|right" image_overlay="Copy" - top_delta="-3" + top_delta="-5" left_pad="4" height="21" width="21" @@ -107,15 +107,15 @@ KC: I used view_border's around text_editor's due to text render issues with bor + value="Online" /> @@ -138,7 +138,7 @@ KC: I used view_border's around text_editor's due to text render issues with bor left_delta="3" bottom_delta="2" height="16" - right="-6" + right="-86" h_pad="0" v_pad="0" allow_scroll="false" @@ -149,10 +149,19 @@ KC: I used view_border's around text_editor's due to text render issues with bor name="user_key" value="(loading...)" /> +