diff options
| author | Leyla Farazha <leyla@lindenlab.com> | 2010-02-12 11:09:39 -0800 | 
|---|---|---|
| committer | Leyla Farazha <leyla@lindenlab.com> | 2010-02-12 11:09:39 -0800 | 
| commit | c61cb61ecc6beca1560a93cdad4ed1bc055c57f9 (patch) | |
| tree | dc451334df084a9961dcb58458b2b2c6324702d9 /indra | |
| parent | de1cf42eb631b1254193e1f9e6e1236da3c4cfda (diff) | |
EXT-5050 Make sure there is a Delete button in God Mode and that it works
reviewed by Monore CC# 108
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterevent.cpp | 81 | ||||
| -rw-r--r-- | indra/newview/llfloaterevent.h | 6 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_event.xml | 21 | 
3 files changed, 58 insertions, 50 deletions
| 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<LLTextBox>("event_duration"); -	mTBDesc = getChild<LLTextEditor>("event_desc"); +	mTBDesc = getChild<LLExpandableTextBox>("event_desc");  	mTBDesc->setEnabled(FALSE);  	mTBRunBy = getChild<LLTextBox>("event_runby"); @@ -128,6 +130,9 @@ BOOL LLFloaterEvent::postBuild()  	mCreateEventBtn = getChild<LLButton>( "create_event_btn");  	mCreateEventBtn->setClickedCallback(onClickCreateEvent, this); +	mGodDeleteEventBtn = getChild<LLButton>( "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 @@ -271,33 +300,12 @@ 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:        </text> -      <name_box +      <text          follows="left|top"          height="20"          initial_value="(retrieving)" @@ -174,8 +174,7 @@                 height="106"                 layout="topleft"                 left="6" -       name="event_desc" -               value="Du waltz die spritz" +               name="event_desc"                 width="313" />      </layout_panel>      <layout_panel @@ -200,12 +199,26 @@             tool_tip="Create Event"             width="18" />        <button +       follows="left|top" +           height="18" +           image_selected="MinusItem_Press" +           image_unselected="MinusItem_Off" +           image_disabled="MinusItem_Disabled" +           layout="topleft" +           visible="false"  +           left="6" +           top_pad="-7"  +          name="god_delete_event_btn" +           picture_style="true" +           tool_tip="Delete Event" +           width="18" /> +      <button     follows="left|top"     height="23"     label="Notify Me"     layout="topleft"     left_pad="3" -   top_delta="-1" +   top_delta="-12"     name="notify_btn"     width="100" />        <button | 
