Add Qt version to About, remove changelog

This commit is contained in:
GriffinR 2024-12-17 22:02:46 -05:00
parent d4ec14584d
commit 12dba1a8b3
3 changed files with 84 additions and 113 deletions

View file

@ -1,19 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>AboutPorymap</class> <class>AboutPorymap</class>
<widget class="QMainWindow" name="AboutPorymap"> <widget class="QDialog" name="AboutPorymap">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>582</width> <width>383</width>
<height>438</height> <height>121</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>About Porymap</string> <string>About Porymap</string>
</property> </property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="label_Title"> <widget class="QLabel" name="label_Title">
@ -21,7 +20,6 @@
<font> <font>
<family>Arial</family> <family>Arial</family>
<pointsize>22</pointsize> <pointsize>22</pointsize>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
<underline>false</underline> <underline>false</underline>
<kerning>true</kerning> <kerning>true</kerning>
@ -31,10 +29,10 @@
<string>Porymap</string> <string>Porymap</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::TextFormat::RichText</enum>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignmentFlag::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -53,7 +51,7 @@
</font> </font>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignmentFlag::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -68,7 +66,7 @@
<string>Map editor for pokeemerald, pokefirered and pokeruby.</string> <string>Map editor for pokeemerald, pokefirered and pokeruby.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignmentFlag::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -78,41 +76,15 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Official Documentation: &lt;a href=&quot;https://huderlem.github.io/porymap/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0069d9;&quot;&gt;https://huderlem.github.io/porymap/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Official Documentation: &lt;a href=&quot;https://huderlem.github.io/porymap/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0069d9;&quot;&gt;https://huderlem.github.io/porymap/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignmentFlag::AlignCenter</set>
</property> </property>
<property name="openExternalLinks"> <property name="openExternalLinks">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </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> </layout>
</widget> </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/> <resources/>
<connections/> <connections/>
</ui> </ui>

View file

@ -3,13 +3,13 @@
#include <QString> #include <QString>
#include <QRegularExpression> #include <QRegularExpression>
#include <QMainWindow> #include <QDialog>
namespace Ui { namespace Ui {
class AboutPorymap; class AboutPorymap;
} }
class AboutPorymap : public QMainWindow class AboutPorymap : public QDialog
{ {
public: public:
explicit AboutPorymap(QWidget *parent = nullptr); explicit AboutPorymap(QWidget *parent = nullptr);

View file

@ -1,22 +1,21 @@
#include "aboutporymap.h" #include "aboutporymap.h"
#include "ui_aboutporymap.h" #include "ui_aboutporymap.h"
#include "log.h"
AboutPorymap::AboutPorymap(QWidget *parent) : AboutPorymap::AboutPorymap(QWidget *parent) :
QMainWindow(parent), QDialog(parent),
ui(new Ui::AboutPorymap) ui(new Ui::AboutPorymap)
{ {
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
QString versionInfo = QString("Version %1 - %2").arg(QCoreApplication::applicationVersion()).arg(QStringLiteral(__DATE__));
static const QString commitHash = PORYMAP_LATEST_COMMIT; static const QString commitHash = PORYMAP_LATEST_COMMIT;
if (!commitHash.isEmpty()) this->ui->label_Version->setText(QString("Version %1%2\nQt %3 (%4)\n%5")
versionInfo.append(QString("\nCommit %1").arg(commitHash)); .arg(QCoreApplication::applicationVersion())
.arg(commitHash.isEmpty() ? "" : QString(" (%1)").arg(commitHash))
this->ui->label_Version->setText(versionInfo); .arg(QStringLiteral(QT_VERSION_STR))
this->ui->textBrowser->setSource(QUrl("qrc:/CHANGELOG.md")); .arg(QSysInfo::buildCpuArchitecture())
.arg(QStringLiteral(__DATE__))
);
} }
AboutPorymap::~AboutPorymap() AboutPorymap::~AboutPorymap()