Added user-defined restart delay on estate tools. Fixes FIRE-1073

meow-7.2.2
Ansariel 2011-07-11 23:07:27 +02:00
parent e104aad66a
commit 070c3aae51
4 changed files with 26 additions and 5 deletions

View File

@ -940,17 +940,18 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data)
// static
void LLPanelRegionDebugInfo::onClickRestart(void* data)
{
LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data;
LLNotificationsUtil::add("ConfirmRestart", LLSD(), LLSD(),
boost::bind(&LLPanelRegionDebugInfo::callbackRestart, (LLPanelRegionDebugInfo*)data, _1, _2));
boost::bind(&LLPanelRegionDebugInfo::callbackRestart, (LLPanelRegionDebugInfo*)data, _1, _2, self->getChild<LLSpinCtrl>("restart_delay")->getValue().asInteger()));
}
bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLSD& response)
bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLSD& response, S32 seconds)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option != 0) return false;
strings_t strings;
strings.push_back("120");
strings.push_back(llformat("%d", seconds));
LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings);
return false;

View File

@ -194,7 +194,7 @@ protected:
static void onClickTopColliders(void*);
static void onClickTopScripts(void*);
static void onClickRestart(void* data);
bool callbackRestart(const LLSD& notification, const LLSD& response);
bool callbackRestart(const LLSD& notification, const LLSD& response, S32 seconds);
static void onClickCancelRestart(void* data);
private:

View File

@ -36,5 +36,9 @@
<button label="?" name="top_scripts_help"/>
<button label="Region neu starten" name="restart_btn" tool_tip="2-Minuten-Countdown und Region neu starten"/>
<button label="?" name="restart_help"/>
<text name="label_restart_delay" width="60">
Sekunden:
</text>
<spinner name="restart_delay" left_delta="65"/>
<button label="Neustart verzögern" name="cancel_restart_btn" tool_tip="Regionsneustart um eine Stunde verschieben"/>
</panel>

View File

@ -191,6 +191,22 @@
tool_tip="Give 2 minute countdown and restart region"
top_pad="5"
width="130" />
<text follows="left|top" top_delta="5" left_delta="135" width="50" name="label_restart_delay">
Seconds:
</text>
<spinner
bottom_delta="0"
decimal_digits="0"
follows="left|top"
height="16"
increment="1"
initial_value="120"
left_delta="55"
max_val="3600"
min_val="15"
mouse_opaque="true"
name="restart_delay"
width="50"/>
<button
follows="left|top"
height="20"
@ -199,6 +215,6 @@
left="10"
name="cancel_restart_btn"
tool_tip="Delay region restart by one hour"
top_pad="5"
top_pad="10"
width="130" />
</panel>