Settings: Regroup all Devices-related configuration pages

Each kind of Device used to add its own top-level preference page, with only a single
tab in each, which makes the list of categories almost irrelevant.

Regrouping all these under the 'Devices' category makes the settings page much more
consistent and reduces the clutter.

Change-Id: I72c04b57004c2e1b1f57208bdaabe8b944390558
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Francois Ferrand
2016-09-06 14:21:09 +02:00
parent 6f698f3e98
commit 59e7528360
13 changed files with 35 additions and 42 deletions

View File

@@ -47,9 +47,7 @@ enum AndroidQemuStatus {
} // namespace Internal
namespace Constants {
const char ANDROID_SETTINGS_ID[] = "ZZ.Android Configurations";
const char ANDROID_SETTINGS_CATEGORY[] = "XA.Android";
const char ANDROID_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("Android", "Android");
const char ANDROID_SETTINGS_ID[] = "BB.Android Configurations";
const char ANDROID_SETTINGS_CATEGORY_ICON[] = ":/android/images/QtAndroid.png";
const char ANDROID_TOOLCHAIN_ID[] = "Qt4ProjectManager.ToolChain.Android";
const char ANDROIDQT[] = "Qt4ProjectManager.QtVersion.Android";

View File

@@ -28,6 +28,7 @@
#include "androidsettingswidget.h"
#include "androidconstants.h"
#include "androidtoolchain.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchainmanager.h>
#include <QCoreApplication>
@@ -41,11 +42,10 @@ AndroidSettingsPage::AndroidSettingsPage(QObject *parent)
: Core::IOptionsPage(parent)
{
setId(Constants::ANDROID_SETTINGS_ID);
setDisplayName(tr("Android Configurations"));
setCategory(Constants::ANDROID_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Android",
Constants::ANDROID_SETTINGS_TR_CATEGORY));
setCategoryIcon(Utils::Icon(Constants::ANDROID_SETTINGS_CATEGORY_ICON));
setDisplayName(tr("Android"));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
ProjectExplorer::Constants::DEVICE_SETTINGS_TR_CATEGORY));
}
QWidget *AndroidSettingsPage::widget()

View File

@@ -47,5 +47,3 @@ HEADERS += baremetalplugin.h \
openocdgdbserverprovider.h \
defaultgdbserverprovider.h \
stlinkutilgdbserverprovider.h
RESOURCES = baremetal.qrc

View File

@@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/baremetal">
<file>images/QtBareMetal.png</file>
</qresource>
</RCC>

View File

@@ -34,11 +34,7 @@ const char BareMetalOsType[] = "BareMetalOsType";
const char ACTION_ID[] = "BareMetal.Action";
const char MENU_ID[] = "BareMetal.Menu";
const char BAREMETAL_SETTINGS_CATEGORY[] = "ZZ.BareMetal";
const char BAREMETAL_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("BareMetal", "Bare Metal");
const char BAREMETAL_SETTINGS_CATEGORY_ICON[] = ":/baremetal/images/QtBareMetal.png";
const char GDB_PROVIDERS_SETTINGS_ID[] = "AA.BareMetal.GdbServerProvidersOptions";
const char GDB_PROVIDERS_SETTINGS_ID[] = "EE.BareMetal.GdbServerProvidersOptions";
// Debugger Server Provider Ids
const char OPENOCD_PROVIDER_ID[] = "BareMetal.GdbServerProvider.OpenOcd";

View File

