CMake: Add CMakeConfigurationKitInformation

Add CMakeConfigurationKitInformation and supporting classes.

This KitInformation can hold CMake settings that are to be applied
for all configurations when this kit is used. It contains e.g.
the Qt version and toolchain configured in the kit by default, but
can be extended to hold more.

The UI will warn if the toolchain or Qt version set up in CMake
does not match up with those used by the Kit, but it will allow
the user to proceed.

Change-Id: I73f06a6535ce14de323130d74af83b9cb2ec0f0f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-02-12 12:23:18 +01:00
parent 3447f8d9f0
commit 18afa34587
9 changed files with 567 additions and 4 deletions

View File

@@ -27,13 +27,17 @@
#include <projectexplorer/kitconfigwidget.h>
QT_BEGIN_NAMESPACE
class QComboBox;
class QLabel;
class QPlainTextEdit;
class QPushButton;
QT_END_NAMESPACE
namespace ProjectExplorer {
class Kit;
class KitInformation;
}
QT_FORWARD_DECLARE_CLASS(QComboBox)
QT_FORWARD_DECLARE_CLASS(QPushButton)
} // namespace ProjectExplorer
namespace CMakeProjectManager {
@@ -99,5 +103,36 @@ private:
CMakeTool *m_currentTool = nullptr;
};
// --------------------------------------------------------------------
// CMakeConfigurationKitConfigWidget:
// --------------------------------------------------------------------
class CMakeConfigurationKitConfigWidget : public ProjectExplorer::KitConfigWidget
{
Q_OBJECT
public:
CMakeConfigurationKitConfigWidget(ProjectExplorer::Kit *kit, const ProjectExplorer::KitInformation *ki);
// KitConfigWidget interface
QString displayName() const override;
void makeReadOnly() override;
void refresh() override;
QWidget *mainWidget() const override;
QWidget *buttonWidget() const override;
QString toolTip() const override;
private:
void editConfigurationChanges();
void applyChanges();
void closeChangesDialog();
void acceptChangesDialog();
QLabel *m_summaryLabel;
QPushButton *m_manageButton;
QDialog *m_dialog = nullptr;
QPlainTextEdit *m_editor = nullptr;
};
} // namespace Internal
} // namespace CMakeProjectManager