r24976 by craig - Add new tab to About Scribus window to include build information in
scribus-commit
scribus-commit at lists.scribus.net
Wed Mar 2 21:14:27 UTC 2022
Author: craig
Date: Wed Mar 2 21:14:26 2022
New Revision: 24976
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24976
Log:
Add new tab to About Scribus window to include build information in
detail with versions for libraries
Modified:
trunk/Scribus/scribus/ui/about.cpp
trunk/Scribus/scribus/ui/about.h
Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24976&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Wed Mar 2 21:14:26 2022
@@ -26,10 +26,19 @@
#include <QToolTip>
#include <QWidget>
+#include "scconfig.h"
#include "about.h"
#include "api/api_application.h"
#include "commonstrings.h"
-#include "scconfig.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 +135,8 @@
buildID = new QLabel( tab );
buildID->setAlignment(Qt::AlignCenter);
buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
- 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);
-
- 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,15 @@
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 );
@@ -641,7 +633,77 @@
result = "";
} // else file found
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)
{
Modified: trunk/Scribus/scribus/ui/about.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24976&path=/trunk/Scribus/scribus/ui/about.h
==============================================================================
--- trunk/Scribus/scribus/ui/about.h (original)
+++ trunk/Scribus/scribus/ui/about.h Wed Mar 2 21:14:26 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