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 "projectexplorerconstants.h"
|
||||||
#include "projectexplorertr.h"
|
#include "projectexplorertr.h"
|
||||||
#include "projectmacro.h"
|
#include "projectmacro.h"
|
||||||
|
#include "toolchainconfigwidget.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
@@ -279,26 +280,8 @@ QList<CustomToolChain::Parser> CustomToolChain::parsers()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<ToolChainConfigWidget> CustomToolChain::createConfigurationWidget()
|
|
||||||
{
|
|
||||||
return std::make_unique<Internal::CustomToolChainConfigWidget>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Internal {
|
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
|
// Helper for ConfigWidget
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@@ -311,7 +294,7 @@ public:
|
|||||||
setWidget(textEdit);
|
setWidget(textEdit);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QPlainTextEdit *textEditWidget() const
|
QPlainTextEdit *textEditWidget() const
|
||||||
{
|
{
|
||||||
return static_cast<QPlainTextEdit *>(widget());
|
return static_cast<QPlainTextEdit *>(widget());
|
||||||
}
|
}
|
||||||
@@ -347,6 +330,34 @@ public:
|
|||||||
// CustomToolChainConfigWidget
|
// 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) :
|
CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) :
|
||||||
ToolChainConfigWidget(tc),
|
ToolChainConfigWidget(tc),
|
||||||
m_compilerCommand(new PathChooser),
|
m_compilerCommand(new PathChooser),
|
||||||
@@ -487,5 +498,27 @@ void CustomToolChainConfigWidget::makeReadOnlyImpl()
|
|||||||
m_mainLayout->setEnabled(false);
|
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 Internal
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -9,28 +9,11 @@
|
|||||||
#include "customparser.h"
|
#include "customparser.h"
|
||||||
#include "headerpath.h"
|
#include "headerpath.h"
|
||||||
#include "toolchain.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 {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class AbiWidget;
|
|
||||||
|
|
||||||
namespace Internal { class CustomToolChainFactory; }
|
namespace Internal { class CustomToolChainFactory; }
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// CustomToolChain
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT CustomToolChain : public ToolChain
|
class PROJECTEXPLORER_EXPORT CustomToolChain : public ToolChain
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -102,42 +85,5 @@ public:
|
|||||||
CustomToolChainFactory();
|
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 Internal
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
Reference in New Issue
Block a user