GUI: Show extraversion in About-dialog.
If the "extra version" is defined (not empty) then it is shown after the actual version number in the About-dialog. Ticket: #2164 ([GUI] Add revision info to "About" window)
This commit is contained in:
parent
9e2dd553fb
commit
c9816c67c5
|
@ -21,12 +21,17 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include "aboutdialog.h"
|
#include "aboutdialog.h"
|
||||||
|
|
||||||
AboutDialog::AboutDialog(const QString &version, QWidget *parent)
|
AboutDialog::AboutDialog(const QString &version, const QString &extraVersion, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
mUI.setupUi(this);
|
mUI.setupUi(this);
|
||||||
|
|
||||||
mUI.mVersion->setText(mUI.mVersion->text().arg(version));
|
QString fmtVersion(version);
|
||||||
|
if (!extraVersion.isEmpty())
|
||||||
|
{
|
||||||
|
fmtVersion += " (" + extraVersion + ")";
|
||||||
|
}
|
||||||
|
mUI.mVersion->setText(mUI.mVersion->text().arg(fmtVersion));
|
||||||
QString url = "<a href=\"http://cppcheck.sourceforge.net/\">http://cppcheck.sourceforge.net/</a>";
|
QString url = "<a href=\"http://cppcheck.sourceforge.net/\">http://cppcheck.sourceforge.net/</a>";
|
||||||
mUI.mHomepage->setText(mUI.mHomepage->text().arg(url));
|
mUI.mHomepage->setText(mUI.mHomepage->text().arg(url));
|
||||||
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||||
|
|
|
@ -36,7 +36,8 @@ class AboutDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AboutDialog(const QString &version, QWidget *parent = 0);
|
AboutDialog(const QString &version, const QString &extraVersion,
|
||||||
|
QWidget *parent = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::About mUI;
|
Ui::About mUI;
|
||||||
|
|
|
@ -680,7 +680,7 @@ void MainWindow::ToggleAllChecked(bool checked)
|
||||||
|
|
||||||
void MainWindow::About()
|
void MainWindow::About()
|
||||||
{
|
{
|
||||||
AboutDialog *dlg = new AboutDialog(CppCheck::version(), this);
|
AboutDialog *dlg = new AboutDialog(CppCheck::version(), CppCheck::extraVersion(), this);
|
||||||
dlg->exec();
|
dlg->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue