From 48ba1af15e149e111592b1e9bfbc8cce4c15d5c4 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 10 Dec 2009 11:30:20 -0800 Subject: EXT-3047 "Block" item in "more verbs" menu of mini inspector isn't disabled when resident is blocked EXT-3358 Cannot toggle Grid pulldown on login screen reviewed by Richard --- indra/newview/llinspectavatar.cpp | 52 ++++++++++++++++++++-- indra/newview/llpanellogin.cpp | 4 -- .../default/xui/en/menu_inspect_avatar_gear.xml | 12 ++++- 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 39114d64b4..dae980feb1 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -115,7 +115,7 @@ private: void onClickTeleport(); void onClickInviteToGroup(); void onClickPay(); - void onClickBlock(); + void onToggleMute(); void onClickReport(); void onClickFreeze(); void onClickEject(); @@ -126,6 +126,8 @@ private: bool onVisibleZoomIn(); void onClickMuteVolume(); void onVolumeChange(const LLSD& data); + bool enableMute(); + bool enableUnmute(); // Is used to determine if "Add friend" option should be enabled in gear menu bool isNotFriend(); @@ -205,7 +207,7 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd) mCommitCallbackRegistrar.add("InspectAvatar.Teleport", boost::bind(&LLInspectAvatar::onClickTeleport, this)); mCommitCallbackRegistrar.add("InspectAvatar.InviteToGroup", boost::bind(&LLInspectAvatar::onClickInviteToGroup, this)); mCommitCallbackRegistrar.add("InspectAvatar.Pay", boost::bind(&LLInspectAvatar::onClickPay, this)); - mCommitCallbackRegistrar.add("InspectAvatar.Block", boost::bind(&LLInspectAvatar::onClickBlock, this)); + mCommitCallbackRegistrar.add("InspectAvatar.ToggleMute", boost::bind(&LLInspectAvatar::onToggleMute, this)); mCommitCallbackRegistrar.add("InspectAvatar.Freeze", boost::bind(&LLInspectAvatar::onClickFreeze, this)); mCommitCallbackRegistrar.add("InspectAvatar.Eject", @@ -221,6 +223,8 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd) mEnableCallbackRegistrar.add("InspectAvatar.VisibleZoomIn", boost::bind(&LLInspectAvatar::onVisibleZoomIn, this)); mEnableCallbackRegistrar.add("InspectAvatar.Gear.Enable", boost::bind(&LLInspectAvatar::isNotFriend, this)); + mEnableCallbackRegistrar.add("InspectAvatar.EnableMute", boost::bind(&LLInspectAvatar::enableMute, this)); + mEnableCallbackRegistrar.add("InspectAvatar.EnableUnmute", boost::bind(&LLInspectAvatar::enableUnmute, this)); // can't make the properties request until the widgets are constructed // as it might return immediately, so do it in postBuild. @@ -625,10 +629,19 @@ void LLInspectAvatar::onClickPay() closeFloater(); } -void LLInspectAvatar::onClickBlock() +void LLInspectAvatar::onToggleMute() { LLMute mute(mAvatarID, mAvatarName, LLMute::AGENT); - LLMuteList::getInstance()->add(mute); + + if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) + { + LLMuteList::getInstance()->remove(mute); + } + else + { + LLMuteList::getInstance()->add(mute); + } + LLPanelBlockedList::showPanelAndSelect(mute.mID); closeFloater(); } @@ -663,6 +676,37 @@ void LLInspectAvatar::onClickFindOnMap() LLFloaterReg::showInstance("world_map"); } + +bool LLInspectAvatar::enableMute() +{ + bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_self = mAvatarID == gAgent.getID(); + + if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName)) + { + return true; + } + else + { + return false; + } +} + +bool LLInspectAvatar::enableUnmute() +{ + bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_self = mAvatarID == gAgent.getID(); + + if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName)) + { + return true; + } + else + { + return false; + } +} + ////////////////////////////////////////////////////////////////////////////// // LLInspectAvatarUtil ////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a729b8c06f..5e983f41c7 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -671,12 +671,8 @@ void LLPanelLogin::refreshLocation( bool force_visible ) sInstance->childSetVisible("start_location_combo", show_start); sInstance->childSetVisible("start_location_text", show_start); -#if LL_RELEASE_FOR_DOWNLOAD BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); sInstance->childSetVisible("server_combo", show_server); -#else - sInstance->childSetVisible("server_combo", TRUE); -#endif #endif } diff --git a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml index ef0bf72058..01df208850 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml @@ -48,7 +48,17 @@ label="Block" name="block"> + function="InspectAvatar.ToggleMute"/> + + + + + Date: Tue, 15 Dec 2009 16:25:11 -0800 Subject: EXT-2649 Replace 'Advanced > Set Away After 30 Minutes' with Away time options EXT-2649 [BSI] Confirm on Drop EXT-3416 Can't name a new gesture on creation (and renaming is HARD) reviewed by James --- indra/newview/app_settings/settings.xml | 13 +--- indra/newview/llappviewer.cpp | 2 +- indra/newview/llpreview.cpp | 7 ++ indra/newview/llpreviewgesture.cpp | 4 + indra/newview/llviewermenu.cpp | 79 ++++++++++++-------- indra/newview/llviewerwindow.cpp | 2 +- .../default/xui/en/floater_preview_gesture.xml | 24 +++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 11 --- .../newview/skins/default/xui/en/notifications.xml | 13 ++++ .../default/xui/en/panel_preferences_general.xml | 85 +++++++++++----------- 10 files changed, 143 insertions(+), 97 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 59252af362..37b55fdd86 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8,7 +8,7 @@ Persist 1 Type - F32 + S32 Value 300.0 @@ -45,17 +45,6 @@ Value 0 - AllowIdleAFK - - Comment - Automatically set AFK (away from keyboard) mode when idle - Persist - 1 - Type - Boolean - Value - 1 - AllowMultipleViewers Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 90b8cd9572..a4dee14e40 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -332,7 +332,7 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; void idle_afk_check() { // check idle timers - if (gSavedSettings.getBOOL("AllowIdleAFK") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) + if (gSavedSettings.getS32("AFKTimeout") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getS32("AFKTimeout"))) { gAgent.setAFK(); } diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index c95882931b..0b0c03e9e9 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -150,6 +150,13 @@ void LLPreview::onCommit() LLPointer new_item = new LLViewerInventoryItem(item); new_item->setDescription(childGetText("desc")); + + std::string new_name = childGetText("name"); + if ( (new_item->getName() != new_name) && !new_name.empty()) + { + new_item->rename(childGetText("name")); + } + if(mObjectUUID.notNull()) { // must be in an object diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 30cb21c83c..e2eee6708a 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -495,6 +495,10 @@ BOOL LLPreviewGesture::postBuild() childSetCommitCallback("desc", LLPreview::onText, this); childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + + childSetCommitCallback("name", LLPreview::onText, this); + childSetText("name", item->getName()); + childSetPrevalidate("name", &LLLineEditor::prevalidateASCIIPrintableNoPipe); } return LLPreview::postBuild(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0be0b56bc3..91d305bee7 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5851,47 +5851,68 @@ void confirm_replace_attachment(S32 option, void* user_data) } } -class LLAttachmentDrop : public view_listener_t +bool callback_attachment_drop(const LLSD& notification, const LLSD& response) { - bool handleEvent(const LLSD& userdata) + // Called when the user clicked on an object attached to them + // and selected "Drop". + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLViewerObject *object = gObjectList.findObject(object_id); + + if (!object) { - // Called when the user clicked on an object attached to them - // and selected "Drop". - LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - if (!object) - { - llwarns << "handle_drop_attachment() - no object to drop" << llendl; - return true; - } + llwarns << "handle_drop_attachment() - no object to drop" << llendl; + return true; + } - LLViewerObject *parent = (LLViewerObject*)object->getParent(); - while (parent) + LLViewerObject *parent = (LLViewerObject*)object->getParent(); + while (parent) + { + if(parent->isAvatar()) { - if(parent->isAvatar()) - { - break; - } - object = parent; - parent = (LLViewerObject*)parent->getParent(); + break; } + object = parent; + parent = (LLViewerObject*)parent->getParent(); + } - if (!object) + if (!object) + { + llwarns << "handle_detach() - no object to detach" << llendl; + return true; + } + + if (object->isAvatar()) + { + llwarns << "Trying to detach avatar from avatar." << llendl; + return true; + } + + // reselect the object + LLSelectMgr::getInstance()->selectObjectAndFamily(object); + + LLSelectMgr::getInstance()->sendDropAttachment(); + + return true; +} + +class LLAttachmentDrop : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLSD payload; + LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + + if (object) { - llwarns << "handle_detach() - no object to detach" << llendl; - return true; + payload["object_id"] = object->getID(); } - - if (object->isAvatar()) + else { - llwarns << "Trying to detach avatar from avatar." << llendl; + llwarns << "Drop object not found" << llendl; return true; } - // The sendDropAttachment() method works on the list of selected - // objects. Thus we need to clear the list, make sure it only - // contains the object the user clicked, send the message, - // then clear the list. - LLSelectMgr::getInstance()->sendDropAttachment(); + LLNotificationsUtil::add("AttachmentDrop", LLSD(), payload, &callback_attachment_drop); return true; } }; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 966aeba25c..0ddc517754 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1014,7 +1014,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) { mActive = FALSE; - if (gSavedSettings.getBOOL("AllowIdleAFK")) + if (gSavedSettings.getS32("AFKTimeout")) { gAgent.setAFK(); } diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml index 8cc2c91ef5..3dc546aee3 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -39,6 +39,28 @@ name="Title"> Gesture: [NAME] + + Name: + + Description: diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 0891afaf76..aff28fd8c8 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1110,17 +1110,6 @@ name="Advanced" tear_off="true" visible="false"> - - - - + + You are about to drop your attachment. + Are you sure you want to continue? + + + - - Away timeout: - - - - seconds - + + Away timeout: + + + + + + + +