2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
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
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Alternatively, 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
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
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"
|
2008-12-09 15:25:01 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "coreconstants.h"
|
2009-01-21 13:33:58 +01:00
|
|
|
#include "icore.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
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;
|
|
|
|
|
using namespace Core::Constants;
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
QString version = QLatin1String(IDE_VERSION_LONG);
|
2010-05-11 10:28:29 +02:00
|
|
|
|
|
|
|
|
QString ideVersionDescription;
|
|
|
|
|
#ifdef IDE_VERSION_DESCRIPTION
|
|
|
|
|
ideVersionDescription = tr("(%1)").arg(QLatin1String(IDE_VERSION_DESCRIPTION_STR));
|
|
|
|
|
#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.
|
|
|
|
|
ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(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),
|
2010-01-29 21:33:57 +01:00
|
|
|
QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(IDE_YEAR),
|
2010-05-11 10:28:29 +02:00
|
|
|
(QLatin1String(IDE_AUTHOR)), ideVersionDescription,
|
|
|
|
|
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);
|
2008-12-09 15:25:01 +01:00
|
|
|
QTC_ASSERT(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);
|
|
|
|
|
}
|