From 2a072bfc678b4e59f1a07fe1bfe3621b4d46660d Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sat, 16 Jan 2016 13:31:21 -0500 Subject: [PATCH] Add package-based licenses to about floater --- indra/newview/CMakeLists.txt | 1 + indra/newview/llfloaterabout.cpp | 27 +++++++++++++++++++++++++++ indra/newview/viewer_manifest.py | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 72f045f63..c9655a98a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1377,6 +1377,7 @@ set(viewer_APPSETTINGS_FILES app_settings/viewerart.xml ${CMAKE_SOURCE_DIR}/../etc/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg + packages-info.txt ) source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index d5dafa9ca..4fe064959 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -111,6 +111,9 @@ LLFloaterAbout::LLFloaterAbout() LLViewerTextEditor *credits_widget = getChild("credits_editor", true); + + LLViewerTextEditor *licenses_widget = + getChild("licenses_editor", true); childSetAction("copy_btn", onAboutClickCopyToClipboard, this); @@ -328,6 +331,30 @@ LLFloaterAbout::LLFloaterAbout() credits_widget->setTakesFocus(TRUE); credits_widget->setHandleEditKeysDirectly(TRUE); + // Get the Versions and Copyrights, created at build time + std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "packages-info.txt"); + llifstream licenses_file; + licenses_file.open(licenses_path); /* Flawfinder: ignore */ + if (licenses_file.is_open()) + { + std::string license_line; + licenses_widget->clear(); + while (std::getline(licenses_file, license_line)) + { + licenses_widget->appendColoredText(license_line + "\n", FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); + } + licenses_file.close(); + } + else + { + // this case will use the (out of date) hard coded value from the XUI + LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL; + } + licenses_widget->setCursorPos(0); + licenses_widget->setEnabled(FALSE); + licenses_widget->setTakesFocus(TRUE); + licenses_widget->setHandleEditKeysDirectly(TRUE); + center(); sInstance = this; diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 125a69c90..3d9ec6405 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -81,6 +81,10 @@ class ViewerManifest(LLManifest): # ... and the hunspell dictionaries self.path("dictionaries") + # include the extracted packages information (see BuildPackagesInfo.cmake) + self.path(src=os.path.join(self.args['build'],"packages-info.txt"), dst="packages-info.txt") + + self.end_prefix("app_settings") if self.prefix(src="character"):