From ec23ec68ea8835e4155e083ec5570245b0aef1ec Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 10 Oct 2011 19:17:38 -0700 Subject: EXP-1310 FIX Profile button should open Web Profile floater removed unused LLWeb functions for opening non-web media moved logic inside floaters and away from auxiliary functions --- indra/newview/llviewerhelp.cpp | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) (limited to 'indra/newview/llviewerhelp.cpp') diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 3a3d4f3881..d1120b6269 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -69,15 +69,12 @@ LLHelpHandler gHelpHandler; ////////////////////////////// // implement LLHelp interface -void LLViewerHelp::showTopic(const std::string &topic) +std::string LLViewerHelp::getURL(const std::string &topic) { // allow overriding the help server with a local help file if( gSavedSettings.getBOOL("HelpUseLocal") ) { - showHelp(); - LLFloaterHelpBrowser* helpbrowser = dynamic_cast(LLFloaterReg::getInstance("help_browser")); - helpbrowser->navigateToLocalPage( "help-offline" , "index.html" ); - return; + return "__local"; } // if the help topic is empty, use the default topic @@ -99,11 +96,12 @@ void LLViewerHelp::showTopic(const std::string &topic) } } - // work out the URL for this topic and display it - showHelp(); - - std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic ); - setRawURL(helpURL); + return LLViewerHelpUtil::buildHelpURL( help_topic ); +} + +void LLViewerHelp::showTopic(const std::string& topic) +{ + LLFloaterReg::showInstance("help_browser", topic); } std::string LLViewerHelp::defaultTopic() @@ -146,23 +144,4 @@ std::string LLViewerHelp::getTopicFromFocus() return defaultTopic(); } -// static -void LLViewerHelp::showHelp() -{ - LLFloaterReg::showInstance("help_browser"); -} - -// static -void LLViewerHelp::setRawURL(std::string url) -{ - LLFloaterHelpBrowser* helpbrowser = dynamic_cast(LLFloaterReg::getInstance("help_browser")); - if (helpbrowser) - { - helpbrowser->openMedia(url); - } - else - { - llwarns << "Eep, help_browser floater not found" << llendl; - } -} -- cgit v1.3 From 87c321512a24527e2e4deddc6bb5db6dda5ca9b8 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 13 Oct 2011 10:47:53 -0700 Subject: fix for profile button not following floater state --- indra/newview/llviewerhelp.cpp | 1 - indra/newview/llviewermenu.cpp | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerhelp.cpp') diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index d1120b6269..a8a918f259 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -144,4 +144,3 @@ std::string LLViewerHelp::getTopicFromFocus() return defaultTopic(); } - diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index aee46ed5be..4b90f1952a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3113,6 +3113,11 @@ void handle_avatar_eject(const LLSD& avatar_id) } } +bool my_profile_visible() +{ + return LLAvatarActions::profileVisible(gAgent.getID()); +} + bool enable_freeze_eject(const LLSD& avatar_id) { // Use avatar_id if available, otherwise default to right-click avatar @@ -4516,6 +4521,13 @@ bool tools_visible_take_object() return !is_selection_buy_not_take(); } +bool enable_how_to_visible(const LLSD& param) +{ + LLFloaterWebContent::Params p; + p.target = "__help_how_to"; + return LLFloaterReg::instanceVisible(param, p); +} + class LLToolsEnableBuyOrTake : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -6879,6 +6891,11 @@ class LLToggleHowTo : public view_listener_t { bool handleEvent(const LLSD& userdata) { + LLFloaterWebContent::Params p; + p.url = gSavedSettings.getString("HowToHelpURL"); + p.target = "__help_how_to"; + + LLFloaterReg::toggleInstanceOrBringToFront(userdata, p); return true; } }; @@ -8047,6 +8064,7 @@ void initialize_menus() // Help menu // most items use the ShowFloater method view_listener_t::addMenu(new LLToggleHowTo(), "Help.ToggleHowTo"); + enable.add("Help.HowToVisible", boost::bind(&enable_how_to_visible, _2)); // Advanced menu view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole"); @@ -8240,7 +8258,7 @@ void initialize_menus() enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile"); - enable.add("Avatar.IsMyProfileOpen", boost::bind(&LLAvatarActions::profileVisible, gAgent.getID())); + enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible)); view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); enable.add("Avatar.EnableFreezeEject", boost::bind(&enable_freeze_eject, _2)); -- cgit v1.3