From 2eb3ec39bfd13e4bcc29655ea41326b4462d938d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 24 Mar 2015 22:40:49 +0100 Subject: [PATCH] NOISSUE tweak version display in the application to reflect recent changes --- BuildConfig.cpp.in | 49 ++++++++++++++++--------------------- BuildConfig.h | 23 ----------------- gui/dialogs/AboutDialog.cpp | 3 +-- gui/dialogs/AboutDialog.ui | 40 ++++++++++++------------------ 4 files changed, 37 insertions(+), 78 deletions(-) diff --git a/BuildConfig.cpp.in b/BuildConfig.cpp.in index 1ea073746..04cfbf050 100644 --- a/BuildConfig.cpp.in +++ b/BuildConfig.cpp.in @@ -1,4 +1,5 @@ #include "BuildConfig.h" +#include Config BuildConfig; @@ -9,16 +10,7 @@ Config::Config() VERSION_MINOR = @MultiMC_VERSION_MINOR@; VERSION_HOTFIX = @MultiMC_VERSION_HOTFIX@; VERSION_BUILD = @MultiMC_VERSION_BUILD@; - VERSION_TYPE = "@MultiMC_VERSION_TYPE@"; - if(VERSION_TYPE == "Release") - versionTypeEnum = Release; - else if(VERSION_TYPE == "ReleaseCandidate") - versionTypeEnum = ReleaseCandidate; - else if(VERSION_TYPE == "Development") - versionTypeEnum = Development; - else - versionTypeEnum = Custom; VERSION_CHANNEL = "@MultiMC_VERSION_CHANNEL@"; BUILD_PLATFORM = "@MultiMC_BUILD_PLATFORM@"; CHANLIST_URL = "@MultiMC_CHANLIST_URL@"; @@ -33,22 +25,6 @@ Config::Config() NEWS_RSS_URL = "@MultiMC_NEWS_RSS_URL@"; } -QString Config::versionTypeName() const -{ - switch (versionTypeEnum) - { - case Release: - return "Stable Release"; - case ReleaseCandidate: - return "Release Candidate"; - case Development: - return "Development"; - case Custom: - default: - return "Custom"; - } -} - QString Config::printableVersionString() const { QString vstr = QString("%1.%2").arg(QString::number(VERSION_MAJOR), QString::number(VERSION_MINOR)); @@ -56,8 +32,25 @@ QString Config::printableVersionString() const if (VERSION_HOTFIX > 0) vstr += "." + QString::number(VERSION_HOTFIX); // If the build is a development build or release candidate, add that info to the end. - if (versionTypeEnum == Development) vstr += "-dev" + QString::number(VERSION_BUILD); - else if (versionTypeEnum == ReleaseCandidate) vstr += "-rc" + QString::number(VERSION_BUILD); - + if(VERSION_CHANNEL == "stable") + { + return vstr; + } + else if(VERSION_CHANNEL == "develop") + { + vstr += "-dev-" + QString::number(VERSION_BUILD); + } + else if(VERSION_CHANNEL == "unstable") + { + vstr += "-nuke-" + QString::number(VERSION_BUILD); + } + else if(VERSION_CHANNEL == "custom") + { + vstr += "-local"; + } + else + { + vstr += "-" + VERSION_CHANNEL + "-" + QString::number(VERSION_BUILD); + } return vstr; } diff --git a/BuildConfig.h b/BuildConfig.h index baf2ad6dd..60aefeb41 100644 --- a/BuildConfig.h +++ b/BuildConfig.h @@ -16,24 +16,6 @@ public: int VERSION_HOTFIX; /// The build number. int VERSION_BUILD; - /// The build type, as specified at build time. - QString VERSION_TYPE; - - /// The build type, transformed. - enum Type - { - /// Version type for stable release builds. - Release, - - /// Version type for release candidates. - ReleaseCandidate, - - /// Version type for development builds. - Development, - - /// Version type for custom builds. This is the default when no version type is specified. - Custom - } versionTypeEnum; /** * The version channel @@ -76,11 +58,6 @@ public: * \return The version number in string format (major.minor.revision.build). */ QString printableVersionString() const; - - /** - * returns a string representation of the version channel type, suitable for printing. - */ - QString versionTypeName() const; }; extern Config BuildConfig; diff --git a/gui/dialogs/AboutDialog.cpp b/gui/dialogs/AboutDialog.cpp index 6b31113c4..e15da1429 100644 --- a/gui/dialogs/AboutDialog.cpp +++ b/gui/dialogs/AboutDialog.cpp @@ -82,10 +82,9 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia ui->urlLabel->setOpenExternalLinks(true); ui->icon->setPixmap(MMC->getThemedIcon("multimc").pixmap(64)); - ui->title->setText("MultiMC 5 " + BuildConfig.printableVersionString()); + ui->title->setText("MultiMC 5"); ui->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString()); - ui->vtypeLabel->setText(tr("Version Type") +": " + BuildConfig.versionTypeName()); ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM); if (BuildConfig.VERSION_BUILD >= 0) diff --git a/gui/dialogs/AboutDialog.ui b/gui/dialogs/AboutDialog.ui index caeaf5448..2b5f8b781 100644 --- a/gui/dialogs/AboutDialog.ui +++ b/gui/dialogs/AboutDialog.ui @@ -100,8 +100,8 @@ 0 0 - 689 - 311 + 695 + 297 @@ -118,16 +118,6 @@ - - - - Version Type: - - - Qt::AlignCenter - - - @@ -225,8 +215,8 @@ 0 0 - 689 - 311 + 695 + 297 @@ -242,7 +232,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:11pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Oxygen-Sans'; font-size:11pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> @@ -267,8 +257,8 @@ p, li { white-space: pre-wrap; } 0 0 - 689 - 311 + 695 + 297 @@ -481,8 +471,8 @@ p, li { white-space: pre-wrap; } 0 0 - 689 - 311 + 695 + 297 @@ -495,12 +485,12 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Part of the reason for using the Apache license is we don't want people using the &quot;MultiMC&quot; name when redistributing the project. This means people must take the time to go through the source code and remove all references to &quot;MultiMC&quot;, including but not limited to the project icon and the title of windows, (no *MultiMC-fork* in the title).</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The Apache license covers reasonable use for the name - a mention of the project's origins in the About dialog and the license is acceptable. However, it should be abundantly clear that the project is a fork <span style=" font-weight:600;">without</span> implying that you have our blessing.</p></body></html> +</style></head><body style=" font-family:'Oxygen-Sans'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">Part of the reason for using the Apache license is we don't want people using the &quot;MultiMC&quot; name when redistributing the project. This means people must take the time to go through the source code and remove all references to &quot;MultiMC&quot;, including but not limited to the project icon and the title of windows, (no *MultiMC-fork* in the title).</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">The Apache license covers reasonable use for the name - a mention of the project's origins in the About dialog and the license is acceptable. However, it should be abundantly clear that the project is a fork </span><span style=" font-family:'Bitstream Vera Sans'; font-weight:600;">without</span><span style=" font-family:'Bitstream Vera Sans';"> implying that you have our blessing.</span></p></body></html> Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse