From c61cb61ecc6beca1560a93cdad4ed1bc055c57f9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 12 Feb 2010 11:09:39 -0800 Subject: EXT-5050 Make sure there is a Delete button in God Mode and that it works reviewed by Monore CC# 108 --- indra/newview/llfloaterevent.cpp | 81 ++++++++++------------ indra/newview/llfloaterevent.h | 6 +- .../newview/skins/default/xui/en/floater_event.xml | 21 ++++-- 3 files changed, 58 insertions(+), 50 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index 91c2810026..a51c613c37 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -45,11 +45,13 @@ #include "llcommandhandler.h" // secondlife:///app/chat/ support #include "lleventflags.h" #include "lleventnotifier.h" +#include "llexpandabletextbox.h" #include "llfloater.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" #include "llinventorymodel.h" #include "llsecondlifeurls.h" +#include "llslurl.h" #include "lltextbox.h" #include "lltexteditor.h" #include "lluiconstants.h" @@ -109,7 +111,7 @@ BOOL LLFloaterEvent::postBuild() mTBDuration = getChild("event_duration"); - mTBDesc = getChild("event_desc"); + mTBDesc = getChild("event_desc"); mTBDesc->setEnabled(FALSE); mTBRunBy = getChild("event_runby"); @@ -128,6 +130,9 @@ BOOL LLFloaterEvent::postBuild() mCreateEventBtn = getChild( "create_event_btn"); mCreateEventBtn->setClickedCallback(onClickCreateEvent, this); + mGodDeleteEventBtn = getChild( "god_delete_event_btn"); + mGodDeleteEventBtn->setClickedCallback(boost::bind(&LLFloaterEvent::onClickDeleteEvent, this)); + return TRUE; } @@ -143,6 +148,20 @@ void LLFloaterEvent::setEventID(const U32 event_id) } } +void LLFloaterEvent::onClickDeleteEvent() +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_EventGodDelete); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_EventData); + msg->addU32Fast(_PREHASH_EventID, mEventID); + + gAgent.sendReliableMessage(); +} void LLFloaterEvent::sendEventInfoRequest() { @@ -157,7 +176,6 @@ void LLFloaterEvent::sendEventInfoRequest() gAgent.sendReliableMessage(); } - //static void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) { @@ -174,6 +192,7 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) floater->mTBCategory->setText(floater->mEventInfo.mCategoryStr); floater->mTBDate->setText(floater->mEventInfo.mTimeStr); floater->mTBDesc->setText(floater->mEventInfo.mDesc); + floater->mTBRunBy->setText(LLSLURL::buildCommand("agent", floater->mEventInfo.mRunByID, "inspect")); floater->mTBDuration->setText(llformat("%d:%.2d", floater->mEventInfo.mDuration / 60, floater->mEventInfo.mDuration % 60)); @@ -224,23 +243,33 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) { floater->mNotifyBtn->setLabel(floater->getString("notify")); } + + floater->mMapBtn->setEnabled(TRUE); + floater->mTeleportBtn->setEnabled(TRUE); } } void LLFloaterEvent::draw() { - std::string name; - gCacheName->getFullName(mEventInfo.mRunByID, name); - - mTBRunBy->setText(name); + mGodDeleteEventBtn->setVisible(gAgent.isGodlike()); LLPanel::draw(); } void LLFloaterEvent::resetInfo() { - // Clear all of the text fields. + mTBName->setText(LLStringUtil::null); + mTBCategory->setText(LLStringUtil::null); + mTBDate->setText(LLStringUtil::null); + mTBDesc->setText(LLStringUtil::null); + mTBDuration->setText(LLStringUtil::null); + mTBCover->setText(LLStringUtil::null); + mTBLocation->setText(LLStringUtil::null); + mTBRunBy->setText(LLStringUtil::null); + mNotifyBtn->setEnabled(FALSE); + mMapBtn->setEnabled(FALSE); + mTeleportBtn->setEnabled(FALSE); } // static @@ -270,34 +299,13 @@ void LLFloaterEvent::onClickMap(void* data) } -// static -/* -void LLPanelEvent::onClickLandmark(void* data) -{ - LLPanelEvent* self = (LLPanelEvent*)data; - //create_landmark(self->mTBName->getText(), "", self->mEventInfo.mPosGlobal); - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("CreateLandmarkForEvent"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_EventData); - msg->addU32Fast(_PREHASH_EventID, self->mEventID); - msg->nextBlockFast(_PREHASH_InventoryBlock); - LLUUID folder_id; - folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); - msg->addUUIDFast(_PREHASH_FolderID, folder_id); - msg->addStringFast(_PREHASH_Name, self->mTBName->getText()); - gAgent.sendReliableMessage(); -} -*/ - // static void LLFloaterEvent::onClickCreateEvent(void* data) { LLNotificationsUtil::add("PromptGoToEventsPage");//, LLSD(), LLSD(), callbackCreateEventWebPage); } + // static void LLFloaterEvent::onClickNotify(void *data) { @@ -314,18 +322,3 @@ void LLFloaterEvent::onClickNotify(void *data) self->mNotifyBtn->setLabel(self->getString("notify")); } } -/* -// static -bool LLPanelEvent::callbackCreateEventWebPage(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (0 == option) - { - llinfos << "Loading events page " << LLNotifications::instance().getGlobalString("EVENTS_URL") << llendl; - - LLWeb::loadURL( LLNotifications::instance().getGlobalString("EVENTS_URL")); - } - return false; -} -*/ - diff --git a/indra/newview/llfloaterevent.h b/indra/newview/llfloaterevent.h index c93e3f73ca..54aaaf6a0f 100644 --- a/indra/newview/llfloaterevent.h +++ b/indra/newview/llfloaterevent.h @@ -34,7 +34,6 @@ #define LL_LLFLOATEREVENT_H #include "llfloater.h" - #include "lleventinfo.h" #include "lluuid.h" #include "v3dmath.h" @@ -42,6 +41,7 @@ class LLTextBox; class LLTextEditor; class LLButton; +class LLExpandableTextBox; class LLMessageSystem; class LLFloaterEvent : public LLFloater @@ -68,6 +68,7 @@ protected: //static void onClickLandmark(void*); static void onClickCreateEvent(void*); static void onClickNotify(void*); + void onClickDeleteEvent(); // static bool callbackCreateEventWebPage(const LLSD& notification, const LLSD& response); @@ -79,7 +80,7 @@ protected: LLTextBox* mTBCategory; LLTextBox* mTBDate; LLTextBox* mTBDuration; - LLTextEditor* mTBDesc; + LLExpandableTextBox* mTBDesc; LLTextBox* mTBRunBy; LLTextBox* mTBLocation; @@ -88,6 +89,7 @@ protected: LLButton* mTeleportBtn; LLButton* mMapBtn; LLButton* mCreateEventBtn; + LLButton* mGodDeleteEventBtn; LLButton* mNotifyBtn; }; diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml index 3d579f56be..9ce0c9c86d 100644 --- a/indra/newview/skins/default/xui/en/floater_event.xml +++ b/indra/newview/skins/default/xui/en/floater_event.xml @@ -73,7 +73,7 @@ width="310"> Run by: -