aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llcommon/llversionviewer.h22
-rw-r--r--linden/indra/newview/CMakeLists.txt4
-rw-r--r--linden/indra/newview/app_settings/viewerversion.xml9
-rw-r--r--linden/indra/newview/llappviewer.cpp55
-rw-r--r--linden/indra/newview/llfloaterabout.cpp18
-rw-r--r--linden/indra/newview/llfloaterreporter.cpp25
-rw-r--r--linden/indra/newview/llpanellogin.cpp40
-rw-r--r--linden/indra/newview/llstartup.cpp8
-rw-r--r--linden/indra/newview/llviewermedia.cpp4
-rw-r--r--linden/indra/newview/viewerinfo.cpp148
-rw-r--r--linden/indra/newview/viewerinfo.h93
-rw-r--r--linden/indra/newview/viewerversion.cpp89
-rw-r--r--linden/indra/newview/viewerversion.h79
13 files changed, 308 insertions, 286 deletions
diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h
index ab74a3f..4162234 100644
--- a/linden/indra/llcommon/llversionviewer.h
+++ b/linden/indra/llcommon/llversionviewer.h
@@ -33,8 +33,6 @@
33#ifndef LL_LLVERSIONVIEWER_H 33#ifndef LL_LLVERSIONVIEWER_H
34#define LL_LLVERSIONVIEWER_H 34#define LL_LLVERSIONVIEWER_H
35 35
36// Version info should be accessed using newview\viewerversion.h -- MC
37
38const S32 LL_VERSION_MAJOR = 1; 36const S32 LL_VERSION_MAJOR = 1;
39const S32 LL_VERSION_MINOR = 23; 37const S32 LL_VERSION_MINOR = 23;
40const S32 LL_VERSION_PATCH = 5; 38const S32 LL_VERSION_PATCH = 5;
@@ -42,17 +40,13 @@ const S32 LL_VERSION_BUILD = 136262;
42 40
43const char * const LL_VIEWER_NAME = "Second Life"; 41const char * const LL_VIEWER_NAME = "Second Life";
44 42
45// These aren't used anymore. 43// These aren't used anymore. See newview/viewerinfo.cpp instead.
46// The channel is ViewerChannelName in settings.xml 44//
47// The Imprudence version is set in app_settings\viewerversion.xml -- MC 45// const char * const LL_CHANNEL = "Imprudence";
48 46// const char * const IMP_VIEWER_NAME = "Imprudence";
49/*const char * const LL_CHANNEL = "Imprudence"; 47// const S32 IMP_VERSION_MAJOR = 0;
50 48// const S32 IMP_VERSION_MINOR = 0;
51const char * const IMP_VIEWER_NAME = "Imprudence"; 49// const S32 IMP_VERSION_PATCH = 0;
52 50// const char * const IMP_VERSION_TEST = "";
53const S32 IMP_VERSION_MAJOR = 1;
54const S32 IMP_VERSION_MINOR = 3;
55const S32 IMP_VERSION_PATCH = 0;
56const char * const IMP_VERSION_TEST = "beta 4";*/
57 51
58#endif 52#endif
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index df6d8b5..7ffb32b 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -500,8 +500,8 @@ set(viewer_SOURCE_FILES
500 rlvextensions.cpp 500 rlvextensions.cpp
501 rlvfloaterbehaviour.cpp 501 rlvfloaterbehaviour.cpp
502 slfloatermediafilter.cpp 502 slfloatermediafilter.cpp
503 viewerinfo.cpp
503 viewertime.cpp 504 viewertime.cpp
504 viewerversion.cpp
505 windlightsettingsupdate.cpp 505 windlightsettingsupdate.cpp
506 wlfloatermanager.cpp 506 wlfloatermanager.cpp
507 wlfloaterwindlightsend.cpp 507 wlfloaterwindlightsend.cpp
@@ -973,8 +973,8 @@ set(viewer_HEADER_FILES
973 slfloatermediafilter.h 973 slfloatermediafilter.h
974 VertexCache.h 974 VertexCache.h
975 VorbisFramework.h 975 VorbisFramework.h
976 viewerinfo.h
976 viewertime.h 977 viewertime.h
977 viewerversion.h
978 wlfloatermanager.h 978 wlfloatermanager.h
979 wlfloaterwindlightsend.h 979 wlfloaterwindlightsend.h
980 wlretrievesettings.h 980 wlretrievesettings.h
diff --git a/linden/indra/newview/app_settings/viewerversion.xml b/linden/indra/newview/app_settings/viewerversion.xml
index 33d810e..cadb946 100644
--- a/linden/indra/newview/app_settings/viewerversion.xml
+++ b/linden/indra/newview/app_settings/viewerversion.xml
@@ -1,5 +1,6 @@
1<!-- 1<!--
2Set the version for Imprudence here! 2This file is obsolete and will be removed in the future.
3Use newview/viewerinfo.cpp instead.
3 4
4NOTE: llcommon/llviewerversion.h still 5NOTE: llcommon/llviewerversion.h still
5contains the version for the LL viewer. 6contains the version for the LL viewer.
@@ -11,15 +12,15 @@ need to be changed manually - MC
11<viewer_version> 12<viewer_version>
12 13
13 <!--int--> 14 <!--int-->
14 <viewer version_major="1" /> 15 <viewer version_major="0" />
15 16
16 <!--int--> 17 <!--int-->
17 <viewer version_minor="4" /> 18 <viewer version_minor="0" />
18 19
19 <!--int--> 20 <!--int-->
20 <viewer version_patch="0" /> 21 <viewer version_patch="0" />
21 22
22 <!--string--> 23 <!--string-->
23 <viewer version_test="beta 1" /> 24 <viewer version_test="" />
24 25
25</viewer_version> 26</viewer_version>
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index aa3de97..aeb52a2 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -154,7 +154,7 @@
154#include "llflexibleobject.h" 154#include "llflexibleobject.h"
155#include "llvosurfacepatch.h" 155#include "llvosurfacepatch.h"
156#include "llslider.h" 156#include "llslider.h"
157#include "viewerversion.h" 157#include "viewerinfo.h"
158 158
159// includes for idle() idleShutdown() 159// includes for idle() idleShutdown()
160#include "floaterao.h" 160#include "floaterao.h"
@@ -597,7 +597,7 @@ bool LLAppViewer::init()
597 597
598 // Need to do this initialization before we do anything else, since anything 598 // Need to do this initialization before we do anything else, since anything
599 // that touches files should really go through the lldir API 599 // that touches files should really go through the lldir API
600 gDirUtilp->initAppDirs(ViewerVersion::getImpViewerName()); 600 gDirUtilp->initAppDirs(ViewerInfo::viewerName());
601 // set skin search path to default, will be overridden later 601 // set skin search path to default, will be overridden later
602 // this allows simple skinned file lookups to work 602 // this allows simple skinned file lookups to work
603 gDirUtilp->setSkinFolder("default"); 603 gDirUtilp->setSkinFolder("default");
@@ -619,15 +619,8 @@ bool LLAppViewer::init()
619 writeSystemInfo(); 619 writeSystemInfo();
620 620
621 621
622 // Build a string representing the current version number. 622 // String representing the current version name/number.
623 gCurrentVersion = llformat( 623 gCurrentVersion = ViewerInfo::terseInfo();
624 "%s %d.%d.%d.%d",
625 gSavedSettings.getString("VersionChannelName").c_str(),
626 ViewerVersion::getImpMajorVersion(),
627 ViewerVersion::getImpMinorVersion(),
628 ViewerVersion::getImpPatchVersion(),
629 0 // our 'build number'
630 );
631 624
632 ////////////////////////////////////////////////////////////////////////////// 625 //////////////////////////////////////////////////////////////////////////////
633 ////////////////////////////////////////////////////////////////////////////// 626 //////////////////////////////////////////////////////////////////////////////
@@ -1796,9 +1789,6 @@ std::string LLAppViewer::getSettingsFilename(const std::string& location_key,
1796 1789
1797bool LLAppViewer::initConfiguration() 1790bool LLAppViewer::initConfiguration()
1798{ 1791{
1799 // init Imprudence version - MC
1800 ViewerVersion::initViewerVersion();
1801
1802 //Set up internal pointers 1792 //Set up internal pointers
1803 gSettings[sGlobalSettingsName] = &gSavedSettings; 1793 gSettings[sGlobalSettingsName] = &gSavedSettings;
1804 gSettings[sPerAccountSettingsName] = &gSavedPerAccountSettings; 1794 gSettings[sPerAccountSettingsName] = &gSavedPerAccountSettings;
@@ -1846,7 +1836,7 @@ bool LLAppViewer::initConfiguration()
1846 // gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global"))); 1836 // gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global")));
1847 gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_imprudence.xml")); 1837 gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_imprudence.xml"));
1848 1838
1849 gSavedSettings.setString("VersionChannelName", ViewerVersion::getImpViewerName()); 1839 gSavedSettings.setString("VersionChannelName", ViewerInfo::nameWithVariant());
1850 1840
1851 //*FIX:Mani - Set default to disabling watchdog mainloop 1841 //*FIX:Mani - Set default to disabling watchdog mainloop
1852 // timeout for mac and linux. There is no call stack info 1842 // timeout for mac and linux. There is no call stack info
@@ -2092,7 +2082,7 @@ bool LLAppViewer::initConfiguration()
2092 mYieldTime = gSavedSettings.getS32("YieldTime"); 2082 mYieldTime = gSavedSettings.getS32("YieldTime");
2093 2083
2094 // XUI:translate 2084 // XUI:translate
2095 gSecondLife = ViewerVersion::getImpViewerName(); 2085 gSecondLife = ViewerInfo::viewerName();
2096 2086
2097 // Read skin/branding settings if specified. 2087 // Read skin/branding settings if specified.
2098 //if (! gDirUtilp->getSkinDir().empty() ) 2088 //if (! gDirUtilp->getSkinDir().empty() )
@@ -2464,11 +2454,12 @@ void LLAppViewer::writeSystemInfo()
2464{ 2454{
2465 gDebugInfo["SLLog"] = LLError::logFileName(); 2455 gDebugInfo["SLLog"] = LLError::logFileName();
2466 2456
2467 gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); 2457 gDebugInfo["ClientInfo"]["Name"] = ViewerInfo::viewerName();
2468 gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerVersion::getImpMajorVersion(); 2458 gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerInfo::versionMajor();
2469 gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerVersion::getImpMinorVersion(); 2459 gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerInfo::versionMinor();
2470 gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerVersion::getImpPatchVersion(); 2460 gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerInfo::versionPatch();
2471 gDebugInfo["ClientInfo"]["BuildVersion"] = 0; 2461 gDebugInfo["ClientInfo"]["ReleaseVersion"] = ViewerInfo::versionRelease();
2462 gDebugInfo["ClientInfo"]["ExtraVersion"] = ViewerInfo::versionExtra();
2472 2463
2473 gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); 2464 gDebugInfo["CAFilename"] = gDirUtilp->getCAFile();
2474 2465
@@ -2553,11 +2544,12 @@ void LLAppViewer::handleViewerCrash()
2553 2544
2554 //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version 2545 //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version
2555 //to check against no matter what 2546 //to check against no matter what
2556 gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); 2547 gDebugInfo["ClientInfo"]["Name"] = ViewerInfo::viewerName();
2557 gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerVersion::getImpMajorVersion(); 2548 gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerInfo::versionMajor();
2558 gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerVersion::getImpMinorVersion(); 2549 gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerInfo::versionMinor();
2559 gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerVersion::getImpPatchVersion(); 2550 gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerInfo::versionPatch();
2560 gDebugInfo["ClientInfo"]["BuildVersion"] = 0; 2551 gDebugInfo["ClientInfo"]["ReleaseVersion"] = ViewerInfo::versionRelease();
2552 gDebugInfo["ClientInfo"]["ExtraVersion"] = ViewerInfo::versionExtra();
2561 2553
2562 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 2554 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
2563 if ( parcel && parcel->getMusicURL()[0]) 2555 if ( parcel && parcel->getMusicURL()[0])
@@ -4333,11 +4325,12 @@ void LLAppViewer::handleLoginComplete()
4333 initMainloopTimeout("Mainloop Init"); 4325 initMainloopTimeout("Mainloop Init");
4334 4326
4335 // Store some data to DebugInfo in case of a freeze. 4327 // Store some data to DebugInfo in case of a freeze.
4336 gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); 4328 gDebugInfo["ClientInfo"]["Name"] = ViewerInfo::viewerName();
4337 gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerVersion::getImpMajorVersion(); 4329 gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerInfo::versionMajor();
4338 gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerVersion::getImpMinorVersion(); 4330 gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerInfo::versionMinor();
4339 gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerVersion::getImpPatchVersion(); 4331 gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerInfo::versionPatch();
4340 gDebugInfo["ClientInfo"]["BuildVersion"] = 0; 4332 gDebugInfo["ClientInfo"]["ReleaseVersion"] = ViewerInfo::versionRelease();
4333 gDebugInfo["ClientInfo"]["ExtraVersion"] = ViewerInfo::versionExtra();
4341 4334
4342 gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile"); 4335 gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile");
4343 gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); 4336 gDebugInfo["CAFilename"] = gDirUtilp->getCAFile();
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp
index a5d2c98..8878de5 100644
--- a/linden/indra/newview/llfloaterabout.cpp
+++ b/linden/indra/newview/llfloaterabout.cpp
@@ -59,7 +59,7 @@
59#include "llglheaders.h" 59#include "llglheaders.h"
60#include "llviewerwindow.h" 60#include "llviewerwindow.h"
61#include "llwindow.h" 61#include "llwindow.h"
62#include "viewerversion.h" 62#include "viewerinfo.h"
63 63
64// [RLVa:KB] 64// [RLVa:KB]
65#include "rlvhandler.h" 65#include "rlvhandler.h"
@@ -120,11 +120,7 @@ LLFloaterAbout::LLFloaterAbout()
120 viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); 120 viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
121 121
122 // Version string 122 // Version string
123 std::string version = llformat( 123 std::string version = llformat("%s (%s %s)\n", ViewerInfo::prettyInfo().c_str(), __DATE__, __TIME__);
124 "%s %d.%d.%d %s (%s %s)\n",
125 ViewerVersion::getImpViewerName().c_str(),
126 ViewerVersion::getImpMajorVersion(), ViewerVersion::getImpMinorVersion(), ViewerVersion::getImpPatchVersion(), ViewerVersion::getImpTestVersion().c_str(),
127 __DATE__, __TIME__);
128 124
129 support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); 125 support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
130 support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style); 126 support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);
@@ -318,13 +314,13 @@ void LLFloaterAbout::onClickCopy(void* user_data)
318static std::string get_viewer_release_notes_url() 314static std::string get_viewer_release_notes_url()
319{ 315{
320 std::ostringstream version; 316 std::ostringstream version;
321 version << ViewerVersion::getImpMajorVersion() << "." 317 version << ViewerInfo::versionMajor() << "."
322 << ViewerVersion::getImpMinorVersion() << "." 318 << ViewerInfo::versionMinor() << "."
323 << ViewerVersion::getImpPatchVersion(); 319 << ViewerInfo::versionPatch();
324 320
325 // Append the test version if it's not empty 321 // Append the test version if it's not empty
326 if( !(ViewerVersion::getImpTestVersion().empty()) ) 322 if( !(ViewerInfo::versionExtra().empty()) )
327 version << "-" << ViewerVersion::getImpTestVersion(); 323 version << "-" << ViewerInfo::versionExtra();
328 324
329 std::ostringstream url; 325 std::ostringstream url;
330 url << RELEASE_NOTES_BASE_URL << version.str(); 326 url << RELEASE_NOTES_BASE_URL << version.str();
diff --git a/linden/indra/newview/llfloaterreporter.cpp b/linden/indra/newview/llfloaterreporter.cpp
index 15f278d..16123ae 100644
--- a/linden/indra/newview/llfloaterreporter.cpp
+++ b/linden/indra/newview/llfloaterreporter.cpp
@@ -80,7 +80,7 @@
80#include "llselectmgr.h" 80#include "llselectmgr.h"
81#include "lluictrlfactory.h" 81#include "lluictrlfactory.h"
82#include "llviewernetwork.h" 82#include "llviewernetwork.h"
83#include "viewerversion.h" 83#include "viewerinfo.h"
84 84
85#include "llassetuploadresponders.h" 85#include "llassetuploadresponders.h"
86 86
@@ -742,13 +742,11 @@ LLSD LLFloaterReporter::gatherReport()
742 742
743 if ( mReportType == BUG_REPORT) 743 if ( mReportType == BUG_REPORT)
744 { 744 {
745 summary << short_platform << " V" << ViewerVersion::getLLMajorVersion() << "." 745 summary << short_platform << " "
746 << ViewerVersion::getLLMinorVersion() << "." 746 << ViewerInfo::terseInfo()
747 << ViewerVersion::getLLPatchVersion() << "." 747 << " (" << regionp->getName() << ")"
748 << ViewerVersion::getLLBuildVersion() 748 << "[" << category_name << "] "
749 << " (" << regionp->getName() << ")" 749 << "\"" << childGetValue("summary_edit").asString() << "\"";
750 << "[" << category_name << "] "
751 << "\"" << childGetValue("summary_edit").asString() << "\"";
752 } 750 }
753 else 751 else
754 { 752 {
@@ -763,10 +761,7 @@ LLSD LLFloaterReporter::gatherReport()
763 std::ostringstream details; 761 std::ostringstream details;
764 if (mReportType != BUG_REPORT) 762 if (mReportType != BUG_REPORT)
765 { 763 {
766 details << "V" << ViewerVersion::getLLMajorVersion() << "." // client version moved to body of email for abuse reports 764 details << ViewerInfo::terseInfo() << std::endl << std::endl;
767 << ViewerVersion::getLLMinorVersion() << "."
768 << ViewerVersion::getLLPatchVersion() << "."
769 << ViewerVersion::getLLBuildVersion() << std::endl << std::endl;
770 } 765 }
771 std::string object_name = childGetText("object_name"); 766 std::string object_name = childGetText("object_name");
772 std::string owner_name = childGetText("owner_name"); 767 std::string owner_name = childGetText("owner_name");
@@ -786,10 +781,8 @@ LLSD LLFloaterReporter::gatherReport()
786 781
787 std::string version_string; 782 std::string version_string;
788 version_string = llformat( 783 version_string = llformat(
789 "%d.%d.%d %s %s %s %s", 784 "%s %s %s %s %s",
790 ViewerVersion::getLLMajorVersion(), 785 ViewerInfo::terseInfo().c_str(),
791 ViewerVersion::getLLMinorVersion(),
792 ViewerVersion::getLLPatchVersion(),
793 platform, 786 platform,
794 gSysCPU.getFamily().c_str(), 787 gSysCPU.getFamily().c_str(),
795 gGLManager.mGLRenderer.c_str(), 788 gGLManager.mGLRenderer.c_str(),
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index e83a466..824c5b0 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -73,7 +73,7 @@
73#include "lluictrlfactory.h" 73#include "lluictrlfactory.h"
74#include "llhttpclient.h" 74#include "llhttpclient.h"
75#include "llweb.h" 75#include "llweb.h"
76#include "viewerversion.h" 76#include "viewerinfo.h"
77#include "llmediactrl.h" 77#include "llmediactrl.h"
78 78
79#include "llfloatermediabrowser.h" 79#include "llfloatermediabrowser.h"
@@ -264,25 +264,10 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
264 264
265 // childSetAction("quit_btn", onClickQuit, this); 265 // childSetAction("quit_btn", onClickQuit, this);
266 266
267 std::string imp_channel = gSavedSettings.getString("VersionChannelName"); 267 std::string imp_version = ViewerInfo::prettyInfo();
268 std::string imp_version = llformat("%d.%d.%d %s",
269 ViewerVersion::getImpMajorVersion(),
270 ViewerVersion::getImpMinorVersion(),
271 ViewerVersion::getImpPatchVersion(),
272 ViewerVersion::getImpTestVersion().c_str() );
273
274 std::string ll_channel = ViewerVersion::getLLViewerName();
275 std::string ll_version = llformat("%d.%d.%d (%d)",
276 ViewerVersion::getLLMajorVersion(),
277 ViewerVersion::getLLMinorVersion(),
278 ViewerVersion::getLLPatchVersion(),
279 ViewerVersion::getLLBuildVersion() );
280 268
281 LLTextBox* channel_text = getChild<LLTextBox>("channel_text"); 269 LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
282 channel_text->setTextArg("[CHANNEL]", imp_channel);
283 channel_text->setTextArg("[VERSION]", imp_version); 270 channel_text->setTextArg("[VERSION]", imp_version);
284 channel_text->setTextArg("[ALT_CHANNEL]", ll_channel);
285 channel_text->setTextArg("[ALT_VERSION]", ll_version);
286 channel_text->setClickedCallback(onClickVersion); 271 channel_text->setClickedCallback(onClickVersion);
287 channel_text->setCallbackUserData(this); 272 channel_text->setCallbackUserData(this);
288 273
@@ -916,12 +901,8 @@ void LLPanelLogin::loadLoginPage()
916 } 901 }
917 902
918 // Channel and Version 903 // Channel and Version
919 std::string version = llformat("%d.%d.%d %s", 904 char* curl_channel = curl_escape(ViewerInfo::nameWithVariant().c_str(), 0);
920 ViewerVersion::getImpMajorVersion(), ViewerVersion::getImpMinorVersion(), 905 char* curl_version = curl_escape(ViewerInfo::versionNumbers4().c_str(), 0);
921 ViewerVersion::getImpPatchVersion(), ViewerVersion::getImpTestVersion().c_str() );
922
923 char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0);
924 char* curl_version = curl_escape(version.c_str(), 0);
925 906
926 oStr << "&channel=" << curl_channel; 907 oStr << "&channel=" << curl_channel;
927 oStr << "&version=" << curl_version; 908 oStr << "&version=" << curl_version;
@@ -1373,19 +1354,10 @@ bool LLPanelLogin::loadNewsBar()
1373 full_url << "?"; 1354 full_url << "?";
1374 } 1355 }
1375 1356
1376 std::string channel = gSavedSettings.getString("VersionChannelName"); 1357 std::string channel = ViewerInfo::nameWithVariant();
1358 std::string version = ViewerInfo::versionNumbers4();
1377 std::string skin = gSavedSettings.getString("SkinCurrent"); 1359 std::string skin = gSavedSettings.getString("SkinCurrent");
1378 1360
1379 std::string version =
1380 llformat("%d.%d.%d",
1381 ViewerVersion::getImpMajorVersion(),
1382 ViewerVersion::getImpMinorVersion(),
1383 ViewerVersion::getImpPatchVersion());
1384 if (!ViewerVersion::getImpTestVersion().empty())
1385 {
1386 version += " " + ViewerVersion::getImpTestVersion();
1387 }
1388
1389 char* curl_channel = curl_escape(channel.c_str(), 0); 1361 char* curl_channel = curl_escape(channel.c_str(), 0);
1390 char* curl_version = curl_escape(version.c_str(), 0); 1362 char* curl_version = curl_escape(version.c_str(), 0);
1391 char* curl_skin = curl_escape(skin.c_str(), 0); 1363 char* curl_skin = curl_escape(skin.c_str(), 0);
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index e29dc5a..b05e36d 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -190,7 +190,7 @@
190#include "llwaterparammanager.h" 190#include "llwaterparammanager.h"
191#include "llagentlanguage.h" 191#include "llagentlanguage.h"
192#include "llsocks5.h" 192#include "llsocks5.h"
193#include "viewerversion.h" 193#include "viewerinfo.h"
194 194
195#include "lgghunspell_wrapper.h" 195#include "lgghunspell_wrapper.h"
196#include "jcfloater_animation_list.h" 196#include "jcfloater_animation_list.h"
@@ -533,9 +533,9 @@ bool idle_startup()
533 if(!start_messaging_system( 533 if(!start_messaging_system(
534 message_template_path, 534 message_template_path,
535 port, 535 port,
536 ViewerVersion::getLLMajorVersion(), 536 ViewerInfo::versionMajor(),
537 ViewerVersion::getLLMinorVersion(), 537 ViewerInfo::versionMinor(),
538 ViewerVersion::getLLPatchVersion(), 538 ViewerInfo::versionPatch(),
539 FALSE, 539 FALSE,
540 std::string(), 540 std::string(),
541 responder, 541 responder,
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp
index c228468..89d7b1f 100644
--- a/linden/indra/newview/llviewermedia.cpp
+++ b/linden/indra/newview/llviewermedia.cpp
@@ -40,7 +40,7 @@
40#include "llviewerimage.h" 40#include "llviewerimage.h"
41#include "llviewerwindow.h" 41#include "llviewerwindow.h"
42#include "llviewerimagelist.h" 42#include "llviewerimagelist.h"
43//#include "viewerversion.h" 43//#include "viewerinfo.h"
44 44
45#include "llpluginclassmedia.h" 45#include "llpluginclassmedia.h"
46 46
@@ -261,7 +261,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
261 std::ostringstream codec; 261 std::ostringstream codec;
262 codec << "SecondLife/"; 262 codec << "SecondLife/";
263 codec << "C64 Basic V2"; 263 codec << "C64 Basic V2";
264 //codec << ViewerVersion::getImpMajorVersion() << "." << ViewerVersion::getImpMinorVersion() << "." << ViewerVersion::getImpPatchVersion() << " " << ViewerVersion::getImpTestVersion(); 264 //codec << " " << ViewerInfo::versionNumbers3();
265 //codec << " (" << channel << "; " << skin_name << " skin)"; 265 //codec << " (" << channel << "; " << skin_name << " skin)";
266// llinfos << codec.str() << llendl; 266// llinfos << codec.str() << llendl;
267 267
diff --git a/linden/indra/newview/viewerinfo.cpp b/linden/indra/newview/viewerinfo.cpp
new file mode 100644
index 0000000..3da924c
--- /dev/null
+++ b/linden/indra/newview/viewerinfo.cpp
@@ -0,0 +1,148 @@
1/**
2 * @file viewerinfo.cpp
3 * @brief Functions for querying the viewer name, version, and other info.
4 * @author Jacek Antonelli
5 *
6 * Copyright (c) 2010-2011, Jacek Antonelli
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation;
11 * version 2.1 of the License only.
12
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA
22 */
23
24#include "llviewerprecompiledheaders.h"
25
26#include "viewerinfo.h"
27
28namespace ViewerInfo
29{
30
31 // These are intentionally defined here instead of in the header,
32 // because they should NOT be read directly. Use the functions.
33 const std::string NAME = "Imprudence";
34 const std::string VARNT = "";
35 const S32 MAJOR = 1;
36 const S32 MINOR = 4;
37 const S32 PATCH = 1;
38 const S32 RLEAS = 1; // increment for each beta/RC/release
39 const std::string EXTRA = "beta 1";
40
41 // Mac OS X bundle identifier. Should match the one in Info.plist.
42 const std::string BUNDLE_ID = "org.imprudenceviewer.viewer";
43
44
45 const std::string& viewerName()
46 {
47 return NAME;
48 }
49
50 const std::string& viewerVariant()
51 {
52 return VARNT;
53 }
54
55 const std::string& nameWithVariant()
56 {
57 static std::string s;
58 if (!s.empty())
59 {
60 return s;
61 }
62
63 if (VARNT.empty())
64 {
65 s = NAME;
66 }
67 else
68 {
69 s = NAME + " " + VARNT;
70 }
71
72 return s;
73 }
74
75 S32 versionMajor()
76 {
77 return MAJOR;
78 }
79
80 S32 versionMinor()
81 {
82 return MINOR;
83 }
84
85 S32 versionPatch()
86 {
87 return PATCH;
88 }
89
90 S32 versionRelease()
91 {
92 return RLEAS;
93 }
94
95 const std::string& versionExtra()
96 {
97 return EXTRA;
98 }
99
100 const std::string& versionNumbers3()
101 {
102 static std::string s = llformat("%d.%d.%d", MAJOR, MINOR, PATCH);
103 return s;
104 }
105
106 const std::string& versionNumbers4()
107 {
108 static std::string s = llformat("%d.%d.%d.%d",
109 MAJOR, MINOR, PATCH, RLEAS);
110 return s;
111 }
112
113 const std::string& prettyVersion()
114 {
115 static std::string s;
116 if (s.length() > 0)
117 {
118 return s;
119 }
120
121 s = versionNumbers3();
122
123 if (EXTRA.length() > 0)
124 {
125 s += " " + EXTRA;
126 }
127
128 return s;
129 }
130
131 const std::string& prettyInfo()
132 {
133 static std::string s = nameWithVariant() + " " + prettyVersion();
134 return s;
135 }
136
137 const std::string& terseInfo()
138 {
139 static std::string s = nameWithVariant() + " " + versionNumbers4();
140 return s;
141 }
142
143 const std::string& bundleID()
144 {
145 return BUNDLE_ID;
146 }
147
148}
diff --git a/linden/indra/newview/viewerinfo.h b/linden/indra/newview/viewerinfo.h
new file mode 100644
index 0000000..fe2e829
--- /dev/null
+++ b/linden/indra/newview/viewerinfo.h
@@ -0,0 +1,93 @@
1/**
2 * @file viewerinfo.h
3 * @brief Functions for querying the viewer name, version, and other info.
4 * @author Jacek Antonelli
5 *
6 * Copyright (c) 2010-2011, Jacek Antonelli
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation;
11 * version 2.1 of the License only.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA
22 */
23
24#ifndef VERSIONINFO_H
25#define VERSIONINFO_H
26
27#include "linden_common.h"
28
29namespace ViewerInfo
30{
31 /// Returns the name of the viewer.
32 const std::string& viewerName();
33
34 /// Returns the viewer variant (e.g. "Experimental").
35 /// May be empty, if no variant string was set.
36 const std::string& viewerVariant();
37
38 /// Returns a string with the viewer name and variant
39 /// (if it has one).
40 const std::string& nameWithVariant();
41
42 /// Returns the major (first) version number.
43 /// This number increases for each major release, and the
44 /// minor, patch, and release numbers are reset to zero.
45 S32 versionMajor();
46
47 /// Returns the minor (second) version number.
48 /// This number increases for each minor release, and the
49 /// patch and release numbers are reset to zero.
50 S32 versionMinor();
51
52 /// Returns the patch (third) version number.
53 /// This number increases for each patch (bugfix) release,
54 /// and the release number is reset to zero.
55 S32 versionPatch();
56
57 /// Returns the release (fourth) version number.
58 /// This number increases for each beta, release candidate,
59 /// and final release.
60 S32 versionRelease();
61
62 /// Returns the extra version string (e.g. "beta 1", "RC1").
63 /// May be empty, if no extra string was set.
64 const std::string& versionExtra();
65
66 /// Returns a three-segment dot-separated version string
67 /// ("major.minor.patch"). Intended for human reading.
68 const std::string& versionNumbers3();
69
70 /// Returns a four-segment dot-separated version string
71 /// ("major.minor.patch.release"). Intended for computer use, e.g.
72 /// login channel or version number comparison.
73 const std::string& versionNumbers4();
74
75 /// Returns the three-segment version number with extra version
76 /// string (if not empty). Intended for human reading.
77 const std::string& prettyVersion();
78
79 /// Returns the viewer name, variant (if not empty), and pretty
80 /// version. Intended for human reading.
81 const std::string& prettyInfo();
82
83 /// Returns the the viewer name, variant (if not empty), and
84 /// 4-segment version. Intended for computer use, e.g. login channel
85 /// or version number comparison.
86 const std::string& terseInfo();
87
88 /// Returns a string with the viewer's Mac OS X bundle identifier.
89 const std::string& bundleID();
90
91}
92
93#endif // VERSIONINFO_H
diff --git a/linden/indra/newview/viewerversion.cpp b/linden/indra/newview/viewerversion.cpp
deleted file mode 100644
index 95c8f76..0000000
--- a/linden/indra/newview/viewerversion.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
1/**
2* @file viewerversion.cpp
3* @brief set the viewer version in xml
4*
5* $LicenseInfo:firstyear=2009&license=viewergpl$
6*
7* Copyright (c) 2010, McCabe Maxsted
8*
9* Imprudence Viewer Source Code
10* The source code in this file ("Source Code") is provided to you
11* under the terms of the GNU General Public License, version 2.0
12* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
13* this distribution, or online at
14* http://secondlifegrid.net/programs/open_source/licensing/gplv2
15*
16* There are special exceptions to the terms and conditions of the GPL as
17* it is applied to this Source Code. View the full text of the exception
18* in the file doc/FLOSS-exception.txt in this software distribution, or
19* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
20*
21* By copying, modifying or distributing this software, you acknowledge
22* that you have read and understood your obligations described above,
23* and agree to abide by those obligations.
24*
25* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
26* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27* COMPLETENESS OR PERFORMANCE.
28* $/LicenseInfo$
29*/
30
31#include "llviewerprecompiledheaders.h"
32
33#include "lldir.h"
34#include "llxmltree.h"
35#include "viewerversion.h"
36
37
38S32 ViewerVersion::sVersionMajor = 0;
39S32 ViewerVersion::sVersionMinor = 0;
40S32 ViewerVersion::sVersionPatch = 0;
41std::string ViewerVersion::sVersionTest = "";
42
43const std::string ViewerVersion::sViewerName = "Imprudence";
44
45ViewerVersion::ViewerVersion()
46{
47}
48
49bool ViewerVersion::initViewerVersion()
50{
51 std::string file_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "viewerversion.xml");
52
53 if (!gDirUtilp->fileExists(file_path))
54 {
55 llwarns << "Unable to find viewerversion.xml in app_settings folder" << llendl;
56 return false;
57 }
58 else
59 {
60 LLXMLNodePtr root;
61
62 if (!LLXMLNode::parseFile(file_path, root, NULL))
63 {
64 llwarns << "Unable to parse version file: " << file_path << llendl;
65 return false;
66 }
67
68 if (root.isNull()) // shouldn't ever happen
69 {
70 llwarns << "Error while trying to read viewerversion.xml" << llendl;
71 return false;
72 }
73
74 LLXMLNodePtr child_nodep = root->getFirstChild();
75 while (child_nodep.notNull())
76 {
77 child_nodep->getAttributeS32("version_major", sVersionMajor);
78 child_nodep->getAttributeS32("version_minor", sVersionMinor);
79 child_nodep->getAttributeS32("version_patch", sVersionPatch);
80 child_nodep->getAttributeString("version_test", sVersionTest);
81
82 child_nodep = child_nodep->getNextSibling();
83 }
84
85 llinfos << "Version set to: " << sVersionMajor << "." << sVersionMinor << "." << sVersionPatch << " " << sVersionTest << llendl;
86
87 return true;
88 }
89}
diff --git a/linden/indra/newview/viewerversion.h b/linden/indra/newview/viewerversion.h
deleted file mode 100644
index d67cee5..0000000
--- a/linden/indra/newview/viewerversion.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/**
2* @file viewerversion.h
3* @brief set the viewer version in xml
4*
5* $LicenseInfo:firstyear=2009&license=viewergpl$
6*
7* Copyright (c) 2010, McCabe Maxsted
8*
9* Imprudence Viewer Source Code
10* The source code in this file ("Source Code") is provided to you
11* under the terms of the GNU General Public License, version 2.0
12* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
13* this distribution, or online at
14* http://secondlifegrid.net/programs/open_source/licensing/gplv2
15*
16* There are special exceptions to the terms and conditions of the GPL as
17* it is applied to this Source Code. View the full text of the exception
18* in the file doc/FLOSS-exception.txt in this software distribution, or
19* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
20*
21* By copying, modifying or distributing this software, you acknowledge
22* that you have read and understood your obligations described above,
23* and agree to abide by those obligations.
24*
25* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
26* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27* COMPLETENESS OR PERFORMANCE.
28* $/LicenseInfo$
29*/
30
31#ifndef VIEWERVERSION_H
32#define VIEWERVERSION_H
33
34#include "llversionviewer.h" // for LL versioning only
35
36class ViewerVersion
37{
38public:
39 ViewerVersion();
40 /*virtual*/ ~ViewerVersion();
41
42 static bool initViewerVersion();
43
44 // Returns the major version of Imprudence
45 static S32 getImpMajorVersion() { return sVersionMajor; }
46 // Returns the minor version of Imprudence
47 static S32 getImpMinorVersion() { return sVersionMinor; }
48 // Returns the patch version of Imprudence
49 static S32 getImpPatchVersion() { return sVersionPatch; }
50 // Returns the test version of Imprudence
51 static std::string getImpTestVersion() { return sVersionTest; }
52 // Returns the name of the viewer. Currently always "Imprudence"
53 static std::string getImpViewerName() { return sViewerName; }
54
55 // Returns the major version of Second Life
56 static S32 getLLMajorVersion() { return LL_VERSION_MAJOR; }
57 // Returns the minor version of Second Life
58 static S32 getLLMinorVersion() { return LL_VERSION_MINOR; }
59 // Returns the patch version of Second Life
60 static S32 getLLPatchVersion() { return LL_VERSION_PATCH; }
61 // Returns the build version of Second Life
62 static S32 getLLBuildVersion() { return LL_VERSION_BUILD; }
63 // Returns the name of the LL viewer ("Second Life")
64 static std::string getLLViewerName() { return LL_VIEWER_NAME; }
65
66 // Note that the viewer channel is set in settings.xml
67 // as VersionChannelName. LL_VIEWER_CHANNEL is not
68 // used in Imprudence
69
70private:
71 static S32 sVersionMajor;
72 static S32 sVersionMinor;
73 static S32 sVersionPatch;
74 static std::string sVersionTest;
75
76 static const std::string sViewerName;
77};
78
79#endif // VIEWERVERSION_H