#9 - region restart delay

This commit is contained in:
Siana Gearz
2011-11-10 03:45:29 +01:00
parent 121a557fe5
commit e6dce6ad7b
5 changed files with 15 additions and 11 deletions

View File

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

View File

@@ -195,7 +195,7 @@ protected:
static void onClickTopColliders(void*); static void onClickTopColliders(void*);
static void onClickTopScripts(void*); static void onClickTopScripts(void*);
static void onClickRestart(void* data); 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); static void onClickCancelRestart(void* data);
private: private:

View File

@@ -3693,7 +3693,7 @@ Does this group contain Mature content?
label="Confirm restart" label="Confirm restart"
name="ConfirmRestart" name="ConfirmRestart"
type="alert"> type="alert">
Do you really want to restart this region in 2 minutes? Do you really want to restart this region?
<usetemplate <usetemplate
name="okcancelbuttons" name="okcancelbuttons"
notext="Cancel" notext="Cancel"

View File

@@ -66,12 +66,15 @@
width="150" /> width="150" />
<button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
left="170" name="top_scripts_help" width="18" /> left="170" name="top_scripts_help" width="18" />
<button bottom_delta="-50" follows="left|top" height="20" label="Restart Region" <button bottom_delta="-50" follows="left|top" height="20" label="Restart Region"
left="10" name="restart_btn" left="10" name="restart_btn"
tool_tip="Give 2 minute countdown and restart region" width="130" /> tool_tip="Give x second countdown and restart region" width="130" />
<button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" <spinner bottom_delta="0" decimal_digits="0" follows="left|top" height="16"
left="150" name="restart_help" width="18" /> increment="1" initial_val="120" left_delta="135" max_val="3600" min_val="15"
<button bottom_delta="-23" follows="left|top" height="20" label="Delay Restart" mouse_opaque="true" name="rcount" label="Seconds:" label_width="50" width="105" />
<button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
left="255" name="restart_help" width="18" />
<button bottom_delta="-23" follows="left|top" height="20" label="Delay Restart"
left="10" name="cancel_restart_btn" left="10" name="cancel_restart_btn"
tool_tip="Delay region restart by one hour" width="130" /> tool_tip="Delay region restart by one hour" width="130" />
</panel> </panel>

View File

@@ -1600,7 +1600,7 @@ Publier cette petite annonce maintenant pour [AMOUNT] L$ ?
<usetemplate canceltext="Annuler" name="yesnocancelbuttons" notext="Non" yestext="Oui"/> <usetemplate canceltext="Annuler" name="yesnocancelbuttons" notext="Non" yestext="Oui"/>
</notification> </notification>
<notification label="Confirmer le redémarrage" name="ConfirmRestart"> <notification label="Confirmer le redémarrage" name="ConfirmRestart">
Souhaitez-vous vraiment redémarrer cette région dans 2 minutes ? Souhaitez-vous vraiment redémarrer cette région ?
<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
</notification> </notification>
<notification label="Envoyer un message à la région" name="MessageRegion"> <notification label="Envoyer un message à la région" name="MessageRegion">