From ce265b39482c7b5c341e57fed57c22e94a7d1c38 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 31 Jul 2014 10:07:11 -0400 Subject: [PATCH] Add Destination Guide Adds llfloaterdestinations.* and floater_destinations.xml (needs translations, but not really) Adds GenericErrorPageURL, DestinationGuideURL (not persistent), DestinationGuideShown, and DestinationGuideRect to debug settings Removes ShowcaseURLDefault in favor of DestinationGuideURL from upstream. Also Adds ToolbarVisibleDestinations for the toolbar button, but I'll need to set up a nice way to make the button invisible when the url is empty before adding it to the gui... maybe.. or maybe it's just not important. This commit comes with support for dynamically changing destination guide page based on opensimextras simulator features cap --- indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 60 +++++++++++--- .../newview/app_settings/settings_ascent.xml | 11 +++ indra/newview/lfsimfeaturehandler.cpp | 2 +- indra/newview/llfloaterdestinations.cpp | 77 ++++++++++++++++++ indra/newview/llfloaterdestinations.h | 45 ++++++++++ indra/newview/llmenucommands.cpp | 2 + indra/newview/llstartup.cpp | 4 +- indra/newview/llviewermenu.cpp | 10 +++ .../textures/icn_toolbar_destinations.tga | Bin 0 -> 22 bytes .../xui/en-us/floater_destinations.xml | 26 ++++++ .../skins/default/xui/en-us/menu_viewer.xml | 5 ++ .../skins/default/xui/en-us/panel_toolbar.xml | 5 ++ 13 files changed, 235 insertions(+), 14 deletions(-) create mode 100644 indra/newview/llfloaterdestinations.cpp create mode 100644 indra/newview/llfloaterdestinations.h create mode 100644 indra/newview/skins/default/textures/icn_toolbar_destinations.tga create mode 100644 indra/newview/skins/default/xui/en-us/floater_destinations.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 95e635a3d..018a69664 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -204,6 +204,7 @@ set(viewer_SOURCE_FILES llfloatercolorpicker.cpp llfloatercustomize.cpp llfloaterdaycycle.cpp + llfloaterdestinations.cpp llfloaterdirectory.cpp llfloaterdisplayname.cpp llfloatereditui.cpp @@ -731,6 +732,7 @@ set(viewer_HEADER_FILES llfloatercolorpicker.h llfloatercustomize.h llfloaterdaycycle.h + llfloaterdestinations.h llfloaterdirectory.h llfloaterdisplayname.h llfloatereditui.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3ba271f23..423456538 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -547,17 +547,6 @@ Value - ShowcaseURLDefault - - Comment - URL to load for the Showcase tab in Second Life - Persist - 0 - Type - String - Value - http://secondlife.com/app/showcase/index.php? - CheckForGridUpdates @@ -6069,6 +6058,44 @@ This should be as low as possible, but too low may break functionality Value 89556747-24cb-43ed-920b-47caed15465f + DestinationGuideRect + + Comment + Rectangle for destination guide + Persist + 1 + Type + Rect + Value + + 0 + 0 + 0 + 0 + + + DestinationGuideShown + + Comment + Show destination guide + Persist + 1 + Type + Boolean + Value + 0 + + DestinationGuideURL + + Comment + Destination guide contents + Persist + 0 + Type + String + Value + http://lecs-viewer-web-components.s3.amazonaws.com/v3.0/[GRID_LOWERCASE]/guide.html + DisableCameraConstraints Comment @@ -17887,6 +17914,17 @@ This should be as low as possible, but too low may break functionality Value 0 + GenericErrorPageURL + + Comment + URL to set as a property on LLMediaControl to navigate to if the a page completes with a 400-499 HTTP status code + Persist + 1 + Type + String + Value + http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/404.html + WebProfileFloaterRect Comment diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 8b827b23c..97b67e15e 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -1173,6 +1173,17 @@ Value 0 + ToolbarVisibleDestinations + + Comment + Whether or not the button for destinations is on the toolbar + Persist + 1 + Type + Boolean + Value + 0 + ToolbarVisibleDisplayName Comment diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 897dbe655..38b0b8c63 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -26,7 +26,7 @@ LFSimFeatureHandler::LFSimFeatureHandler() : mSupportsExport(false) -, mDestinationGuideURL(gSavedSettings.getString("ShowcaseURLDefault")) +, mDestinationGuideURL(gSavedSettings.getString("DestinationGuideURL")) , mSearchURL(gSavedSettings.getString("SearchURL")) , mSayRange(20) , mShoutRange(100) diff --git a/indra/newview/llfloaterdestinations.cpp b/indra/newview/llfloaterdestinations.cpp new file mode 100644 index 000000000..219df67ce --- /dev/null +++ b/indra/newview/llfloaterdestinations.cpp @@ -0,0 +1,77 @@ +/** + * @file llfloaterdestinations.h + * @author Leyla Farazha + * @brief floater for the destinations guide + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +/** + * Floater that appears when buying an object, giving a preview + * of its contents and their permissions. + */ + +#include "llviewerprecompiledheaders.h" + +#include "lfsimfeaturehandler.h" +#include "llfloaterdestinations.h" +#include "llmediactrl.h" +#include "lluictrlfactory.h" +#include "llweb.h" + + +LLFloaterDestinations::LLFloaterDestinations(const LLSD& key) + : LLFloater(key) +{ + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_destinations.xml", NULL, false); +} + +LLFloaterDestinations::~LLFloaterDestinations() +{ +} + +BOOL LLFloaterDestinations::postBuild() +{ + enableResizeCtrls(true, true, false); + LLMediaCtrl* destinations = getChild("destination_guide_contents"); + if (destinations) + { + destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + std::string url = gSavedSettings.getString("DestinationGuideURL"); + changeURL(destinations, url); + LFSimFeatureHandler::instance().setDestinationGuideURLCallback(boost::bind(&LLFloaterDestinations::changeURL, this, destinations, _1)); + } + return TRUE; +} + +void LLFloaterDestinations::changeURL(LLMediaCtrl* destinations, const std::string& url) +{ + if (url.empty()) + { + close(); + return; + } + + destinations->navigateTo(LLWeb::expandURLSubstitutions(url, LLSD()), "text/html"); +} + + diff --git a/indra/newview/llfloaterdestinations.h b/indra/newview/llfloaterdestinations.h new file mode 100644 index 000000000..619960a1c --- /dev/null +++ b/indra/newview/llfloaterdestinations.h @@ -0,0 +1,45 @@ +/** + * @file llfloaterdestinations.h + * @author Leyla Farazha + * @brief floater for the destinations guide + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_FLOATER_DESTINATIONS_H +#define LL_FLOATER_DESTINATIONS_H + +#include "llfloater.h" + +class LLFloaterDestinations : + public LLFloater +, public LLFloaterSingleton +{ + friend class LLUISingleton >; +private: + LLFloaterDestinations(const LLSD& key); + /*virtual*/ ~LLFloaterDestinations(); + /*virtual*/ BOOL postBuild(); + void changeURL(class LLMediaCtrl* destinations, const std::string& url); +}; + +#endif diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 109801206..7c60f66cb 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -58,6 +58,7 @@ #include "llfloaterchatterbox.h" #include "llfloatercustomize.h" #include "llfloaterdaycycle.h" +#include "llfloaterdestinations.h" #include "llfloaterdisplayname.h" #include "llfloatereditui.h" #include "llfloaterenvsettings.h" @@ -224,6 +225,7 @@ struct MenuFloaterDict : public LLSingleton registerFloater ("camera controls"); registerFloater ("chat history"); registerFloater ("communicate"); + registerFloater ("destinations"); registerFloater ("friends", 0); registerFloater ("gestures"); registerFloater ("groups", 1); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index df84f6917..de3a8b4f8 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1597,7 +1597,7 @@ bool idle_startup() if (!secondlife) { LFSimFeatureHandler& inst(LFSimFeatureHandler::instance()); - inst.setDestinationGuideURLCallback(boost::bind(simfeature_debug_update, _1, "ShowcaseURLDefault")); + inst.setDestinationGuideURLCallback(boost::bind(simfeature_debug_update, _1, "DestinationGuideURL")); inst.setSearchURLCallback(boost::bind(simfeature_debug_update, _1, "SearchURL")); } @@ -4199,7 +4199,7 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x if (opensim) { gSavedSettings.setString("SearchURL", tmp); // Singu Note: For web search purposes, always set this setting - gSavedSettings.setString("ShowcaseURLDefault", response["destination_guide_url"].asString()); + gSavedSettings.setString("DestinationGuideURL", response["destination_guide_url"].asString()); } tmp = response["currency"].asString(); if (!tmp.empty()) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bcc2f5ee5..03f109d12 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6471,6 +6471,15 @@ BOOL enable_buy_land(void*) LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false); } +class LLWorldVisibleDestinations : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + bool visible(!LFSimFeatureHandler::instance().destinationGuideURL().empty()); + gMenuHolder->findControl(userdata["control"].asString())->setValue(visible); + return visible; + } +}; class LLObjectAttachToAvatar : public view_listener_t { @@ -9339,6 +9348,7 @@ void initialize_menus() addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); addMenu(new LLWorldEnableTeleportHome(), "World.EnableTeleportHome"); addMenu(new LLWorldEnableBuyLand(), "World.EnableBuyLand"); + addMenu(new LLWorldVisibleDestinations(), "World.VisibleDestinations"); (new LLWorldEnvSettings())->registerListener(gMenuHolder, "World.EnvSettings"); (new LLWorldEnableEnvSettings())->registerListener(gMenuHolder, "World.EnableEnvSettings"); diff --git a/indra/newview/skins/default/textures/icn_toolbar_destinations.tga b/indra/newview/skins/default/textures/icn_toolbar_destinations.tga new file mode 100644 index 0000000000000000000000000000000000000000..0a1a235f352f836cc45efc94d8c745f1829bca07 GIT binary patch literal 22 XcmZQzU}As)Mg~R(1&;s!|1$sp3NHgH literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/xui/en-us/floater_destinations.xml b/indra/newview/skins/default/xui/en-us/floater_destinations.xml new file mode 100644 index 000000000..a5c6c07ac --- /dev/null +++ b/indra/newview/skins/default/xui/en-us/floater_destinations.xml @@ -0,0 +1,26 @@ + + + + diff --git a/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/indra/newview/skins/default/xui/en-us/menu_viewer.xml index de1af4121..47311ad33 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -590,6 +590,11 @@ + + + + + diff --git a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml index 92715b864..ca33bd396 100644 --- a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml @@ -287,6 +287,11 @@ + + +