forked from qt-creator/qt-creator
ProjectExplorer: Hide CustomToolChainConfigWidget implementation
Also, remove unneeded Q_OBJECT. Change-Id: I6cefce78356011d97f281d4fcb023806d52d9452 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "projectexplorertr.h"
|
||||
#include "projectmacro.h"
|
||||
#include "toolchainconfigwidget.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/detailswidget.h>
|
||||
@@ -279,26 +280,8 @@ QList<CustomToolChain::Parser> CustomToolChain::parsers()
|
||||
return result;
|
||||
}
|
||||
|
||||
std::unique_ptr<ToolChainConfigWidget> CustomToolChain::createConfigurationWidget()
|
||||
{
|
||||
return std::make_unique<Internal::CustomToolChainConfigWidget>(this);
|
||||
}
|
||||
|
||||
namespace Internal {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// CustomToolChainFactory
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
CustomToolChainFactory::CustomToolChainFactory()
|
||||
{
|
||||
setDisplayName(Tr::tr("Custom"));
|
||||
setSupportedToolChainType(Constants::CUSTOM_TOOLCHAIN_TYPEID);
|
||||
setSupportsAllLanguages(true);
|
||||
setToolchainConstructor([] { return new CustomToolChain; });
|
||||
setUserCreatable(true);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Helper for ConfigWidget
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -311,7 +294,7 @@ public:
|
||||
setWidget(textEdit);
|
||||
}
|
||||
|
||||
inline QPlainTextEdit *textEditWidget() const
|
||||
QPlainTextEdit *textEditWidget() const
|
||||
{
|
||||
return static_cast<QPlainTextEdit *>(widget());
|
||||
}
|
||||
@@ -347,6 +330,34 @@ public:
|
||||
// CustomToolChainConfigWidget
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class CustomToolChainConfigWidget final : public ToolChainConfigWidget
|
||||
{
|
||||
public:
|
||||
explicit CustomToolChainConfigWidget(CustomToolChain *);
|
||||
|
||||
private:
|
||||
void updateSummaries(TextEditDetailsWidget *detailsWidget);
|
||||
void errorParserChanged(int index = -1);
|
||||
|
||||
void applyImpl() override;
|
||||
void discardImpl() override { setFromToolchain(); }
|
||||
bool isDirtyImpl() const override;
|
||||
void makeReadOnlyImpl() override;
|
||||
|
||||
void setFromToolchain();
|
||||
|
||||
Utils::PathChooser *m_compilerCommand;
|
||||
Utils::PathChooser *m_makeCommand;
|
||||
AbiWidget *m_abiWidget;
|
||||
QPlainTextEdit *m_predefinedMacros;
|
||||
QPlainTextEdit *m_headerPaths;
|
||||
TextEditDetailsWidget *m_predefinedDetails;
|
||||
TextEditDetailsWidget *m_headerDetails;
|
||||
QLineEdit *m_cxx11Flags;
|
||||
QLineEdit *m_mkspecs;
|
||||
QComboBox *m_errorParserComboBox;
|
||||
};
|
||||
|
||||
CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) :
|
||||
ToolChainConfigWidget(tc),
|
||||
m_compilerCommand(new PathChooser),
|
||||
@@ -487,5 +498,27 @@ void CustomToolChainConfigWidget::makeReadOnlyImpl()
|
||||
m_mainLayout->setEnabled(false);
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
||||
std::unique_ptr<ToolChainConfigWidget> CustomToolChain::createConfigurationWidget()
|
||||
{
|
||||
return std::make_unique<Internal::CustomToolChainConfigWidget>(this);
|
||||
}
|
||||
|
||||
namespace Internal {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// CustomToolChainFactory
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
CustomToolChainFactory::CustomToolChainFactory()
|
||||
{
|
||||
setDisplayName(Tr::tr("Custom"));
|
||||
setSupportedToolChainType(Constants::CUSTOM_TOOLCHAIN_TYPEID);
|
||||
setSupportsAllLanguages(true);
|
||||
setToolchainConstructor([] { return new CustomToolChain; });
|
||||
setUserCreatable(true);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
@@ -9,28 +9,11 @@
|
||||
#include "customparser.h"
|
||||
#include "headerpath.h"
|
||||
#include "toolchain.h"
|
||||
#include "toolchainconfigwidget.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPlainTextEdit;
|
||||
class QTextEdit;
|
||||
class QComboBox;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class PathChooser; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class AbiWidget;
|
||||
|
||||
namespace Internal { class CustomToolChainFactory; }
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// CustomToolChain
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT CustomToolChain : public ToolChain
|
||||
{
|
||||
public:
|
||||
@@ -102,42 +85,5 @@ public:
|
||||
CustomToolChainFactory();
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// CustomToolChainConfigWidget
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class TextEditDetailsWidget;
|
||||
|
||||
class CustomToolChainConfigWidget : public ToolChainConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomToolChainConfigWidget(CustomToolChain *);
|
||||
|
||||
private:
|
||||
void updateSummaries(TextEditDetailsWidget *detailsWidget);
|
||||
void errorParserChanged(int index = -1);
|
||||
|
||||
protected:
|
||||
void applyImpl() override;
|
||||
void discardImpl() override { setFromToolchain(); }
|
||||
bool isDirtyImpl() const override;
|
||||
void makeReadOnlyImpl() override;
|
||||
|
||||
void setFromToolchain();
|
||||
|
||||
Utils::PathChooser *m_compilerCommand;
|
||||
Utils::PathChooser *m_makeCommand;
|
||||
AbiWidget *m_abiWidget;
|
||||
QPlainTextEdit *m_predefinedMacros;
|
||||
QPlainTextEdit *m_headerPaths;
|
||||
TextEditDetailsWidget *m_predefinedDetails;
|
||||
TextEditDetailsWidget *m_headerDetails;
|
||||
QLineEdit *m_cxx11Flags;
|
||||
QLineEdit *m_mkspecs;
|
||||
QComboBox *m_errorParserComboBox;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
Reference in New Issue
Block a user