forked from qt-creator/qt-creator
Utils: Use dialogParent() more directly in wizards
Change-Id: Icfb8e7bdba1ba44fb64cc80ef9a2c20e59df755c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "wizard.h"
|
#include "wizard.h"
|
||||||
|
|
||||||
#include "algorithm.h"
|
#include "algorithm.h"
|
||||||
|
#include "guiutils.h"
|
||||||
#include "hostosinfo.h"
|
#include "hostosinfo.h"
|
||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
#include "qtcassert.h"
|
#include "qtcassert.h"
|
||||||
@@ -281,8 +282,8 @@ public:
|
|||||||
bool m_skipForSubproject = false;
|
bool m_skipForSubproject = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
Wizard::Wizard(QWidget *parent, Qt::WindowFlags flags) :
|
Wizard::Wizard(Qt::WindowFlags flags)
|
||||||
QWizard(parent, flags), d_ptr(new WizardPrivate)
|
: QWizard(dialogParent(), flags), d_ptr(new WizardPrivate)
|
||||||
{
|
{
|
||||||
d_ptr->m_wizardProgress = new WizardProgress(this);
|
d_ptr->m_wizardProgress = new WizardProgress(this);
|
||||||
connect(this, &QWizard::currentIdChanged, this, &Wizard::_q_currentPageChanged);
|
connect(this, &QWizard::currentIdChanged, this, &Wizard::_q_currentPageChanged);
|
||||||
|
@@ -21,7 +21,7 @@ class QTCREATOR_UTILS_EXPORT Wizard : public QWizard
|
|||||||
Q_PROPERTY(bool automaticProgressCreationEnabled READ isAutomaticProgressCreationEnabled WRITE setAutomaticProgressCreationEnabled)
|
Q_PROPERTY(bool automaticProgressCreationEnabled READ isAutomaticProgressCreationEnabled WRITE setAutomaticProgressCreationEnabled)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Wizard(QWidget *parent = nullptr, Qt::WindowFlags flags = {});
|
explicit Wizard(Qt::WindowFlags flags = {});
|
||||||
~Wizard() override;
|
~Wizard() override;
|
||||||
|
|
||||||
bool isAutomaticProgressCreationEnabled() const;
|
bool isAutomaticProgressCreationEnabled() const;
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
#include "androidutils.h"
|
#include "androidutils.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <projectexplorer/buildsystem.h>
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -231,8 +230,7 @@ void ChooseDirectoryPage::initializePage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
CreateAndroidManifestWizard::CreateAndroidManifestWizard(BuildSystem *buildSystem)
|
CreateAndroidManifestWizard::CreateAndroidManifestWizard(BuildSystem *buildSystem)
|
||||||
: Wizard(Core::ICore::dialogParent())
|
: m_buildSystem(buildSystem)
|
||||||
, m_buildSystem(buildSystem)
|
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("Create Android Template Files Wizard"));
|
setWindowTitle(Tr::tr("Create Android Template Files Wizard"));
|
||||||
|
|
||||||
|
@@ -13,9 +13,8 @@ namespace BareMetal::Internal {
|
|||||||
|
|
||||||
enum PageId { SetupPageId };
|
enum PageId { SetupPageId };
|
||||||
|
|
||||||
BareMetalDeviceConfigurationWizard::BareMetalDeviceConfigurationWizard(QWidget *parent) :
|
BareMetalDeviceConfigurationWizard::BareMetalDeviceConfigurationWizard()
|
||||||
Utils::Wizard(parent),
|
: m_setupPage(new BareMetalDeviceConfigurationWizardSetupPage(this))
|
||||||
m_setupPage(new BareMetalDeviceConfigurationWizardSetupPage(this))
|
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("New Bare Metal Device Configuration Setup"));
|
setWindowTitle(Tr::tr("New Bare Metal Device Configuration Setup"));
|
||||||
setPage(SetupPageId, m_setupPage);
|
setPage(SetupPageId, m_setupPage);
|
||||||
|
@@ -13,7 +13,7 @@ class BareMetalDeviceConfigurationWizardSetupPage;
|
|||||||
class BareMetalDeviceConfigurationWizard final : public Utils::Wizard
|
class BareMetalDeviceConfigurationWizard final : public Utils::Wizard
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit BareMetalDeviceConfigurationWizard(QWidget *parent = nullptr);
|
BareMetalDeviceConfigurationWizard();
|
||||||
|
|
||||||
ProjectExplorer::IDevicePtr device() const;
|
ProjectExplorer::IDevicePtr device() const;
|
||||||
|
|
||||||
|
@@ -25,12 +25,8 @@ IFileWizardExtension::~IFileWizardExtension()
|
|||||||
g_fileWizardExtensions.removeOne(this);
|
g_fileWizardExtensions.removeOne(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseFileWizard::BaseFileWizard(const BaseFileWizardFactory *factory,
|
BaseFileWizard::BaseFileWizard(const BaseFileWizardFactory *factory, const QVariantMap &extraValues)
|
||||||
const QVariantMap &extraValues,
|
: m_extraValues(extraValues), m_factory(factory)
|
||||||
QWidget *parent) :
|
|
||||||
Wizard(parent),
|
|
||||||
m_extraValues(extraValues),
|
|
||||||
m_factory(factory)
|
|
||||||
{
|
{
|
||||||
for (IFileWizardExtension *extension : std::as_const(g_fileWizardExtensions))
|
for (IFileWizardExtension *extension : std::as_const(g_fileWizardExtensions))
|
||||||
m_extensionPages += extension->extensionPages(factory);
|
m_extensionPages += extension->extensionPages(factory);
|
||||||
|
@@ -20,8 +20,7 @@ class CORE_EXPORT BaseFileWizard : public Utils::Wizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BaseFileWizard(const BaseFileWizardFactory *factory, const QVariantMap &extraValues,
|
explicit BaseFileWizard(const BaseFileWizardFactory *factory, const QVariantMap &extraValues);
|
||||||
QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
void initializePage(int id) override;
|
void initializePage(int id) override;
|
||||||
|
|
||||||
|
@@ -502,7 +502,7 @@ static bool copyPluginFile(const FilePath &src, const FilePath &dest)
|
|||||||
|
|
||||||
bool executePluginInstallWizard(const FilePath &archive)
|
bool executePluginInstallWizard(const FilePath &archive)
|
||||||
{
|
{
|
||||||
Wizard wizard(ICore::dialogParent());
|
Wizard wizard;
|
||||||
wizard.setWindowTitle(Tr::tr("Install Plugin"));
|
wizard.setWindowTitle(Tr::tr("Install Plugin"));
|
||||||
|
|
||||||
Data data;
|
Data data;
|
||||||
|
@@ -15,17 +15,14 @@
|
|||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
|
namespace Designer::Internal {
|
||||||
|
|
||||||
enum { FormPageId, ClassPageId };
|
enum { FormPageId, ClassPageId };
|
||||||
|
|
||||||
namespace Designer {
|
FormClassWizardDialog::FormClassWizardDialog(const Core::BaseFileWizardFactory *factory)
|
||||||
namespace Internal {
|
: Core::BaseFileWizard(factory, QVariantMap())
|
||||||
|
, m_formPage(new FormTemplateWizardPage)
|
||||||
// ----------------- FormClassWizardDialog
|
, m_classPage(new FormClassWizardPage)
|
||||||
FormClassWizardDialog::FormClassWizardDialog(const Core::BaseFileWizardFactory *factory,
|
|
||||||
QWidget *parent) :
|
|
||||||
Core::BaseFileWizard(factory, QVariantMap(), parent),
|
|
||||||
m_formPage(new FormTemplateWizardPage),
|
|
||||||
m_classPage(new FormClassWizardPage)
|
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("Qt Widgets Designer Form Class"));
|
setWindowTitle(Tr::tr("Qt Widgets Designer Form Class"));
|
||||||
|
|
||||||
@@ -74,5 +71,4 @@ FormClassWizardParameters FormClassWizardDialog::parameters() const
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Designer::Internal
|
||||||
} // namespace Designer
|
|
||||||
|
@@ -21,7 +21,7 @@ class FormClassWizardDialog : public Core::BaseFileWizard
|
|||||||
public:
|
public:
|
||||||
typedef QList<QWizardPage *> WizardPageList;
|
typedef QList<QWizardPage *> WizardPageList;
|
||||||
|
|
||||||
explicit FormClassWizardDialog(const Core::BaseFileWizardFactory *factory, QWidget *parent = nullptr);
|
explicit FormClassWizardDialog(const Core::BaseFileWizardFactory *factory);
|
||||||
|
|
||||||
Utils::FilePath filePath() const;
|
Utils::FilePath filePath() const;
|
||||||
void setFilePath(const Utils::FilePath &);
|
void setFilePath(const Utils::FilePath &);
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
#include "genericprojectmanagertr.h"
|
#include "genericprojectmanagertr.h"
|
||||||
|
|
||||||
#include <coreplugin/basefilewizard.h>
|
#include <coreplugin/basefilewizard.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/iwizardfactory.h>
|
#include <coreplugin/iwizardfactory.h>
|
||||||
|
|
||||||
#include <projectexplorer/customwizard/customwizard.h>
|
#include <projectexplorer/customwizard/customwizard.h>
|
||||||
@@ -99,7 +98,7 @@ class GenericProjectWizard final : public BaseFileWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
GenericProjectWizard(const BaseFileWizardFactory *factory)
|
GenericProjectWizard(const BaseFileWizardFactory *factory)
|
||||||
: BaseFileWizard(factory, QVariantMap(), Core::ICore::dialogParent())
|
: BaseFileWizard(factory, QVariantMap())
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("Import Existing Project"));
|
setWindowTitle(Tr::tr("Import Existing Project"));
|
||||||
|
|
||||||
|
@@ -129,7 +129,6 @@ private:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
JsonWizard::JsonWizard()
|
JsonWizard::JsonWizard()
|
||||||
: Wizard(Core::ICore::dialogParent())
|
|
||||||
{
|
{
|
||||||
setMinimumSize(800, 500);
|
setMinimumSize(800, 500);
|
||||||
m_expander.registerExtraResolver([this](const QString &name, QString *ret) -> bool {
|
m_expander.registerExtraResolver([this](const QString &name, QString *ret) -> bool {
|
||||||
|
@@ -64,9 +64,8 @@ static FancyLineEdit::AsyncValidationResult validateLibraryPath(const QString &i
|
|||||||
return make_unexpected(::QmakeProjectManager::Tr::tr("File does not match filter."));
|
return make_unexpected(::QmakeProjectManager::Tr::tr("File does not match filter."));
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent)
|
AddLibraryWizard::AddLibraryWizard(const FilePath &proFile)
|
||||||
: Wizard(parent)
|
: m_proFile(proFile)
|
||||||
, m_proFile(proFile)
|
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("Add Library"));
|
setWindowTitle(Tr::tr("Add Library"));
|
||||||
m_libraryTypePage = new LibraryTypePage(this);
|
m_libraryTypePage = new LibraryTypePage(this);
|
||||||
|
@@ -90,7 +90,7 @@ public:
|
|||||||
|
|
||||||
Q_DECLARE_FLAGS(Platforms, Platform)
|
Q_DECLARE_FLAGS(Platforms, Platform)
|
||||||
|
|
||||||
explicit AddLibraryWizard(const Utils::FilePath &proFile, QWidget *parent = nullptr);
|
explicit AddLibraryWizard(const Utils::FilePath &proFile);
|
||||||
~AddLibraryWizard() override;
|
~AddLibraryWizard() override;
|
||||||
|
|
||||||
LibraryKind libraryKind() const;
|
LibraryKind libraryKind() const;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#include "qmakestep.h"
|
#include "qmakestep.h"
|
||||||
#include "wizards/subdirsprojectwizard.h"
|
#include "wizards/subdirsprojectwizard.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
@@ -348,7 +347,7 @@ void QmakeProjectManagerPluginPrivate::addLibraryImpl(const FilePath &filePath,
|
|||||||
if (filePath.isEmpty())
|
if (filePath.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Internal::AddLibraryWizard wizard(filePath, Core::ICore::dialogParent());
|
Internal::AddLibraryWizard wizard(filePath);
|
||||||
if (wizard.exec() != QDialog::Accepted)
|
if (wizard.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -7,8 +7,6 @@
|
|||||||
#include "remotelinuxtr.h"
|
#include "remotelinuxtr.h"
|
||||||
#include "sshkeycreationdialog.h"
|
#include "sshkeycreationdialog.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/devicesupport/sshparameters.h>
|
#include <projectexplorer/devicesupport/sshparameters.h>
|
||||||
|
|
||||||
@@ -194,7 +192,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
SshDeviceWizard::SshDeviceWizard(const QString &title, const DeviceRef &device)
|
SshDeviceWizard::SshDeviceWizard(const QString &title, const DeviceRef &device)
|
||||||
: Wizard(Core::ICore::dialogParent())
|
|
||||||
{
|
{
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user