Commit 5a6d5d66 authored by Daniel Teske's avatar Daniel Teske

CMakeOpenProjectWizard: Set a parent

Task-number: QTCREATORBUG-11856
Change-Id: Ie80352683e2a8276f70191db2a3b333275e2648f
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent d30393c2
......@@ -173,7 +173,7 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
parent->kit(),
copy.displayName));
CMakeOpenProjectWizard copw(project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory, &copy);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory, &copy);
if (copw.exec() != QDialog::Accepted)
return 0;
......
......@@ -214,8 +214,9 @@ QList<GeneratorInfo> GeneratorInfo::generatorInfosFor(ProjectExplorer::Kit *k, N
/// CMakeOpenProjectWizard
//////////////
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env)
: m_cmakeManager(cmakeManager),
CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env)
: Utils::Wizard(parent),
m_cmakeManager(cmakeManager),
m_sourceDirectory(sourceDirectory),
m_environment(env),
m_useNinja(false),
......@@ -240,9 +241,10 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
init();
}
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, CMakeOpenProjectWizard::Mode mode,
CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, CMakeOpenProjectWizard::Mode mode,
const CMakeBuildInfo *info)
: m_cmakeManager(cmakeManager),
: Utils::Wizard(parent),
m_cmakeManager(cmakeManager),
m_sourceDirectory(info->sourceDirectory),
m_environment(info->environment),
m_useNinja(info->useNinja),
......
......@@ -70,12 +70,12 @@ public:
};
/// used at importing a project without a .user file
CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env);
CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env);
/// used to update if we have already a .user file
/// recreates or updates the cbp file
/// Also used to change the build directory of one buildconfiguration or create a new buildconfiguration
CMakeOpenProjectWizard(CMakeManager *cmakeManager, Mode mode, const CMakeBuildInfo *info);
CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, Mode mode, const CMakeBuildInfo *info);
QString buildDirectory() const;
QString sourceDirectory() const;
......
......@@ -143,7 +143,7 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur
if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(cmakebc);
CMakeOpenProjectWizard copw(m_manager, mode, &info);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
if (copw.exec() == QDialog::Accepted)
cmakebc->setUseNinja(copw.useNinja()); // NeedToCreate can change the Ninja setting
}
......@@ -531,7 +531,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
bool hasUserFile = activeTarget();
if (!hasUserFile) {
CMakeOpenProjectWizard copw(m_manager, projectDirectory(), Utils::Environment::systemEnvironment());
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, projectDirectory(), Utils::Environment::systemEnvironment());
if (copw.exec() != QDialog::Accepted)
return false;
Kit *k = copw.kit();
......@@ -574,7 +574,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(activeBC);
CMakeOpenProjectWizard copw(m_manager, mode, &info);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
if (copw.exec() != QDialog::Accepted)
return false;
else
......@@ -856,7 +856,8 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
{
CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory,
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory,
&info);
if (copw.exec() == QDialog::Accepted) {
project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory());
......@@ -871,7 +872,8 @@ void CMakeBuildSettingsWidget::runCMake()
return;
CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(project->projectManager(),
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
project->projectManager(),
CMakeOpenProjectWizard::WantToUpdate, &info);
if (copw.exec() == QDialog::Accepted)
project->parseCMakeLists();
......
......@@ -123,7 +123,7 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project)
CMakeBuildInfo info(bc);
CMakeOpenProjectWizard copw(this, CMakeOpenProjectWizard::WantToUpdate, &info);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), this, CMakeOpenProjectWizard::WantToUpdate, &info);
if (copw.exec() == QDialog::Accepted)
cmakeProject->parseCMakeLists();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment