diff --git a/forms/aboutporymap.ui b/forms/aboutporymap.ui index f823396c..7a211e0a 100644 --- a/forms/aboutporymap.ui +++ b/forms/aboutporymap.ui @@ -1,117 +1,89 @@ AboutPorymap - + 0 0 - 582 - 438 + 383 + 121 About Porymap - - - - - - - Arial - 22 - 75 - true - false - true - - - - Porymap - - - Qt::RichText - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - Arial - 12 - - - - Qt::AlignCenter - - - - - - - - Arial - - - - Map editor for pokeemerald, pokefirered and pokeruby. - - - Qt::AlignCenter - - - - - - - <html><head/><body><p>Official Documentation: <a href="https://huderlem.github.io/porymap/"><span style=" text-decoration: underline; color:#0069d9;">https://huderlem.github.io/porymap/</span></a></p></body></html> - - - Qt::AlignCenter - - - true - - - - - - - Qt::Horizontal - - - - - - - true - - - - - - - - - 0 - 0 - 582 - 22 - - - - + + + + + + Arial + 22 + true + false + true + + + + Porymap + + + Qt::TextFormat::RichText + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 0 + 0 + + + + + Arial + 12 + + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + Arial + + + + Map editor for pokeemerald, pokefirered and pokeruby. + + + Qt::AlignmentFlag::AlignCenter + + + + + + + <html><head/><body><p>Official Documentation: <a href="https://huderlem.github.io/porymap/"><span style=" text-decoration: underline; color:#0069d9;">https://huderlem.github.io/porymap/</span></a></p></body></html> + + + Qt::AlignmentFlag::AlignCenter + + + true + + + + diff --git a/include/ui/aboutporymap.h b/include/ui/aboutporymap.h index 28b06249..148fc8b1 100644 --- a/include/ui/aboutporymap.h +++ b/include/ui/aboutporymap.h @@ -3,13 +3,13 @@ #include #include -#include +#include namespace Ui { class AboutPorymap; } -class AboutPorymap : public QMainWindow +class AboutPorymap : public QDialog { public: explicit AboutPorymap(QWidget *parent = nullptr); diff --git a/porymap.pro b/porymap.pro index 51eadbb3..9555e7e5 100644 --- a/porymap.pro +++ b/porymap.pro @@ -20,6 +20,16 @@ RC_ICONS = resources/icons/porymap-icon-2.ico ICON = resources/icons/porymap.icns QMAKE_CXXFLAGS += -std=c++17 -Wall QMAKE_TARGET_BUNDLE_PREFIX = com.pret + +# Get latest commit hash if we can (to display alongside version information). +win32 { + LATEST_COMMIT = $$system(git rev-parse --short HEAD 2> nul) +} else { + LATEST_COMMIT = $$system(git rev-parse --short HEAD 2>/dev/null) +} + +DEFINES += PORYMAP_LATEST_COMMIT=\\\"$$LATEST_COMMIT\\\" + VERSION = 5.4.1 DEFINES += PORYMAP_VERSION=\\\"$$VERSION\\\" diff --git a/src/ui/aboutporymap.cpp b/src/ui/aboutporymap.cpp index 22c5fabc..07654e14 100644 --- a/src/ui/aboutporymap.cpp +++ b/src/ui/aboutporymap.cpp @@ -1,16 +1,23 @@ #include "aboutporymap.h" #include "ui_aboutporymap.h" -#include "log.h" AboutPorymap::AboutPorymap(QWidget *parent) : - QMainWindow(parent), + QDialog(parent), ui(new Ui::AboutPorymap) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); - this->ui->label_Version->setText(QString("Version %1 - %2").arg(QCoreApplication::applicationVersion()).arg(QStringLiteral(__DATE__))); - this->ui->textBrowser->setSource(QUrl("qrc:/CHANGELOG.md")); + static const QString commitHash = PORYMAP_LATEST_COMMIT; + this->ui->label_Version->setText(QString("Version %1%2\nQt %3 (%4)\n%5") + .arg(QCoreApplication::applicationVersion()) + .arg(commitHash.isEmpty() ? "" : QString(" (%1)").arg(commitHash)) + .arg(QStringLiteral(QT_VERSION_STR)) + .arg(QSysInfo::buildCpuArchitecture()) + .arg(QStringLiteral(__DATE__)) + ); + + layout()->setSizeConstraint(QLayout::SetFixedSize); } AboutPorymap::~AboutPorymap()