diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index f256b9e0eb6..a321752a2c7 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -47,7 +47,7 @@ add_qtc_plugin(ProjectExplorer deploymentdataview.cpp deploymentdataview.h desktoprunconfiguration.cpp desktoprunconfiguration.h devicesupport/desktopdevice.cpp devicesupport/desktopdevice.h - devicesupport/desktopdeviceconfigurationwidget.cpp devicesupport/desktopdeviceconfigurationwidget.h devicesupport/desktopdeviceconfigurationwidget.ui + devicesupport/desktopdeviceconfigurationwidget.cpp devicesupport/desktopdeviceconfigurationwidget.h devicesupport/desktopdevicefactory.cpp devicesupport/desktopdevicefactory.h devicesupport/desktopprocesssignaloperation.cpp devicesupport/desktopprocesssignaloperation.h devicesupport/devicecheckbuildstep.cpp devicesupport/devicecheckbuildstep.h diff --git a/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.cpp b/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.cpp index 9a603a9b054..5153c8c620a 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.cpp @@ -1,38 +1,19 @@ -/**************************************************************************** -** -** 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. -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "desktopdeviceconfigurationwidget.h" -#include "ui_desktopdeviceconfigurationwidget.h" #include "../projectexplorerconstants.h" +#include "../projectexplorertr.h" #include "idevice.h" -#include +#include +#include #include #include +#include +#include #include using namespace ProjectExplorer::Constants; @@ -40,21 +21,27 @@ using namespace ProjectExplorer::Constants; namespace ProjectExplorer { DesktopDeviceConfigurationWidget::DesktopDeviceConfigurationWidget(const IDevicePtr &device) : - IDeviceWidget(device), - m_ui(new Ui::DesktopDeviceConfigurationWidget) + IDeviceWidget(device) { - m_ui->setupUi(this); - connect(m_ui->freePortsLineEdit, &QLineEdit::textChanged, + m_freePortsLineEdit = new QLineEdit; + m_portsWarningLabel = new Utils::InfoLabel( + Tr::tr("You will need at least one port for QML debugging."), + Utils::InfoLabel::Warning); + + using namespace Layouting; + Form { + Tr::tr("Machine type:"), Tr::tr("Physical Device"), br, + Tr::tr("Free ports:"), m_freePortsLineEdit, br, + empty, m_portsWarningLabel, br, + noMargin, + }.attachTo(this); + + connect(m_freePortsLineEdit, &QLineEdit::textChanged, this, &DesktopDeviceConfigurationWidget::updateFreePorts); initGui(); } -DesktopDeviceConfigurationWidget::~DesktopDeviceConfigurationWidget() -{ - delete m_ui; -} - void DesktopDeviceConfigurationWidget::updateDeviceFromUi() { updateFreePorts(); @@ -62,25 +49,20 @@ void DesktopDeviceConfigurationWidget::updateDeviceFromUi() void DesktopDeviceConfigurationWidget::updateFreePorts() { - device()->setFreePorts(Utils::PortList::fromString(m_ui->freePortsLineEdit->text())); - m_ui->portsWarningLabel->setVisible(!device()->freePorts().hasMore()); + device()->setFreePorts(Utils::PortList::fromString(m_freePortsLineEdit->text())); + m_portsWarningLabel->setVisible(!device()->freePorts().hasMore()); } void DesktopDeviceConfigurationWidget::initGui() { QTC_CHECK(device()->machineType() == IDevice::Hardware); - m_ui->machineTypeValueLabel->setText(tr("Physical Device")); - m_ui->freePortsLineEdit->setPlaceholderText( + m_freePortsLineEdit->setPlaceholderText( QString::fromLatin1("eg: %1-%2").arg(DESKTOP_PORT_START).arg(DESKTOP_PORT_END)); - m_ui->portsWarningLabel->setPixmap(Utils::Icons::WARNING.pixmap()); - m_ui->portsWarningLabel->setToolTip(QLatin1String("") - + tr("You will need at least one port for QML debugging.") - + QLatin1String("")); const auto portsValidator = new QRegularExpressionValidator( QRegularExpression(Utils::PortList::regularExpression()), this); - m_ui->freePortsLineEdit->setValidator(portsValidator); + m_freePortsLineEdit->setValidator(portsValidator); - m_ui->freePortsLineEdit->setText(device()->freePorts().toString()); + m_freePortsLineEdit->setText(device()->freePorts().toString()); updateFreePorts(); } diff --git a/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.h b/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.h index 11112b04ed6..a161ab40ae0 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.h @@ -1,40 +1,21 @@ -/**************************************************************************** -** -** 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. -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #pragma once #include "idevicewidget.h" +QT_BEGIN_NAMESPACE +class QLineEdit; +class QLabel; +QT_END_NAMESPACE + namespace ProjectExplorer { -namespace Ui { class DesktopDeviceConfigurationWidget; } class DesktopDeviceConfigurationWidget : public IDeviceWidget { public: explicit DesktopDeviceConfigurationWidget(const IDevicePtr &device); - ~DesktopDeviceConfigurationWidget() override; void updateDeviceFromUi() override; @@ -44,7 +25,8 @@ private: void initGui(); private: - Ui::DesktopDeviceConfigurationWidget *m_ui; + QLineEdit *m_freePortsLineEdit; + QLabel *m_portsWarningLabel; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.ui b/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.ui deleted file mode 100644 index 3fd9fd184eb..00000000000 --- a/src/plugins/projectexplorer/devicesupport/desktopdeviceconfigurationwidget.ui +++ /dev/null @@ -1,69 +0,0 @@ - - - ProjectExplorer::DesktopDeviceConfigurationWidget - - - - 0 - 0 - 437 - 265 - - - - - - - - - - Machine type: - - - - - - - TextLabel - - - - - - - Free ports: - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index b3b6f6930ae..15af723ab4c 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -223,7 +223,7 @@ QtcPlugin { "sshparameters.cpp", "sshparameters.h", "sshsettings.cpp", "sshsettings.h", "sshsettingspage.cpp", "sshsettingspage.h", - "desktopdeviceconfigurationwidget.cpp", "desktopdeviceconfigurationwidget.h", "desktopdeviceconfigurationwidget.ui", + "desktopdeviceconfigurationwidget.cpp", "desktopdeviceconfigurationwidget.h", "desktopprocesssignaloperation.cpp", "desktopprocesssignaloperation.h", ] }