Skip to content

Commit

Permalink
Tidying up the about dialog version strings
Browse files Browse the repository at this point in the history
- Release build => Version: 0.6.x & git info
- Nightly build => Nightly build & git info
- Dev build => Development Build
  • Loading branch information
chchwy committed Jan 8, 2020
1 parent 29e5a26 commit bf3e9da
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
23 changes: 16 additions & 7 deletions app/src/aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,24 @@ AboutDialog::~AboutDialog()

void AboutDialog::init()
{
QStringList devText;
devText << tr("Version: %1", "Version Number in About Dialog").arg(APP_VERSION);
#if defined(GIT_EXISTS) && defined(NIGHTLY_BUILD)
devText << "commit: " S__GIT_COMMIT_HASH
<< "date: " S__GIT_TIMESTAMP;
#endif
#if !defined(PENCIL2D_RELEASE)
QStringList devText;

#if defined(PENCIL2D_RELEASE_BUILD)
devText << tr("Version: %1", "Version Number in About Dialog").arg(APP_VERSION);
#elif defined(PENCIL2D_NIGHTLY_BUILD)
devText << "Nightly build";
#else
devText << "Development build";
#endif

devText << ""; // An empty line

#if defined(GIT_EXISTS)
devText << "commit: " S__GIT_COMMIT_HASH
<< "date: " S__GIT_TIMESTAMP
<< "";
#endif

devText << QString("Operating System: %1").arg(QSysInfo::prettyProductName())
<< QString("CPU Architecture: %1").arg(QSysInfo::buildCpuArchitecture());
if(QString(qVersion()) == QT_VERSION_STR)
Expand Down
4 changes: 2 additions & 2 deletions app/src/mainwindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ GNU General Public License for more details.
#define BUILD_DATE __DATE__
#endif

#ifdef NIGHTLY_BUILD
#define PENCIL_WINDOW_TITLE QString("[*]Pencil2D - Nightly Build %1").arg( BUILD_DATE )
#ifdef PENCIL2D_NIGHTLY_BUILD
#define PENCIL_WINDOW_TITLE QString("[*]Pencil2D - Nightly Build %1").arg(BUILD_DATE)
#else
#define PENCIL_WINDOW_TITLE QString("[*]Pencil2D v%1").arg(APP_VERSION)
#endif
Expand Down
9 changes: 7 additions & 2 deletions common.pri
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
VERSION = 0.6.4
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

NIGHTLY {
DEFINES += NIGHTLY_BUILD
PENCIL2D_NIGHTLY {
DEFINES += PENCIL2D_NIGHTLY_BUILD
}

PENCIL2D_RELEASE {
DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += PENCIL2D_RELEASE_BUILD
}

CONFIG += c++11
Expand Down
9 changes: 6 additions & 3 deletions core_lib/src/util/pencilerror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ void DebugDetails::appendSystemInfo()

#if QT_VERSION >= 0x050400
mDetails << "System Info";
#if !defined(PENCIL2D_RELEASE)
mDetails << "Pencil version: " APP_VERSION " (dev)";
#else
#if defined(PENCIL2D_RELEASE_BUILD)
mDetails << "Pencil version: " APP_VERSION " (stable)";
#elif defined(PENCIL2D_NIGHTLY_BUILD)
mDetails << "Pencil version: " APP_VERSION " (nightly)";
#else
mDetails << "Pencil version: " APP_VERSION " (dev)";
#endif

#if defined(GIT_EXISTS)
mDetails << "Commit: " S__GIT_COMMIT_HASH;
#endif
Expand Down

0 comments on commit bf3e9da

Please sign in to comment.