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 000000000..0a1a235f3 Binary files /dev/null and b/indra/newview/skins/default/textures/icn_toolbar_destinations.tga differ 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 @@ + + +