forked from qt-creator/qt-creator
QbsProjectManager: Display qbs version in settings page.
Task-number: QBS-855 Change-Id: I2f9c5536a79a8a5564daeca869c1d7951732658c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
This commit is contained in:
76
src/plugins/qbsprojectmanager/qbsinfopage.cpp
Normal file
76
src/plugins/qbsprojectmanager/qbsinfopage.cpp
Normal file
@@ -0,0 +1,76 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qbsinfopage.h"
|
||||
#include "ui_qbsinfowidget.h"
|
||||
|
||||
#include "qbsconstants.h"
|
||||
|
||||
#include <qbs.h>
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class QbsInfoWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QbsInfoWidget(QWidget *parent = 0) : QWidget(parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
m_ui.versionValueLabel->setText(qbs::LanguageInfo::qbsVersion());
|
||||
}
|
||||
|
||||
Ui::QbsInfoWidget m_ui;
|
||||
};
|
||||
|
||||
|
||||
QbsInfoPage::QbsInfoPage(QObject *parent) : Core::IOptionsPage(parent), m_widget(nullptr)
|
||||
{
|
||||
setId("AB.QbsInfo");
|
||||
setDisplayName(QCoreApplication::translate("QbsProjectManager", "Version Info"));
|
||||
setCategory(Constants::QBS_SETTINGS_CATEGORY);
|
||||
setDisplayCategory(QCoreApplication::translate("QbsProjectManager",
|
||||
Constants::QBS_SETTINGS_TR_CATEGORY));
|
||||
setCategoryIcon(QLatin1String(Constants::QBS_SETTINGS_CATEGORY_ICON));
|
||||
}
|
||||
|
||||
QWidget *QbsInfoPage::widget()
|
||||
{
|
||||
if (!m_widget)
|
||||
m_widget = new QbsInfoWidget;
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
void QbsInfoPage::finish()
|
||||
{
|
||||
delete m_widget;
|
||||
m_widget = nullptr;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QbsProjectManager
|
||||
|
||||
#include "qbsinfopage.moc"
|
||||
48
src/plugins/qbsprojectmanager/qbsinfopage.h
Normal file
48
src/plugins/qbsprojectmanager/qbsinfopage.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
class QbsInfoWidget;
|
||||
|
||||
class QbsInfoPage : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
QbsInfoPage(QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
QWidget *widget() override;
|
||||
void apply() override { };
|
||||
void finish() override;
|
||||
|
||||
QbsInfoWidget *m_widget;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QbsProjectManager
|
||||
35
src/plugins/qbsprojectmanager/qbsinfowidget.ui
Normal file
35
src/plugins/qbsprojectmanager/qbsinfowidget.ui
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QbsProjectManager::Internal::QbsInfoWidget</class>
|
||||
<widget class="QWidget" name="QbsProjectManager::Internal::QbsInfoWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>229</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="versionKeyLabel">
|
||||
<property name="text">
|
||||
<string>Qbs version:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="versionValueLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -26,6 +26,7 @@ HEADERS = \
|
||||
qbsbuildstep.h \
|
||||
qbscleanstep.h \
|
||||
qbsdeployconfigurationfactory.h \
|
||||
qbsinfopage.h \
|
||||
qbsinstallstep.h \
|
||||
qbslogsink.h \
|
||||
qbsnodes.h \
|
||||
@@ -49,6 +50,7 @@ SOURCES = \
|
||||
qbsbuildstep.cpp \
|
||||
qbscleanstep.cpp \
|
||||
qbsdeployconfigurationfactory.cpp \
|
||||
qbsinfopage.cpp \
|
||||
qbsinstallstep.cpp \
|
||||
qbslogsink.cpp \
|
||||
qbsnodes.cpp \
|
||||
@@ -65,6 +67,7 @@ FORMS = \
|
||||
customqbspropertiesdialog.ui \
|
||||
qbsbuildstepconfigwidget.ui \
|
||||
qbscleanstepconfigwidget.ui \
|
||||
qbsinfowidget.ui \
|
||||
qbsinstallstepconfigwidget.ui \
|
||||
qbsprofilessettingswidget.ui
|
||||
|
||||
|
||||
@@ -78,6 +78,9 @@ QtcPlugin {
|
||||
"qbsconstants.h",
|
||||
"qbsdeployconfigurationfactory.cpp",
|
||||
"qbsdeployconfigurationfactory.h",
|
||||
"qbsinfopage.cpp",
|
||||
"qbsinfopage.h",
|
||||
"qbsinfowidget.ui",
|
||||
"qbsinstallstep.cpp",
|
||||
"qbsinstallstep.h",
|
||||
"qbsinstallstepconfigwidget.ui",
|
||||
@@ -104,7 +107,7 @@ QtcPlugin {
|
||||
"qbsprojectparser.cpp",
|
||||
"qbsprojectparser.h",
|
||||
"qbsrunconfiguration.cpp",
|
||||
"qbsrunconfiguration.h"
|
||||
"qbsrunconfiguration.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "qbsbuildstep.h"
|
||||
#include "qbscleanstep.h"
|
||||
#include "qbsdeployconfigurationfactory.h"
|
||||
#include "qbsinfopage.h"
|
||||
#include "qbsinstallstep.h"
|
||||
#include "qbsnodes.h"
|
||||
#include "qbsprofilessettingspage.h"
|
||||
@@ -104,6 +105,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
addAutoReleasedObject(new QbsDeployConfigurationFactory);
|
||||
addAutoReleasedObject(new QbsRunConfigurationFactory);
|
||||
addAutoReleasedObject(new QbsProfilesSettingsPage);
|
||||
addAutoReleasedObject(new QbsInfoPage);
|
||||
|
||||
//menus
|
||||
// Build Menu:
|
||||
|
||||
Reference in New Issue
Block a user