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 ...@@ -173,7 +173,7 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
parent->kit(), parent->kit(),
copy.displayName)); copy.displayName));
CMakeOpenProjectWizard copw(project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory, &copy); CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory, &copy);
if (copw.exec() != QDialog::Accepted) if (copw.exec() != QDialog::Accepted)
return 0; return 0;
......
...@@ -214,8 +214,9 @@ QList<GeneratorInfo> GeneratorInfo::generatorInfosFor(ProjectExplorer::Kit *k, N ...@@ -214,8 +214,9 @@ QList<GeneratorInfo> GeneratorInfo::generatorInfosFor(ProjectExplorer::Kit *k, N
/// CMakeOpenProjectWizard /// CMakeOpenProjectWizard
////////////// //////////////
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env) CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env)
: m_cmakeManager(cmakeManager), : Utils::Wizard(parent),
m_cmakeManager(cmakeManager),
m_sourceDirectory(sourceDirectory), m_sourceDirectory(sourceDirectory),
m_environment(env), m_environment(env),
m_useNinja(false), m_useNinja(false),
...@@ -240,9 +241,10 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const ...@@ -240,9 +241,10 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
init(); init();
} }
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, CMakeOpenProjectWizard::Mode mode, CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, CMakeOpenProjectWizard::Mode mode,
const CMakeBuildInfo *info) const CMakeBuildInfo *info)
: m_cmakeManager(cmakeManager), : Utils::Wizard(parent),
m_cmakeManager(cmakeManager),
m_sourceDirectory(info->sourceDirectory), m_sourceDirectory(info->sourceDirectory),
m_environment(info->environment), m_environment(info->environment),
m_useNinja(info->useNinja), m_useNinja(info->useNinja),
......
...@@ -70,12 +70,12 @@ public: ...@@ -70,12 +70,12 @@ public:
}; };
/// used at importing a project without a .user file /// 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 /// used to update if we have already a .user file
/// recreates or updates the cbp file /// recreates or updates the cbp file
/// Also used to change the build directory of one buildconfiguration or create a new buildconfiguration /// 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 buildDirectory() const;
QString sourceDirectory() const; QString sourceDirectory() const;
......
...@@ -143,7 +143,7 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur ...@@ -143,7 +143,7 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur
if (mode != CMakeOpenProjectWizard::Nothing) { if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(cmakebc); CMakeBuildInfo info(cmakebc);
CMakeOpenProjectWizard copw(m_manager, mode, &info); CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
if (copw.exec() == QDialog::Accepted) if (copw.exec() == QDialog::Accepted)
cmakebc->setUseNinja(copw.useNinja()); // NeedToCreate can change the Ninja setting cmakebc->setUseNinja(copw.useNinja()); // NeedToCreate can change the Ninja setting
} }
...@@ -531,7 +531,7 @@ bool CMakeProject::fromMap(const QVariantMap &map) ...@@ -531,7 +531,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
bool hasUserFile = activeTarget(); bool hasUserFile = activeTarget();
if (!hasUserFile) { 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) if (copw.exec() != QDialog::Accepted)
return false; return false;
Kit *k = copw.kit(); Kit *k = copw.kit();
...@@ -574,7 +574,7 @@ bool CMakeProject::fromMap(const QVariantMap &map) ...@@ -574,7 +574,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
if (mode != CMakeOpenProjectWizard::Nothing) { if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(activeBC); CMakeBuildInfo info(activeBC);
CMakeOpenProjectWizard copw(m_manager, mode, &info); CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
if (copw.exec() != QDialog::Accepted) if (copw.exec() != QDialog::Accepted)
return false; return false;
else else
...@@ -856,7 +856,8 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog() ...@@ -856,7 +856,8 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
{ {
CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project()); CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
CMakeBuildInfo info(m_buildConfiguration); CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory, CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
project->projectManager(), CMakeOpenProjectWizard::ChangeDirectory,
&info); &info);
if (copw.exec() == QDialog::Accepted) { if (copw.exec() == QDialog::Accepted) {
project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory()); project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory());
...@@ -871,7 +872,8 @@ void CMakeBuildSettingsWidget::runCMake() ...@@ -871,7 +872,8 @@ void CMakeBuildSettingsWidget::runCMake()
return; return;
CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project()); CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
CMakeBuildInfo info(m_buildConfiguration); CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(project->projectManager(), CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
project->projectManager(),
CMakeOpenProjectWizard::WantToUpdate, &info); CMakeOpenProjectWizard::WantToUpdate, &info);
if (copw.exec() == QDialog::Accepted) if (copw.exec() == QDialog::Accepted)
project->parseCMakeLists(); project->parseCMakeLists();
......
...@@ -123,7 +123,7 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project) ...@@ -123,7 +123,7 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project)
CMakeBuildInfo info(bc); CMakeBuildInfo info(bc);
CMakeOpenProjectWizard copw(this, CMakeOpenProjectWizard::WantToUpdate, &info); CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), this, CMakeOpenProjectWizard::WantToUpdate, &info);
if (copw.exec() == QDialog::Accepted) if (copw.exec() == QDialog::Accepted)
cmakeProject->parseCMakeLists(); 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