forked from qt-creator/qt-creator
Set parent for options dialog where appropriate.
Otherwise the options dialog might appear behind the current "dialog" (for example the "new" wizards). Also, take ICore::dialogParent as default. Change-Id: I4578e269db5763842a942549a45ec8cdd6b28b5d Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -120,7 +120,8 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)
|
||||
void AndroidPotentialKitWidget::openOptions()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(Constants::ANDROID_SETTINGS_CATEGORY,
|
||||
Constants::ANDROID_SETTINGS_ID);
|
||||
Constants::ANDROID_SETTINGS_ID,
|
||||
this);
|
||||
}
|
||||
|
||||
void AndroidPotentialKitWidget::recheck()
|
||||
|
||||
@@ -292,7 +292,8 @@ bool NoKitPage::isComplete() const
|
||||
void NoKitPage::showOptions()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(Core::Id(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY),
|
||||
Core::Id(ProjectExplorer::Constants::KITS_SETTINGS_PAGE_ID), this);
|
||||
Core::Id(ProjectExplorer::Constants::KITS_SETTINGS_PAGE_ID),
|
||||
this);
|
||||
}
|
||||
|
||||
InSourceBuildPage::InSourceBuildPage(CMakeOpenProjectWizard *cmakeWizard)
|
||||
|
||||
@@ -69,8 +69,11 @@ static void showGraphicalShellError(QWidget *parent, const QString &app, const Q
|
||||
QAbstractButton *settingsButton = mbox.addButton(Core::ICore::msgShowOptionsDialog(),
|
||||
QMessageBox::ActionRole);
|
||||
mbox.exec();
|
||||
if (mbox.clickedButton() == settingsButton)
|
||||
ICore::showOptionsDialog(Constants::SETTINGS_CATEGORY_CORE, Constants::SETTINGS_ID_ENVIRONMENT);
|
||||
if (mbox.clickedButton() == settingsButton) {
|
||||
ICore::showOptionsDialog(Constants::SETTINGS_CATEGORY_CORE,
|
||||
Constants::SETTINGS_ID_ENVIRONMENT,
|
||||
parent);
|
||||
}
|
||||
}
|
||||
|
||||
void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
|
||||
|
||||
@@ -833,7 +833,7 @@ bool MainWindow::showOptionsDialog(Id category, Id page, QWidget *parent)
|
||||
{
|
||||
emit m_coreImpl->optionsDialogRequested();
|
||||
if (!parent)
|
||||
parent = this;
|
||||
parent = ICore::dialogParent();
|
||||
SettingsDialog *dialog = SettingsDialog::getSettingsDialog(parent, category, page);
|
||||
return dialog->execDialog();
|
||||
}
|
||||
|
||||
@@ -169,9 +169,11 @@ bool Protocol::showConfigurationError(const Protocol *p,
|
||||
settingsButton = mb.addButton(Core::ICore::msgShowOptionsDialog(), QMessageBox::AcceptRole);
|
||||
mb.exec();
|
||||
bool rc = false;
|
||||
if (mb.clickedButton() == settingsButton)
|
||||
if (mb.clickedButton() == settingsButton) {
|
||||
rc = Core::ICore::showOptionsDialog(p->settingsPage()->category(),
|
||||
p->settingsPage()->id(), parent);
|
||||
p->settingsPage()->id(),
|
||||
parent);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,8 @@ QWidget *DebuggerKitConfigWidget::mainWidget() const
|
||||
void DebuggerKitConfigWidget::manageDebuggers()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
||||
ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID);
|
||||
ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID,
|
||||
buttonWidget());
|
||||
}
|
||||
|
||||
void DebuggerKitConfigWidget::currentDebuggerChanged(int)
|
||||
|
||||
@@ -205,7 +205,8 @@ void ToolChainInformationConfigWidget::toolChainUpdated(ProjectExplorer::ToolCha
|
||||
void ToolChainInformationConfigWidget::manageToolChains()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
||||
Constants::TOOLCHAIN_SETTINGS_PAGE_ID);
|
||||
Constants::TOOLCHAIN_SETTINGS_PAGE_ID,
|
||||
buttonWidget());
|
||||
}
|
||||
|
||||
void ToolChainInformationConfigWidget::currentToolChainChanged(int idx)
|
||||
@@ -368,7 +369,8 @@ QWidget *DeviceInformationConfigWidget::buttonWidget() const
|
||||
void DeviceInformationConfigWidget::manageDevices()
|
||||
{
|
||||
ICore::showOptionsDialog(Constants::DEVICE_SETTINGS_CATEGORY,
|
||||
Constants::DEVICE_SETTINGS_PAGE_ID);
|
||||
Constants::DEVICE_SETTINGS_PAGE_ID,
|
||||
buttonWidget());
|
||||
}
|
||||
|
||||
void DeviceInformationConfigWidget::modelAboutToReset()
|
||||
|
||||
@@ -215,5 +215,6 @@ void ProjectWizardPage::slotProjectChanged(int index)
|
||||
void ProjectWizardPage::slotManageVcs()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY,
|
||||
VcsBase::Constants::VCS_COMMON_SETTINGS_ID);
|
||||
VcsBase::Constants::VCS_COMMON_SETTINGS_ID,
|
||||
this);
|
||||
}
|
||||
|
||||
@@ -630,7 +630,8 @@ void TargetSettingsPanelWidget::openTargetPreferences()
|
||||
page->showKit(m_targets.at(targetIndex)->kit());
|
||||
}
|
||||
ICore::showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
||||
Constants::KITS_SETTINGS_PAGE_ID);
|
||||
Constants::KITS_SETTINGS_PAGE_ID,
|
||||
this);
|
||||
}
|
||||
|
||||
void TargetSettingsPanelWidget::importTarget()
|
||||
|
||||
@@ -231,7 +231,8 @@ void TargetSetupWidget::manageKit()
|
||||
|
||||
page->showKit(m_kit);
|
||||
Core::ICore::showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
||||
Constants::KITS_SETTINGS_PAGE_ID);
|
||||
Constants::KITS_SETTINGS_PAGE_ID,
|
||||
this);
|
||||
}
|
||||
|
||||
void TargetSetupWidget::setProjectPath(const QString &projectPath)
|
||||
|
||||
@@ -77,10 +77,11 @@ bool BlackBerryPotentialKit::shouldShow()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BlackBerryPotentialKit::openSettings()
|
||||
void BlackBerryPotentialKit::openSettings(QWidget *parent)
|
||||
{
|
||||
Core::ICore::showOptionsDialog(Qnx::Constants::QNX_BB_CATEGORY,
|
||||
Qnx::Constants::QNX_BB_SETUP_ID);
|
||||
Qnx::Constants::QNX_BB_SETUP_ID,
|
||||
parent);
|
||||
}
|
||||
|
||||
BlackBerryPotentialKitWidget::BlackBerryPotentialKitWidget(QWidget *parent)
|
||||
@@ -111,7 +112,7 @@ BlackBerryPotentialKitWidget::BlackBerryPotentialKitWidget(QWidget *parent)
|
||||
|
||||
void BlackBerryPotentialKitWidget::openOptions()
|
||||
{
|
||||
BlackBerryPotentialKit::openSettings();
|
||||
BlackBerryPotentialKit::openSettings(this);
|
||||
}
|
||||
|
||||
void BlackBerryPotentialKitWidget::recheck()
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
bool isEnabled() const;
|
||||
|
||||
static bool shouldShow();
|
||||
static void openSettings();
|
||||
static void openSettings(QWidget *parent = 0);
|
||||
};
|
||||
|
||||
class BlackBerryPotentialKitWidget : public Utils::DetailsWidget
|
||||
|
||||
@@ -140,7 +140,8 @@ void QtKitConfigWidget::versionsChanged(const QList<int> &added, const QList<int
|
||||
void QtKitConfigWidget::manageQtVersions()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
||||
Constants::QTVERSION_SETTINGS_PAGE_ID);
|
||||
Constants::QTVERSION_SETTINGS_PAGE_ID,
|
||||
buttonWidget());
|
||||
}
|
||||
|
||||
void QtKitConfigWidget::currentWasChanged(int idx)
|
||||
|
||||
@@ -181,7 +181,8 @@ bool PlainTextEditorWidget::isMissingSyntaxDefinition() const
|
||||
void PlainTextEditorWidget::acceptMissingSyntaxDefinitionInfo()
|
||||
{
|
||||
ICore::showOptionsDialog(Constants::TEXT_EDITOR_SETTINGS_CATEGORY,
|
||||
Constants::TEXT_EDITOR_HIGHLIGHTER_SETTINGS);
|
||||
Constants::TEXT_EDITOR_HIGHLIGHTER_SETTINGS,
|
||||
this);
|
||||
}
|
||||
|
||||
PlainTextDocument::PlainTextDocument()
|
||||
|
||||
@@ -83,7 +83,8 @@ bool VcsConfigurationPage::isComplete() const
|
||||
void VcsConfigurationPage::openConfiguration()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(Constants::VCS_SETTINGS_CATEGORY,
|
||||
d->m_versionControl->id());
|
||||
d->m_versionControl->id(),
|
||||
this);
|
||||
}
|
||||
|
||||
} // namespace VcsBase
|
||||
|
||||
Reference in New Issue
Block a user