diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index 73544db89a2..499e77854e1 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -232,10 +232,11 @@ const char WIZARD_KIND_FILE[] = "file"; const char SETTINGS_CATEGORY_CORE[] = "A.Core"; const char SETTINGS_CATEGORY_CORE_ICON[] = ":/core/images/category_core.png"; const char SETTINGS_TR_CATEGORY_CORE[] = QT_TRANSLATE_NOOP("Core", "Environment"); -const char SETTINGS_ID_ENVIRONMENT[] = "A.General"; -const char SETTINGS_ID_SHORTCUTS[] = "B.Keyboard"; -const char SETTINGS_ID_TOOLS[] = "C.ExternalTools"; -const char SETTINGS_ID_MIMETYPES[] = "D.MimeTypes"; +const char SETTINGS_ID_INTERFACE[] = "A.Interface"; +const char SETTINGS_ID_SYSTEM[] = "B.Core.System"; +const char SETTINGS_ID_SHORTCUTS[] = "C.Keyboard"; +const char SETTINGS_ID_TOOLS[] = "D.ExternalTools"; +const char SETTINGS_ID_MIMETYPES[] = "E.MimeTypes"; const char SETTINGS_DEFAULTTEXTENCODING[] = "General/DefaultFileEncoding"; diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index 239b0dc74a0..3cfb51fcb37 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -117,7 +117,8 @@ SOURCES += corejsextensions.cpp \ themeeditor/themesettingsitemdelegate.cpp \ messagebox.cpp \ iwelcomepage.cpp \ - externaltoolmanager.cpp + externaltoolmanager.cpp \ + systemsettings.cpp HEADERS += corejsextensions.h \ mainwindow.h \ @@ -234,7 +235,8 @@ HEADERS += corejsextensions.h \ themeeditor/sectionedtablemodel.h \ themeeditor/themesettingsitemdelegate.h \ messagebox.h \ - iwelcomepage.h + iwelcomepage.h \ + systemsettings.h FORMS += dialogs/newdialog.ui \ dialogs/saveitemsdialog.ui \ @@ -247,7 +249,8 @@ FORMS += dialogs/newdialog.ui \ mimetypemagicdialog.ui \ removefiledialog.ui \ dialogs/addtovcsdialog.ui \ - themeeditor/themeeditorwidget.ui + themeeditor/themeeditorwidget.ui \ + systemsettings.ui RESOURCES += core.qrc \ fancyactionbar.qrc diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index d2873702f19..1cdf4f15200 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -97,6 +97,7 @@ QtcPlugin { "statusbarmanager.cpp", "statusbarmanager.h", "statusbarwidget.cpp", "statusbarwidget.h", "styleanimator.cpp", "styleanimator.h", + "systemsettings.cpp", "systemsettings.h", "systemsettings.ui", "tabpositionindicator.cpp", "tabpositionindicator.h", "textdocument.cpp", "textdocument.h", "themesettings.cpp", "themesettings.h", "themesettings.ui", diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp index 28f66b50d4c..ac75fe5eeaa 100644 --- a/src/plugins/coreplugin/fileutils.cpp +++ b/src/plugins/coreplugin/fileutils.cpp @@ -67,7 +67,7 @@ static void showGraphicalShellError(QWidget *parent, const QString &app, const Q QMessageBox::ActionRole); mbox.exec(); if (mbox.clickedButton() == settingsButton) - ICore::showOptionsDialog(Constants::SETTINGS_ID_ENVIRONMENT, parent); + ICore::showOptionsDialog(Constants::SETTINGS_ID_INTERFACE, parent); } void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn) diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index c8f0df54f85..0106628d444 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -32,23 +32,15 @@ #include "coreconstants.h" #include "icore.h" #include "infobar.h" -#include "patchtool.h" -#include "vcsmanager.h" -#include "editormanager/editormanager_p.h" #include -#include -#include -#include #include -#include #include #include #include #include #include -#include #include "ui_generalsettings.h" @@ -60,8 +52,8 @@ namespace Internal { GeneralSettings::GeneralSettings() : m_page(0), m_dialog(0) { - setId(Constants::SETTINGS_ID_ENVIRONMENT); - setDisplayName(tr("General")); + setId(Constants::SETTINGS_ID_INTERFACE); + setDisplayName(tr("Interface")); setCategory(Constants::SETTINGS_CATEGORY_CORE); setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE)); setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON)); @@ -114,58 +106,12 @@ QWidget *GeneralSettings::widget() fillLanguageBox(); m_page->colorButton->setColor(StyleHelper::requestedBaseColor()); - m_page->reloadBehavior->setCurrentIndex(EditorManager::reloadSetting()); - if (HostOsInfo::isAnyUnixHost()) { - const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators(); - const QString currentTerminal = ConsoleProcess::terminalEmulator(ICore::settings(), false); - m_page->terminalComboBox->addItems(availableTerminals); - m_page->terminalComboBox->lineEdit()->setText(currentTerminal); - m_page->terminalComboBox->lineEdit()->setPlaceholderText(ConsoleProcess::defaultTerminalEmulator()); - } else { - m_page->terminalLabel->hide(); - m_page->terminalComboBox->hide(); - m_page->resetTerminalButton->hide(); - } - - if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) { - m_page->externalFileBrowserEdit->setText(UnixUtils::fileBrowser(ICore::settings())); - } else { - m_page->externalFileBrowserLabel->hide(); - m_page->externalFileBrowserEdit->hide(); - m_page->resetFileBrowserButton->hide(); - m_page->helpExternalFileBrowserButton->hide(); - } - - const QString patchToolTip = tr("Command used for reverting diff chunks."); - m_page->patchCommandLabel->setToolTip(patchToolTip); - m_page->patchChooser->setToolTip(patchToolTip); - m_page->patchChooser->setExpectedKind(PathChooser::ExistingCommand); - m_page->patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History")); - m_page->patchChooser->setPath(PatchTool::patchCommand()); - m_page->autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled()); - m_page->autoSaveInterval->setValue(EditorManagerPrivate::autoSaveInterval()); - m_page->warnBeforeOpeningBigFiles->setChecked( - EditorManagerPrivate::warnBeforeOpeningBigFilesEnabled()); - m_page->bigFilesLimitSpinBox->setValue(EditorManagerPrivate::bigFileSizeLimit()); m_page->resetWarningsButton->setEnabled(canResetWarnings()); connect(m_page->resetColorButton, SIGNAL(clicked()), this, SLOT(resetInterfaceColor())); connect(m_page->resetWarningsButton, SIGNAL(clicked()), this, SLOT(resetWarnings())); - if (HostOsInfo::isAnyUnixHost()) { - connect(m_page->resetTerminalButton, SIGNAL(clicked()), this, SLOT(resetTerminal())); - if (!HostOsInfo::isMacHost()) { - connect(m_page->resetFileBrowserButton, SIGNAL(clicked()), this, SLOT(resetFileBrowser())); - connect(m_page->helpExternalFileBrowserButton, SIGNAL(clicked()), - this, SLOT(showHelpForFileBrowser())); - } - } - - updatePath(); - - connect(VcsManager::instance(), SIGNAL(configurationChanged(const IVersionControl*)), - this, SLOT(updatePath())); } return m_widget; } @@ -178,21 +124,6 @@ void GeneralSettings::apply() setLanguage(m_page->languageBox->itemData(currentIndex, Qt::UserRole).toString()); // Apply the new base color if accepted StyleHelper::setBaseColor(m_page->colorButton->color()); - EditorManager::setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex())); - if (HostOsInfo::isAnyUnixHost()) { - ConsoleProcess::setTerminalEmulator(ICore::settings(), - m_page->terminalComboBox->lineEdit()->text()); - if (!HostOsInfo::isMacHost()) { - UnixUtils::setFileBrowser(ICore::settings(), - m_page->externalFileBrowserEdit->text()); - } - } - PatchTool::setPatchCommand(m_page->patchChooser->path()); - EditorManagerPrivate::setAutoSaveEnabled(m_page->autoSaveCheckBox->isChecked()); - EditorManagerPrivate::setAutoSaveInterval(m_page->autoSaveInterval->value()); - EditorManagerPrivate::setWarnBeforeOpeningBigFilesEnabled( - m_page->warnBeforeOpeningBigFiles->isChecked()); - EditorManagerPrivate::setBigFileSizeLimit(m_page->bigFilesLimitSpinBox->value()); m_page->themeWidget->apply(); } @@ -215,59 +146,12 @@ void GeneralSettings::resetWarnings() m_page->resetWarningsButton->setEnabled(false); } -void GeneralSettings::resetTerminal() -{ - if (HostOsInfo::isAnyUnixHost()) - m_page->terminalComboBox->lineEdit()->clear(); -} - -void GeneralSettings::resetFileBrowser() -{ - if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) - m_page->externalFileBrowserEdit->setText(UnixUtils::defaultFileBrowser()); -} - -void GeneralSettings::updatePath() -{ - Environment env = Environment::systemEnvironment(); - QStringList toAdd = VcsManager::additionalToolsPath(); - env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator())); - m_page->patchChooser->setEnvironment(env); -} - bool GeneralSettings::canResetWarnings() const { return InfoBar::anyGloballySuppressed() || CheckableMessageBox::hasSuppressedQuestions(ICore::settings()); } -void GeneralSettings::variableHelpDialogCreator(const QString &helpText) -{ - if (m_dialog) { - if (m_dialog->text() != helpText) - m_dialog->setText(helpText); - - m_dialog->show(); - ICore::raiseWindow(m_dialog); - return; - } - QMessageBox *mb = new QMessageBox(QMessageBox::Information, - tr("Variables"), - helpText, - QMessageBox::Close, - m_widget); - mb->setWindowModality(Qt::NonModal); - m_dialog = mb; - mb->show(); -} - - -void GeneralSettings::showHelpForFileBrowser() -{ - if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) - variableHelpDialogCreator(UnixUtils::fileBrowserHelpText()); -} - void GeneralSettings::resetLanguage() { // system language is default diff --git a/src/plugins/coreplugin/generalsettings.h b/src/plugins/coreplugin/generalsettings.h index 1ac4f456d2e..1cda4e6e4c2 100644 --- a/src/plugins/coreplugin/generalsettings.h +++ b/src/plugins/coreplugin/generalsettings.h @@ -58,14 +58,9 @@ private slots: void resetInterfaceColor(); void resetWarnings(); void resetLanguage(); - void showHelpForFileBrowser(); - void resetFileBrowser(); - void resetTerminal(); - void updatePath(); private: bool canResetWarnings() const; - void variableHelpDialogCreator(const QString &helpText); void fillLanguageBox() const; QString language() const; void setLanguage(const QString&); diff --git a/src/plugins/coreplugin/generalsettings.ui b/src/plugins/coreplugin/generalsettings.ui index d7fabd91600..ad28b9c5d5c 100644 --- a/src/plugins/coreplugin/generalsettings.ui +++ b/src/plugins/coreplugin/generalsettings.ui @@ -7,7 +7,7 @@ 0 0 527 - 366 + 469 @@ -22,9 +22,6 @@ Color: - - colorButton - @@ -130,232 +127,6 @@ - - - - System - - - - - - Terminal: - - - - - - - true - - - - - - - Reset to default. - - - Reset - - - - - - - External file browser: - - - - - - - - - - Reset to default. - - - Reset - - - - - - - ? - - - - :/core/images/help.png:/core/images/help.png - - - - - - - Patch command: - - - - - - - - - - - - When files are externally modified: - - - - - - - 0 - - - - Always Ask - - - - - Reload All Unchanged Editors - - - - - Ignore Modifications - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Automatically creates temporary copies of modified files. If Qt Creator is restarted after a crash or power failure, it asks whether to recover the auto-saved content. - - - Auto-save modified files - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Interval: - - - - - - - min - - - 1 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Warn before opening text files greater than - - - true - - - - - - - MB - - - 1 - - - 500 - - - 5 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - @@ -377,16 +148,6 @@ QToolButton
utils/qtcolorbutton.h
- - Utils::PathChooser - QWidget -
utils/pathchooser.h
- 1 - - editingFinished() - browsingFinished() - -
Core::Internal::ThemeSettingsWidget QWidget @@ -394,41 +155,6 @@ 1 - - - - - - autoSaveCheckBox - toggled(bool) - autoSaveInterval - setEnabled(bool) - - - 181 - 310 - - - 340 - 311 - - - - - warnBeforeOpeningBigFiles - toggled(bool) - bigFilesLimitSpinBox - setEnabled(bool) - - - 124 - 330 - - - 305 - 332 - - - - + + diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 15d094bbfbe..57026c1382a 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -53,6 +53,7 @@ #include "rightpane.h" #include "editormanager/ieditorfactory.h" #include "statusbarwidget.h" +#include "systemsettings.h" #include "externaltoolmanager.h" #include "editormanager/systemeditor.h" #include "windowsupport.h" @@ -130,6 +131,7 @@ MainWindow::MainWindow() : m_rightPaneWidget(0), m_versionDialog(0), m_generalSettings(new GeneralSettings), + m_systemSettings(new SystemSettings), m_shortcutSettings(new ShortcutSettings), m_toolSettings(new ToolSettings), m_mimeTypeSettings(new MimeTypeSettings), @@ -246,6 +248,7 @@ MainWindow::~MainWindow() PluginManager::removeObject(m_shortcutSettings); PluginManager::removeObject(m_generalSettings); + PluginManager::removeObject(m_systemSettings); PluginManager::removeObject(m_toolSettings); PluginManager::removeObject(m_mimeTypeSettings); PluginManager::removeObject(m_systemEditor); @@ -257,6 +260,8 @@ MainWindow::~MainWindow() m_shortcutSettings = 0; delete m_generalSettings; m_generalSettings = 0; + delete m_systemSettings; + m_systemSettings = 0; delete m_toolSettings; m_toolSettings = 0; delete m_mimeTypeSettings; @@ -309,6 +314,7 @@ bool MainWindow::init(QString *errorMessage) m_progressManager->init(); // needs the status bar manager PluginManager::addObject(m_generalSettings); + PluginManager::addObject(m_systemSettings); PluginManager::addObject(m_shortcutSettings); PluginManager::addObject(m_toolSettings); PluginManager::addObject(m_mimeTypeSettings); diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 558c1636acf..b931f2652c1 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -76,6 +76,7 @@ class StatusBarManager; class VersionDialog; class WindowSupport; class SystemEditor; +class SystemSettings; class MainWindow : public Utils::AppMainWindow { @@ -174,6 +175,7 @@ private: QMap m_contextWidgets; GeneralSettings *m_generalSettings; + SystemSettings *m_systemSettings; ShortcutSettings *m_shortcutSettings; ToolSettings *m_toolSettings; MimeTypeSettings *m_mimeTypeSettings; diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp new file mode 100644 index 00000000000..f7b30f134b2 --- /dev/null +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "systemsettings.h" +#include "coreconstants.h" +#include "editormanager/editormanager_p.h" +#include "icore.h" +#include "patchtool.h" +#include "vcsmanager.h" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ui_systemsettings.h" + +using namespace Utils; + +namespace Core { +namespace Internal { + +SystemSettings::SystemSettings() + : m_page(0), m_dialog(0) +{ + setId(Constants::SETTINGS_ID_SYSTEM); + setDisplayName(tr("System")); + setCategory(Constants::SETTINGS_CATEGORY_CORE); + setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE)); + setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON)); +} + +QWidget *SystemSettings::widget() +{ + if (!m_widget) { + m_page = new Ui::SystemSettings(); + m_widget = new QWidget; + m_page->setupUi(m_widget); + + m_page->reloadBehavior->setCurrentIndex(EditorManager::reloadSetting()); + if (HostOsInfo::isAnyUnixHost()) { + const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators(); + const QString currentTerminal = ConsoleProcess::terminalEmulator(ICore::settings(), false); + m_page->terminalComboBox->addItems(availableTerminals); + m_page->terminalComboBox->lineEdit()->setText(currentTerminal); + m_page->terminalComboBox->lineEdit()->setPlaceholderText(ConsoleProcess::defaultTerminalEmulator()); + } else { + m_page->terminalLabel->hide(); + m_page->terminalComboBox->hide(); + m_page->resetTerminalButton->hide(); + } + + if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) { + m_page->externalFileBrowserEdit->setText(UnixUtils::fileBrowser(ICore::settings())); + } else { + m_page->externalFileBrowserLabel->hide(); + m_page->externalFileBrowserEdit->hide(); + m_page->resetFileBrowserButton->hide(); + m_page->helpExternalFileBrowserButton->hide(); + } + + const QString patchToolTip = tr("Command used for reverting diff chunks."); + m_page->patchCommandLabel->setToolTip(patchToolTip); + m_page->patchChooser->setToolTip(patchToolTip); + m_page->patchChooser->setExpectedKind(PathChooser::ExistingCommand); + m_page->patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History")); + m_page->patchChooser->setPath(PatchTool::patchCommand()); + m_page->autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled()); + m_page->autoSaveInterval->setValue(EditorManagerPrivate::autoSaveInterval()); + m_page->warnBeforeOpeningBigFiles->setChecked( + EditorManagerPrivate::warnBeforeOpeningBigFilesEnabled()); + m_page->bigFilesLimitSpinBox->setValue(EditorManagerPrivate::bigFileSizeLimit()); + + if (HostOsInfo::isAnyUnixHost()) { + connect(m_page->resetTerminalButton, SIGNAL(clicked()), this, SLOT(resetTerminal())); + if (!HostOsInfo::isMacHost()) { + connect(m_page->resetFileBrowserButton, SIGNAL(clicked()), this, SLOT(resetFileBrowser())); + connect(m_page->helpExternalFileBrowserButton, SIGNAL(clicked()), + this, SLOT(showHelpForFileBrowser())); + } + } + + updatePath(); + + connect(VcsManager::instance(), SIGNAL(configurationChanged(const IVersionControl*)), + this, SLOT(updatePath())); + } + return m_widget; +} + +void SystemSettings::apply() +{ + if (!m_page) // wasn't shown, can't be changed + return; + EditorManager::setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex())); + if (HostOsInfo::isAnyUnixHost()) { + ConsoleProcess::setTerminalEmulator(ICore::settings(), + m_page->terminalComboBox->lineEdit()->text()); + if (!HostOsInfo::isMacHost()) { + UnixUtils::setFileBrowser(ICore::settings(), + m_page->externalFileBrowserEdit->text()); + } + } + PatchTool::setPatchCommand(m_page->patchChooser->path()); + EditorManagerPrivate::setAutoSaveEnabled(m_page->autoSaveCheckBox->isChecked()); + EditorManagerPrivate::setAutoSaveInterval(m_page->autoSaveInterval->value()); + EditorManagerPrivate::setWarnBeforeOpeningBigFilesEnabled( + m_page->warnBeforeOpeningBigFiles->isChecked()); + EditorManagerPrivate::setBigFileSizeLimit(m_page->bigFilesLimitSpinBox->value()); +} + +void SystemSettings::finish() +{ + delete m_widget; + delete m_page; + m_page = 0; +} + +void SystemSettings::resetTerminal() +{ + if (HostOsInfo::isAnyUnixHost()) + m_page->terminalComboBox->lineEdit()->clear(); +} + +void SystemSettings::resetFileBrowser() +{ + if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) + m_page->externalFileBrowserEdit->setText(UnixUtils::defaultFileBrowser()); +} + +void SystemSettings::updatePath() +{ + Environment env = Environment::systemEnvironment(); + QStringList toAdd = VcsManager::additionalToolsPath(); + env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator())); + m_page->patchChooser->setEnvironment(env); +} + +void SystemSettings::variableHelpDialogCreator(const QString &helpText) +{ + if (m_dialog) { + if (m_dialog->text() != helpText) + m_dialog->setText(helpText); + + m_dialog->show(); + ICore::raiseWindow(m_dialog); + return; + } + QMessageBox *mb = new QMessageBox(QMessageBox::Information, + tr("Variables"), + helpText, + QMessageBox::Close, + m_widget); + mb->setWindowModality(Qt::NonModal); + m_dialog = mb; + mb->show(); +} + + +void SystemSettings::showHelpForFileBrowser() +{ + if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) + variableHelpDialogCreator(UnixUtils::fileBrowserHelpText()); +} + +} // namespace Internal +} // namespace Core diff --git a/src/plugins/coreplugin/systemsettings.h b/src/plugins/coreplugin/systemsettings.h new file mode 100644 index 00000000000..c9077927bb2 --- /dev/null +++ b/src/plugins/coreplugin/systemsettings.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef SYSTEMSETTINGS_H +#define SYSTEMSETTINGS_H + +#include +#include + +QT_BEGIN_NAMESPACE +class QMessageBox; +QT_END_NAMESPACE + +namespace Core { +namespace Internal { + +namespace Ui { class SystemSettings; } + +class SystemSettings : public IOptionsPage +{ + Q_OBJECT + +public: + SystemSettings(); + + QWidget *widget(); + void apply(); + void finish(); + +private slots: + void showHelpForFileBrowser(); + void resetFileBrowser(); + void resetTerminal(); + void updatePath(); + +private: + void variableHelpDialogCreator(const QString &helpText); + Ui::SystemSettings *m_page; + QPointer m_dialog; + QPointer m_widget; +}; + +} // namespace Internal +} // namespace Core + +#endif // SYSTEMSETTINGS_H diff --git a/src/plugins/coreplugin/systemsettings.ui b/src/plugins/coreplugin/systemsettings.ui new file mode 100644 index 00000000000..945dd7a0128 --- /dev/null +++ b/src/plugins/coreplugin/systemsettings.ui @@ -0,0 +1,271 @@ + + + Core::Internal::SystemSettings + + + + 0 + 0 + 527 + 469 + + + + + + + System + + + + + + Terminal: + + + + + + + true + + + + + + + Reset to default. + + + Reset + + + + + + + External file browser: + + + + + + + + + + Reset to default. + + + Reset + + + + + + + ? + + + + :/core/images/help.png:/core/images/help.png + + + + + + + Patch command: + + + + + + + + + + + + When files are externally modified: + + + + + + + 0 + + + + Always Ask + + + + + Reload All Unchanged Editors + + + + + Ignore Modifications + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Automatically creates temporary copies of modified files. If Qt Creator is restarted after a crash or power failure, it asks whether to recover the auto-saved content. + + + Auto-save modified files + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Interval: + + + + + + + min + + + 1 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Warn before opening text files greater than + + + true + + + + + + + MB + + + 1 + + + 500 + + + 5 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 30 + + + + + + + + + Utils::PathChooser + QWidget +
utils/pathchooser.h
+ 1 + + editingFinished() + browsingFinished() + +
+
+ + + + +
diff --git a/src/plugins/coreplugin/themesettings.cpp b/src/plugins/coreplugin/themesettings.cpp index 8a2ded94780..4bad6936729 100644 --- a/src/plugins/coreplugin/themesettings.cpp +++ b/src/plugins/coreplugin/themesettings.cpp @@ -40,7 +40,7 @@ namespace Internal { ThemeSettings::ThemeSettings() : m_widget(0) { - setId(Constants::SETTINGS_ID_ENVIRONMENT); + setId(Constants::SETTINGS_ID_INTERFACE); setDisplayName(tr("Theme")); setCategory(Constants::SETTINGS_CATEGORY_CORE); setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));