2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02: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.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "versiondialog.h"
|
|
|
|
|
|
2011-08-30 15:57:00 +02:00
|
|
|
#include <app/app_version.h>
|
|
|
|
|
#include <coreplugin/coreconstants.h>
|
2013-05-24 16:45:49 +02:00
|
|
|
#include <coreplugin/icore.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDialogButtonBox>
|
|
|
|
|
#include <QGridLayout>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QPushButton>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
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);
|
|
|
|
|
|
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(
|
2013-05-24 16:45:49 +02:00
|
|
|
"<h3>%1</h3>"
|
|
|
|
|
"%2<br/>"
|
2008-12-02 12:01:29 +01:00
|
|
|
"<br/>"
|
2013-05-24 16:45:49 +02:00
|
|
|
"Built on %3 at %4<br />"
|
2008-12-02 12:01:29 +01:00
|
|
|
"<br/>"
|
2013-05-24 16:45:49 +02:00
|
|
|
"%5"
|
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/>")
|
2013-05-24 16:45:49 +02:00
|
|
|
.arg(ICore::versionString(),
|
|
|
|
|
ICore::buildCompatibilityString(),
|
|
|
|
|
QLatin1String(__DATE__), QLatin1String(__TIME__),
|
|
|
|
|
ideRev,
|
|
|
|
|
QLatin1String(Constants::IDE_YEAR),
|
|
|
|
|
QLatin1String(Constants::IDE_AUTHOR));
|
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);
|
|
|
|
|
}
|