forked from qt-creator/qt-creator
KitManager: spacing in dialog
Change-Id: I243de278cd964c9aa51e7ff091a2c33e8043a562 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -65,20 +65,12 @@ static const char dgbToolsDownloadLink64C[] = "http://www.microsoft.com/whdc/dev
|
|||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
DebuggerKitConfigWidget::DebuggerKitConfigWidget(ProjectExplorer::Kit *workingCopy,
|
DebuggerKitConfigWidget::DebuggerKitConfigWidget(ProjectExplorer::Kit *workingCopy,
|
||||||
const DebuggerKitInformation *ki,
|
const DebuggerKitInformation *ki)
|
||||||
QWidget *parent) :
|
: KitConfigWidget(workingCopy),
|
||||||
ProjectExplorer::KitConfigWidget(parent),
|
|
||||||
m_kit(workingCopy),
|
|
||||||
m_info(ki),
|
m_info(ki),
|
||||||
m_label(new QLabel(this)),
|
m_label(new QLabel),
|
||||||
m_button(new QPushButton(tr("Manage..."), this))
|
m_button(new QPushButton(tr("Manage...")))
|
||||||
{
|
{
|
||||||
setToolTip(tr("The debugger to use for this kit."));
|
|
||||||
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
|
||||||
layout->setMargin(0);
|
|
||||||
layout->addWidget(m_label);
|
|
||||||
|
|
||||||
// ToolButton with Menu, defaulting to 'Autodetect'.
|
// ToolButton with Menu, defaulting to 'Autodetect'.
|
||||||
QMenu *buttonMenu = new QMenu(m_button);
|
QMenu *buttonMenu = new QMenu(m_button);
|
||||||
QAction *autoDetectAction = buttonMenu->addAction(tr("Auto-detect"));
|
QAction *autoDetectAction = buttonMenu->addAction(tr("Auto-detect"));
|
||||||
@@ -90,6 +82,16 @@ DebuggerKitConfigWidget::DebuggerKitConfigWidget(ProjectExplorer::Kit *workingCo
|
|||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString DebuggerKitConfigWidget::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("The debugger to use for this kit.");
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *DebuggerKitConfigWidget::mainWidget() const
|
||||||
|
{
|
||||||
|
return m_label;
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *DebuggerKitConfigWidget::buttonWidget() const
|
QWidget *DebuggerKitConfigWidget::buttonWidget() const
|
||||||
{
|
{
|
||||||
return m_button;
|
return m_button;
|
||||||
|
|||||||
@@ -62,23 +62,23 @@ class DebuggerKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerKitConfigWidget(ProjectExplorer::Kit *workingCopy,
|
DebuggerKitConfigWidget(ProjectExplorer::Kit *workingCopy,
|
||||||
const DebuggerKitInformation *ki,
|
const DebuggerKitInformation *ki);
|
||||||
QWidget *parent = 0);
|
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
QWidget *buttonWidget() const;
|
QWidget *buttonWidget() const;
|
||||||
|
QWidget *mainWidget() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void autoDetectDebugger();
|
void autoDetectDebugger();
|
||||||
void showDialog();
|
void showDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::Kit *m_kit;
|
|
||||||
const DebuggerKitInformation *m_info;
|
const DebuggerKitInformation *m_info;
|
||||||
QLabel *m_label;
|
QLabel *m_label;
|
||||||
QPushButton *m_button;
|
QPushButton *m_button;
|
||||||
|
|||||||
@@ -34,30 +34,34 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QGridLayout)
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
|
class Kit;
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// KitConfigWidget
|
// KitConfigWidget
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT KitConfigWidget : public QWidget
|
class PROJECTEXPLORER_EXPORT KitConfigWidget : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
KitConfigWidget(QWidget *parent = 0) : QWidget(parent)
|
KitConfigWidget(Kit *kit) : m_kit(kit) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
|
virtual QString toolTip() const { return QString(); }
|
||||||
virtual void makeReadOnly() = 0;
|
virtual void makeReadOnly() = 0;
|
||||||
virtual void refresh() = 0;
|
virtual void refresh() = 0;
|
||||||
|
|
||||||
|
virtual QWidget *mainWidget() const = 0;
|
||||||
virtual QWidget *buttonWidget() const { return 0; }
|
virtual QWidget *buttonWidget() const { return 0; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dirty();
|
void dirty();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
ProjectExplorer::Kit *m_kit;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -288,7 +288,6 @@ QList<Task> DeviceTypeKitInformation::validate(const Kit *k) const
|
|||||||
|
|
||||||
KitConfigWidget *DeviceTypeKitInformation::createConfigWidget(Kit *k) const
|
KitConfigWidget *DeviceTypeKitInformation::createConfigWidget(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(k);
|
|
||||||
return new Internal::DeviceTypeInformationConfigWidget(k);
|
return new Internal::DeviceTypeInformationConfigWidget(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,7 +380,6 @@ void DeviceKitInformation::fix(Kit *k)
|
|||||||
|
|
||||||
KitConfigWidget *DeviceKitInformation::createConfigWidget(Kit *k) const
|
KitConfigWidget *DeviceKitInformation::createConfigWidget(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(k);
|
|
||||||
return new Internal::DeviceInformationConfigWidget(k);
|
return new Internal::DeviceInformationConfigWidget(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
@@ -54,21 +53,12 @@ namespace Internal {
|
|||||||
// SysRootInformationConfigWidget:
|
// SysRootInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
SysRootInformationConfigWidget::SysRootInformationConfigWidget(Kit *k, QWidget *parent) :
|
SysRootInformationConfigWidget::SysRootInformationConfigWidget(Kit *k) :
|
||||||
KitConfigWidget(parent),
|
KitConfigWidget(k)
|
||||||
m_kit(k)
|
|
||||||
{
|
{
|
||||||
setToolTip(tr("The root directory of the system image to use.<br>"
|
|
||||||
"Leave empty when building for the desktop."));
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
|
||||||
layout->setMargin(0);
|
|
||||||
m_chooser = new Utils::PathChooser;
|
m_chooser = new Utils::PathChooser;
|
||||||
m_chooser->setContentsMargins(0, 0, 0, 0);
|
|
||||||
layout->addWidget(m_chooser);
|
|
||||||
m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
||||||
|
|
||||||
m_chooser->setFileName(SysRootKitInformation::sysRoot(k));
|
m_chooser->setFileName(SysRootKitInformation::sysRoot(k));
|
||||||
|
|
||||||
connect(m_chooser, SIGNAL(changed(QString)), this, SLOT(pathWasChanged()));
|
connect(m_chooser, SIGNAL(changed(QString)), this, SLOT(pathWasChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +67,12 @@ QString SysRootInformationConfigWidget::displayName() const
|
|||||||
return tr("Sysroot:");
|
return tr("Sysroot:");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString SysRootInformationConfigWidget::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("The root directory of the system image to use.<br>"
|
||||||
|
"Leave empty when building for the desktop.");
|
||||||
|
}
|
||||||
|
|
||||||
void SysRootInformationConfigWidget::refresh()
|
void SysRootInformationConfigWidget::refresh()
|
||||||
{
|
{
|
||||||
m_chooser->setFileName(SysRootKitInformation::sysRoot(m_kit));
|
m_chooser->setFileName(SysRootKitInformation::sysRoot(m_kit));
|
||||||
@@ -87,6 +83,11 @@ void SysRootInformationConfigWidget::makeReadOnly()
|
|||||||
m_chooser->setEnabled(false);
|
m_chooser->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *SysRootInformationConfigWidget::mainWidget() const
|
||||||
|
{
|
||||||
|
return m_chooser->lineEdit();
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *SysRootInformationConfigWidget::buttonWidget() const
|
QWidget *SysRootInformationConfigWidget::buttonWidget() const
|
||||||
{
|
{
|
||||||
return m_chooser->buttonAtIndex(0);
|
return m_chooser->buttonAtIndex(0);
|
||||||
@@ -101,22 +102,13 @@ void SysRootInformationConfigWidget::pathWasChanged()
|
|||||||
// ToolChainInformationConfigWidget:
|
// ToolChainInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Kit *k, QWidget *parent) :
|
ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Kit *k) :
|
||||||
KitConfigWidget(parent),
|
KitConfigWidget(k), m_isReadOnly(false)
|
||||||
m_isReadOnly(false), m_kit(k),
|
|
||||||
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this))
|
|
||||||
{
|
{
|
||||||
setToolTip(tr("The compiler to use for building.<br>"
|
|
||||||
"Make sure the compiler will produce binaries compatible with the target device, "
|
|
||||||
"Qt version and other libraries used."));
|
|
||||||
ToolChainManager *tcm = ToolChainManager::instance();
|
ToolChainManager *tcm = ToolChainManager::instance();
|
||||||
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
m_comboBox = new QComboBox;
|
||||||
layout->setMargin(0);
|
|
||||||
m_comboBox->setContentsMargins(0, 0, 0, 0);
|
|
||||||
m_comboBox->setEnabled(false);
|
m_comboBox->setEnabled(false);
|
||||||
m_comboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
|
||||||
layout->addWidget(m_comboBox);
|
|
||||||
|
|
||||||
foreach (ToolChain *tc, tcm->toolChains())
|
foreach (ToolChain *tc, tcm->toolChains())
|
||||||
toolChainAdded(tc);
|
toolChainAdded(tc);
|
||||||
@@ -126,8 +118,8 @@ ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Kit *k, QWidg
|
|||||||
refresh();
|
refresh();
|
||||||
connect(m_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentToolChainChanged(int)));
|
connect(m_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentToolChainChanged(int)));
|
||||||
|
|
||||||
|
m_manageButton = new QPushButton(tr("Manage..."));
|
||||||
m_manageButton->setContentsMargins(0, 0, 0, 0);
|
m_manageButton->setContentsMargins(0, 0, 0, 0);
|
||||||
m_manageButton->setText(tr("Manage..."));
|
|
||||||
connect(m_manageButton, SIGNAL(clicked()), this, SLOT(manageToolChains()));
|
connect(m_manageButton, SIGNAL(clicked()), this, SLOT(manageToolChains()));
|
||||||
|
|
||||||
connect(tcm, SIGNAL(toolChainAdded(ProjectExplorer::ToolChain*)),
|
connect(tcm, SIGNAL(toolChainAdded(ProjectExplorer::ToolChain*)),
|
||||||
@@ -143,6 +135,13 @@ QString ToolChainInformationConfigWidget::displayName() const
|
|||||||
return tr("Compiler:");
|
return tr("Compiler:");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ToolChainInformationConfigWidget::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("The compiler to use for building.<br>"
|
||||||
|
"Make sure the compiler will produce binaries compatible with the target device, "
|
||||||
|
"Qt version and other libraries used.");
|
||||||
|
}
|
||||||
|
|
||||||
void ToolChainInformationConfigWidget::refresh()
|
void ToolChainInformationConfigWidget::refresh()
|
||||||
{
|
{
|
||||||
m_comboBox->setCurrentIndex(indexOf(ToolChainKitInformation::toolChain(m_kit)));
|
m_comboBox->setCurrentIndex(indexOf(ToolChainKitInformation::toolChain(m_kit)));
|
||||||
@@ -153,6 +152,11 @@ void ToolChainInformationConfigWidget::makeReadOnly()
|
|||||||
m_comboBox->setEnabled(false);
|
m_comboBox->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *ToolChainInformationConfigWidget::mainWidget() const
|
||||||
|
{
|
||||||
|
return m_comboBox;
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *ToolChainInformationConfigWidget::buttonWidget() const
|
QWidget *ToolChainInformationConfigWidget::buttonWidget() const
|
||||||
{
|
{
|
||||||
return m_manageButton;
|
return m_manageButton;
|
||||||
@@ -222,35 +226,35 @@ int ToolChainInformationConfigWidget::indexOf(const ToolChain *tc)
|
|||||||
// DeviceTypeInformationConfigWidget:
|
// DeviceTypeInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
DeviceTypeInformationConfigWidget::DeviceTypeInformationConfigWidget(Kit *workingCopy, QWidget *parent) :
|
DeviceTypeInformationConfigWidget::DeviceTypeInformationConfigWidget(Kit *workingCopy) :
|
||||||
KitConfigWidget(parent),
|
KitConfigWidget(workingCopy), m_isReadOnly(false), m_comboBox(new QComboBox)
|
||||||
m_isReadOnly(false), m_kit(workingCopy),
|
|
||||||
m_comboBox(new QComboBox)
|
|
||||||
{
|
{
|
||||||
setToolTip(tr("The type of device to run applications on."));
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
|
||||||
layout->setMargin(0);
|
|
||||||
m_comboBox->setContentsMargins(0, 0, 0, 0);
|
|
||||||
m_comboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
|
||||||
layout->addWidget(m_comboBox);
|
|
||||||
|
|
||||||
QList<IDeviceFactory *> factories
|
QList<IDeviceFactory *> factories
|
||||||
= ExtensionSystem::PluginManager::instance()->getObjects<IDeviceFactory>();
|
= ExtensionSystem::PluginManager::instance()->getObjects<IDeviceFactory>();
|
||||||
foreach (IDeviceFactory *factory, factories) {
|
foreach (IDeviceFactory *factory, factories) {
|
||||||
foreach (Core::Id id, factory->availableCreationIds()) {
|
foreach (Core::Id id, factory->availableCreationIds())
|
||||||
m_comboBox->addItem(factory->displayNameForId(id), id.uniqueIdentifier());
|
m_comboBox->addItem(factory->displayNameForId(id), id.uniqueIdentifier());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
connect(m_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentTypeChanged(int)));
|
connect(m_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentTypeChanged(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *DeviceTypeInformationConfigWidget::mainWidget() const
|
||||||
|
{
|
||||||
|
return m_comboBox;
|
||||||
|
}
|
||||||
|
|
||||||
QString DeviceTypeInformationConfigWidget::displayName() const
|
QString DeviceTypeInformationConfigWidget::displayName() const
|
||||||
{
|
{
|
||||||
return tr("Device type:");
|
return tr("Device type:");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString DeviceTypeInformationConfigWidget::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("The type of device to run applications on.");
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceTypeInformationConfigWidget::refresh()
|
void DeviceTypeInformationConfigWidget::refresh()
|
||||||
{
|
{
|
||||||
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(m_kit);
|
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(m_kit);
|
||||||
@@ -279,39 +283,38 @@ void DeviceTypeInformationConfigWidget::currentTypeChanged(int idx)
|
|||||||
// DeviceInformationConfigWidget:
|
// DeviceInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
DeviceInformationConfigWidget::DeviceInformationConfigWidget(Kit *workingCopy, QWidget *parent) :
|
DeviceInformationConfigWidget::DeviceInformationConfigWidget(Kit *workingCopy) :
|
||||||
KitConfigWidget(parent),
|
KitConfigWidget(workingCopy),
|
||||||
m_isReadOnly(false), m_kit(workingCopy),
|
m_isReadOnly(false),
|
||||||
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this)),
|
m_comboBox(new QComboBox),
|
||||||
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
||||||
{
|
{
|
||||||
connect(m_model, SIGNAL(modelAboutToBeReset()), SLOT(modelAboutToReset()));
|
|
||||||
connect(m_model, SIGNAL(modelReset()), SLOT(modelReset()));
|
|
||||||
|
|
||||||
setToolTip(tr("The device to run the applications on."));
|
|
||||||
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
|
||||||
layout->setMargin(0);
|
|
||||||
m_comboBox->setContentsMargins(0, 0, 0, 0);
|
|
||||||
m_comboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
|
||||||
layout->addWidget(m_comboBox);
|
|
||||||
|
|
||||||
m_comboBox->setModel(m_model);
|
m_comboBox->setModel(m_model);
|
||||||
|
|
||||||
m_manageButton->setContentsMargins(0, 0, 0, 0);
|
m_manageButton = new QPushButton(tr("Manage"));
|
||||||
m_manageButton->setText(tr("Manage..."));
|
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
connect(m_model, SIGNAL(modelAboutToBeReset()), SLOT(modelAboutToReset()));
|
||||||
|
connect(m_model, SIGNAL(modelReset()), SLOT(modelReset()));
|
||||||
connect(m_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentDeviceChanged()));
|
connect(m_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentDeviceChanged()));
|
||||||
|
|
||||||
connect(m_manageButton, SIGNAL(clicked()), this, SLOT(manageDevices()));
|
connect(m_manageButton, SIGNAL(clicked()), this, SLOT(manageDevices()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *DeviceInformationConfigWidget::mainWidget() const
|
||||||
|
{
|
||||||
|
return m_comboBox;
|
||||||
|
}
|
||||||
|
|
||||||
QString DeviceInformationConfigWidget::displayName() const
|
QString DeviceInformationConfigWidget::displayName() const
|
||||||
{
|
{
|
||||||
return tr("Device:");
|
return tr("Device:");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString DeviceInformationConfigWidget::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("The device to run the applications on.");
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceInformationConfigWidget::refresh()
|
void DeviceInformationConfigWidget::refresh()
|
||||||
{
|
{
|
||||||
m_model->setTypeFilter(DeviceTypeKitInformation::deviceTypeId(m_kit));
|
m_model->setTypeFilter(DeviceTypeKitInformation::deviceTypeId(m_kit));
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ namespace Utils { class PathChooser; }
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class DeviceManagerModel;
|
class DeviceManagerModel;
|
||||||
class Kit;
|
|
||||||
class ToolChain;
|
class ToolChain;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -58,18 +57,19 @@ class SysRootInformationConfigWidget : public KitConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SysRootInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
explicit SysRootInformationConfigWidget(Kit *k);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void refresh();
|
void refresh();
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
QWidget *buttonWidget() const;
|
QWidget *buttonWidget() const;
|
||||||
|
QWidget *mainWidget() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void pathWasChanged();
|
void pathWasChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Kit *m_kit;
|
|
||||||
Utils::PathChooser *m_chooser;
|
Utils::PathChooser *m_chooser;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,12 +82,14 @@ class ToolChainInformationConfigWidget : public KitConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ToolChainInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
explicit ToolChainInformationConfigWidget(Kit *k);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void refresh();
|
void refresh();
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
|
QWidget *mainWidget() const;
|
||||||
QWidget *buttonWidget() const;
|
QWidget *buttonWidget() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void toolChainAdded(ProjectExplorer::ToolChain *tc);
|
void toolChainAdded(ProjectExplorer::ToolChain *tc);
|
||||||
@@ -101,7 +103,6 @@ private:
|
|||||||
int indexOf(const ToolChain *tc);
|
int indexOf(const ToolChain *tc);
|
||||||
|
|
||||||
bool m_isReadOnly;
|
bool m_isReadOnly;
|
||||||
Kit *m_kit;
|
|
||||||
QComboBox *m_comboBox;
|
QComboBox *m_comboBox;
|
||||||
QPushButton *m_manageButton;
|
QPushButton *m_manageButton;
|
||||||
};
|
};
|
||||||
@@ -115,9 +116,11 @@ class DeviceTypeInformationConfigWidget : public KitConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DeviceTypeInformationConfigWidget(Kit *workingCopy, QWidget *parent = 0);
|
explicit DeviceTypeInformationConfigWidget(Kit *workingCopy);
|
||||||
|
|
||||||
|
QWidget *mainWidget() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
QString toolTip() const;
|
||||||
void refresh();
|
void refresh();
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
|
|
||||||
@@ -126,7 +129,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isReadOnly;
|
bool m_isReadOnly;
|
||||||
Kit *m_kit;
|
|
||||||
QComboBox *m_comboBox;
|
QComboBox *m_comboBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,12 +141,14 @@ class DeviceInformationConfigWidget : public KitConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DeviceInformationConfigWidget(Kit *workingCopy, QWidget *parent = 0);
|
explicit DeviceInformationConfigWidget(Kit *workingCopy);
|
||||||
|
|
||||||
|
QWidget *mainWidget() const;
|
||||||
|
QWidget *buttonWidget() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
QString toolTip() const;
|
||||||
void refresh();
|
void refresh();
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
QWidget *buttonWidget() const;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void manageDevices();
|
void manageDevices();
|
||||||
@@ -154,7 +158,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isReadOnly;
|
bool m_isReadOnly;
|
||||||
Kit *m_kit;
|
|
||||||
QComboBox *m_comboBox;
|
QComboBox *m_comboBox;
|
||||||
QPushButton *m_manageButton;
|
QPushButton *m_manageButton;
|
||||||
DeviceManagerModel *m_model;
|
DeviceManagerModel *m_model;
|
||||||
|
|||||||
@@ -33,12 +33,13 @@
|
|||||||
#include "kitmanager.h"
|
#include "kitmanager.h"
|
||||||
|
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QPainter>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QSizePolicy>
|
#include <QSizePolicy>
|
||||||
@@ -47,11 +48,9 @@
|
|||||||
static const char WORKING_COPY_KIT_ID[] = "modified kit";
|
static const char WORKING_COPY_KIT_ID[] = "modified kit";
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
|
KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
|
||||||
QWidget(parent),
|
|
||||||
m_layout(new QGridLayout),
|
m_layout(new QGridLayout),
|
||||||
m_iconButton(new QToolButton),
|
m_iconButton(new QToolButton),
|
||||||
m_nameEdit(new QLineEdit),
|
m_nameEdit(new QLineEdit),
|
||||||
@@ -59,30 +58,27 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
|
|||||||
m_modifiedKit(new Kit(Core::Id(WORKING_COPY_KIT_ID))),
|
m_modifiedKit(new Kit(Core::Id(WORKING_COPY_KIT_ID))),
|
||||||
m_fixingKit(false)
|
m_fixingKit(false)
|
||||||
{
|
{
|
||||||
QVBoxLayout *top = new QVBoxLayout(this);
|
m_layout->addWidget(m_nameEdit, 0, WidgetColumn);
|
||||||
top->setMargin(0);
|
m_layout->addWidget(m_iconButton, 0, ButtonColumn);
|
||||||
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
|
|
||||||
|
QWidget *inner = new QWidget;
|
||||||
|
inner->setLayout(m_layout);
|
||||||
|
|
||||||
QScrollArea *scroll = new QScrollArea;
|
QScrollArea *scroll = new QScrollArea;
|
||||||
|
scroll->setWidget(inner);
|
||||||
scroll->setFrameShape(QFrame::NoFrame);
|
scroll->setFrameShape(QFrame::NoFrame);
|
||||||
scroll->setWidgetResizable(true);
|
scroll->setWidgetResizable(true);
|
||||||
scroll->setFocusPolicy(Qt::NoFocus);
|
scroll->setFocusPolicy(Qt::NoFocus);
|
||||||
top->addWidget(scroll);
|
|
||||||
|
|
||||||
Utils::DetailsWidget *details = new Utils::DetailsWidget;
|
QGridLayout *mainLayout = new QGridLayout(this);
|
||||||
details->setState(Utils::DetailsWidget::NoSummary);
|
mainLayout->setMargin(1);
|
||||||
scroll->setWidget(details);
|
mainLayout->addWidget(scroll, 0, 0);
|
||||||
|
|
||||||
QWidget *widget = new QWidget;
|
QString toolTip = tr("Kit name and icon.");
|
||||||
|
setLabel(tr("Name:"), toolTip, 0);
|
||||||
|
m_iconButton->setToolTip(toolTip);
|
||||||
|
|
||||||
m_layout->setMargin(0);
|
|
||||||
m_layout->setSpacing(6);
|
|
||||||
m_layout->setContentsMargins(6, 0, 6, 0);
|
|
||||||
m_layout->setRowStretch(1, 1);
|
|
||||||
widget->setLayout(m_layout);
|
|
||||||
|
|
||||||
details->setWidget(widget);
|
|
||||||
|
|
||||||
addToLayout(tr("Name:"), tr("Kit name and icon."), m_nameEdit, m_iconButton);
|
|
||||||
discard();
|
discard();
|
||||||
|
|
||||||
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(setIcon()));
|
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(setIcon()));
|
||||||
@@ -100,7 +96,7 @@ KitManagerConfigWidget::~KitManagerConfigWidget()
|
|||||||
delete m_modifiedKit;
|
delete m_modifiedKit;
|
||||||
// Make sure our workingCopy did not get registered somehow:
|
// Make sure our workingCopy did not get registered somehow:
|
||||||
foreach (const Kit *k, KitManager::instance()->kits())
|
foreach (const Kit *k, KitManager::instance()->kits())
|
||||||
Q_ASSERT(k->id() != Core::Id(WORKING_COPY_KIT_ID));
|
QTC_CHECK(k->id() != Core::Id(WORKING_COPY_KIT_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString KitManagerConfigWidget::displayName() const
|
QString KitManagerConfigWidget::displayName() const
|
||||||
@@ -159,10 +155,18 @@ QString KitManagerConfigWidget::validityMessage() const
|
|||||||
|
|
||||||
void KitManagerConfigWidget::addConfigWidget(ProjectExplorer::KitConfigWidget *widget)
|
void KitManagerConfigWidget::addConfigWidget(ProjectExplorer::KitConfigWidget *widget)
|
||||||
{
|
{
|
||||||
Q_ASSERT(widget);
|
QTC_ASSERT(widget, return);
|
||||||
Q_ASSERT(!m_widgets.contains(widget));
|
QTC_ASSERT(!m_widgets.contains(widget), return);
|
||||||
|
|
||||||
|
QString name = widget->displayName();
|
||||||
|
QString toolTip = widget->toolTip();
|
||||||
|
|
||||||
|
int row = m_layout->rowCount();
|
||||||
|
m_layout->addWidget(widget->mainWidget(), row, WidgetColumn);
|
||||||
|
if (QWidget *button = widget->buttonWidget())
|
||||||
|
m_layout->addWidget(button, row, ButtonColumn);
|
||||||
|
setLabel(name, toolTip, row);
|
||||||
|
|
||||||
addToLayout(widget->displayName(), widget->toolTip(), widget, widget->buttonWidget());
|
|
||||||
m_widgets.append(widget);
|
m_widgets.append(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,16 +252,7 @@ void KitManagerConfigWidget::kitWasUpdated(Kit *k)
|
|||||||
discard();
|
discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitManagerConfigWidget::addToLayout(const QString &name, const QString &toolTip,
|
void KitManagerConfigWidget::setLabel(const QString &name, const QString &toolTip, int row)
|
||||||
QWidget *widget, QWidget *button)
|
|
||||||
{
|
|
||||||
int row = m_layout->rowCount();
|
|
||||||
addLabel(name, toolTip, row);
|
|
||||||
m_layout->addWidget(widget, row, WidgetColumn);
|
|
||||||
addButtonWidget(button, toolTip, row);
|
|
||||||
}
|
|
||||||
|
|
||||||
void KitManagerConfigWidget::addLabel(const QString &name, const QString &toolTip, int row)
|
|
||||||
{
|
{
|
||||||
static const Qt::Alignment alignment
|
static const Qt::Alignment alignment
|
||||||
= static_cast<Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment));
|
= static_cast<Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment));
|
||||||
@@ -266,13 +261,12 @@ void KitManagerConfigWidget::addLabel(const QString &name, const QString &toolTi
|
|||||||
m_layout->addWidget(label, row, LabelColumn, alignment);
|
m_layout->addWidget(label, row, LabelColumn, alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitManagerConfigWidget::addButtonWidget(QWidget *button, const QString &toolTip, int row)
|
void KitManagerConfigWidget::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
if (!button)
|
QPainter p(this);
|
||||||
return;
|
if (m_background.size() != size())
|
||||||
if (button->toolTip().isEmpty())
|
m_background = Utils::DetailsWidget::createBackground(size(), 0, this);
|
||||||
button->setToolTip(toolTip);
|
p.drawPixmap(rect(), m_background);
|
||||||
m_layout->addWidget(button, row, ButtonColumn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -32,8 +32,9 @@
|
|||||||
|
|
||||||
#include "kitconfigwidget.h"
|
#include "kitconfigwidget.h"
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QHBoxLayout;
|
|
||||||
class QGridLayout;
|
class QGridLayout;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
@@ -49,7 +50,7 @@ class KitManagerConfigWidget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KitManagerConfigWidget(Kit *k, QWidget *parent = 0);
|
explicit KitManagerConfigWidget(Kit *k);
|
||||||
~KitManagerConfigWidget();
|
~KitManagerConfigWidget();
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
@@ -68,8 +69,6 @@ public:
|
|||||||
bool isDefaultKit() const;
|
bool isDefaultKit() const;
|
||||||
void removeKit();
|
void removeKit();
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dirty();
|
void dirty();
|
||||||
|
|
||||||
@@ -86,11 +85,8 @@ private:
|
|||||||
ButtonColumn
|
ButtonColumn
|
||||||
};
|
};
|
||||||
|
|
||||||
void addToLayout(const QString &name, const QString &toolTip, QWidget *widget, QWidget *button = 0);
|
void setLabel(const QString &name, const QString &toolTip, int row);
|
||||||
|
void paintEvent(QPaintEvent *ev);
|
||||||
|
|
||||||
void addLabel(const QString &name, const QString &toolTip, int row);
|
|
||||||
void addButtonWidget(QWidget *button, const QString &toolTip, int row);
|
|
||||||
|
|
||||||
QGridLayout *m_layout;
|
QGridLayout *m_layout;
|
||||||
QToolButton *m_iconButton;
|
QToolButton *m_iconButton;
|
||||||
@@ -100,6 +96,7 @@ private:
|
|||||||
Kit *m_modifiedKit;
|
Kit *m_modifiedKit;
|
||||||
bool m_isDefaultKit;
|
bool m_isDefaultKit;
|
||||||
bool m_fixingKit;
|
bool m_fixingKit;
|
||||||
|
QPixmap m_background;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -368,8 +368,7 @@ KitNode *KitModel::findWorkingCopy(Kit *k) const
|
|||||||
KitNode *KitModel::createNode(KitNode *parent, Kit *k)
|
KitNode *KitModel::createNode(KitNode *parent, Kit *k)
|
||||||
{
|
{
|
||||||
KitNode *node = new KitNode(parent, k);
|
KitNode *node = new KitNode(parent, k);
|
||||||
node->widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
m_parentLayout->addWidget(node->widget);
|
||||||
m_parentLayout->addWidget(node->widget, 2);
|
|
||||||
connect(node->widget, SIGNAL(dirty()), this, SLOT(setDirty()));
|
connect(node->widget, SIGNAL(dirty()), this, SLOT(setDirty()));
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ QWidget *KitOptionsPage::createPage(QWidget *parent)
|
|||||||
buttonLayout->addWidget(m_cloneButton);
|
buttonLayout->addWidget(m_cloneButton);
|
||||||
buttonLayout->addWidget(m_delButton);
|
buttonLayout->addWidget(m_delButton);
|
||||||
buttonLayout->addWidget(m_makeDefaultButton);
|
buttonLayout->addWidget(m_makeDefaultButton);
|
||||||
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
buttonLayout->addStretch();
|
||||||
|
|
||||||
QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
||||||
horizontalLayout->addWidget(m_kitsView);
|
horizontalLayout->addWidget(m_kitsView);
|
||||||
@@ -93,11 +93,12 @@ QWidget *KitOptionsPage::createPage(QWidget *parent)
|
|||||||
|
|
||||||
QVBoxLayout *verticalLayout = new QVBoxLayout(m_configWidget);
|
QVBoxLayout *verticalLayout = new QVBoxLayout(m_configWidget);
|
||||||
verticalLayout->addLayout(horizontalLayout);
|
verticalLayout->addLayout(horizontalLayout);
|
||||||
verticalLayout->setStretch(0, 1);
|
|
||||||
|
|
||||||
Q_ASSERT(!m_model);
|
Q_ASSERT(!m_model);
|
||||||
m_model = new Internal::KitModel(verticalLayout);
|
m_model = new Internal::KitModel(verticalLayout);
|
||||||
connect(m_model, SIGNAL(kitStateChanged()), this, SLOT(updateState()));
|
connect(m_model, SIGNAL(kitStateChanged()), this, SLOT(updateState()));
|
||||||
|
verticalLayout->setStretch(0, 1);
|
||||||
|
verticalLayout->setStretch(1, 0);
|
||||||
|
|
||||||
m_kitsView->setModel(m_model);
|
m_kitsView->setModel(m_model);
|
||||||
m_kitsView->header()->setResizeMode(0, QHeaderView::Stretch);
|
m_kitsView->header()->setResizeMode(0, QHeaderView::Stretch);
|
||||||
|
|||||||
@@ -47,9 +47,6 @@ namespace ProjectExplorer {
|
|||||||
namespace Internal { class KitModel; }
|
namespace Internal { class KitModel; }
|
||||||
|
|
||||||
class Kit;
|
class Kit;
|
||||||
class KitConfigWidget;
|
|
||||||
class KitFactory;
|
|
||||||
class KitManager;
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// KitOptionsPage:
|
// KitOptionsPage:
|
||||||
|
|||||||
@@ -35,34 +35,35 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
QmakeKitConfigWidget::QmakeKitConfigWidget(ProjectExplorer::Kit *k, QWidget *parent) :
|
QmakeKitConfigWidget::QmakeKitConfigWidget(ProjectExplorer::Kit *k) :
|
||||||
ProjectExplorer::KitConfigWidget(parent),
|
ProjectExplorer::KitConfigWidget(k),
|
||||||
m_kit(k),
|
|
||||||
m_lineEdit(new QLineEdit)
|
m_lineEdit(new QLineEdit)
|
||||||
{
|
{
|
||||||
setToolTip(tr("The mkspec to use when building the project with qmake.<br>"
|
|
||||||
"This setting is ignored when using other build systems."));
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
|
||||||
layout->setMargin(0);
|
|
||||||
|
|
||||||
m_lineEdit->setContentsMargins(0, 0, 0, 0);
|
|
||||||
layout->addWidget(m_lineEdit);
|
|
||||||
|
|
||||||
refresh(); // set up everything according to kit
|
refresh(); // set up everything according to kit
|
||||||
connect(m_lineEdit, SIGNAL(textEdited(QString)), this, SLOT(mkspecWasChanged(QString)));
|
connect(m_lineEdit, SIGNAL(textEdited(QString)), this, SLOT(mkspecWasChanged(QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *QmakeKitConfigWidget::mainWidget() const
|
||||||
|
{
|
||||||
|
return m_lineEdit;
|
||||||
|
}
|
||||||
|
|
||||||
QString QmakeKitConfigWidget::displayName() const
|
QString QmakeKitConfigWidget::displayName() const
|
||||||
{
|
{
|
||||||
return tr("Qt mkspec:");
|
return tr("Qt mkspec:");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QmakeKitConfigWidget::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("The mkspec to use when building the project with qmake.<br>"
|
||||||
|
"This setting is ignored when using other build systems.");
|
||||||
|
}
|
||||||
|
|
||||||
void QmakeKitConfigWidget::makeReadOnly()
|
void QmakeKitConfigWidget::makeReadOnly()
|
||||||
{
|
{
|
||||||
m_lineEdit->setEnabled(false);
|
m_lineEdit->setEnabled(false);
|
||||||
|
|||||||
@@ -32,13 +32,11 @@
|
|||||||
|
|
||||||
#include <projectexplorer/kitconfigwidget.h>
|
#include <projectexplorer/kitconfigwidget.h>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QLineEdit)
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QLineEdit;
|
||||||
namespace ProjectExplorer { class Kit; }
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
class BaseQtVersion;
|
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmakeKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
class QmakeKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
||||||
@@ -46,12 +44,13 @@ class QmakeKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QmakeKitConfigWidget(ProjectExplorer::Kit *k, QWidget *parent = 0);
|
explicit QmakeKitConfigWidget(ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
|
QWidget *mainWidget() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@@ -60,7 +59,6 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
int findQtVersion(const int id) const;
|
int findQtVersion(const int id) const;
|
||||||
|
|
||||||
ProjectExplorer::Kit *m_kit;
|
|
||||||
QLineEdit *m_lineEdit;
|
QLineEdit *m_lineEdit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -45,34 +45,21 @@
|
|||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k, QWidget *parent) :
|
QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k) :
|
||||||
ProjectExplorer::KitConfigWidget(parent),
|
KitConfigWidget(k)
|
||||||
m_kit(k),
|
|
||||||
m_combo(new QComboBox),
|
|
||||||
m_manageButton(new QPushButton(this))
|
|
||||||
{
|
{
|
||||||
setToolTip(tr("The Qt library to use for all projects using this kit.<br>"
|
m_combo = new QComboBox;
|
||||||
"A Qt version is required for qmake-based projects and optional when using other build systems."));
|
m_combo->addItem(tr("None"), -1);
|
||||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
|
||||||
layout->setMargin(0);
|
|
||||||
|
|
||||||
m_combo->setContentsMargins(0, 0, 0, 0);
|
|
||||||
m_combo->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
|
||||||
layout->addWidget(m_combo);
|
|
||||||
|
|
||||||
m_manageButton->setContentsMargins(0, 0, 0, 0);
|
|
||||||
m_manageButton->setText(tr("Manage..."));
|
|
||||||
|
|
||||||
QtVersionManager *mgr = QtVersionManager::instance();
|
QtVersionManager *mgr = QtVersionManager::instance();
|
||||||
|
|
||||||
// initially populate combobox:
|
|
||||||
m_combo->addItem(tr("None"), -1);
|
|
||||||
QList<BaseQtVersion *> versions = mgr->validVersions();
|
QList<BaseQtVersion *> versions = mgr->validVersions();
|
||||||
QList<int> versionIds;
|
QList<int> versionIds;
|
||||||
foreach (BaseQtVersion *v, versions)
|
foreach (BaseQtVersion *v, versions)
|
||||||
versionIds.append(v->uniqueId());
|
versionIds.append(v->uniqueId());
|
||||||
versionsChanged(versionIds, QList<int>(), QList<int>());
|
versionsChanged(versionIds, QList<int>(), QList<int>());
|
||||||
|
|
||||||
|
m_manageButton = new QPushButton(tr("Manage..."));
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
connect(m_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(currentWasChanged(int)));
|
connect(m_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(currentWasChanged(int)));
|
||||||
|
|
||||||
@@ -87,6 +74,13 @@ QString QtKitConfigWidget::displayName() const
|
|||||||
return tr("Qt version:");
|
return tr("Qt version:");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QtKitConfigWidget::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("The Qt library to use for all projects using this kit.<br>"
|
||||||
|
"A Qt version is required for qmake-based projects "
|
||||||
|
"and optional when using other build systems.");
|
||||||
|
}
|
||||||
|
|
||||||
void QtKitConfigWidget::makeReadOnly()
|
void QtKitConfigWidget::makeReadOnly()
|
||||||
{
|
{
|
||||||
m_combo->setEnabled(false);
|
m_combo->setEnabled(false);
|
||||||
@@ -97,6 +91,11 @@ void QtKitConfigWidget::refresh()
|
|||||||
m_combo->setCurrentIndex(findQtVersion(QtKitInformation::qtVersionId(m_kit)));
|
m_combo->setCurrentIndex(findQtVersion(QtKitInformation::qtVersionId(m_kit)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *QtKitConfigWidget::mainWidget() const
|
||||||
|
{
|
||||||
|
return m_combo;
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *QtKitConfigWidget::buttonWidget() const
|
QWidget *QtKitConfigWidget::buttonWidget() const
|
||||||
{
|
{
|
||||||
return m_manageButton;
|
return m_manageButton;
|
||||||
|
|||||||
@@ -32,14 +32,12 @@
|
|||||||
|
|
||||||
#include <projectexplorer/kitconfigwidget.h>
|
#include <projectexplorer/kitconfigwidget.h>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QComboBox)
|
QT_BEGIN_NAMESPACE
|
||||||
QT_FORWARD_DECLARE_CLASS(QPushButton)
|
class QComboBox;
|
||||||
|
class QPushButton;
|
||||||
namespace ProjectExplorer { class Kit; }
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
class BaseQtVersion;
|
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QtKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
class QtKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
||||||
@@ -47,14 +45,16 @@ class QtKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QtKitConfigWidget(ProjectExplorer::Kit *k, QWidget *parent = 0);
|
explicit QtKitConfigWidget(ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
QWidget *mainWidget() const;
|
||||||
QWidget *buttonWidget() const;
|
QWidget *buttonWidget() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void versionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed);
|
void versionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed);
|
||||||
@@ -64,7 +64,6 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
int findQtVersion(const int id) const;
|
int findQtVersion(const int id) const;
|
||||||
|
|
||||||
ProjectExplorer::Kit *m_kit;
|
|
||||||
QComboBox *m_combo;
|
QComboBox *m_combo;
|
||||||
QPushButton *m_manageButton;
|
QPushButton *m_manageButton;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user