summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneltopinfobar.cpp
diff options
context:
space:
mode:
authorAndrew Polunin <apolunin@productengine.com>2010-06-18 15:58:00 +0300
committerAndrew Polunin <apolunin@productengine.com>2010-06-18 15:58:00 +0300
commit2c5af9672c8b531762475c752dd1904a4024ff67 (patch)
treee97f3a00fe526e65d7ed44bf264afd39486b408c /indra/newview/llpaneltopinfobar.cpp
parenta8276dfd5998a7ef86668d7a8e3f9e8a7d124801 (diff)
EXT-5808 FIXED Added another context menu. Also Navigation Bar and Mini-Location bar are mutually exclusive now
- Implemented context menu for Mini-Location bar (menu_topinfobar.xml) - Implemented function show_topinfobar_context_menu() (in llviewermenu.h) which displays context menu for Mini-Location bar. - Functions toggle_show_navigation_panel() and toggle_show_mini_location_panel() modified so that Navigation Bar and Mini-Location bar are mutually exclusive (when the former is visible the latter is hidden and vice versa). - Implemented method LLPanelTopInfoBar::onContextMenuItemClicked which handles \"landmark\" and \"copy\" Mini-Location bar context menu actions. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/607/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpaneltopinfobar.cpp')
-rw-r--r--indra/newview/llpaneltopinfobar.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 7cf574b6e5..68dc1cdf71 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -36,12 +36,16 @@
#include "llagent.h"
#include "llagentui.h"
+#include "llclipboard.h"
+#include "lllandmarkactions.h"
#include "lllocationinputctrl.h"
#include "llnotificationsutil.h"
#include "llparcel.h"
#include "llsidetray.h"
+#include "llslurl.h"
#include "llstatusbar.h"
#include "llviewercontrol.h"
+#include "llviewerinventory.h"
#include "llviewermenu.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
@@ -65,6 +69,9 @@ private:
LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(0)
{
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar()
+ .add("TopInfoBar.Action", boost::bind(&LLPanelTopInfoBar::onContextMenuItemClicked, this, _2));
+
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_topinfo_bar.xml");
}
@@ -120,7 +127,7 @@ void LLPanelTopInfoBar::handleLoginComplete()
BOOL LLPanelTopInfoBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
- show_navbar_context_menu(this, x, y);
+ show_topinfobar_context_menu(this, x, y);
return TRUE;
}
@@ -387,6 +394,32 @@ void LLPanelTopInfoBar::onAgentParcelChange()
update();
}
+void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item)
+{
+ if (item == "landmark")
+ {
+ LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
+
+ if(landmark == NULL)
+ {
+ LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark"));
+ }
+ else
+ {
+ LLSideTray::getInstance()->showPanel("panel_places",
+ LLSD().with("type", "landmark").with("id",landmark->getUUID()));
+ }
+ }
+ else if (item == "copy")
+ {
+ LLSLURL slurl;
+ LLAgentUI::buildSLURL(slurl, false);
+ LLUIString location_str(slurl.getSLURLString());
+
+ gClipboard.copyFromString(location_str);
+ }
+}
+
void LLPanelTopInfoBar::onInfoButtonClicked()
{
LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "agent"));