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:
Kimmo Varis 2011-08-11 18:13:54 +03:00
parent 9e2dd553fb
commit c9816c67c5
3 changed files with 10 additions and 4 deletions

View File

@ -21,12 +21,17 @@
#include <QString>
#include "aboutdialog.h"
AboutDialog::AboutDialog(const QString &version, QWidget *parent)
AboutDialog::AboutDialog(const QString &version, const QString &extraVersion, QWidget *parent)
: QDialog(parent)
{
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>";
mUI.mHomepage->setText(mUI.mHomepage->text().arg(url));
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(accept()));

View File

@ -36,7 +36,8 @@ class AboutDialog : public QDialog
{
Q_OBJECT
public:
AboutDialog(const QString &version, QWidget *parent = 0);
AboutDialog(const QString &version, const QString &extraVersion,
QWidget *parent = 0);
private:
Ui::About mUI;

View File

@ -680,7 +680,7 @@ void MainWindow::ToggleAllChecked(bool checked)
void MainWindow::About()
{
AboutDialog *dlg = new AboutDialog(CppCheck::version(), this);
AboutDialog *dlg = new AboutDialog(CppCheck::version(), CppCheck::extraVersion(), this);
dlg->exec();
}