summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-11-23 15:29:01 -0800
committerJames Cook <james@lindenlab.com>2009-11-23 15:29:01 -0800
commit2ede27a5e266794fc3d034f12344a580260a3546 (patch)
tree3999b35def2542cee36400eff09c764ab993bd22
parent620de712c44e2229158d93e456d500a65d842b8d (diff)
Context menu item to show/hide nav bar parcel property icons.
-rw-r--r--indra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/lllocationinputctrl.cpp44
-rw-r--r--indra/newview/skins/default/xui/en/menu_navbar.xml17
3 files changed, 51 insertions, 23 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 21ccf2ac91..85a465c073 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7712,7 +7712,7 @@
<key>NavBarShowCoordinates</key>
<map>
<key>Comment</key>
- <string>Show Coordinates in Location Input Field</string>
+ <string>Show coordinates in navigation bar</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -7720,6 +7720,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>NavBarShowParcelProperties</key>
+ <map>
+ <key>Comment</key>
+ <string>Show parcel property icons in navigation bar</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>ShowCrosshairs</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index be96d7b43a..5d2a0aa382 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -596,6 +596,16 @@ void LLLocationInputCtrl::refreshLocation()
void LLLocationInputCtrl::refreshParcelIcons()
{
+ static LLUICachedControl<bool> show_properties("NavBarShowParcelProperties", false);
+ if (!show_properties)
+ {
+ for (S32 i = 0; i < ICON_COUNT; ++i)
+ {
+ mParcelIcon[i]->setVisible(false);
+ }
+ return;
+ }
+
LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance();
// *TODO buy
//bool allow_buy = vpm->canAgentBuyParcel( vpm->getAgentParcel(), false);
@@ -754,11 +764,17 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata)
{
std::string item = userdata.asString();
- if (item == std::string("show_coordinates"))
+ if (item == "show_coordinates")
{
gSavedSettings.setBOOL("NavBarShowCoordinates",!gSavedSettings.getBOOL("NavBarShowCoordinates"));
}
- else if (item == std::string("landmark"))
+ else if (item == "show_properties")
+ {
+ gSavedSettings.setBOOL("NavBarShowParcelProperties",
+ !gSavedSettings.getBOOL("NavBarShowParcelProperties"));
+ refreshParcelIcons();
+ }
+ else if (item == "landmark")
{
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
@@ -772,23 +788,23 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata)
LLSD().insert("type", "landmark").insert("id",landmark->getUUID()));
}
}
- else if (item == std::string("cut"))
+ else if (item == "cut")
{
mTextEntry->cut();
}
- else if (item == std::string("copy"))
+ else if (item == "copy")
{
mTextEntry->copy();
}
- else if (item == std::string("paste"))
+ else if (item == "paste")
{
mTextEntry->paste();
}
- else if (item == std::string("delete"))
+ else if (item == "delete")
{
mTextEntry->deleteSelection();
}
- else if (item == std::string("select_all"))
+ else if (item == "select_all")
{
mTextEntry->selectAll();
}
@@ -798,28 +814,28 @@ bool LLLocationInputCtrl::onLocationContextMenuItemEnabled(const LLSD& userdata)
{
std::string item = userdata.asString();
- if (item == std::string("can_cut"))
+ if (item == "can_cut")
{
return mTextEntry->canCut();
}
- else if (item == std::string("can_copy"))
+ else if (item == "can_copy")
{
return mTextEntry->canCopy();
}
- else if (item == std::string("can_paste"))
+ else if (item == "can_paste")
{
return mTextEntry->canPaste();
}
- else if (item == std::string("can_delete"))
+ else if (item == "can_delete")
{
return mTextEntry->canDeselect();
}
- else if (item == std::string("can_select_all"))
+ else if (item == "can_select_all")
{
return mTextEntry->canSelectAll();
}
- else if(item == std::string("show_coordinates")){
-
+ else if(item == "show_coordinates")
+ {
return gSavedSettings.getBOOL("NavBarShowCoordinates");
}
diff --git a/indra/newview/skins/default/xui/en/menu_navbar.xml b/indra/newview/skins/default/xui/en/menu_navbar.xml
index 89469fb013..e17eeb46f6 100644
--- a/indra/newview/skins/default/xui/en/menu_navbar.xml
+++ b/indra/newview/skins/default/xui/en/menu_navbar.xml
@@ -10,7 +10,6 @@
width="128">
<menu_item_check
label="Show Coordinates"
- layout="topleft"
name="Show Coordinates">
<menu_item_check.on_click
function="Navbar.Action"
@@ -19,22 +18,28 @@
function="Navbar.EnableMenuItem"
parameter="show_coordinates" />
</menu_item_check>
+ <menu_item_check
+ label="Show Parcel Properties"
+ name="Show Parcel Properties">
+ <menu_item_check.on_click
+ function="Navbar.Action"
+ parameter="show_properties" />
+ <menu_item_check.on_check
+ control="NavBarShowParcelProperties" />
+ </menu_item_check>
<!-- Label of 'Landmark' item is changing in runtime,
see AddLandmarkNavBarMenu/EditLandmarkNavBarMenu in strings.xml -->
<menu_item_call
label="Landmark"
- layout="topleft"
name="Landmark">
<menu_item_call.on_click
function="Navbar.Action"
parameter="landmark" />
</menu_item_call>
<menu_item_separator
- layout="topleft"
name="Separator" />
<menu_item_call
label="Cut"
- layout="topleft"
name="Cut">
<menu_item_call.on_click
function="Navbar.Action"
@@ -45,7 +50,6 @@
</menu_item_call>
<menu_item_call
label="Copy"
- layout="topleft"
name="Copy">
<menu_item_call.on_click
function="Navbar.Action"
@@ -56,7 +60,6 @@
</menu_item_call>
<menu_item_call
label="Paste"
- layout="topleft"
name="Paste">
<menu_item_call.on_click
function="Navbar.Action"
@@ -67,7 +70,6 @@
</menu_item_call>
<menu_item_call
label="Delete"
- layout="topleft"
name="Delete">
<menu_item_call.on_click
function="Navbar.Action"
@@ -78,7 +80,6 @@
</menu_item_call>
<menu_item_call
label="Select All"
- layout="topleft"
name="Select All">
<menu_item_call.on_click
function="Navbar.Action"