forked from qt-creator/qt-creator
SettingsDialog: Remove CategoryId parameter from callers
PageIds are supposed to be unique, so the CategoryId can be determined from the PageId. Look for PageIds in the already expanded categories first before searching through expensive categories. Change-Id: I006beb0df6183453163ac1810fe59a306a0f52b1 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -55,8 +55,7 @@ QString AndroidPotentialKit::displayName() const
|
|||||||
|
|
||||||
void AndroidPotentialKit::executeFromMenu()
|
void AndroidPotentialKit::executeFromMenu()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(Constants::ANDROID_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(Constants::ANDROID_SETTINGS_ID);
|
||||||
Constants::ANDROID_SETTINGS_ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *AndroidPotentialKit::createWidget(QWidget *parent) const
|
QWidget *AndroidPotentialKit::createWidget(QWidget *parent) const
|
||||||
@@ -120,9 +119,7 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)
|
|||||||
|
|
||||||
void AndroidPotentialKitWidget::openOptions()
|
void AndroidPotentialKitWidget::openOptions()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(Constants::ANDROID_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(Constants::ANDROID_SETTINGS_ID, this);
|
||||||
Constants::ANDROID_SETTINGS_ID,
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidPotentialKitWidget::recheck()
|
void AndroidPotentialKitWidget::recheck()
|
||||||
|
@@ -85,8 +85,7 @@ void GdbServerProviderChooser::setCurrentProviderId(const QString &id)
|
|||||||
|
|
||||||
void GdbServerProviderChooser::manageButtonClicked()
|
void GdbServerProviderChooser::manageButtonClicked()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(Constants::BAREMETAL_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(Constants::GDB_PROVIDERS_SETTINGS_ID, this);
|
||||||
Constants::GDB_PROVIDERS_SETTINGS_ID, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbServerProviderChooser::currentIndexChanged(int index)
|
void GdbServerProviderChooser::currentIndexChanged(int index)
|
||||||
|
@@ -289,9 +289,7 @@ bool NoKitPage::isComplete() const
|
|||||||
|
|
||||||
void NoKitPage::showOptions()
|
void NoKitPage::showOptions()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(Core::Id(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY),
|
Core::ICore::showOptionsDialog(ProjectExplorer::Constants::KITS_SETTINGS_PAGE_ID, this);
|
||||||
Core::Id(ProjectExplorer::Constants::KITS_SETTINGS_PAGE_ID),
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InSourceBuildPage::InSourceBuildPage(CMakeOpenProjectWizard *cmakeWizard)
|
InSourceBuildPage::InSourceBuildPage(CMakeOpenProjectWizard *cmakeWizard)
|
||||||
|
@@ -54,7 +54,6 @@
|
|||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
|
|
||||||
static const char categoryKeyC[] = "General/LastPreferenceCategory";
|
|
||||||
static const char pageKeyC[] = "General/LastPreferencePage";
|
static const char pageKeyC[] = "General/LastPreferencePage";
|
||||||
const int categoryIconSize = 24;
|
const int categoryIconSize = 24;
|
||||||
|
|
||||||
@@ -70,6 +69,18 @@ class Category
|
|||||||
public:
|
public:
|
||||||
Category() : index(-1), providerPagesCreated(false) { }
|
Category() : index(-1), providerPagesCreated(false) { }
|
||||||
|
|
||||||
|
bool findPageById(const Id id, int *pageIndex) const
|
||||||
|
{
|
||||||
|
for (int j = 0; j < pages.size(); ++j) {
|
||||||
|
IOptionsPage *page = pages.at(j);
|
||||||
|
if (page->id() == id) {
|
||||||
|
*pageIndex = j;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Id id;
|
Id id;
|
||||||
int index;
|
int index;
|
||||||
QString displayName;
|
QString displayName;
|
||||||
@@ -345,43 +356,49 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
|
|||||||
m_categoryList->setFocus();
|
m_categoryList->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::showPage(Id categoryId, Id pageId)
|
void SettingsDialog::showPage(const Id pageId)
|
||||||
{
|
{
|
||||||
// handle the case of "show last page"
|
// handle the case of "show last page"
|
||||||
Id initialCategory = categoryId;
|
Id initialPageId = pageId;
|
||||||
Id initialPage = pageId;
|
if (!initialPageId.isValid()) {
|
||||||
if (!initialCategory.isValid() && !initialPage.isValid()) {
|
|
||||||
QSettings *settings = ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
initialCategory = Id::fromSetting(settings->value(QLatin1String(categoryKeyC)));
|
initialPageId = Id::fromSetting(settings->value(QLatin1String(pageKeyC)));
|
||||||
initialPage = Id::fromSetting(settings->value(QLatin1String(pageKeyC)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!initialCategory.isValid()) // no category given and no old setting
|
|
||||||
return;
|
|
||||||
|
|
||||||
int initialCategoryIndex = -1;
|
int initialCategoryIndex = -1;
|
||||||
int initialPageIndex = -1;
|
int initialPageIndex = -1;
|
||||||
|
|
||||||
const QList<Category*> &categories = m_model->categories();
|
const QList<Category*> &categories = m_model->categories();
|
||||||
for (int i = 0; i < categories.size(); ++i) {
|
if (initialPageId.isValid()) {
|
||||||
Category *category = categories.at(i);
|
// First try categories without lazy items.
|
||||||
if (category->id == initialCategory) {
|
for (int i = 0; i < categories.size(); ++i) {
|
||||||
initialCategoryIndex = i;
|
Category *category = categories.at(i);
|
||||||
if (initialPage.isValid()) {
|
if (category->providers.isEmpty()) { // no providers
|
||||||
ensureCategoryWidget(category);
|
ensureCategoryWidget(category);
|
||||||
for (int j = 0; j < category->pages.size(); ++j) {
|
if (category->findPageById(initialPageId, &initialPageIndex)) {
|
||||||
IOptionsPage *page = category->pages.at(j);
|
initialCategoryIndex = i;
|
||||||
if (page->id() == initialPage)
|
break;
|
||||||
initialPageIndex = j;
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (initialPageIndex == -1) {
|
||||||
|
// On failure, expand the remaining items.
|
||||||
|
for (int i = 0; i < categories.size(); ++i) {
|
||||||
|
Category *category = categories.at(i);
|
||||||
|
if (!category->providers.isEmpty()) { // has providers
|
||||||
|
ensureCategoryWidget(category);
|
||||||
|
if (category->findPageById(initialPageId, &initialPageIndex)) {
|
||||||
|
initialCategoryIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTC_ASSERT(initialCategoryIndex != -1,
|
QTC_ASSERT(!initialPageId.isValid() || initialPageIndex != -1,
|
||||||
qDebug("Unknown category: %s", initialCategory.name().constData()); return);
|
qDebug("Unknown page: %s", initialPageId.name().constData()));
|
||||||
QTC_ASSERT(!initialPage.isValid() || initialPageIndex != -1,
|
|
||||||
qDebug("Unknown page: %s", initialPage.name().constData()));
|
|
||||||
|
|
||||||
if (initialCategoryIndex != -1) {
|
if (initialCategoryIndex != -1) {
|
||||||
const QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
|
const QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
|
||||||
@@ -588,7 +605,6 @@ void SettingsDialog::apply()
|
|||||||
void SettingsDialog::done(int val)
|
void SettingsDialog::done(int val)
|
||||||
{
|
{
|
||||||
QSettings *settings = ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
settings->setValue(QLatin1String(categoryKeyC), m_currentCategory.toSetting());
|
|
||||||
settings->setValue(QLatin1String(pageKeyC), m_currentPage.toSetting());
|
settings->setValue(QLatin1String(pageKeyC), m_currentPage.toSetting());
|
||||||
|
|
||||||
ICore::saveSettings(); // save all settings
|
ICore::saveSettings(); // save all settings
|
||||||
@@ -612,12 +628,11 @@ QSize SettingsDialog::sizeHint() const
|
|||||||
return minimumSize();
|
return minimumSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsDialog *SettingsDialog::getSettingsDialog(QWidget *parent,
|
SettingsDialog *SettingsDialog::getSettingsDialog(QWidget *parent, Id initialPage)
|
||||||
Id initialCategory, Id initialPage)
|
|
||||||
{
|
{
|
||||||
if (!m_instance)
|
if (!m_instance)
|
||||||
m_instance = new SettingsDialog(parent);
|
m_instance = new SettingsDialog(parent);
|
||||||
m_instance->showPage(initialCategory, initialPage);
|
m_instance->showPage(initialPage);
|
||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,8 +62,7 @@ public:
|
|||||||
// Returns a settings dialog. This makes sure that always only
|
// Returns a settings dialog. This makes sure that always only
|
||||||
// a single settings dialog instance is running.
|
// a single settings dialog instance is running.
|
||||||
// The dialog will be deleted automatically on close.
|
// The dialog will be deleted automatically on close.
|
||||||
static SettingsDialog *getSettingsDialog(QWidget *parent,
|
static SettingsDialog *getSettingsDialog(QWidget *parent, Id initialPage);
|
||||||
Id initialCategory, Id initialPage);
|
|
||||||
// Run the dialog and wait for it to finish.
|
// Run the dialog and wait for it to finish.
|
||||||
// Returns if the changes have been applied.
|
// Returns if the changes have been applied.
|
||||||
bool execDialog();
|
bool execDialog();
|
||||||
@@ -86,7 +85,7 @@ private:
|
|||||||
|
|
||||||
void createGui();
|
void createGui();
|
||||||
void showCategory(int index);
|
void showCategory(int index);
|
||||||
void showPage(Id categoryId, Id pageId);
|
void showPage(Id pageId);
|
||||||
void updateEnabledTabs(Category *category, const QString &searchText);
|
void updateEnabledTabs(Category *category, const QString &searchText);
|
||||||
void ensureCategoryWidget(Category *category);
|
void ensureCategoryWidget(Category *category);
|
||||||
void disconnectTabWidgets();
|
void disconnectTabWidgets();
|
||||||
|
@@ -81,7 +81,7 @@ ExternalToolManager::ExternalToolManager()
|
|||||||
d->m_configureSeparator->setSeparator(true);
|
d->m_configureSeparator->setSeparator(true);
|
||||||
d->m_configureAction = new QAction(ICore::msgShowOptionsDialog(), this);
|
d->m_configureAction = new QAction(ICore::msgShowOptionsDialog(), this);
|
||||||
connect(d->m_configureAction, &QAction::triggered, [this] {
|
connect(d->m_configureAction, &QAction::triggered, [this] {
|
||||||
ICore::showOptionsDialog(Constants::SETTINGS_CATEGORY_CORE, Constants::SETTINGS_ID_TOOLS);
|
ICore::showOptionsDialog(Constants::SETTINGS_ID_TOOLS);
|
||||||
});
|
});
|
||||||
|
|
||||||
// add the external tools menu
|
// add the external tools menu
|
||||||
|
@@ -66,11 +66,8 @@ static void showGraphicalShellError(QWidget *parent, const QString &app, const Q
|
|||||||
QAbstractButton *settingsButton = mbox.addButton(Core::ICore::msgShowOptionsDialog(),
|
QAbstractButton *settingsButton = mbox.addButton(Core::ICore::msgShowOptionsDialog(),
|
||||||
QMessageBox::ActionRole);
|
QMessageBox::ActionRole);
|
||||||
mbox.exec();
|
mbox.exec();
|
||||||
if (mbox.clickedButton() == settingsButton) {
|
if (mbox.clickedButton() == settingsButton)
|
||||||
ICore::showOptionsDialog(Constants::SETTINGS_CATEGORY_CORE,
|
ICore::showOptionsDialog(Constants::SETTINGS_ID_ENVIRONMENT, parent);
|
||||||
Constants::SETTINGS_ID_ENVIRONMENT,
|
|
||||||
parent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
|
void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
|
||||||
|
@@ -337,9 +337,9 @@ void ICore::showNewItemDialog(const QString &title,
|
|||||||
m_mainwindow->showNewItemDialog(title, factories, defaultLocation, extraVariables);
|
m_mainwindow->showNewItemDialog(title, factories, defaultLocation, extraVariables);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ICore::showOptionsDialog(const Id group, const Id page, QWidget *parent)
|
bool ICore::showOptionsDialog(const Id page, QWidget *parent)
|
||||||
{
|
{
|
||||||
return m_mainwindow->showOptionsDialog(group, page, parent);
|
return m_mainwindow->showOptionsDialog(page, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ICore::msgShowOptionsDialog()
|
QString ICore::msgShowOptionsDialog()
|
||||||
@@ -358,14 +358,9 @@ QString ICore::msgShowOptionsDialogToolTip()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ICore::showWarningWithOptions(const QString &title, const QString &text,
|
bool ICore::showWarningWithOptions(const QString &title, const QString &text,
|
||||||
const QString &details,
|
const QString &details, Id settingsId, QWidget *parent)
|
||||||
Id settingsCategory,
|
|
||||||
Id settingsId,
|
|
||||||
QWidget *parent)
|
|
||||||
{
|
{
|
||||||
return m_mainwindow->showWarningWithOptions(title, text,
|
return m_mainwindow->showWarningWithOptions(title, text, details, settingsId, parent);
|
||||||
details, settingsCategory,
|
|
||||||
settingsId, parent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSettings *ICore::settings(QSettings::Scope scope)
|
QSettings *ICore::settings(QSettings::Scope scope)
|
||||||
|
@@ -74,13 +74,12 @@ public:
|
|||||||
const QString &defaultLocation = QString(),
|
const QString &defaultLocation = QString(),
|
||||||
const QVariantMap &extraVariables = QVariantMap());
|
const QVariantMap &extraVariables = QVariantMap());
|
||||||
|
|
||||||
static bool showOptionsDialog(Id group, Id page, QWidget *parent = 0);
|
static bool showOptionsDialog(Id page, QWidget *parent = 0);
|
||||||
static QString msgShowOptionsDialog();
|
static QString msgShowOptionsDialog();
|
||||||
static QString msgShowOptionsDialogToolTip();
|
static QString msgShowOptionsDialogToolTip();
|
||||||
|
|
||||||
static bool showWarningWithOptions(const QString &title, const QString &text,
|
static bool showWarningWithOptions(const QString &title, const QString &text,
|
||||||
const QString &details = QString(),
|
const QString &details = QString(),
|
||||||
Id settingsCategory = Id(),
|
|
||||||
Id settingsId = Id(),
|
Id settingsId = Id(),
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
|
|
||||||
|
@@ -625,7 +625,7 @@ void LocatorWidget::filterSelected()
|
|||||||
|
|
||||||
void LocatorWidget::showConfigureDialog()
|
void LocatorWidget::showConfigureDialog()
|
||||||
{
|
{
|
||||||
ICore::showOptionsDialog(Constants::SETTINGS_CATEGORY_CORE, Constants::FILTER_OPTIONS_PAGE);
|
ICore::showOptionsDialog(Constants::FILTER_OPTIONS_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocatorWidget::addSearchResults(int firstIndex, int endIndex)
|
void LocatorWidget::addSearchResults(int firstIndex, int endIndex)
|
||||||
|
@@ -823,12 +823,12 @@ void MainWindow::showNewItemDialog(const QString &title,
|
|||||||
emit newItemDialogRunningChanged();
|
emit newItemDialogRunningChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::showOptionsDialog(Id category, Id page, QWidget *parent)
|
bool MainWindow::showOptionsDialog(Id page, QWidget *parent)
|
||||||
{
|
{
|
||||||
emit m_coreImpl->optionsDialogRequested();
|
emit m_coreImpl->optionsDialogRequested();
|
||||||
if (!parent)
|
if (!parent)
|
||||||
parent = ICore::dialogParent();
|
parent = ICore::dialogParent();
|
||||||
SettingsDialog *dialog = SettingsDialog::getSettingsDialog(parent, category, page);
|
SettingsDialog *dialog = SettingsDialog::getSettingsDialog(parent, page);
|
||||||
return dialog->execDialog();
|
return dialog->execDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1092,7 +1092,6 @@ QPrinter *MainWindow::printer() const
|
|||||||
bool MainWindow::showWarningWithOptions(const QString &title,
|
bool MainWindow::showWarningWithOptions(const QString &title,
|
||||||
const QString &text,
|
const QString &text,
|
||||||
const QString &details,
|
const QString &details,
|
||||||
Id settingsCategory,
|
|
||||||
Id settingsId,
|
Id settingsId,
|
||||||
QWidget *parent)
|
QWidget *parent)
|
||||||
{
|
{
|
||||||
@@ -1103,11 +1102,11 @@ bool MainWindow::showWarningWithOptions(const QString &title,
|
|||||||
if (!details.isEmpty())
|
if (!details.isEmpty())
|
||||||
msgBox.setDetailedText(details);
|
msgBox.setDetailedText(details);
|
||||||
QAbstractButton *settingsButton = 0;
|
QAbstractButton *settingsButton = 0;
|
||||||
if (settingsId.isValid() || settingsCategory.isValid())
|
if (settingsId.isValid())
|
||||||
settingsButton = msgBox.addButton(tr("Settings..."), QMessageBox::AcceptRole);
|
settingsButton = msgBox.addButton(tr("Settings..."), QMessageBox::AcceptRole);
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
if (settingsButton && msgBox.clickedButton() == settingsButton)
|
if (settingsButton && msgBox.clickedButton() == settingsButton)
|
||||||
return showOptionsDialog(settingsCategory, settingsId);
|
return showOptionsDialog(settingsId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,11 +122,10 @@ public slots:
|
|||||||
const QString &defaultLocation = QString(),
|
const QString &defaultLocation = QString(),
|
||||||
const QVariantMap &extraVariables = QVariantMap());
|
const QVariantMap &extraVariables = QVariantMap());
|
||||||
|
|
||||||
bool showOptionsDialog(Id category = Id(), Id page = Id(), QWidget *parent = 0);
|
bool showOptionsDialog(Id page = Id(), QWidget *parent = 0);
|
||||||
|
|
||||||
bool showWarningWithOptions(const QString &title, const QString &text,
|
bool showWarningWithOptions(const QString &title, const QString &text,
|
||||||
const QString &details = QString(),
|
const QString &details = QString(),
|
||||||
Id settingsCategory = Id(),
|
|
||||||
Id settingsId = Id(),
|
Id settingsId = Id(),
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
|
|
||||||
|
@@ -344,8 +344,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &input
|
|||||||
d->m_unconfiguredVcs = versionControl;
|
d->m_unconfiguredVcs = versionControl;
|
||||||
info.setCustomButtonInfo(ICore::msgShowOptionsDialog(), []() {
|
info.setCustomButtonInfo(ICore::msgShowOptionsDialog(), []() {
|
||||||
QTC_ASSERT(d->m_unconfiguredVcs, return);
|
QTC_ASSERT(d->m_unconfiguredVcs, return);
|
||||||
ICore::showOptionsDialog(Id(VcsBase::Constants::VCS_SETTINGS_CATEGORY),
|
ICore::showOptionsDialog(d->m_unconfiguredVcs->id());
|
||||||
d->m_unconfiguredVcs->id());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
infoBar->addInfo(info);
|
infoBar->addInfo(info);
|
||||||
|
@@ -170,11 +170,8 @@ bool Protocol::showConfigurationError(const Protocol *p,
|
|||||||
settingsButton = mb.addButton(Core::ICore::msgShowOptionsDialog(), QMessageBox::AcceptRole);
|
settingsButton = mb.addButton(Core::ICore::msgShowOptionsDialog(), QMessageBox::AcceptRole);
|
||||||
mb.exec();
|
mb.exec();
|
||||||
bool rc = false;
|
bool rc = false;
|
||||||
if (mb.clickedButton() == settingsButton) {
|
if (mb.clickedButton() == settingsButton)
|
||||||
rc = Core::ICore::showOptionsDialog(p->settingsPage()->category(),
|
rc = Core::ICore::showOptionsDialog(p->settingsPage()->id(), parent);
|
||||||
p->settingsPage()->id(),
|
|
||||||
parent);
|
|
||||||
}
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -127,8 +127,7 @@ QWidget *DebuggerKitConfigWidget::mainWidget() const
|
|||||||
|
|
||||||
void DebuggerKitConfigWidget::manageDebuggers()
|
void DebuggerKitConfigWidget::manageDebuggers()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID,
|
||||||
ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID,
|
|
||||||
buttonWidget());
|
buttonWidget());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -706,7 +706,6 @@ public:
|
|||||||
const QString &tracePointMessage = QString());
|
const QString &tracePointMessage = QString());
|
||||||
void onModeChanged(IMode *mode);
|
void onModeChanged(IMode *mode);
|
||||||
void onCoreAboutToOpen();
|
void onCoreAboutToOpen();
|
||||||
void showSettingsDialog();
|
|
||||||
void updateDebugWithoutDeployMenu();
|
void updateDebugWithoutDeployMenu();
|
||||||
|
|
||||||
void startAndDebugApplication();
|
void startAndDebugApplication();
|
||||||
@@ -2161,11 +2160,6 @@ void DebuggerPluginPrivate::onModeChanged(IMode *mode)
|
|||||||
m_toolTipManager.debugModeEntered();
|
m_toolTipManager.debugModeEntered();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPluginPrivate::showSettingsDialog()
|
|
||||||
{
|
|
||||||
ICore::showOptionsDialog(DEBUGGER_SETTINGS_CATEGORY, DEBUGGER_COMMON_SETTINGS_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerPluginPrivate::updateDebugWithoutDeployMenu()
|
void DebuggerPluginPrivate::updateDebugWithoutDeployMenu()
|
||||||
{
|
{
|
||||||
const bool state = ProjectExplorerPlugin::projectExplorerSettings().deployBeforeRun;
|
const bool state = ProjectExplorerPlugin::projectExplorerSettings().deployBeforeRun;
|
||||||
@@ -2990,7 +2984,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
|||||||
|
|
||||||
// Application interaction
|
// Application interaction
|
||||||
connect(action(SettingsDialog), &QAction::triggered,
|
connect(action(SettingsDialog), &QAction::triggered,
|
||||||
this, &DebuggerPluginPrivate::showSettingsDialog);
|
[] { ICore::showOptionsDialog(DEBUGGER_COMMON_SETTINGS_ID); });
|
||||||
|
|
||||||
// QML Actions
|
// QML Actions
|
||||||
connect(action(ShowQmlObjectTree), &SavedAction::valueChanged,
|
connect(action(ShowQmlObjectTree), &SavedAction::valueChanged,
|
||||||
|
@@ -4426,8 +4426,7 @@ void GdbEngine::handleAdapterStartFailed(const QString &msg, Id settingsIdHint)
|
|||||||
if (!settingsIdHint.isValid()) {
|
if (!settingsIdHint.isValid()) {
|
||||||
ICore::showWarningWithOptions(title, msg);
|
ICore::showWarningWithOptions(title, msg);
|
||||||
} else {
|
} else {
|
||||||
ICore::showWarningWithOptions(title, msg, QString(),
|
ICore::showWarningWithOptions(title, msg, QString(), settingsIdHint);
|
||||||
Constants::DEBUGGER_SETTINGS_CATEGORY, settingsIdHint);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
notifyEngineSetupFailed();
|
notifyEngineSetupFailed();
|
||||||
|
@@ -1016,7 +1016,6 @@ private slots:
|
|||||||
void fold(int depth, bool fold);
|
void fold(int depth, bool fold);
|
||||||
void foldGoTo(int count, bool current);
|
void foldGoTo(int count, bool current);
|
||||||
void jumpToGlobalMark(QChar mark, bool backTickMode, const QString &fileName);
|
void jumpToGlobalMark(QChar mark, bool backTickMode, const QString &fileName);
|
||||||
void showSettingsDialog();
|
|
||||||
void maybeReadVimRc();
|
void maybeReadVimRc();
|
||||||
void disableBlockSelection();
|
void disableBlockSelection();
|
||||||
void setBlockSelection(const QTextCursor&);
|
void setBlockSelection(const QTextCursor&);
|
||||||
@@ -1382,11 +1381,6 @@ void FakeVimPluginPrivate::maybeReadVimRc()
|
|||||||
//qDebug() << theFakeVimSetting(ConfigShiftWidth)->value();
|
//qDebug() << theFakeVimSetting(ConfigShiftWidth)->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimPluginPrivate::showSettingsDialog()
|
|
||||||
{
|
|
||||||
ICore::showOptionsDialog(SETTINGS_CATEGORY, SETTINGS_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FakeVimPluginPrivate::triggerAction(Id id)
|
void FakeVimPluginPrivate::triggerAction(Id id)
|
||||||
{
|
{
|
||||||
Command *cmd = ActionManager::command(id);
|
Command *cmd = ActionManager::command(id);
|
||||||
@@ -2007,7 +2001,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
|
|||||||
} else if (cmd.matches(_("se"), _("set"))) {
|
} else if (cmd.matches(_("se"), _("set"))) {
|
||||||
if (cmd.args.isEmpty()) {
|
if (cmd.args.isEmpty()) {
|
||||||
// :se[t]
|
// :se[t]
|
||||||
showSettingsDialog();
|
ICore::showOptionsDialog(SETTINGS_ID);
|
||||||
} else if (cmd.args == _("ic") || cmd.args == _("ignorecase")) {
|
} else if (cmd.args == _("ic") || cmd.args == _("ignorecase")) {
|
||||||
// :set nc
|
// :set nc
|
||||||
setActionChecked(Core::Constants::CASE_SENSITIVE, false);
|
setActionChecked(Core::Constants::CASE_SENSITIVE, false);
|
||||||
|
@@ -374,8 +374,7 @@ void GerritPlugin::openView()
|
|||||||
while (!m_parameters->isValid()) {
|
while (!m_parameters->isValid()) {
|
||||||
Core::AsynchronousMessageBox::warning(tr("Error"),
|
Core::AsynchronousMessageBox::warning(tr("Error"),
|
||||||
tr("Invalid Gerrit configuration. Host, user and ssh binary are mandatory."));
|
tr("Invalid Gerrit configuration. Host, user and ssh binary are mandatory."));
|
||||||
const Id group = VcsBase::Constants::VCS_SETTINGS_CATEGORY;
|
if (!ICore::showOptionsDialog("Gerrit"))
|
||||||
if (!ICore::showOptionsDialog(group, "Gerrit"))
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GerritDialog *gd = new GerritDialog(m_parameters, ICore::mainWindow());
|
GerritDialog *gd = new GerritDialog(m_parameters, ICore::mainWindow());
|
||||||
|
@@ -42,9 +42,8 @@
|
|||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
|
|
||||||
ConfigTaskHandler::ConfigTaskHandler(const Task &pattern, Core::Id group, Core::Id page) :
|
ConfigTaskHandler::ConfigTaskHandler(const Task &pattern, Core::Id page) :
|
||||||
m_pattern(pattern),
|
m_pattern(pattern),
|
||||||
m_targetGroup(group),
|
|
||||||
m_targetPage(page)
|
m_targetPage(page)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@@ -57,7 +56,7 @@ bool ConfigTaskHandler::canHandle(const Task &task) const
|
|||||||
void ConfigTaskHandler::handle(const Task &task)
|
void ConfigTaskHandler::handle(const Task &task)
|
||||||
{
|
{
|
||||||
Q_UNUSED(task);
|
Q_UNUSED(task);
|
||||||
Core::ICore::showOptionsDialog(m_targetGroup, m_targetPage);
|
Core::ICore::showOptionsDialog(m_targetPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *ConfigTaskHandler::createAction(QObject *parent) const
|
QAction *ConfigTaskHandler::createAction(QObject *parent) const
|
||||||
|
@@ -43,7 +43,7 @@ class ConfigTaskHandler : public ITaskHandler
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConfigTaskHandler(const Task &pattern, Core::Id group, Core::Id page);
|
ConfigTaskHandler(const Task &pattern, Core::Id page);
|
||||||
|
|
||||||
bool canHandle(const Task &task) const;
|
bool canHandle(const Task &task) const;
|
||||||
void handle(const Task &task);
|
void handle(const Task &task);
|
||||||
@@ -51,8 +51,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const Task m_pattern;
|
const Task m_pattern;
|
||||||
|
|
||||||
const Core::Id m_targetGroup;
|
|
||||||
const Core::Id m_targetPage;
|
const Core::Id m_targetPage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -67,8 +67,7 @@ KitChooser::KitChooser(QWidget *parent) :
|
|||||||
|
|
||||||
void KitChooser::onManageButtonClicked()
|
void KitChooser::onManageButtonClicked()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(Constants::KITS_SETTINGS_PAGE_ID, this);
|
||||||
Constants::KITS_SETTINGS_PAGE_ID, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitChooser::onCurrentIndexChanged(int index)
|
void KitChooser::onCurrentIndexChanged(int index)
|
||||||
|
@@ -215,9 +215,7 @@ void ToolChainInformationConfigWidget::toolChainUpdated(ToolChain *tc)
|
|||||||
|
|
||||||
void ToolChainInformationConfigWidget::manageToolChains()
|
void ToolChainInformationConfigWidget::manageToolChains()
|
||||||
{
|
{
|
||||||
ICore::showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
ICore::showOptionsDialog(Constants::TOOLCHAIN_SETTINGS_PAGE_ID, buttonWidget());
|
||||||
Constants::TOOLCHAIN_SETTINGS_PAGE_ID,
|
|
||||||
buttonWidget());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolChainInformationConfigWidget::currentToolChainChanged(int idx)
|
void ToolChainInformationConfigWidget::currentToolChainChanged(int idx)
|
||||||
@@ -379,9 +377,7 @@ QWidget *DeviceInformationConfigWidget::buttonWidget() const
|
|||||||
|
|
||||||
void DeviceInformationConfigWidget::manageDevices()
|
void DeviceInformationConfigWidget::manageDevices()
|
||||||
{
|
{
|
||||||
ICore::showOptionsDialog(Constants::DEVICE_SETTINGS_CATEGORY,
|
ICore::showOptionsDialog(Constants::DEVICE_SETTINGS_PAGE_ID, buttonWidget());
|
||||||
Constants::DEVICE_SETTINGS_PAGE_ID,
|
|
||||||
buttonWidget());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceInformationConfigWidget::modelAboutToReset()
|
void DeviceInformationConfigWidget::modelAboutToReset()
|
||||||
|
@@ -473,7 +473,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
addAutoReleasedObject(new VcsAnnotateTaskHandler);
|
addAutoReleasedObject(new VcsAnnotateTaskHandler);
|
||||||
addAutoReleasedObject(new RemoveTaskHandler);
|
addAutoReleasedObject(new RemoveTaskHandler);
|
||||||
addAutoReleasedObject(new ConfigTaskHandler(Task::compilerMissingTask(),
|
addAutoReleasedObject(new ConfigTaskHandler(Task::compilerMissingTask(),
|
||||||
Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
|
||||||
Constants::KITS_SETTINGS_PAGE_ID));
|
Constants::KITS_SETTINGS_PAGE_ID));
|
||||||
addAutoReleasedObject(new CoreListener);
|
addAutoReleasedObject(new CoreListener);
|
||||||
|
|
||||||
|
@@ -584,9 +584,7 @@ void ProjectWizardPage::projectChanged(int index)
|
|||||||
|
|
||||||
void ProjectWizardPage::manageVcs()
|
void ProjectWizardPage::manageVcs()
|
||||||
{
|
{
|
||||||
ICore::showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY,
|
ICore::showOptionsDialog(VcsBase::Constants::VCS_COMMON_SETTINGS_ID, this);
|
||||||
VcsBase::Constants::VCS_COMMON_SETTINGS_ID,
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -644,9 +644,7 @@ void TargetSettingsPanelWidget::openTargetPreferences()
|
|||||||
if (KitOptionsPage *page = ExtensionSystem::PluginManager::getObject<KitOptionsPage>())
|
if (KitOptionsPage *page = ExtensionSystem::PluginManager::getObject<KitOptionsPage>())
|
||||||
page->showKit(m_targets.at(targetIndex)->kit());
|
page->showKit(m_targets.at(targetIndex)->kit());
|
||||||
}
|
}
|
||||||
ICore::showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
ICore::showOptionsDialog(Constants::KITS_SETTINGS_PAGE_ID, this);
|
||||||
Constants::KITS_SETTINGS_PAGE_ID,
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSettingsPanelWidget::importTarget()
|
void TargetSettingsPanelWidget::importTarget()
|
||||||
|
@@ -428,9 +428,7 @@ void TargetSetupPage::updateVisibility()
|
|||||||
|
|
||||||
void TargetSetupPage::openOptions()
|
void TargetSetupPage::openOptions()
|
||||||
{
|
{
|
||||||
Core::ICore::instance()->showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(Constants::KITS_SETTINGS_PAGE_ID, this);
|
||||||
Constants::KITS_SETTINGS_PAGE_ID,
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::import(const Utils::FileName &path)
|
void TargetSetupPage::import(const Utils::FileName &path)
|
||||||
|
@@ -230,9 +230,7 @@ void TargetSetupWidget::manageKit()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
page->showKit(m_kit);
|
page->showKit(m_kit);
|
||||||
Core::ICore::showOptionsDialog(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(Constants::KITS_SETTINGS_PAGE_ID, parentWidget());
|
||||||
Constants::KITS_SETTINGS_PAGE_ID,
|
|
||||||
this->parentWidget());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupWidget::setProjectPath(const QString &projectPath)
|
void TargetSetupWidget::setProjectPath(const QString &projectPath)
|
||||||
|
@@ -80,9 +80,7 @@ bool BlackBerryPotentialKit::shouldShow()
|
|||||||
|
|
||||||
void BlackBerryPotentialKit::openSettings(QWidget *parent)
|
void BlackBerryPotentialKit::openSettings(QWidget *parent)
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(Qnx::Constants::QNX_BB_CATEGORY,
|
Core::ICore::showOptionsDialog(Qnx::Constants::QNX_BB_SETUP_ID, parent);
|
||||||
Qnx::Constants::QNX_BB_SETUP_ID,
|
|
||||||
parent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryPotentialKitWidget::BlackBerryPotentialKitWidget(QWidget *parent)
|
BlackBerryPotentialKitWidget::BlackBerryPotentialKitWidget(QWidget *parent)
|
||||||
|
@@ -139,9 +139,7 @@ void QtKitConfigWidget::versionsChanged(const QList<int> &added, const QList<int
|
|||||||
|
|
||||||
void QtKitConfigWidget::manageQtVersions()
|
void QtKitConfigWidget::manageQtVersions()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(Constants::QTVERSION_SETTINGS_PAGE_ID, buttonWidget());
|
||||||
Constants::QTVERSION_SETTINGS_PAGE_ID,
|
|
||||||
buttonWidget());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtKitConfigWidget::currentWasChanged(int idx)
|
void QtKitConfigWidget::currentWasChanged(int idx)
|
||||||
|
@@ -268,12 +268,10 @@ void BehaviorSettingsPage::openCodingStylePreferences(TabSettingsWidget::CodingS
|
|||||||
{
|
{
|
||||||
switch (link) {
|
switch (link) {
|
||||||
case TabSettingsWidget::CppLink:
|
case TabSettingsWidget::CppLink:
|
||||||
Core::ICore::showOptionsDialog(CppTools::Constants::CPP_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(CppTools::Constants::CPP_CODE_STYLE_SETTINGS_ID);
|
||||||
CppTools::Constants::CPP_CODE_STYLE_SETTINGS_ID);
|
|
||||||
break;
|
break;
|
||||||
case TabSettingsWidget::QtQuickLink:
|
case TabSettingsWidget::QtQuickLink:
|
||||||
Core::ICore::showOptionsDialog(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML,
|
Core::ICore::showOptionsDialog(QmlJSTools::Constants::QML_JS_CODE_STYLE_SETTINGS_ID);
|
||||||
QmlJSTools::Constants::QML_JS_CODE_STYLE_SETTINGS_ID);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -548,9 +548,7 @@ static void updateEditorInfoBar(TextEditorWidget *widget)
|
|||||||
"Would you like to try to find one?"),
|
"Would you like to try to find one?"),
|
||||||
InfoBarEntry::GlobalSuppressionEnabled);
|
InfoBarEntry::GlobalSuppressionEnabled);
|
||||||
info.setCustomButtonInfo(BaseTextEditor::tr("Show Highlighter Options..."), [widget]() {
|
info.setCustomButtonInfo(BaseTextEditor::tr("Show Highlighter Options..."), [widget]() {
|
||||||
ICore::showOptionsDialog(Constants::TEXT_EDITOR_SETTINGS_CATEGORY,
|
ICore::showOptionsDialog(Constants::TEXT_EDITOR_HIGHLIGHTER_SETTINGS, widget);
|
||||||
Constants::TEXT_EDITOR_HIGHLIGHTER_SETTINGS,
|
|
||||||
widget);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
infoBar->addInfo(info);
|
infoBar->addInfo(info);
|
||||||
|
@@ -174,7 +174,7 @@ bool VcsConfigurationPage::isComplete() const
|
|||||||
|
|
||||||
void VcsConfigurationPage::openConfiguration()
|
void VcsConfigurationPage::openConfiguration()
|
||||||
{
|
{
|
||||||
ICore::showOptionsDialog(Constants::VCS_SETTINGS_CATEGORY, d->m_versionControl->id(), this);
|
ICore::showOptionsDialog(d->m_versionControl->id(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace VcsBase
|
} // namespace VcsBase
|
||||||
|
Reference in New Issue
Block a user