summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-03-30 15:51:32 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-03-30 15:51:32 +0300
commitc73dcb079991bad12458386274cec409013ad76b (patch)
tree56c272ffb43590d05e73e30448c448fcde624791 /indra
parent4968d50ae6cce7e3b6f03f5d799303f8f466081c (diff)
Fixed bug EXT-6270 (No confirm teleport dialog appears, while teleporting from teleport history tab).
Added teleport confirmation dialog to the teleport history panel. Reviewed by Mike: https://codereview.productengine.com/secondlife/r/135/ --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelteleporthistory.cpp28
-rw-r--r--indra/newview/llpanelteleporthistory.h3
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml12
3 files changed, 41 insertions, 2 deletions
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 90c8f2551f..0a34531eee 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -348,7 +348,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu()
void LLTeleportHistoryPanel::ContextMenu::onTeleport()
{
- LLTeleportHistoryStorage::getInstance()->goToItem(mIndex);
+ confirmTeleport(mIndex);
}
void LLTeleportHistoryPanel::ContextMenu::onInfo()
@@ -507,7 +507,7 @@ void LLTeleportHistoryPanel::onTeleport()
return;
// teleport to existing item in history, so we don't add it again
- mTeleportHistory->goToItem(itemp->getIndex());
+ confirmTeleport(itemp->getIndex());
}
/*
@@ -1058,3 +1058,27 @@ void LLTeleportHistoryPanel::onAccordionExpand(LLUICtrl* ctrl, const LLSD& param
mLastSelectedFlatlList->resetSelection();
}
}
+
+// static
+void LLTeleportHistoryPanel::confirmTeleport(S32 hist_idx)
+{
+ LLSD args;
+ args["HISTORY_ENTRY"] = LLTeleportHistoryStorage::getInstance()->getItems()[hist_idx].mTitle;
+ LLNotificationsUtil::add("TeleportToHistoryEntry", args, LLSD(),
+ boost::bind(&LLTeleportHistoryPanel::onTeleportConfirmation, _1, _2, hist_idx));
+}
+
+// Called when user reacts upon teleport confirmation dialog.
+// static
+bool LLTeleportHistoryPanel::onTeleportConfirmation(const LLSD& notification, const LLSD& response, S32 hist_idx)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+
+ if (0 == option)
+ {
+ // Teleport to given history item.
+ LLTeleportHistoryStorage::getInstance()->goToItem(hist_idx);
+ }
+
+ return false;
+}
diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h
index 4eeaec7705..5e2ccc0c93 100644
--- a/indra/newview/llpanelteleporthistory.h
+++ b/indra/newview/llpanelteleporthistory.h
@@ -103,6 +103,9 @@ private:
bool isAccordionCollapsedByUser(LLUICtrl* acc_tab);
void onAccordionExpand(LLUICtrl* ctrl, const LLSD& param);
+ static void confirmTeleport(S32 hist_idx);
+ static bool onTeleportConfirmation(const LLSD& notification, const LLSD& response, S32 hist_idx);
+
LLTeleportHistoryStorage* mTeleportHistory;
LLAccordionCtrl* mHistoryAccordion;
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 6d18111be0..8501143fe6 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3111,6 +3111,18 @@ Teleport to [PICK]?
</notification>
<notification
+ icon="alertmodal.tga"
+ name="TeleportToHistoryEntry"
+ type="alertmodal">
+Teleport to [HISTORY_ENTRY]?
+ <usetemplate
+ ignoretext="Confirm that I want to teleport to a history location"
+ name="okcancelignore"
+ notext="Cancel"
+ yestext="Teleport"/>
+ </notification>
+
+ <notification
icon="alert.tga"
label="Message everyone in your Estate"
name="MessageEstate"