r24977 by craig - Add new tab to About Scribus window to include build information in detail with versions for libraries

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 2 21:25:36 UTC 2022


Author: craig
Date: Wed Mar  2 21:25:36 2022
New Revision: 24977

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24977
Log:
Add new tab to About Scribus window to include build information in detail with versions for libraries

Modified:
    branches/Version15x/Scribus/scribus/ui/about.cpp
    branches/Version15x/Scribus/scribus/ui/about.h

Modified: branches/Version15x/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24977&path=/branches/Version15x/Scribus/scribus/ui/about.cpp
==============================================================================
--- branches/Version15x/Scribus/scribus/ui/about.cpp	(original)
+++ branches/Version15x/Scribus/scribus/ui/about.cpp	Wed Mar  2 21:25:36 2022
@@ -26,10 +26,20 @@
 #include <QToolTip>
 #include <QWidget>
 
+#include "scconfig.h"
 #include "about.h"
 #include "api/api_application.h"
 #include "commonstrings.h"
-#include "scconfig.h"
+#include "scpaths.h"
+#include <cairo.h>
+#include <hb.h>
+#include <lcms2.h>
+#ifdef HAVE_PODOFO
+	#include <podofo/podofo.h>
+#endif
+#ifdef HAVE_POPPLER
+	#include <poppler/cpp/poppler-version.h>
+#endif
 #include "scpaths.h"
 #ifdef HAVE_SVNVERSION
 	#include "svnversion.h"
@@ -126,34 +136,7 @@
 	buildID = new QLabel( tab );
 	buildID->setAlignment(Qt::AlignCenter);
 	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
-	QString BUILD_DAY = "18";
-	QString BUILD_MONTH = CommonStrings::february;
-	QString BUILD_YEAR = "2022";
-	QString BUILD_TIME = "";
-	QString BUILD_TZ = "";
-	QString BUILD_NAME = "";
-
-	QString built = tr("%1 %2 %3").arg(BUILD_DAY, BUILD_MONTH, BUILD_YEAR);
-	QString version(ScribusAPI::getVersion());
-	if (BUILD_NAME != "")
-		version += " \"" + BUILD_NAME + "\"";
-	if (BUILD_NAME == "BleedingEdge")
-		built = tr("%3-%2-%1 %4 %5").arg(BUILD_DAY, BUILD_MONTH, BUILD_YEAR, BUILD_TIME, BUILD_TZ);
-
-	if (ScribusAPI::isSVN() && ScribusAPI::haveSVNRevision())
-	{
-		QString revText(tr("SVN Revision: "));
-		revText += ScribusAPI::getSVNRevision();
-		built += " - ";
-		built += revText;
-	}
-
-	QString gsver(getGSVersion());
-	if (!gsver.isEmpty())
-		gsver = tr("Using Ghostscript version %1").arg(gsver);
-	else
-		gsver = tr("No Ghostscript version available");
-	buildID->setText( tr("<p align=\"center\"><b>%1 %2</b></p><p align=\"center\">%3<br>%4 %5<br>%6</p>").arg( tr("Scribus Version"), version, built, tr("Build ID:"), ScribusAPI::getBuildInformation(), gsver));
+	buildID->setText( tr("<p align=\"center\"><b>%1 %2</b></p>").arg( tr("Scribus Version"), ScribusAPI::getVersion()));
 	tabLayout1->addWidget( buildID, 0, Qt::AlignHCenter );
 	tabWidget2->addTab( tab, tr("&About") );
 
@@ -221,6 +204,16 @@
 		textViewLicence->setPlainText(licenceText);
 	} 
 
+	/*! BUILD tab */
+	tab_build = new QWidget( tabWidget2 );
+	tabWidget2->addTab( tab_build, tr("&Build Information") );
+	buildLayout = new QVBoxLayout( tab_build );
+	buildLayout->setSpacing(6);
+	buildLayout->setContentsMargins(9, 9, 9, 9);
+	textViewBuild = new QTextBrowser( tab_build);
+	buildLayout->addWidget( textViewBuild );
+	textViewBuild->setText(generateBuildInfo());
+	
 	//Add tab widget to about window
 	aboutLayout->addWidget( tabWidget2 );
 
@@ -643,6 +636,76 @@
 	return result;
 } // parseLinksFile()
 
