From dcf3e8884d1378f1f95921d24eab7a41248b3570 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 15 Dec 2009 15:59:16 -0800 Subject: 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. --- indra/newview/llviewermenu.cpp | 66 ++++++++-------------- .../skins/default/xui/en/menu_attachment_self.xml | 23 +------- .../skins/default/xui/en/menu_avatar_self.xml | 11 +--- .../default/xui/en/menu_inspect_self_gear.xml | 3 +- indra/newview/skins/default/xui/en/menu_land.xml | 3 +- indra/newview/skins/default/xui/en/menu_login.xml | 18 +++--- .../newview/skins/default/xui/en/menu_mini_map.xml | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 35 ++---------- .../skins/default/xui/en/panel_place_profile.xml | 4 +- 9 files changed, 44 insertions(+), 121 deletions(-) (limited to 'indra') 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 @@ - @@ -88,11 +69,9 @@ + function="CustomizeAvatar" /> 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..."> + function="CustomizeAvatar" /> @@ -200,14 +199,6 @@ function="SideTray.PanelPeopleTab" parameter="friends_panel" /> - + function="CustomizeAvatar" /> 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"> + function="Land.Buy" /> 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"> @@ -53,7 +53,7 @@ label="About [APP_NAME]" name="About Second Life"> @@ -175,7 +175,7 @@ name="UI Preview Tool" shortcut="control|T"> @@ -196,7 +196,7 @@ name="Textbox" shortcut="control|1"> @@ -237,14 +237,14 @@ label="Show TOS" name="TOS"> 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$"> + function="BuyCurrency" /> @@ -50,8 +49,7 @@ layout="topleft" name="Appearance"> + function="CustomizeAvatar" /> @@ -82,7 +80,7 @@ name="Gestures" shortcut="control|G"> + function="Land.Buy" /> @@ -295,7 +292,7 @@ layout="topleft" name="My Land"> - + function="ReportAbuse" /> - - - - @@ -652,7 +652,7 @@ tab_stop="false" width="105"> -- cgit v1.2.3