diff options
Diffstat (limited to 'indra/newview/llfloatergodtools.cpp')
-rw-r--r-- | indra/newview/llfloatergodtools.cpp | 90 |
1 files changed, 24 insertions, 66 deletions
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 886f5ec924..e7b2da043f 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -39,12 +39,12 @@ #include "llframetimer.h" #include "llgl.h" #include "llhost.h" +#include "llnotificationsutil.h" #include "llregionflags.h" #include "llstring.h" #include "message.h" #include "llagent.h" -#include "llalertdialog.h" #include "llbutton.h" #include "llcheckboxctrl.h" #include "llcombobox.h" @@ -68,7 +68,6 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llfloateravatarpicker.h" -#include "llnotify.h" #include "llxfermanager.h" #include "llvlcomposition.h" #include "llsurface.h" @@ -214,6 +213,9 @@ void LLFloaterGodTools::showPanel(const std::string& panel_name) // static void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) { + llassert(msg); + if (!msg) return; + LLHost host = msg->getSender(); if (host != gAgent.getRegionHost()) { @@ -271,8 +273,7 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) if ( gAgent.isGodlike() && LLFloaterReg::instanceVisible("god_tools") && god_tools->mPanelRegionTools - && god_tools->mPanelObjectTools - && msg ) + && god_tools->mPanelObjectTools) { LLPanelRegionTools* rtool = god_tools->mPanelRegionTools; god_tools->mCurrentHost = host; @@ -415,17 +416,17 @@ LLPanelRegionTools::LLPanelRegionTools() BOOL LLPanelRegionTools::postBuild() { getChild<LLLineEditor>("region name")->setKeystrokeCallback(onChangeSimName, this); - childSetPrevalidate("region name", &LLLineEditor::prevalidatePrintableNotPipe); - childSetPrevalidate("estate", &LLLineEditor::prevalidatePositiveS32); - childSetPrevalidate("parentestate", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("region name", &LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("estate", &LLTextValidate::validatePositiveS32); + childSetPrevalidate("parentestate", &LLTextValidate::validatePositiveS32); childDisable("parentestate"); - childSetPrevalidate("gridposx", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("gridposx", &LLTextValidate::validatePositiveS32); childDisable("gridposx"); - childSetPrevalidate("gridposy", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("gridposy", &LLTextValidate::validatePositiveS32); childDisable("gridposy"); - childSetPrevalidate("redirectx", &LLLineEditor::prevalidatePositiveS32); - childSetPrevalidate("redirecty", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("redirectx", &LLTextValidate::validatePositiveS32); + childSetPrevalidate("redirecty", &LLTextValidate::validatePositiveS32); return TRUE; } @@ -827,7 +828,6 @@ const F32 HOURS_TO_RADIANS = (2.f*F_PI)/24.f; LLPanelGridTools::LLPanelGridTools() : LLPanel() { - mCommitCallbackRegistrar.add("GridTools.KickAll", boost::bind(&LLPanelGridTools::onClickKickAll, this)); mCommitCallbackRegistrar.add("GridTools.FlushMapVisibilityCaches", boost::bind(&LLPanelGridTools::onClickFlushMapVisibilityCaches, this)); } @@ -845,55 +845,15 @@ void LLPanelGridTools::refresh() { } -void LLPanelGridTools::onClickKickAll() -{ - LLNotifications::instance().add("KickAllUsers", LLSD(), LLSD(), LLPanelGridTools::confirmKick); -} - - -bool LLPanelGridTools::confirmKick(const LLSD& notification, const LLSD& response) -{ - if (LLNotification::getSelectedOption(notification, response) == 0) - { - LLSD payload; - payload["kick_message"] = response["message"].asString(); - LLNotifications::instance().add("ConfirmKick", LLSD(), payload, LLPanelGridTools::finishKick); - } - return false; -} - - -// static -bool LLPanelGridTools::finishKick(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - - - if (option == 0) - { - LLMessageSystem* msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_GodKickUser); - msg->nextBlockFast(_PREHASH_UserInfo); - msg->addUUIDFast(_PREHASH_GodID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_AgentID, LL_UUID_ALL_AGENTS ); - msg->addU32("KickFlags", KICK_FLAGS_DEFAULT ); - msg->addStringFast(_PREHASH_Reason, notification["payload"]["kick_message"].asString()); - gAgent.sendReliableMessage(); - } - return false; -} - void LLPanelGridTools::onClickFlushMapVisibilityCaches() { - LLNotifications::instance().add("FlushMapVisibilityCaches", LLSD(), LLSD(), flushMapVisibilityCachesConfirm); + LLNotificationsUtil::add("FlushMapVisibilityCaches", LLSD(), LLSD(), flushMapVisibilityCachesConfirm); } // static bool LLPanelGridTools::flushMapVisibilityCachesConfirm(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) return false; // HACK: Send this as an EstateOwnerRequest so it gets routed @@ -1101,7 +1061,7 @@ void LLPanelObjectTools::onClickDeletePublicOwnedBy() payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; - LLNotifications::instance().add( "GodDeleteAllScriptedPublicObjectsByUser", + LLNotificationsUtil::add( "GodDeleteAllScriptedPublicObjectsByUser", args, payload, callbackSimWideDeletes); @@ -1121,7 +1081,7 @@ void LLPanelObjectTools::onClickDeleteAllScriptedOwnedBy() payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; - LLNotifications::instance().add( "GodDeleteAllScriptedObjectsByUser", + LLNotificationsUtil::add( "GodDeleteAllScriptedObjectsByUser", args, payload, callbackSimWideDeletes); @@ -1141,7 +1101,7 @@ void LLPanelObjectTools::onClickDeleteAllOwnedBy() payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; - LLNotifications::instance().add( "GodDeleteAllObjectsByUser", + LLNotificationsUtil::add( "GodDeleteAllObjectsByUser", args, payload, callbackSimWideDeletes); @@ -1151,7 +1111,7 @@ void LLPanelObjectTools::onClickDeleteAllOwnedBy() // static bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { if (!notification["payload"]["avatar_id"].asUUID().isNull()) @@ -1166,7 +1126,7 @@ bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const void LLPanelObjectTools::onClickSet() { // grandparent is a floater, which can have a dependent - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, this)); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2))); } void LLPanelObjectTools::onClickSetBySelection(void* data) @@ -1190,14 +1150,12 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) panelp->childSetValue("target_avatar_name", name); } -// static -void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) +void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) { - LLPanelObjectTools* object_tools = (LLPanelObjectTools*) data; if (ids.empty() || names.empty()) return; - object_tools->mTargetAvatar = ids[0]; - object_tools->childSetValue("target_avatar_name", names[0]); - object_tools->refresh(); + mTargetAvatar = ids[0]; + childSetValue("target_avatar_name", names[0]); + refresh(); } void LLPanelObjectTools::onChangeAnything() @@ -1334,7 +1292,7 @@ void LLPanelRequestTools::onClickRequest() void terrain_download_done(void** data, S32 status, LLExtStat ext_status) { - LLNotifications::instance().add("TerrainDownloaded"); + LLNotificationsUtil::add("TerrainDownloaded"); } |