forked from qt-creator/qt-creator
ProjectExplorer: Use BuildConfiguration instead of Target
... in AddRunConfigDialog. Change-Id: I1a8f2ddaafaa345b157634a1a0391688bb5a372b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#include "addrunconfigdialog.h"
|
#include "addrunconfigdialog.h"
|
||||||
|
|
||||||
|
#include "buildconfiguration.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "projectexplorertr.h"
|
#include "projectexplorertr.h"
|
||||||
#include "target.h"
|
|
||||||
|
|
||||||
#include <utils/itemviews.h>
|
#include <utils/itemviews.h>
|
||||||
#include <utils/fancylineedit.h>
|
#include <utils/fancylineedit.h>
|
||||||
@@ -30,9 +30,9 @@ const Qt::ItemDataRole IsCustomRole = Qt::UserRole;
|
|||||||
class CandidateTreeItem : public TreeItem
|
class CandidateTreeItem : public TreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CandidateTreeItem(const RunConfigurationCreationInfo &rci, const Target *target)
|
CandidateTreeItem(const RunConfigurationCreationInfo &rci, const BuildConfiguration *bc)
|
||||||
: m_creationInfo(rci), m_projectRoot(target->project()->projectDirectory()),
|
: m_creationInfo(rci), m_projectRoot(bc->project()->projectDirectory()),
|
||||||
m_displayName(target->macroExpander()->expand(rci.displayName))
|
m_displayName(bc->macroExpander()->expand(rci.displayName))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
RunConfigurationCreationInfo creationInfo() const { return m_creationInfo; }
|
RunConfigurationCreationInfo creationInfo() const { return m_creationInfo; }
|
||||||
@@ -64,12 +64,12 @@ private:
|
|||||||
class CandidatesModel : public TreeModel<TreeItem, CandidateTreeItem>
|
class CandidatesModel : public TreeModel<TreeItem, CandidateTreeItem>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CandidatesModel(Target *target, QObject *parent) : TreeModel(parent)
|
CandidatesModel(BuildConfiguration *bc, QObject *parent) : TreeModel(parent)
|
||||||
{
|
{
|
||||||
setHeader({Tr::tr("Name"), Tr::tr("Source")});
|
setHeader({Tr::tr("Name"), Tr::tr("Source")});
|
||||||
for (const RunConfigurationCreationInfo &rci
|
for (const RunConfigurationCreationInfo &rci
|
||||||
: RunConfigurationFactory::creatorsForTarget(target)) {
|
: RunConfigurationFactory::creatorsForTarget(bc->target())) {
|
||||||
rootItem()->appendChild(new CandidateTreeItem(rci, target));
|
rootItem()->appendChild(new CandidateTreeItem(rci, bc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -108,11 +108,11 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AddRunConfigDialog::AddRunConfigDialog(Target *target, QWidget *parent)
|
AddRunConfigDialog::AddRunConfigDialog(BuildConfiguration *bc, QWidget *parent)
|
||||||
: QDialog(parent), m_view(new CandidatesTreeView(this))
|
: QDialog(parent), m_view(new CandidatesTreeView(this))
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("Create Run Configuration"));
|
setWindowTitle(Tr::tr("Create Run Configuration"));
|
||||||
const auto model = new CandidatesModel(target, this);
|
const auto model = new CandidatesModel(bc, this);
|
||||||
const auto proxyModel = new ProxyModel(this);
|
const auto proxyModel = new ProxyModel(this);
|
||||||
proxyModel->setSourceModel(model);
|
proxyModel->setSourceModel(model);
|
||||||
const auto filterEdit = new FancyLineEdit(this);
|
const auto filterEdit = new FancyLineEdit(this);
|
||||||
|
@@ -9,16 +9,13 @@
|
|||||||
|
|
||||||
namespace Utils { class TreeView; }
|
namespace Utils { class TreeView; }
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer::Internal {
|
||||||
class Target;
|
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class AddRunConfigDialog : public QDialog
|
class AddRunConfigDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AddRunConfigDialog(Target *target, QWidget *parent);
|
AddRunConfigDialog(BuildConfiguration *bc, QWidget *parent);
|
||||||
|
|
||||||
RunConfigurationCreationInfo creationInfo() const { return m_creationInfo; }
|
RunConfigurationCreationInfo creationInfo() const { return m_creationInfo; }
|
||||||
|
|
||||||
@@ -29,5 +26,4 @@ private:
|
|||||||
RunConfigurationCreationInfo m_creationInfo;
|
RunConfigurationCreationInfo m_creationInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace ProjectExplorer::Internal
|
||||||
} // namespace ProjectExplorer
|
|
||||||
|
@@ -157,7 +157,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) :
|
|||||||
|
|
||||||
void RunSettingsWidget::showAddRunConfigDialog()
|
void RunSettingsWidget::showAddRunConfigDialog()
|
||||||
{
|
{
|
||||||
AddRunConfigDialog dlg(m_target, this);
|
AddRunConfigDialog dlg(m_target->activeBuildConfiguration(), this);
|
||||||
if (dlg.exec() != QDialog::Accepted)
|
if (dlg.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
RunConfigurationCreationInfo rci = dlg.creationInfo();
|
RunConfigurationCreationInfo rci = dlg.creationInfo();
|
||||||
|
Reference in New Issue
Block a user