@@ -30,6 +30,7 @@
#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/detailswidget.h>
#include <utils/qtcassert.h>
@@ -47,6 +48,7 @@
#include <QTextStream>
#include <QTreeView>
#include <QVBoxLayout>
#include <QGroupBox>
using namespace Utils;
@@ -293,10 +295,16 @@ GdbServerProvidersSettingsWidget::GdbServerProvidersSettingsWidget
verticalLayout->addWidget(m_providerView);
verticalLayout->addLayout(buttonLayout);
auto horizontalLayout = new QHBoxLayout(this);
auto horizontalLayout = new QHBoxLayout();
horizontalLayout->addLayout(verticalLayout);
horizontalLayout->addWidget(m_container);
auto groupBox = new QGroupBox(tr("GDB Server Providers"), this);
groupBox->setLayout(horizontalLayout);
auto topLayout = new QVBoxLayout(this);
topLayout->addWidget(groupBox);
connect(&m_model, &GdbServerProviderModel::providerStateChanged,
this, &GdbServerProvidersSettingsWidget::updateState);
@@ -411,12 +419,11 @@ QModelIndex GdbServerProvidersSettingsWidget::currentIndex() const
GdbServerProvidersSettingsPage::GdbServerProvidersSettingsPage(QObject *parent)
: Core::IOptionsPage(parent)
{
setCategory(Constants::BAREMETAL_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate(
"BareMetal", Constants::BAREMETAL_SETTINGS_TR_CATEGORY));
setCategoryIcon(Utils::Icon(Constants::BAREMETAL_SETTINGS_CATEGORY_ICON));
setId(Constants::GDB_PROVIDERS_SETTINGS_ID);
setDisplayName(tr("GDB Server Providers"));
setDisplayName(tr("Bare Metal"));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
ProjectExplorer::Constants::DEVICE_SETTINGS_TR_CATEGORY));
}
QWidget *GdbServerProvidersSettingsPage::widget()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -34,9 +34,7 @@ Q_DECLARE_LOGGING_CATEGORY(iosLog)
} // namespace Internal
namespace Constants {
const char IOS_SETTINGS_ID[] = "ZZ.Ios Configurations";
const char IOS_SETTINGS_CATEGORY[] = "XA.Ios";
const char IOS_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("Ios", "iOS");
const char IOS_SETTINGS_ID[] = "CC.Ios Configurations";
const char IOS_SETTINGS_CATEGORY_ICON[] = ":/ios/images/iossettings.png";
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // this literal is replicated to avoid dependencies

View File

@@ -28,6 +28,8 @@
#include "iossettingswidget.h"
#include "iosconstants.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <QCoreApplication>
namespace Ios {
@@ -37,11 +39,10 @@ IosSettingsPage::IosSettingsPage(QObject *parent)
: Core::IOptionsPage(parent)
{
setId(Constants::IOS_SETTINGS_ID);
setDisplayName(tr("iOS Configurations"));
setCategory(Constants::IOS_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("iOS",
Constants::IOS_SETTINGS_TR_CATEGORY));
setCategoryIcon(Utils::Icon(QLatin1String(Constants::IOS_SETTINGS_CATEGORY_ICON)));
setDisplayName(tr("iOS"));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
ProjectExplorer::Constants::DEVICE_SETTINGS_TR_CATEGORY));
}
QWidget *IosSettingsPage::widget()

View File

@@ -41,7 +41,8 @@ DeviceSettingsPage::DeviceSettingsPage(QObject *parent)
setId(Constants::DEVICE_SETTINGS_PAGE_ID);
setDisplayName(tr("Devices"));
setCategory(Constants::DEVICE_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Devices"));
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
ProjectExplorer::Constants::DEVICE_SETTINGS_TR_CATEGORY));
setCategoryIcon(Utils::Icon(":/projectexplorer/images/MaemoDevice.png"));
}

View File

@@ -172,6 +172,7 @@ const char KITS_SETTINGS_PAGE_ID[] = "D.ProjectExplorer.KitsOptions";
// Device settings page
const char DEVICE_SETTINGS_CATEGORY[] = "XW.Devices";
const char DEVICE_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Devices");
const char DEVICE_SETTINGS_PAGE_ID[] = "AA.Device Settings";
// Task categories

View File

@@ -55,10 +55,8 @@ const char QNX_DEBUG_EXECUTABLE[] = "pdebug";
const char QNX_TOOLCHAIN_ID[] = "Qnx.QccToolChain";
// QNX settings constants
const char QNX_CATEGORY[] = "XF.Qnx";
const char QNX_CATEGORY_TR[] = QT_TRANSLATE_NOOP("QNX", "QNX");
const char QNX_CATEGORY_ICON[] = ":/qnx/images/qnx-target.png";
const char QNX_SETTINGS_ID[] = "ZZ.Qnx Configuration";
const char QNX_SETTINGS_ID[] = "DD.Qnx Configuration";
const char QNX_CONFIGS_FILENAME[] = "qnxconfigurations.xml";

View File

@@ -30,6 +30,7 @@
#include "qnxsettingswidget.h"
#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QCoreApplication>
@@ -43,10 +44,9 @@ QnxSettingsPage::QnxSettingsPage(QObject* parent) :
{
setId(Core::Id(Constants::QNX_SETTINGS_ID));
setDisplayName(tr("QNX"));
setCategory(Constants::QNX_CATEGORY);
setDisplayCategory(QCoreApplication::translate("QNX",
Constants::QNX_CATEGORY_TR));
setCategoryIcon(Utils::Icon(Constants::QNX_CATEGORY_ICON));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
ProjectExplorer::Constants::DEVICE_SETTINGS_TR_CATEGORY));
}
QWidget* QnxSettingsPage::widget()