summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lllocationinputctrl.cpp7
-rw-r--r--indra/newview/lllocationinputctrl.h1
-rw-r--r--indra/newview/llviewermenu.cpp17
-rw-r--r--indra/newview/llviewermenu.h2
4 files changed, 20 insertions, 7 deletions
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index bb713aba19..45c60df84f 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -243,6 +243,8 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
addChild(mAddLandmarkBtn);
LLButton::Params for_sale_button = p.for_sale_button;
+ for_sale_button.click_callback.function(
+ boost::bind(&LLLocationInputCtrl::onForSaleButtonClicked, this));
mForSaleBtn = LLUICtrlFactory::create<LLButton>( for_sale_button );
// *TODO: Make clickable?
addChild(mForSaleBtn);
@@ -474,6 +476,11 @@ void LLLocationInputCtrl::onInfoButtonClicked()
LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "agent"));
}
+void LLLocationInputCtrl::onForSaleButtonClicked()
+{
+ handle_buy_land();
+}
+
void LLLocationInputCtrl::onAddLandmarkButtonClicked()
{
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h
index 442a64f521..0211062b05 100644
--- a/indra/newview/lllocationinputctrl.h
+++ b/indra/newview/lllocationinputctrl.h
@@ -132,6 +132,7 @@ private:
void onLocationPrearrange(const LLSD& data);
void onTextEditorRightClicked(S32 x, S32 y, MASK mask);
void onLandmarkLoaded(LLLandmark* lm);
+ void onForSaleButtonClicked();
void onAddLandmarkButtonClicked();
void onAgentParcelChange();
// callbacks
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index f853a70c87..4307002980 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5628,12 +5628,7 @@ class LLShowFloater : public view_listener_t
}
else if (floater_name == "buy land")
{
- if (LLViewerParcelMgr::getInstance()->selectionEmpty())
- {
- LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
- }
-
- LLViewerParcelMgr::getInstance()->startBuyLand();
+ handle_buy_land();
}
else if (floater_name == "script errors")
{
@@ -5843,7 +5838,15 @@ BOOL enable_buy_land(void*)
LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false);
}
-
+void handle_buy_land()
+{
+ LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance();
+ if (vpm->selectionEmpty())
+ {
+ vpm->selectParcelAt(gAgent.getPositionGlobal());
+ }
+ vpm->startBuyLand();
+}
class LLObjectAttachToAvatar : public view_listener_t
{
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 9a6fe03f9f..01a6b34170 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -102,6 +102,8 @@ void handle_take_copy();
void handle_look_at_selection(const LLSD& param);
void handle_zoom_to_object(LLUUID object_id);
+void handle_buy_land();
+
// Takes avatar UUID, or if no UUID passed, uses last selected object
void handle_avatar_freeze(const LLSD& avatar_id);