2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-05-06 15:05:37 +02:00
|
|
|
** Nokia at info@qt.nokia.com.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "versiondialog.h"
|
2009-01-21 13:33:58 +01:00
|
|
|
#include "icore.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2011-08-30 15:57:00 +02:00
|
|
|
#include <app/app_version.h>
|
|
|
|
|
#include <coreplugin/coreconstants.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include <QtCore/QDate>
|
|
|
|
|
#include <QtCore/QFile>
|
2009-06-02 19:35:30 +02:00
|
|
|
#include <QtCore/QSysInfo>
|
2008-12-09 15:25:01 +01:00
|
|
|
|
|
|
|
|
#include <QtGui/QDialogButtonBox>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <QtGui/QGridLayout>
|
|
|
|
|
#include <QtGui/QLabel>
|
|
|
|
|
#include <QtGui/QPushButton>
|
|
|
|
|
#include <QtGui/QTextBrowser>
|
|
|
|
|
|
2008-12-09 15:25:01 +01:00
|
|
|
using namespace Core;
|
|
|
|
|
using namespace Core::Internal;
|
|
|
|
|
|
2008-12-02 15:08:31 +01:00
|
|
|
VersionDialog::VersionDialog(QWidget *parent)
|
|
|
|
|
: QDialog(parent)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
// We need to set the window icon explicitly here since for some reason the
|
|
|
|
|
// application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
|
2010-07-30 22:16:59 +02:00
|
|
|
setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
setWindowTitle(tr("About Qt Creator"));
|
|
|
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
|
|
|
QGridLayout *layout = new QGridLayout(this);
|
|
|
|
|
layout->setSizeConstraint(QLayout::SetFixedSize);
|
|
|
|
|
|
2011-08-30 15:57:00 +02:00
|
|
|
QString version = QLatin1String(Constants::IDE_VERSION_LONG);
|
2010-05-11 10:28:29 +02:00
|
|
|
|
|
|
|
|
QString ideVersionDescription;
|
|
|
|
|
#ifdef IDE_VERSION_DESCRIPTION
|
2011-08-30 15:57:00 +02:00
|
|
|
ideVersionDescription = tr("(%1)").arg(QLatin1String(Constants::IDE_VERSION_DESCRIPTION_STR));
|
2010-05-11 10:28:29 +02:00
|
|
|
#endif
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-06-02 19:35:30 +02:00
|
|
|
QString ideRev;
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifdef IDE_REVISION
|
2009-06-02 19:35:30 +02:00
|
|
|
//: This gets conditionally inserted as argument %8 into the description string.
|
2011-08-30 15:57:00 +02:00
|
|
|
ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(10));
|
2008-12-02 12:01:29 +01:00
|
|
|
#endif
|
2009-06-02 19:35:30 +02:00
|
|
|
|
|
|
|
|
const QString description = tr(
|
2010-05-11 10:28:29 +02:00
|
|
|
"<h3>Qt Creator %1 %8</h3>"
|
2009-06-02 19:35:30 +02:00
|
|
|
"Based on Qt %2 (%3 bit)<br/>"
|
2008-12-02 12:01:29 +01:00
|
|
|
"<br/>"
|
2009-06-02 19:35:30 +02:00
|
|
|
"Built on %4 at %5<br />"
|
2008-12-02 12:01:29 +01:00
|
|
|
"<br/>"
|
2010-05-11 10:28:29 +02:00
|
|
|
"%9"
|
2009-06-02 19:35:30 +02:00
|
|
|
"<br/>"
|
|
|
|
|
"Copyright 2008-%6 %7. All rights reserved.<br/>"
|
2008-12-02 12:01:29 +01:00
|
|
|
"<br/>"
|
|
|
|
|
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
|
|
|
|
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
|
|
|
|
|
"PARTICULAR PURPOSE.<br/>")
|
2010-05-11 10:28:29 +02:00
|
|
|
.arg(version,
|
|
|
|
|
QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize),
|
2011-08-30 15:57:00 +02:00
|
|
|
QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(Constants::IDE_YEAR),
|
|
|
|
|
(QLatin1String(Constants::IDE_AUTHOR)), ideVersionDescription,
|
2010-05-11 10:28:29 +02:00
|
|
|
ideRev);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QLabel *copyRightLabel = new QLabel(description);
|
|
|
|
|
copyRightLabel->setWordWrap(true);
|
|
|
|
|
copyRightLabel->setOpenExternalLinks(true);
|
|
|
|
|
copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
|
|
|
|
|
|
|
|
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
|
|
|
QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
|
2011-07-29 12:00:11 +02:00
|
|
|
QTC_CHECK(closeButton);
|
2008-12-02 12:01:29 +01:00
|
|
|
buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
|
|
|
|
|
connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
|
|
|
|
|
|
|
|
|
|
QLabel *logoLabel = new QLabel;
|
2010-07-30 22:16:59 +02:00
|
|
|
logoLabel->setPixmap(QPixmap(QLatin1String(Constants::ICON_QTLOGO_128)));
|
2008-12-02 12:01:29 +01:00
|
|
|
layout->addWidget(logoLabel , 0, 0, 1, 1);
|
|
|
|
|
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
|
|
|
|
|
layout->addWidget(buttonBox, 4, 0, 1, 5);
|
|
|
|
|
}
|