aboutsummaryrefslogtreecommitdiffstats
path: root/src/aboutdialog.cpp
blob: ac670bb41330b850201775807e5c60ecbebb9b9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "aboutdialog.h"
#include "gen/git_version.h"
#include <QSizePolicy>

AboutDialog::AboutDialog(QWidget* parent)
    : QDialog(parent, Qt::Dialog), ui(new Ui::AboutDialog)
{
    ui->setupUi(this);

#ifdef GIT_COMMIT_HASH
    ui->label->setText(ui->label->text().arg(tr("(commit %1)").arg(GIT_COMMIT_HASH)));
#elif defined GIT_DESCRIBE_TEXT
    ui->label->setText(ui->label->text().arg(tr("(%1)").arg(GIT_DESCRIBE_TEXT)));
#else
    ui->label->setText(ui->label->text().arg(""));
#endif

    // I have been saved by https://stackoverflow.com/a/22565649
    // It's not more complicated than that… thankfully
    adjustSize();
    setFixedSize(sizeHint());
}

AboutDialog::~AboutDialog() {
    delete ui;
}