diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/CMakeLists.txt | 9 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llfloaterabout.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llfloaterreporter.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpanelhome.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llpanellogin.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llviewerassetstorage.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llviewerhelputil.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llviewerhome.cpp | 71 | ||||
-rw-r--r-- | indra/newview/llviewerhome.h | 49 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 4 | ||||
-rw-r--r-- | indra/newview/tests/llviewerhelputil_test.cpp | 7 |
13 files changed, 170 insertions, 53 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dd3fc10fa2..76b967eb82 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,7 +452,7 @@ set(viewer_SOURCE_FILES llviewerassettype.cpp llvieweraudio.cpp llviewercamera.cpp - llviewerchat.cpp + llviewerchat.cpp llviewercontrol.cpp llviewercontrollistener.cpp llviewerdisplay.cpp @@ -462,6 +462,7 @@ set(viewer_SOURCE_FILES llviewergesture.cpp llviewerhelp.cpp llviewerhelputil.cpp + llviewerhome.cpp llviewerinventory.cpp llviewerjoint.cpp llviewerjointattachment.cpp @@ -495,6 +496,7 @@ set(viewer_SOURCE_FILES llviewertextureanim.cpp llviewertexturelist.cpp llviewerthrottle.cpp + llviewerversion.cpp llviewervisualparam.cpp llviewerwindow.cpp llviewerwindowlistener.cpp @@ -953,9 +955,8 @@ set(viewer_HEADER_FILES llviewerassetstorage.h llviewerassettype.h llvieweraudio.h - llviewerbuild.h llviewercamera.h - llviewerchat.h + llviewerchat.h llviewercontrol.h llviewercontrollistener.h llviewerdisplay.h @@ -964,6 +965,7 @@ set(viewer_HEADER_FILES llviewergenericmessage.h llviewergesture.h llviewerhelp.h + llviewerhome.h llviewerinventory.h llviewerjoint.h llviewerjointattachment.h @@ -995,6 +997,7 @@ set(viewer_HEADER_FILES llviewertextureanim.h llviewertexturelist.h llviewerthrottle.h + llviewerversion.h llviewervisualparam.h llviewerwindow.h llviewerwindowlistener.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b301d784f9..ec28603d25 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3587,6 +3587,17 @@ <key>Value</key> <string>http://viewer-help.secondlife.com/[LANGUAGE]/[CHANNEL]/[VERSION]/[TOPIC]</string> </map> + <key>HomeSidePanelURL</key> + <map> + <key>Comment</key> + <string>URL for the web page to display in the Home side panel</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>http://www.secondlife.com/</string> + </map> <key>HighResSnapshot</key> <map> <key>Comment</key> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ddc818172d..6bbc1eaa6a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -36,6 +36,7 @@ // Viewer includes #include "llversionviewer.h" +#include "llviewerversion.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -647,12 +648,9 @@ bool LLAppViewer::init() writeSystemInfo(); // Build a string representing the current version number. - gCurrentVersion = llformat("%s %d.%d.%d.%d", - gSavedSettings.getString("VersionChannelName").c_str(), - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VERSION_BUILD ); + gCurrentVersion = llformat("%s %s", + gSavedSettings.getString("VersionChannelName").c_str(), + llGetViewerVersion().c_str()); ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -2521,8 +2519,7 @@ void LLAppViewer::writeSystemInfo() // Dump some debugging info LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME") - << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH - << LL_ENDL; + << " version " << llGetViewerShortVersion() << LL_ENDL; // Dump the local time and time zone time_t now; diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 68fc69b4f7..b2588cc01b 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -46,7 +46,7 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llversionviewer.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llweb.h" // Linden library includes @@ -217,10 +217,7 @@ LLSD LLFloaterAbout::getInfo() version.append(LL_VERSION_PATCH); version.append(LL_VERSION_BUILD); info["VIEWER_VERSION"] = version; - info["VIEWER_VERSION_STR"] = STRINGIZE(version[0].asInteger() << '.' << - version[1].asInteger() << '.' << - version[2].asInteger() << '.' << - version[3].asInteger()); + info["VIEWER_VERSION_STR"] = llGetViewerVersion(); info["BUILD_DATE"] = __DATE__; info["BUILD_TIME"] = __TIME__; info["CHANNEL"] = gSavedSettings.getString("VersionChannelName"); @@ -286,15 +283,9 @@ LLSD LLFloaterAbout::getInfo() static std::string get_viewer_release_notes_url() { - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; - LLSD query; query["channel"] = gSavedSettings.getString("VersionChannelName"); - query["version"] = version.str(); + query["version"] = llGetViewerVersion(); std::ostringstream url; url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 1f3bd50d5b..be821ad43b 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -45,7 +45,6 @@ #include "llnotificationsutil.h" #include "llstring.h" #include "llsys.h" -#include "llversionviewer.h" #include "message.h" #include "v3math.h" @@ -76,7 +75,7 @@ #include "llfloateravatarpicker.h" #include "lldir.h" #include "llselectmgr.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "lluictrlfactory.h" #include "llviewernetwork.h" @@ -609,10 +608,7 @@ LLSD LLFloaterReporter::gatherReport() std::ostringstream details; - details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VIEWER_BUILD << std::endl << std::endl; + details << "V" << llGetViewerVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports std::string object_name = childGetText("object_name"); if (!object_name.empty() && !mOwnerName.empty()) @@ -629,10 +625,8 @@ LLSD LLFloaterReporter::gatherReport() std::string version_string; version_string = llformat( - "%d.%d.%d %s %s %s %s", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, + "%s %s %s %s %s", + llGetViewerShortVersion().c_str(), platform, gSysCPU.getFamily().c_str(), gGLManager.mGLRenderer.c_str(), diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index de7a85836d..fb2629c692 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -35,6 +35,7 @@ #include "llpanelhome.h" #include "llmediactrl.h" +#include "llviewerhome.h" static LLRegisterPanelClassWrapper<LLPanelHome> t_people("panel_sidetray_home"); @@ -62,9 +63,12 @@ BOOL LLPanelHome::postBuild() mBrowser = getChild<LLMediaCtrl>("browser"); if (mBrowser) { + // read the URL to display from settings.xml + std::string url = LLViewerHome::getHomeURL(); + mBrowser->addObserver(this); mBrowser->setTrusted(true); - mBrowser->setHomePageUrl("http://www.secondlife.com/"); + mBrowser->setHomePageUrl(url); childSetAction("back", onClickBack, this); childSetAction("forward", onClickForward, this); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4bae6af12e..d80d5c3d2e 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -57,7 +57,7 @@ #include "llui.h" #include "lluiconstants.h" #include "llurlsimstring.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llviewerhelp.h" #include "llviewertexturelist.h" #include "llviewermenu.h" // for handle_preferences() @@ -248,11 +248,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, getChild<LLPanel>("login_widgets")->setDefaultBtn("connect_btn"); std::string channel = gSavedSettings.getString("VersionChannelName"); - std::string version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VIEWER_BUILD ); + std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), + llGetViewerBuildVersion().c_str()); LLTextBox* channel_text = getChild<LLTextBox>("channel_text"); channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[VERSION]", version); @@ -741,8 +738,8 @@ void LLPanelLogin::loadLoginPage() } // Channel and Version - std::string version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD); + std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), + llGetViewerBuildVersion().c_str()); char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0); char* curl_version = curl_escape(version.c_str(), 0); diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index c32e67ef90..a041f3ac98 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -36,7 +36,6 @@ #include "llagent.h" #include "llviewerassetstorage.h" -#include "llviewerbuild.h" #include "llvfile.h" #include "llvfs.h" diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp index c1555eacdc..2642b2378e 100644 --- a/indra/newview/llviewerhelputil.cpp +++ b/indra/newview/llviewerhelputil.cpp @@ -34,6 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llversionviewer.h" +#include "llviewerversion.h" //#include "llfloaterhelpbrowser.h" //#include "llfloaterreg.h" @@ -86,14 +87,7 @@ std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic, substitution["CHANNEL"] = helpURLEncode(savedSettings.getString("VersionChannelName")); - // *TODO: We should put this version pattern in a central place; this and near - // equivalents are replicated in other code - what's a good location? - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; - substitution["VERSION"] = helpURLEncode(version.str()); + substitution["VERSION"] = helpURLEncode(llGetViewerVersion()); substitution["VERSION_MAJOR"] = buildHelpVersion(LL_VERSION_MAJOR); substitution["VERSION_MINOR"] = buildHelpVersion(LL_VERSION_MINOR); substitution["VERSION_PATCH"] = buildHelpVersion(LL_VERSION_PATCH); diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp new file mode 100644 index 0000000000..ee1e46dc59 --- /dev/null +++ b/indra/newview/llviewerhome.cpp @@ -0,0 +1,71 @@ +/** + * @file llviewerhome.cpp + * @brief Model (non-View) component for the web-based Home side panel + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llviewerhome.h" + +#include "lllogininstance.h" +#include "llui.h" +#include "lluri.h" +#include "llsd.h" +#include "llviewerversion.h" +#include "llviewercontrol.h" + +//static +std::string LLViewerHome::getHomeURL() +{ + // Return the URL to display in the Home side tray. We read + // this value from settings.xml and support various substitutions + + LLSD substitution; + substitution["VERSION"] = llGetViewerVersion(); + substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName")); + substitution["LANGUAGE"] = LLUI::getLanguage(); + substitution["AUTH_KEY"] = LLURI::escape(getAuthKey()); + + std::string homeURL = gSavedSettings.getString("HomeSidePanelURL"); + LLStringUtil::format(homeURL, substitution); + + return homeURL; +} + +//static +std::string LLViewerHome::getAuthKey() +{ + // return the value of the (optional) auth token returned by login.cgi + // this lets the server provide an authentication token that we can + // blindly pass to the Home web page for it to perform authentication. + static const std::string authKeyName("home_sidetray_token"); + return LLLoginInstance::getInstance()->getResponse(authKeyName); +} + diff --git a/indra/newview/llviewerhome.h b/indra/newview/llviewerhome.h new file mode 100644 index 0000000000..50454a71b7 --- /dev/null +++ b/indra/newview/llviewerhome.h @@ -0,0 +1,49 @@ +/** + * @file llviewerhome.h + * @brief Model (non-View) component for the web-based Home side panel + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLVIEWERHOME_H +#define LL_LLVIEWERHOME_H + +#include <string> + +class LLViewerHome +{ +public: + /// return the URL to use for the web-based Home side panel + static std::string getHomeURL(); + + /// return the authentication key for the Home web site + static std::string getAuthKey(); +}; + +#endif diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f6db661489..a206768d33 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -41,7 +41,7 @@ #include "llviewertexture.h" #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" -#include "llversionviewer.h" +#include "llviewerversion.h" #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" @@ -446,7 +446,7 @@ std::string LLViewerMedia::getCurrentUserAgent() // http://www.mozilla.org/build/revised-user-agent-strings.html std::ostringstream codec; codec << "SecondLife/"; - codec << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD; + codec << llGetViewerVersion(); codec << " (" << channel << "; " << skin_name << " skin)"; llinfos << codec.str() << llendl; diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 988d28c301..90e3e7a7e0 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -36,6 +36,7 @@ #include "../test/lltut.h" #include "../llviewerhelputil.h" +#include "../llviewerversion.h" #include "llcontrol.h" #include "llsys.h" @@ -75,6 +76,12 @@ std::string LLControlGroup::getString(const std::string& name) return test_stringvec[name]; } +const std::string &llGetViewerVersion() +{ + static std::string version = "2.0.0.200099"; + return version; +} + //---------------------------------------------------------------------------- namespace tut |