forked from qt-creator/qt-creator
Use Core::Id in ICore::showOptionsDialog
Change-Id: I3865fde2347d687a7dee76dd5ca62db69cc4dd04 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -944,6 +944,5 @@ void ExternalToolManager::writeSettings()
|
||||
|
||||
void ExternalToolManager::openPreferences()
|
||||
{
|
||||
ICore::showOptionsDialog(QLatin1String(Core::Constants::SETTINGS_CATEGORY_CORE),
|
||||
QLatin1String(Core::Constants::SETTINGS_ID_TOOLS));
|
||||
ICore::showOptionsDialog(Constants::SETTINGS_CATEGORY_CORE, Constants::SETTINGS_ID_TOOLS);
|
||||
}
|
||||
|
||||
@@ -71,10 +71,8 @@ static void showGraphicalShellError(QWidget *parent, const QString &app, const Q
|
||||
QAbstractButton *settingsButton = mbox.addButton(QApplication::translate("Core::Internal", "Settings..."),
|
||||
QMessageBox::ActionRole);
|
||||
mbox.exec();
|
||||
if (mbox.clickedButton() == settingsButton) {
|
||||
ICore::showOptionsDialog(QLatin1String(Constants::SETTINGS_CATEGORY_CORE),
|
||||
QLatin1String(Constants::SETTINGS_ID_ENVIRONMENT));
|
||||
}
|
||||
if (mbox.clickedButton() == settingsButton)
|
||||
ICore::showOptionsDialog(Constants::SETTINGS_CATEGORY_CORE, Constants::SETTINGS_ID_ENVIRONMENT);
|
||||
}
|
||||
|
||||
void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
|
||||
|
||||
@@ -393,7 +393,7 @@ void ICore::showNewItemDialog(const QString &title,
|
||||
m_mainwindow->showNewItemDialog(title, wizards, defaultLocation, extraVariables);
|
||||
}
|
||||
|
||||
bool ICore::showOptionsDialog(const QString &group, const QString &page, QWidget *parent)
|
||||
bool ICore::showOptionsDialog(const Id group, const Id page, QWidget *parent)
|
||||
{
|
||||
return m_mainwindow->showOptionsDialog(group, page, parent);
|
||||
}
|
||||
@@ -401,7 +401,7 @@ bool ICore::showOptionsDialog(const QString &group, const QString &page, QWidget
|
||||
bool ICore::showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details,
|
||||
Id settingsCategory,
|
||||
const QString &settingsId,
|
||||
Id settingsId,
|
||||
QWidget *parent)
|
||||
{
|
||||
return m_mainwindow->showWarningWithOptions(title, text,
|
||||
|
||||
@@ -82,14 +82,12 @@ public:
|
||||
const QString &defaultLocation = QString(),
|
||||
const QVariantMap &extraVariables = QVariantMap());
|
||||
|
||||
static bool showOptionsDialog(const QString &group = QString(),
|
||||
const QString &page = QString(),
|
||||
QWidget *parent = 0);
|
||||
static bool showOptionsDialog(Id group, Id page, QWidget *parent = 0);
|
||||
|
||||
static bool showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details = QString(),
|
||||
Id settingsCategory = Id(),
|
||||
const QString &settingsId = QString(),
|
||||
Id settingsId = Id(),
|
||||
QWidget *parent = 0);
|
||||
|
||||
static QT_DEPRECATED ActionManager *actionManager(); // Use Actionmanager::... directly.
|
||||
|
||||
@@ -960,14 +960,12 @@ void MainWindow::showNewItemDialog(const QString &title,
|
||||
wizard->runWizard(path, this, selectedPlatform, extraVariables);
|
||||
}
|
||||
|
||||
bool MainWindow::showOptionsDialog(const QString &category,
|
||||
const QString &page,
|
||||
QWidget *parent)
|
||||
bool MainWindow::showOptionsDialog(Id category, Id page, QWidget *parent)
|
||||
{
|
||||
emit m_coreImpl->optionsDialogRequested();
|
||||
if (!parent)
|
||||
parent = this;
|
||||
SettingsDialog *dialog = SettingsDialog::getSettingsDialog(parent, category, page);
|
||||
SettingsDialog *dialog = SettingsDialog::getSettingsDialog(parent, category.toString(), page.toString());
|
||||
return dialog->execDialog();
|
||||
}
|
||||
|
||||
@@ -1349,7 +1347,7 @@ bool MainWindow::showWarningWithOptions(const QString &title,
|
||||
const QString &text,
|
||||
const QString &details,
|
||||
Id settingsCategory,
|
||||
const QString &settingsId,
|
||||
Id settingsId,
|
||||
QWidget *parent)
|
||||
{
|
||||
if (parent == 0)
|
||||
@@ -1359,11 +1357,10 @@ bool MainWindow::showWarningWithOptions(const QString &title,
|
||||
if (!details.isEmpty())
|
||||
msgBox.setDetailedText(details);
|
||||
QAbstractButton *settingsButton = 0;
|
||||
if (!settingsId.isEmpty() || settingsCategory.isValid())
|
||||
if (settingsId.isValid() || settingsCategory.isValid())
|
||||
settingsButton = msgBox.addButton(tr("Settings..."), QMessageBox::AcceptRole);
|
||||
msgBox.exec();
|
||||
if (settingsButton && msgBox.clickedButton() == settingsButton) {
|
||||
return showOptionsDialog(settingsCategory.toString(), settingsId);
|
||||
}
|
||||
if (settingsButton && msgBox.clickedButton() == settingsButton)
|
||||
return showOptionsDialog(settingsCategory, settingsId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -138,14 +138,12 @@ public slots:
|
||||
const QString &defaultLocation = QString(),
|
||||
const QVariantMap &extraVariables = QVariantMap());
|
||||
|
||||
bool showOptionsDialog(const QString &category = QString(),
|
||||
const QString &page = QString(),
|
||||
QWidget *parent = 0);
|
||||
bool showOptionsDialog(Id category, Id page, QWidget *parent = 0);
|
||||
|
||||
bool showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details = QString(),
|
||||
Id settingsCategory = Id(),
|
||||
const QString &settingsId = QString(),
|
||||
Id settingsId = Id(),
|
||||
QWidget *parent = 0);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user