summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-12-15 15:59:16 -0800
committerJames Cook <james@lindenlab.com>2009-12-15 15:59:16 -0800
commitdcf3e8884d1378f1f95921d24eab7a41248b3570 (patch)
treea6d1c6e35307a8759ef5c2430bf9ea65291d311a
parentcb5935fd1bd78d64aea7d33629ee7b95b61c1f90 (diff)
EXT-3494 Sanitize floater show versus toggle
Eliminated legacy "ShowFloater" method in favor of Floater.Show and Floater.Toggle. Wrote new custom show methods where needed. Reviewed with Leyla.
-rw-r--r--indra/newview/llviewermenu.cpp66
-rw-r--r--indra/newview/skins/default/xui/en/menu_attachment_self.xml23
-rw-r--r--indra/newview/skins/default/xui/en/menu_avatar_self.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml3
-rw-r--r--indra/newview/skins/default/xui/en/menu_land.xml3
-rw-r--r--indra/newview/skins/default/xui/en/menu_login.xml18
-rw-r--r--indra/newview/skins/default/xui/en/menu_mini_map.xml2
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml35
-rw-r--r--indra/newview/skins/default/xui/en/panel_place_profile.xml4
9 files changed, 44 insertions, 121 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 0be0b56bc3..075c4a30fa 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5520,47 +5520,27 @@ void handle_viewer_disable_message_log(void*)
gMessageSystem->stopLogging();
}
-class LLShowFloater : public view_listener_t
+void handle_customize_avatar()
{
- bool handleEvent(const LLSD& userdata)
+ if (gAgentWearables.areWearablesLoaded())
{
- std::string floater_name = userdata.asString();
- if (floater_name == "appearance")
- {
- if (gAgentWearables.areWearablesLoaded())
- {
- gAgent.changeCameraToCustomizeAvatar();
- }
- }
- else if (floater_name == "toolbar")
- {
- LLToolBar::toggle(NULL);
- }
- else if (floater_name == "buy land")
- {
- handle_buy_land();
- }
- else if (floater_name == "script errors")
- {
- LLFloaterScriptDebug::show(LLUUID::null);
- }
- else if (floater_name == "complaint reporter")
- {
- // Prevent menu from appearing in screen shot.
- gMenuHolder->hideMenus();
- LLFloaterReporter::showFromMenu(COMPLAINT_REPORT);
- }
- else if (floater_name == "buy currency")
- {
- LLFloaterBuyCurrency::buyCurrency();
- }
- else
- {
- LLFloaterReg::toggleInstance(floater_name);
- }
- return true;
+ gAgent.changeCameraToCustomizeAvatar();
}
-};
+}
+
+void handle_report_abuse()
+{
+ // Prevent menu from appearing in screen shot.
+ gMenuHolder->hideMenus();
+ LLFloaterReporter::showFromMenu(COMPLAINT_REPORT);
+}
+
+void handle_buy_currency()
+{
+ LLFloaterBuyCurrency::buyCurrency();
+}
+
+
class LLFloaterVisible : public view_listener_t
{
@@ -5568,11 +5548,6 @@ class LLFloaterVisible : public view_listener_t
{
std::string floater_name = userdata.asString();
bool new_value = false;
- if (floater_name == "toolbar")
- {
- new_value = LLToolBar::visible(NULL);
- }
- else
{
new_value = LLFloaterReg::instanceVisible(floater_name);
}
@@ -7607,6 +7582,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate");
view_listener_t::addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff");
view_listener_t::addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar");
+ commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar));
// View menu
view_listener_t::addMenu(new LLViewMouselook(), "View.Mouselook");
@@ -7931,9 +7907,11 @@ void initialize_menus()
view_listener_t::addMenu(new LLLandEdit(), "Land.Edit");
view_listener_t::addMenu(new LLLandEnableBuyPass(), "Land.EnableBuyPass");
+ commit.add("Land.Buy", boost::bind(&handle_buy_land));
// Generic actions
- view_listener_t::addMenu(new LLShowFloater(), "ShowFloater");
+ commit.add("ReportAbuse", boost::bind(&handle_report_abuse));
+ commit.add("BuyCurrency", boost::bind(&handle_buy_currency));
view_listener_t::addMenu(new LLShowHelp(), "ShowHelp");
view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL");
view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile");
diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
index c85dbbb1bc..281ec5a7c3 100644
--- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml
+++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
@@ -54,25 +54,6 @@
<menu_item_call.on_enable
function="Attachment.EnableDrop" />
</menu_item_call>
- <!--menu_item_call
- label="My Profile"
- layout="topleft"
- name="Profile...">
- <menu_item_call.on_click
- function="ShowAgentProfile"
- parameter="agent" />
- </menu_item_call>
- <menu_item_call
- label="My Appearance"
- layout="topleft"
- name="Appearance...">
- <menu_item_call.on_click
- function="ShowFloater"
- parameter="appearance" />
- <menu_item_call.on_enable
- function="Edit.EnableCustomizeAvatar" />
-
- </menu_item_call-->
<menu_item_separator
layout="topleft" />
@@ -88,11 +69,9 @@
</menu_item_call>
<menu_item_call
label="My Appearance"
- layout="topleft"
name="Appearance...">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="appearance" />
+ function="CustomizeAvatar" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml
index c6ce612a76..9212d2d648 100644
--- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml
+++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml
@@ -187,8 +187,7 @@
layout="topleft"
name="Appearance...">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="appearance" />
+ function="CustomizeAvatar" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
@@ -200,14 +199,6 @@
function="SideTray.PanelPeopleTab"
parameter="friends_panel" />
</menu_item_call>
- <!--menu_item_call
- label="My Gestures"
- layout="topleft"
- name="Gestures...">
- <menu_item_call.on_click
- function="ShowFloater"
- parameter="gestures" />
- </menu_item_call-->
<menu_item_call
label="My Groups"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml
index 9894a01701..9dc2611663 100644
--- a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml
@@ -19,8 +19,7 @@
label="My Appearance"
name="my_appearance">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="appearance" />
+ function="CustomizeAvatar" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
diff --git a/indra/newview/skins/default/xui/en/menu_land.xml b/indra/newview/skins/default/xui/en/menu_land.xml
index bf797555c5..cc6d8ad9c1 100644
--- a/indra/newview/skins/default/xui/en/menu_land.xml
+++ b/indra/newview/skins/default/xui/en/menu_land.xml
@@ -28,8 +28,7 @@
label="Buy This Land"
name="Land Buy">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="buy land" />
+ function="Land.Buy" />
<menu_item_call.on_enable
function="World.EnableBuyLand" />
</menu_item_call>
diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml
index ba3bcc93b3..7a0b11872a 100644
--- a/indra/newview/skins/default/xui/en/menu_login.xml
+++ b/indra/newview/skins/default/xui/en/menu_login.xml
@@ -16,7 +16,7 @@
name="Preferences..."
shortcut="control|P">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Toggle"
parameter="preferences" />
</menu_item_call>
<menu_item_separator />
@@ -53,7 +53,7 @@
label="About [APP_NAME]"
name="About Second Life">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="sl_about" />
</menu_item_call>
</menu>
@@ -175,7 +175,7 @@
name="UI Preview Tool"
shortcut="control|T">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Toggle"
parameter="ui_preview" />
</menu_item_call>
<menu_item_separator />
@@ -196,7 +196,7 @@
name="Textbox"
shortcut="control|1">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="test_textbox" />
</menu_item_call>
<menu_item_call
@@ -204,7 +204,7 @@
name="Text Editor"
shortcut="control|2">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="test_text_editor" />
</menu_item_call>
<menu_item_call
@@ -212,14 +212,14 @@
name="Widgets"
shortcut="control|shift|T">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="test_widgets" />
</menu_item_call>
<menu_item_call
label="Inspectors"
name="Inspectors">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="test_inspectors" />
</menu_item_call>
</menu>
@@ -237,14 +237,14 @@
label="Show TOS"
name="TOS">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="message_tos" />
</menu_item_call>
<menu_item_call
label="Show Critical Message"
name="Critical">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="message_critical" />
</menu_item_call>
<menu_item_call
diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml
index 8d0edf018d..f5ea3e735b 100644
--- a/indra/newview/skins/default/xui/en/menu_mini_map.xml
+++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml
@@ -51,7 +51,7 @@
label="World Map"
name="World Map">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="world_map" />
</menu_item_call>
</menu>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 0891afaf76..71b67594e5 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -32,8 +32,7 @@
layout="topleft"
name="Buy and Sell L$">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="buy currency" />
+ function="BuyCurrency" />
</menu_item_call>
<menu_item_separator
layout="topleft" />
@@ -50,8 +49,7 @@
layout="topleft"
name="Appearance">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="appearance" />
+ function="CustomizeAvatar" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
@@ -82,7 +80,7 @@
name="Gestures"
shortcut="control|G">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Toggle"
parameter="gestures" />
</menu_item_call>
<menu
@@ -285,8 +283,7 @@
layout="topleft"
name="Buy Land">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="buy land" />
+ function="Land.Buy" />
<menu_item_call.on_enable
function="World.EnableBuyLand" />
</menu_item_call>
@@ -295,7 +292,7 @@
layout="topleft"
name="My Land">
<menu_item_call.on_click
- function="ShowFloater"
+ function="Floater.Show"
parameter="land_holdings" />
</menu_item_call>
<menu
@@ -868,14 +865,6 @@
function="ToggleControl"
parameter="DebugPermissions" />
</menu_item_check>
- <!--menu_item_call
- label="Show Script Warning/Error Window"
- layout="topleft"
- name="Show Script Warning/Error Window">
- <menu_item_call.on_click
- function="ShowFloater"
- parameter="script errors" />
- </menu_item_call-->
<menu_item_separator
layout="topleft" />
<menu
@@ -1082,8 +1071,7 @@
layout="topleft"
name="Report Abuse">
<menu_item_call.on_click
- function="ShowFloater"
- parameter="complaint reporter" />
+ function="ReportAbuse" />
</menu_item_call>
<menu_item_call
label="Report Bug"
@@ -3640,17 +3628,6 @@
parameter="all" />
</menu_item_call>
</menu>
- <menu_item_check
- label="Show Toolbar"
- layout="topleft"
- name="Show Toolbar">
- <menu_item_check.on_check
- function="FloaterVisible"
- parameter="toolbar" />
- <menu_item_check.on_click
- function="ShowFloater"
- parameter="toolbar" />
- </menu_item_check>
<menu
create_jump_keys="true"
label="Help"
diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml
index b25d9a7dfc..a5731123b1 100644
--- a/indra/newview/skins/default/xui/en/panel_place_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml
@@ -526,7 +526,7 @@
top="138"
width="90">
<click_callback
- function="ShowFloater"
+ function="Floater.Show"
parameter="about_land" />
</button>
</panel>
@@ -652,7 +652,7 @@
tab_stop="false"
width="105">
<click_callback
- function="ShowFloater"
+ function="Floater.Show"
parameter="region_info" />
</button>
</panel>