+QString About::generateBuildInfo()
+{
+	QString BUILD_DAY = "6";
+	QString BUILD_MONTH = CommonStrings::february;
+	QString BUILD_YEAR = "2022";
+	QString BUILD_TIME;
+	QString BUILD_TZ;
+	QString BUILD_NAME;
+
+	QString built = tr("%1 %2 %3").arg(BUILD_DAY, BUILD_MONTH, BUILD_YEAR);
+	QString version(ScribusAPI::getVersion());
+	if (BUILD_NAME != "")
+		version += " \"" + BUILD_NAME + "\"";
+	if (BUILD_NAME == "BleedingEdge")
+		built = tr("%3-%2-%1 %4 %5").arg(BUILD_DAY, BUILD_MONTH, BUILD_YEAR, BUILD_TIME, BUILD_TZ);
+
+	QString revText;
+	if (ScribusAPI::isSVN() && ScribusAPI::haveSVNRevision())
+		revText = tr("SVN Revision: %1").arg(ScribusAPI::getSVNRevision());
+
+	QString gsver(getGSVersion());
+	if (gsver.isEmpty())
+		gsver = tr("No Ghostscript version available");
+	QString buildText;
+	buildText.append("<p>");
+	buildText.append("<b>");
+	buildText.append(tr("Scribus Version %1").arg(version));
+	buildText.append("</b>");
+	buildText.append("</p><p>");
+	buildText.append(tr("Build ID: %1").arg(ScribusAPI::getBuildInformation()));
+	buildText.append("<br>");
+	if (!revText.isEmpty())
+	{
+		buildText.append(revText);
+		buildText.append("<br>");
+	}
+	buildText.append(tr("Built: %1").arg(built));
+	buildText.append("</p>");
+	buildText.append("<b>");
+	buildText.append(tr("Companion Programs:"));
+	buildText.append("</b>");
+	buildText.append("</p><p>");
+	buildText.append(tr("Ghostscript Version: %1").arg(gsver));
+	buildText.append("</p><p>");
+	buildText.append("<b>");
+	buildText.append(tr("Libraries:"));
+	buildText.append("</b>");
+	buildText.append("</p><p>");
+	buildText.append(tr("cairo: %1").arg(CAIRO_VERSION_STRING));
+	buildText.append("<br>");
+	buildText.append(tr("Harfbuzz: %1").arg(HB_VERSION_STRING));
+	buildText.append("<br>");
+	buildText.append(tr("littlcms: %1").arg(LCMS_VERSION));
+	buildText.append("<br>");
+	QString podofoVersion;
+#ifdef HAVE_PODOFO
+	podofoVersion.append(PODOFO_VERSION_STRING);
+#endif
+	buildText.append(tr("podofo: %1").arg(podofoVersion));
+	buildText.append("<br>");
+	QString popplerVersion;
+#ifdef HAVE_POPPLER
+	popplerVersion.append(POPPLER_VERSION);
+#endif
+	buildText.append(tr("poppler: %1").arg(popplerVersion));
+	buildText.append("</p>");
+
+	return buildText;
+}
+
 void About::setVisible (bool visible)
 {
 	QDialog::setVisible(visible);

Modified: branches/Version15x/Scribus/scribus/ui/about.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24977&path=/branches/Version15x/Scribus/scribus/ui/about.h
==============================================================================
--- branches/Version15x/Scribus/scribus/ui/about.h	(original)
+++ branches/Version15x/Scribus/scribus/ui/about.h	Wed Mar  2 21:25:36 2022
@@ -48,14 +48,17 @@
 	QWidget* tab_4;
 	QWidget* tab_5;
 	QWidget* tab_Licence;
+	QWidget* tab_build;
 	QTextBrowser* authorView;
 	QTextBrowser* transView;
 	QTextBrowser* onlineView;
 	QTextBrowser* updateView;
 	QTextBrowser* textViewLicence;
+	QTextBrowser* textViewBuild;
 	QVBoxLayout* aboutLayout;
 	QVBoxLayout* updateLayout;
 	QVBoxLayout* licenceLayout;
+	QVBoxLayout* buildLayout;
 	QHBoxLayout* tabLayout;
 	QVBoxLayout* tabLayout1;
 	QHBoxLayout* tabLayout_2;
@@ -71,6 +74,7 @@
 	QString parseAuthorFile(const QString& fileName);
 	QString parseTranslationFile(const QString& fileName);
 	QString parseLinksFile(const QString& fileName);
+	QString generateBuildInfo();
 
 protected slots:
 	void runUpdateCheck();




More information about the scribus-commit mailing list