forked from qt-creator/qt-creator
ProjectExplorer: Merge device settings file pair, part 1
Step #1 into the "wrong" file to keep the change small. Step #2 will rename the files Change-Id: I2bdcc9e2149ca764f0bbebffb3ec520da72f8098 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -55,7 +55,6 @@ add_qtc_plugin(ProjectExplorer
|
|||||||
devicesupport/devicemanager.cpp devicesupport/devicemanager.h
|
devicesupport/devicemanager.cpp devicesupport/devicemanager.h
|
||||||
devicesupport/devicemanagermodel.cpp devicesupport/devicemanagermodel.h
|
devicesupport/devicemanagermodel.cpp devicesupport/devicemanagermodel.h
|
||||||
devicesupport/deviceprocessesdialog.cpp devicesupport/deviceprocessesdialog.h
|
devicesupport/deviceprocessesdialog.cpp devicesupport/deviceprocessesdialog.h
|
||||||
devicesupport/devicesettingspage.cpp devicesupport/devicesettingspage.h
|
|
||||||
devicesupport/devicesettingswidget.cpp devicesupport/devicesettingswidget.h
|
devicesupport/devicesettingswidget.cpp devicesupport/devicesettingswidget.h
|
||||||
devicesupport/devicetestdialog.cpp devicesupport/devicetestdialog.h
|
devicesupport/devicetestdialog.cpp devicesupport/devicetestdialog.h
|
||||||
devicesupport/deviceusedportsgatherer.cpp devicesupport/deviceusedportsgatherer.h
|
devicesupport/deviceusedportsgatherer.cpp devicesupport/deviceusedportsgatherer.h
|
||||||
|
@@ -1,26 +0,0 @@
|
|||||||
// 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 "devicesettingspage.h"
|
|
||||||
|
|
||||||
#include "devicesettingswidget.h"
|
|
||||||
#include "../projectexplorerconstants.h"
|
|
||||||
#include "../projectexplorertr.h"
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
DeviceSettingsPage::DeviceSettingsPage()
|
|
||||||
{
|
|
||||||
setId(Constants::DEVICE_SETTINGS_PAGE_ID);
|
|
||||||
setDisplayName(Tr::tr("Devices"));
|
|
||||||
setCategory(Constants::DEVICE_SETTINGS_CATEGORY);
|
|
||||||
setDisplayCategory(Tr::tr("Devices"));
|
|
||||||
setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png");
|
|
||||||
setWidgetCreator([] { return new DeviceSettingsWidget; });
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace ProjectExplorer
|
|
@@ -1,18 +0,0 @@
|
|||||||
// 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 <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class DeviceSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DeviceSettingsPage();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace ProjectExplorer
|
|
@@ -11,6 +11,7 @@
|
|||||||
#include "idevice.h"
|
#include "idevice.h"
|
||||||
#include "idevicefactory.h"
|
#include "idevicefactory.h"
|
||||||
#include "idevicewidget.h"
|
#include "idevicewidget.h"
|
||||||
|
#include "../projectexplorerconstants.h"
|
||||||
#include "../projectexplorericons.h"
|
#include "../projectexplorericons.h"
|
||||||
#include "../projectexplorertr.h"
|
#include "../projectexplorertr.h"
|
||||||
|
|
||||||
@@ -38,8 +39,8 @@
|
|||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer::Internal {
|
||||||
namespace Internal {
|
|
||||||
const char LastDeviceIndexKey[] = "LastDisplayedMaemoDeviceConfig";
|
const char LastDeviceIndexKey[] = "LastDisplayedMaemoDeviceConfig";
|
||||||
|
|
||||||
class NameValidator : public QValidator
|
class NameValidator : public QValidator
|
||||||
@@ -72,24 +73,65 @@ private:
|
|||||||
const DeviceManager * const m_deviceManager;
|
const DeviceManager * const m_deviceManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DeviceSettingsWidget final : public Core::IOptionsPageWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DeviceSettingsWidget();
|
||||||
|
~DeviceSettingsWidget() final
|
||||||
|
{
|
||||||
|
DeviceManager::removeClonedInstance();
|
||||||
|
delete m_configWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void apply() final { saveSettings(); }
|
||||||
|
|
||||||
|
void saveSettings();
|
||||||
|
|
||||||
|
void handleDeviceUpdated(Utils::Id id);
|
||||||
|
void currentDeviceChanged(int index);
|
||||||
|
void addDevice();
|
||||||
|
void removeDevice();
|
||||||
|
void deviceNameEditingFinished();
|
||||||
|
void setDefaultDevice();
|
||||||
|
void testDevice();
|
||||||
|
void handleProcessListRequested();
|
||||||
|
|
||||||
|
void initGui();
|
||||||
|
void displayCurrent();
|
||||||
|
void setDeviceInfoWidgetsEnabled(bool enable);
|
||||||
|
IDeviceConstPtr currentDevice() const;
|
||||||
|
int currentIndex() const;
|
||||||
|
void clearDetails();
|
||||||
|
QString parseTestOutput();
|
||||||
|
void fillInValues();
|
||||||
|
void updateDeviceFromUi();
|
||||||
|
|
||||||
|
DeviceManager * const m_deviceManager;
|
||||||
|
DeviceManagerModel * const m_deviceManagerModel;
|
||||||
|
NameValidator * const m_nameValidator;
|
||||||
|
QList<QPushButton *> m_additionalActionButtons;
|
||||||
|
IDeviceWidget *m_configWidget;
|
||||||
|
|
||||||
|
QLabel *m_configurationLabel;
|
||||||
|
QComboBox *m_configurationComboBox;
|
||||||
|
QGroupBox *m_generalGroupBox;
|
||||||
|
QLineEdit *m_nameLineEdit;
|
||||||
|
QLabel *m_osTypeValueLabel;
|
||||||
|
QLabel *m_autoDetectionLabel;
|
||||||
|
QLabel *m_deviceStateIconLabel;
|
||||||
|
QLabel *m_deviceStateTextLabel;
|
||||||
|
QGroupBox *m_osSpecificGroupBox;
|
||||||
|
QPushButton *m_removeConfigButton;
|
||||||
|
QPushButton *m_defaultDeviceButton;
|
||||||
|
QVBoxLayout *m_buttonsLayout;
|
||||||
|
};
|
||||||
|
|
||||||
DeviceSettingsWidget::DeviceSettingsWidget()
|
DeviceSettingsWidget::DeviceSettingsWidget()
|
||||||
: m_deviceManager(DeviceManager::cloneInstance()),
|
: m_deviceManager(DeviceManager::cloneInstance()),
|
||||||
m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)),
|
m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)),
|
||||||
m_nameValidator(new NameValidator(m_deviceManager, this)),
|
m_nameValidator(new NameValidator(m_deviceManager, this)),
|
||||||
m_configWidget(nullptr)
|
m_configWidget(nullptr)
|
||||||
{
|
|
||||||
initGui();
|
|
||||||
connect(m_deviceManager, &DeviceManager::deviceUpdated,
|
|
||||||
this, &DeviceSettingsWidget::handleDeviceUpdated);
|
|
||||||
}
|
|
||||||
|
|
||||||
DeviceSettingsWidget::~DeviceSettingsWidget()
|
|
||||||
{
|
|
||||||
DeviceManager::removeClonedInstance();
|
|
||||||
delete m_configWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DeviceSettingsWidget::initGui()
|
|
||||||
{
|
{
|
||||||
m_configurationLabel = new QLabel(Tr::tr("&Device:"));
|
m_configurationLabel = new QLabel(Tr::tr("&Device:"));
|
||||||
m_configurationComboBox = new QComboBox;
|
m_configurationComboBox = new QComboBox;
|
||||||
@@ -185,6 +227,7 @@ void DeviceSettingsWidget::initGui()
|
|||||||
lastIndex = 0;
|
lastIndex = 0;
|
||||||
if (lastIndex < m_configurationComboBox->count())
|
if (lastIndex < m_configurationComboBox->count())
|
||||||
m_configurationComboBox->setCurrentIndex(lastIndex);
|
m_configurationComboBox->setCurrentIndex(lastIndex);
|
||||||
|
|
||||||
connect(m_configurationComboBox, &QComboBox::currentIndexChanged,
|
connect(m_configurationComboBox, &QComboBox::currentIndexChanged,
|
||||||
this, &DeviceSettingsWidget::currentDeviceChanged);
|
this, &DeviceSettingsWidget::currentDeviceChanged);
|
||||||
currentDeviceChanged(currentIndex());
|
currentDeviceChanged(currentIndex());
|
||||||
@@ -192,10 +235,10 @@ void DeviceSettingsWidget::initGui()
|
|||||||
this, &DeviceSettingsWidget::setDefaultDevice);
|
this, &DeviceSettingsWidget::setDefaultDevice);
|
||||||
connect(m_removeConfigButton, &QAbstractButton::clicked,
|
connect(m_removeConfigButton, &QAbstractButton::clicked,
|
||||||
this, &DeviceSettingsWidget::removeDevice);
|
this, &DeviceSettingsWidget::removeDevice);
|
||||||
connect(m_nameLineEdit,
|
connect(m_nameLineEdit, &QLineEdit::editingFinished,
|
||||||
&QLineEdit::editingFinished,
|
this, &DeviceSettingsWidget::deviceNameEditingFinished);
|
||||||
this,
|
connect(m_deviceManager, &DeviceManager::deviceUpdated,
|
||||||
&DeviceSettingsWidget::deviceNameEditingFinished);
|
this, &DeviceSettingsWidget::handleDeviceUpdated);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceSettingsWidget::addDevice()
|
void DeviceSettingsWidget::addDevice()
|
||||||
@@ -408,5 +451,16 @@ void DeviceSettingsWidget::handleProcessListRequested()
|
|||||||
dlg.exec();
|
dlg.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
// DeviceSettingsPage
|
||||||
} // namespace ProjectExplorer
|
|
||||||
|
DeviceSettingsPage::DeviceSettingsPage()
|
||||||
|
{
|
||||||
|
setId(Constants::DEVICE_SETTINGS_PAGE_ID);
|
||||||
|
setDisplayName(Tr::tr("Devices"));
|
||||||
|
setCategory(Constants::DEVICE_SETTINGS_CATEGORY);
|
||||||
|
setDisplayCategory(Tr::tr("Devices"));
|
||||||
|
setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png");
|
||||||
|
setWidgetCreator([] { return new DeviceSettingsWidget; });
|
||||||
|
}
|
||||||
|
|
||||||
|
} // ProjectExplorer::Internal
|
||||||
|
@@ -3,83 +3,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "idevicefwd.h"
|
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QString>
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
namespace ProjectExplorer::Internal {
|
||||||
class QComboBox;
|
|
||||||
class QGroupBox;
|
|
||||||
class QLabel;
|
|
||||||
class QLineEdit;
|
|
||||||
class QPushButton;
|
|
||||||
class QVBoxLayout;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
class DeviceSettingsPage final : public Core::IOptionsPage
|
||||||
class DeviceManager;
|
|
||||||
class DeviceManagerModel;
|
|
||||||
class IDeviceWidget;
|
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
namespace Ui { class DeviceSettingsWidget; }
|
|
||||||
class NameValidator;
|
|
||||||
|
|
||||||
class DeviceSettingsWidget final : public Core::IOptionsPageWidget
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
DeviceSettingsWidget();
|
DeviceSettingsPage();
|
||||||
~DeviceSettingsWidget() final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void apply() final { saveSettings(); }
|
|
||||||
|
|
||||||
void saveSettings();
|
|
||||||
|
|
||||||
void handleDeviceUpdated(Utils::Id id);
|
|
||||||
void currentDeviceChanged(int index);
|
|
||||||
void addDevice();
|
|
||||||
void removeDevice();
|
|
||||||
void deviceNameEditingFinished();
|
|
||||||
void setDefaultDevice();
|
|
||||||
void testDevice();
|
|
||||||
void handleProcessListRequested();
|
|
||||||
|
|
||||||
void initGui();
|
|
||||||
void displayCurrent();
|
|
||||||
void setDeviceInfoWidgetsEnabled(bool enable);
|
|
||||||
IDeviceConstPtr currentDevice() const;
|
|
||||||
int currentIndex() const;
|
|
||||||
void clearDetails();
|
|
||||||
QString parseTestOutput();
|
|
||||||
void fillInValues();
|
|
||||||
void updateDeviceFromUi();
|
|
||||||
|
|
||||||
Ui::DeviceSettingsWidget *m_ui;
|
|
||||||
DeviceManager * const m_deviceManager;
|
|
||||||
DeviceManagerModel * const m_deviceManagerModel;
|
|
||||||
NameValidator * const m_nameValidator;
|
|
||||||
QList<QPushButton *> m_additionalActionButtons;
|
|
||||||
IDeviceWidget *m_configWidget;
|
|
||||||
|
|
||||||
QLabel *m_configurationLabel;
|
|
||||||
QComboBox *m_configurationComboBox;
|
|
||||||
QGroupBox *m_generalGroupBox;
|
|
||||||
QLineEdit *m_nameLineEdit;
|
|
||||||
QLabel *m_osTypeValueLabel;
|
|
||||||
QLabel *m_autoDetectionLabel;
|
|
||||||
QLabel *m_deviceStateIconLabel;
|
|
||||||
QLabel *m_deviceStateTextLabel;
|
|
||||||
QGroupBox *m_osSpecificGroupBox;
|
|
||||||
QPushButton *m_removeConfigButton;
|
|
||||||
QPushButton *m_defaultDeviceButton;
|
|
||||||
QVBoxLayout *m_buttonsLayout;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // ProjectExplorer::Internal
|
||||||
} // namespace ProjectExplorer
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#include "devicesupport/desktopdevicefactory.h"
|
#include "devicesupport/desktopdevicefactory.h"
|
||||||
#include "devicesupport/devicecheckbuildstep.h"
|
#include "devicesupport/devicecheckbuildstep.h"
|
||||||
#include "devicesupport/devicemanager.h"
|
#include "devicesupport/devicemanager.h"
|
||||||
#include "devicesupport/devicesettingspage.h"
|
#include "devicesupport/devicesettingswidget.h"
|
||||||
#include "devicesupport/sshsettings.h"
|
#include "devicesupport/sshsettings.h"
|
||||||
#include "devicesupport/sshsettingspage.h"
|
#include "devicesupport/sshsettingspage.h"
|
||||||
#include "editorsettingspropertiespage.h"
|
#include "editorsettingspropertiespage.h"
|
||||||
|
@@ -209,7 +209,6 @@ Project {
|
|||||||
"devicemanager.cpp", "devicemanager.h",
|
"devicemanager.cpp", "devicemanager.h",
|
||||||
"devicemanagermodel.cpp", "devicemanagermodel.h",
|
"devicemanagermodel.cpp", "devicemanagermodel.h",
|
||||||
"deviceprocessesdialog.cpp", "deviceprocessesdialog.h",
|
"deviceprocessesdialog.cpp", "deviceprocessesdialog.h",
|
||||||
"devicesettingspage.cpp", "devicesettingspage.h",
|
|
||||||
"devicesettingswidget.cpp", "devicesettingswidget.h",
|
"devicesettingswidget.cpp", "devicesettingswidget.h",
|
||||||
"devicetestdialog.cpp", "devicetestdialog.h",
|
"devicetestdialog.cpp", "devicetestdialog.h",
|
||||||
"deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h",
|
"deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h",
|
||||||
|
Reference in New Issue
Block a user