From 5eae8b4806547cc698f572b052d95ce1c170d066 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 6 Mar 2019 11:10:45 -0800 Subject: [PATCH] added version identifier to about dialog --- dialogs/aboutdialog.cpp | 50 +++++++++++++++++++++++------------------ dialogs/aboutdialog.h | 4 ++-- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/dialogs/aboutdialog.cpp b/dialogs/aboutdialog.cpp index 9d2ab6ba2..3e5969075 100644 --- a/dialogs/aboutdialog.cpp +++ b/dialogs/aboutdialog.cpp @@ -24,32 +24,38 @@ #include #include +#include "oliveglobal.h" + AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent) + QDialog(parent) { - setWindowTitle("About Olive"); + setWindowTitle("About Olive"); - QVBoxLayout* layout = new QVBoxLayout(this); - layout->setSpacing(20); + QVBoxLayout* layout = new QVBoxLayout(this); + layout->setSpacing(20); - QLabel* label = - new QLabel("" - "

" - "

" - "" - "https://www.olivevideoeditor.org/" - "

" - + tr("Olive is a non-linear video editor. This software is free and protected by the GNU GPL.") - + "

" - + tr("Olive Team is obliged to inform users that Olive source code is available for download from its website.") - + "

", this); - label->setAlignment(Qt::AlignCenter); - label->setWordWrap(true); - layout->addWidget(label); + QLabel* label = + new QLabel(QString("" + "

" + "

" + "" + "https://www.olivevideoeditor.org/" + "

" + "

%1

" // AppName (version identifier) + "

%2

" // First statement + "

%3

" // Second statement + "").arg(olive::AppName, + tr("Olive is a non-linear video editor. This software is free and " + "protected by the GNU GPL."), + tr("Olive Team is obliged to inform users that Olive source code is " + "available for download from its website.")), this); + label->setAlignment(Qt::AlignCenter); + label->setWordWrap(true); + layout->addWidget(label); - QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok, this); - buttons->setCenterButtons(true); - layout->addWidget(buttons); + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok, this); + buttons->setCenterButtons(true); + layout->addWidget(buttons); - connect(buttons, SIGNAL(accepted()), this, SLOT(accept())); + connect(buttons, SIGNAL(accepted()), this, SLOT(accept())); } diff --git a/dialogs/aboutdialog.h b/dialogs/aboutdialog.h index 2faee3f58..4f4e49134 100644 --- a/dialogs/aboutdialog.h +++ b/dialogs/aboutdialog.h @@ -25,10 +25,10 @@ class AboutDialog : public QDialog { - Q_OBJECT + Q_OBJECT public: - explicit AboutDialog(QWidget *parent = 0); + explicit AboutDialog(QWidget *parent = nullptr); }; #endif // ABOUTDIALOG_H