From 4ddc1e2ce8896a43aaee1b886cd112c4bb63e721 Mon Sep 17 00:00:00 2001
From: Cinders <cinder@cinderblocks.biz>
Date: Sat, 15 Aug 2015 14:55:17 -0600
Subject: [PATCH] ALCH-269 - User specified time for region restarts

---
 indra/newview/llfloaterregioninfo.cpp         |  9 ++++++---
 .../skins/default/xui/en/notifications.xml    |  2 +-
 .../default/xui/en/panel_region_debug.xml     | 19 +++++++++++++++++--
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 19b233fdf0..bc253bb2fd 100755
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1103,8 +1103,11 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data)
 // static
 void LLPanelRegionDebugInfo::onClickRestart(void* data)
 {
-	LLNotificationsUtil::add("ConfirmRestart", LLSD(), LLSD(), 
-		boost::bind(&LLPanelRegionDebugInfo::callbackRestart, (LLPanelRegionDebugInfo*)data, _1, _2));
+	LLPanelRegionDebugInfo* self = static_cast<LLPanelRegionDebugInfo*>(data);
+	LLSD payload;
+	payload["SECONDS"] = self->getChild<LLUICtrl>("restart_timer")->getValue().asString();
+	LLNotificationsUtil::add("ConfirmRestart", payload, payload,
+		boost::bind(&LLPanelRegionDebugInfo::callbackRestart, self, _1, _2));
 }
 
 bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLSD& response)
@@ -1113,7 +1116,7 @@ bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLS
 	if (option != 0) return false;
 
 	strings_t strings;
-	strings.push_back("120");
+	strings.push_back(notification["payload"]["SECONDS"].asString());
 	LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
 	sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings);
 	return false;
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 449d58aba4..8ae97f0019 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5307,7 +5307,7 @@ Does this group contain Moderate content?
    label="Confirm restart"
    name="ConfirmRestart"
    type="alert">
-Do you really want to restart this region in 2 minutes?
+Do you really want to restart this region in [SECONDS] seconds?
     <tag>confirm</tag>
     <usetemplate
      name="okcancelbuttons"
diff --git a/indra/newview/skins/default/xui/en/panel_region_debug.xml b/indra/newview/skins/default/xui/en/panel_region_debug.xml
index fea5f1b19f..6065228d55 100755
--- a/indra/newview/skins/default/xui/en/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_debug.xml
@@ -178,9 +178,24 @@
      layout="topleft"
      left_pad="155"
      name="restart_btn"
-     tool_tip="Give 2 minute countdown and restart region"
+     tool_tip="Give a countdown and restart region"
      top_delta="0"
-     width="150" />
+     width="100" />
+    <spinner
+     decimal_digits="0"
+     enabled="true"
+     follows="left|top"
+     height="20"
+     increment="1"
+     initial_value="120"
+     layout="topleft"
+     left_pad="0"
+     max_val="1024"
+     min_val="0"
+     name="restart_timer"
+     tool_tip="Seconds before restart"
+     top_delta="0"
+     width="50" />
     <button
      follows="left|top"
      height="20"
-- 
GitLab