Merge pull request #609 from GriffinRichards/commit-version
Include latest commit hash in version info
This commit is contained in:
commit
9efbe53238
4 changed files with 97 additions and 108 deletions
|
@ -1,19 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AboutPorymap</class>
|
||||
<widget class="QMainWindow" name="AboutPorymap">
|
||||
<widget class="QDialog" name="AboutPorymap">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>582</width>
|
||||
<height>438</height>
|
||||
<width>383</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>About Porymap</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Title">
|
||||
|
@ -21,7 +20,6 @@
|
|||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>22</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
<underline>false</underline>
|
||||
<kerning>true</kerning>
|
||||
|
@ -31,10 +29,10 @@
|
|||
<string>Porymap</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
<enum>Qt::TextFormat::RichText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -53,7 +51,7 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -68,7 +66,7 @@
|
|||
<string>Map editor for pokeemerald, pokefirered and pokeruby.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -78,41 +76,15 @@
|
|||
<string><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></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>582</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
#include <QString>
|
||||
#include <QRegularExpression>
|
||||
#include <QMainWindow>
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AboutPorymap;
|
||||
}
|
||||
|
||||
class AboutPorymap : public QMainWindow
|
||||
class AboutPorymap : public QDialog
|
||||
{
|
||||
public:
|
||||
explicit AboutPorymap(QWidget *parent = nullptr);
|
||||
|
|
10
porymap.pro
10
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\\\"
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue