forked from qt-creator/qt-creator
Split general settings page in two
It was too crowded to add anything to it. Split it into "interface" and "system" related pages. Change-Id: I2aa7984de4d672ca000e991b0cfb32a3f706c988 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -232,10 +232,11 @@ const char WIZARD_KIND_FILE[] = "file";
|
|||||||
const char SETTINGS_CATEGORY_CORE[] = "A.Core";
|
const char SETTINGS_CATEGORY_CORE[] = "A.Core";
|
||||||
const char SETTINGS_CATEGORY_CORE_ICON[] = ":/core/images/category_core.png";
|
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_TR_CATEGORY_CORE[] = QT_TRANSLATE_NOOP("Core", "Environment");
|
||||||
const char SETTINGS_ID_ENVIRONMENT[] = "A.General";
|
const char SETTINGS_ID_INTERFACE[] = "A.Interface";
|
||||||
const char SETTINGS_ID_SHORTCUTS[] = "B.Keyboard";
|
const char SETTINGS_ID_SYSTEM[] = "B.Core.System";
|
||||||
const char SETTINGS_ID_TOOLS[] = "C.ExternalTools";
|
const char SETTINGS_ID_SHORTCUTS[] = "C.Keyboard";
|
||||||
const char SETTINGS_ID_MIMETYPES[] = "D.MimeTypes";
|
const char SETTINGS_ID_TOOLS[] = "D.ExternalTools";
|
||||||
|
const char SETTINGS_ID_MIMETYPES[] = "E.MimeTypes";
|
||||||
|
|
||||||
const char SETTINGS_DEFAULTTEXTENCODING[] = "General/DefaultFileEncoding";
|
const char SETTINGS_DEFAULTTEXTENCODING[] = "General/DefaultFileEncoding";
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ SOURCES += corejsextensions.cpp \
|
|||||||
themeeditor/themesettingsitemdelegate.cpp \
|
themeeditor/themesettingsitemdelegate.cpp \
|
||||||
messagebox.cpp \
|
messagebox.cpp \
|
||||||
iwelcomepage.cpp \
|
iwelcomepage.cpp \
|
||||||
externaltoolmanager.cpp
|
externaltoolmanager.cpp \
|
||||||
|
systemsettings.cpp
|
||||||
|
|
||||||
HEADERS += corejsextensions.h \
|
HEADERS += corejsextensions.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
@@ -234,7 +235,8 @@ HEADERS += corejsextensions.h \
|
|||||||
themeeditor/sectionedtablemodel.h \
|
themeeditor/sectionedtablemodel.h \
|
||||||
themeeditor/themesettingsitemdelegate.h \
|
themeeditor/themesettingsitemdelegate.h \
|
||||||
messagebox.h \
|
messagebox.h \
|
||||||
iwelcomepage.h
|
iwelcomepage.h \
|
||||||
|
systemsettings.h
|
||||||
|
|
||||||
FORMS += dialogs/newdialog.ui \
|
FORMS += dialogs/newdialog.ui \
|
||||||
dialogs/saveitemsdialog.ui \
|
dialogs/saveitemsdialog.ui \
|
||||||
@@ -247,7 +249,8 @@ FORMS += dialogs/newdialog.ui \
|
|||||||
mimetypemagicdialog.ui \
|
mimetypemagicdialog.ui \
|
||||||
removefiledialog.ui \
|
removefiledialog.ui \
|
||||||
dialogs/addtovcsdialog.ui \
|
dialogs/addtovcsdialog.ui \
|
||||||
themeeditor/themeeditorwidget.ui
|
themeeditor/themeeditorwidget.ui \
|
||||||
|
systemsettings.ui
|
||||||
|
|
||||||
RESOURCES += core.qrc \
|
RESOURCES += core.qrc \
|
||||||
fancyactionbar.qrc
|
fancyactionbar.qrc
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ QtcPlugin {
|
|||||||
"statusbarmanager.cpp", "statusbarmanager.h",
|
"statusbarmanager.cpp", "statusbarmanager.h",
|
||||||
"statusbarwidget.cpp", "statusbarwidget.h",
|
"statusbarwidget.cpp", "statusbarwidget.h",
|
||||||
"styleanimator.cpp", "styleanimator.h",
|
"styleanimator.cpp", "styleanimator.h",
|
||||||
|
"systemsettings.cpp", "systemsettings.h", "systemsettings.ui",
|
||||||
"tabpositionindicator.cpp", "tabpositionindicator.h",
|
"tabpositionindicator.cpp", "tabpositionindicator.h",
|
||||||
"textdocument.cpp", "textdocument.h",
|
"textdocument.cpp", "textdocument.h",
|
||||||
"themesettings.cpp", "themesettings.h", "themesettings.ui",
|
"themesettings.cpp", "themesettings.h", "themesettings.ui",
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ static void showGraphicalShellError(QWidget *parent, const QString &app, const Q
|
|||||||
QMessageBox::ActionRole);
|
QMessageBox::ActionRole);
|
||||||
mbox.exec();
|
mbox.exec();
|
||||||
if (mbox.clickedButton() == settingsButton)
|
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)
|
void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
|
||||||
|
|||||||
@@ -32,23 +32,15 @@
|
|||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
#include "icore.h"
|
#include "icore.h"
|
||||||
#include "infobar.h"
|
#include "infobar.h"
|
||||||
#include "patchtool.h"
|
|
||||||
#include "vcsmanager.h"
|
|
||||||
#include "editormanager/editormanager_p.h"
|
|
||||||
|
|
||||||
#include <utils/checkablemessagebox.h>
|
#include <utils/checkablemessagebox.h>
|
||||||
#include <utils/consoleprocess.h>
|
|
||||||
#include <utils/environment.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/unixutils.h>
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTextStream>
|
|
||||||
|
|
||||||
#include "ui_generalsettings.h"
|
#include "ui_generalsettings.h"
|
||||||
|
|
||||||
@@ -60,8 +52,8 @@ namespace Internal {
|
|||||||
GeneralSettings::GeneralSettings()
|
GeneralSettings::GeneralSettings()
|
||||||
: m_page(0), m_dialog(0)
|
: m_page(0), m_dialog(0)
|
||||||
{
|
{
|
||||||
setId(Constants::SETTINGS_ID_ENVIRONMENT);
|
setId(Constants::SETTINGS_ID_INTERFACE);
|
||||||
setDisplayName(tr("General"));
|
setDisplayName(tr("Interface"));
|
||||||
setCategory(Constants::SETTINGS_CATEGORY_CORE);
|
setCategory(Constants::SETTINGS_CATEGORY_CORE);
|
||||||
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
|
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
|
||||||
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
|
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
|
||||||
@@ -114,58 +106,12 @@ QWidget *GeneralSettings::widget()
|
|||||||
fillLanguageBox();
|
fillLanguageBox();
|
||||||
|
|
||||||
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
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());
|
m_page->resetWarningsButton->setEnabled(canResetWarnings());
|
||||||
|
|
||||||
connect(m_page->resetColorButton, SIGNAL(clicked()),
|
connect(m_page->resetColorButton, SIGNAL(clicked()),
|
||||||
this, SLOT(resetInterfaceColor()));
|
this, SLOT(resetInterfaceColor()));
|
||||||
connect(m_page->resetWarningsButton, SIGNAL(clicked()),
|
connect(m_page->resetWarningsButton, SIGNAL(clicked()),
|
||||||
this, SLOT(resetWarnings()));
|
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;
|
return m_widget;
|
||||||
}
|
}
|
||||||
@@ -178,21 +124,6 @@ void GeneralSettings::apply()
|
|||||||
setLanguage(m_page->languageBox->itemData(currentIndex, Qt::UserRole).toString());
|
setLanguage(m_page->languageBox->itemData(currentIndex, Qt::UserRole).toString());
|
||||||
// Apply the new base color if accepted
|
// Apply the new base color if accepted
|
||||||
StyleHelper::setBaseColor(m_page->colorButton->color());
|
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();
|
m_page->themeWidget->apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,59 +146,12 @@ void GeneralSettings::resetWarnings()
|
|||||||
m_page->resetWarningsButton->setEnabled(false);
|
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
|
bool GeneralSettings::canResetWarnings() const
|
||||||
{
|
{
|
||||||
return InfoBar::anyGloballySuppressed()
|
return InfoBar::anyGloballySuppressed()
|
||||||
|| CheckableMessageBox::hasSuppressedQuestions(ICore::settings());
|
|| 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()
|
void GeneralSettings::resetLanguage()
|
||||||
{
|
{
|
||||||
// system language is default
|
// system language is default
|
||||||
|
|||||||
@@ -58,14 +58,9 @@ private slots:
|
|||||||
void resetInterfaceColor();
|
void resetInterfaceColor();
|
||||||
void resetWarnings();
|
void resetWarnings();
|
||||||
void resetLanguage();
|
void resetLanguage();
|
||||||
void showHelpForFileBrowser();
|
|
||||||
void resetFileBrowser();
|
|
||||||
void resetTerminal();
|
|
||||||
void updatePath();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool canResetWarnings() const;
|
bool canResetWarnings() const;
|
||||||
void variableHelpDialogCreator(const QString &helpText);
|
|
||||||
void fillLanguageBox() const;
|
void fillLanguageBox() const;
|
||||||
QString language() const;
|
QString language() const;
|
||||||
void setLanguage(const QString&);
|
void setLanguage(const QString&);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>527</width>
|
<width>527</width>
|
||||||
<height>366</height>
|
<height>469</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@@ -22,9 +22,6 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Color:</string>
|
<string>Color:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
|
||||||
<cstring>colorButton</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
@@ -130,232 +127,6 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="systemBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>System</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="terminalLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Terminal:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="terminalComboBox">
|
|
||||||
<property name="editable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QPushButton" name="resetTerminalButton">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string comment="Terminal">Reset to default.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="externalFileBrowserLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>External file browser:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="externalFileBrowserEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QPushButton" name="resetFileBrowserButton">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string comment="File Browser">Reset to default.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="3">
|
|
||||||
<widget class="QToolButton" name="helpExternalFileBrowserButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>?</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="core.qrc">
|
|
||||||
<normaloff>:/core/images/help.png</normaloff>:/core/images/help.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="patchCommandLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Patch command:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" colspan="2">
|
|
||||||
<widget class="Utils::PathChooser" name="patchChooser" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="4">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="modifiedLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>When files are externally modified:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="reloadBehavior">
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Always Ask</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reload All Unchanged Editors</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Ignore Modifications</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="4">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="autoSaveCheckBox">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>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.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Auto-save modified files</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_6">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="autoSaveIntervalLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Interval:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="autoSaveInterval">
|
|
||||||
<property name="suffix">
|
|
||||||
<string extracomment="unit for minutes">min</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0" colspan="4">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="warnBeforeOpeningBigFiles">
|
|
||||||
<property name="text">
|
|
||||||
<string>Warn before opening text files greater than</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="bigFilesLimitSpinBox">
|
|
||||||
<property name="suffix">
|
|
||||||
<string>MB</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>500</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_4">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@@ -377,16 +148,6 @@
|
|||||||
<extends>QToolButton</extends>
|
<extends>QToolButton</extends>
|
||||||
<header location="global">utils/qtcolorbutton.h</header>
|
<header location="global">utils/qtcolorbutton.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>Utils::PathChooser</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">utils/pathchooser.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
<slots>
|
|
||||||
<signal>editingFinished()</signal>
|
|
||||||
<signal>browsingFinished()</signal>
|
|
||||||
</slots>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Core::Internal::ThemeSettingsWidget</class>
|
<class>Core::Internal::ThemeSettingsWidget</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
@@ -394,41 +155,6 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="core.qrc"/>
|
<connections/>
|
||||||
</resources>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>autoSaveCheckBox</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>autoSaveInterval</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>181</x>
|
|
||||||
<y>310</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>340</x>
|
|
||||||
<y>311</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>warnBeforeOpeningBigFiles</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>bigFilesLimitSpinBox</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>124</x>
|
|
||||||
<y>330</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>305</x>
|
|
||||||
<y>332</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
#include "rightpane.h"
|
#include "rightpane.h"
|
||||||
#include "editormanager/ieditorfactory.h"
|
#include "editormanager/ieditorfactory.h"
|
||||||
#include "statusbarwidget.h"
|
#include "statusbarwidget.h"
|
||||||
|
#include "systemsettings.h"
|
||||||
#include "externaltoolmanager.h"
|
#include "externaltoolmanager.h"
|
||||||
#include "editormanager/systemeditor.h"
|
#include "editormanager/systemeditor.h"
|
||||||
#include "windowsupport.h"
|
#include "windowsupport.h"
|
||||||
@@ -130,6 +131,7 @@ MainWindow::MainWindow() :
|
|||||||
m_rightPaneWidget(0),
|
m_rightPaneWidget(0),
|
||||||
m_versionDialog(0),
|
m_versionDialog(0),
|
||||||
m_generalSettings(new GeneralSettings),
|
m_generalSettings(new GeneralSettings),
|
||||||
|
m_systemSettings(new SystemSettings),
|
||||||
m_shortcutSettings(new ShortcutSettings),
|
m_shortcutSettings(new ShortcutSettings),
|
||||||
m_toolSettings(new ToolSettings),
|
m_toolSettings(new ToolSettings),
|
||||||
m_mimeTypeSettings(new MimeTypeSettings),
|
m_mimeTypeSettings(new MimeTypeSettings),
|
||||||
@@ -246,6 +248,7 @@ MainWindow::~MainWindow()
|
|||||||
|
|
||||||
PluginManager::removeObject(m_shortcutSettings);
|
PluginManager::removeObject(m_shortcutSettings);
|
||||||
PluginManager::removeObject(m_generalSettings);
|
PluginManager::removeObject(m_generalSettings);
|
||||||
|
PluginManager::removeObject(m_systemSettings);
|
||||||
PluginManager::removeObject(m_toolSettings);
|
PluginManager::removeObject(m_toolSettings);
|
||||||
PluginManager::removeObject(m_mimeTypeSettings);
|
PluginManager::removeObject(m_mimeTypeSettings);
|
||||||
PluginManager::removeObject(m_systemEditor);
|
PluginManager::removeObject(m_systemEditor);
|
||||||
@@ -257,6 +260,8 @@ MainWindow::~MainWindow()
|
|||||||
m_shortcutSettings = 0;
|
m_shortcutSettings = 0;
|
||||||
delete m_generalSettings;
|
delete m_generalSettings;
|
||||||
m_generalSettings = 0;
|
m_generalSettings = 0;
|
||||||
|
delete m_systemSettings;
|
||||||
|
m_systemSettings = 0;
|
||||||
delete m_toolSettings;
|
delete m_toolSettings;
|
||||||
m_toolSettings = 0;
|
m_toolSettings = 0;
|
||||||
delete m_mimeTypeSettings;
|
delete m_mimeTypeSettings;
|
||||||
@@ -309,6 +314,7 @@ bool MainWindow::init(QString *errorMessage)
|
|||||||
m_progressManager->init(); // needs the status bar manager
|
m_progressManager->init(); // needs the status bar manager
|
||||||
|
|
||||||
PluginManager::addObject(m_generalSettings);
|
PluginManager::addObject(m_generalSettings);
|
||||||
|
PluginManager::addObject(m_systemSettings);
|
||||||
PluginManager::addObject(m_shortcutSettings);
|
PluginManager::addObject(m_shortcutSettings);
|
||||||
PluginManager::addObject(m_toolSettings);
|
PluginManager::addObject(m_toolSettings);
|
||||||
PluginManager::addObject(m_mimeTypeSettings);
|
PluginManager::addObject(m_mimeTypeSettings);
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class StatusBarManager;
|
|||||||
class VersionDialog;
|
class VersionDialog;
|
||||||
class WindowSupport;
|
class WindowSupport;
|
||||||
class SystemEditor;
|
class SystemEditor;
|
||||||
|
class SystemSettings;
|
||||||
|
|
||||||
class MainWindow : public Utils::AppMainWindow
|
class MainWindow : public Utils::AppMainWindow
|
||||||
{
|
{
|
||||||
@@ -174,6 +175,7 @@ private:
|
|||||||
QMap<QWidget *, IContext *> m_contextWidgets;
|
QMap<QWidget *, IContext *> m_contextWidgets;
|
||||||
|
|
||||||
GeneralSettings *m_generalSettings;
|
GeneralSettings *m_generalSettings;
|
||||||
|
SystemSettings *m_systemSettings;
|
||||||
ShortcutSettings *m_shortcutSettings;
|
ShortcutSettings *m_shortcutSettings;
|
||||||
ToolSettings *m_toolSettings;
|
ToolSettings *m_toolSettings;
|
||||||
MimeTypeSettings *m_mimeTypeSettings;
|
MimeTypeSettings *m_mimeTypeSettings;
|
||||||
|
|||||||
199
src/plugins/coreplugin/systemsettings.cpp
Normal file
199
src/plugins/coreplugin/systemsettings.cpp
Normal file
@@ -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 <utils/checkablemessagebox.h>
|
||||||
|
#include <utils/consoleprocess.h>
|
||||||
|
#include <utils/environment.h>
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/unixutils.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
|
#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
|
||||||
73
src/plugins/coreplugin/systemsettings.h
Normal file
73
src/plugins/coreplugin/systemsettings.h
Normal file
@@ -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 <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
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<QMessageBox> m_dialog;
|
||||||
|
QPointer<QWidget> m_widget;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Core
|
||||||
|
|
||||||
|
#endif // SYSTEMSETTINGS_H
|
||||||
271
src/plugins/coreplugin/systemsettings.ui
Normal file
271
src/plugins/coreplugin/systemsettings.ui
Normal file
@@ -0,0 +1,271 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Core::Internal::SystemSettings</class>
|
||||||
|
<widget class="QWidget" name="Core::Internal::SystemSettings">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>527</width>
|
||||||
|
<height>469</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="systemBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>System</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="terminalLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Terminal:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="terminalComboBox">
|
||||||
|
<property name="editable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="resetTerminalButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string comment="Terminal">Reset to default.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="externalFileBrowserLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>External file browser:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="externalFileBrowserEdit"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QPushButton" name="resetFileBrowserButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string comment="File Browser">Reset to default.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QToolButton" name="helpExternalFileBrowserButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>?</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="core.qrc">
|
||||||
|
<normaloff>:/core/images/help.png</normaloff>:/core/images/help.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="patchCommandLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Patch command:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1" colspan="2">
|
||||||
|
<widget class="Utils::PathChooser" name="patchChooser" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="4">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="modifiedLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>When files are externally modified:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="reloadBehavior">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Always Ask</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reload All Unchanged Editors</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore Modifications</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="4">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="autoSaveCheckBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>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.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto-save modified files</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_6">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="autoSaveIntervalLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Interval:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="autoSaveInterval">
|
||||||
|
<property name="suffix">
|
||||||
|
<string extracomment="unit for minutes">min</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" colspan="4">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="warnBeforeOpeningBigFiles">
|
||||||
|
<property name="text">
|
||||||
|
<string>Warn before opening text files greater than</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="bigFilesLimitSpinBox">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>MB</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>500</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>Utils::PathChooser</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header location="global">utils/pathchooser.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
<slots>
|
||||||
|
<signal>editingFinished()</signal>
|
||||||
|
<signal>browsingFinished()</signal>
|
||||||
|
</slots>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources>
|
||||||
|
<include location="core.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -40,7 +40,7 @@ namespace Internal {
|
|||||||
ThemeSettings::ThemeSettings() :
|
ThemeSettings::ThemeSettings() :
|
||||||
m_widget(0)
|
m_widget(0)
|
||||||
{
|
{
|
||||||
setId(Constants::SETTINGS_ID_ENVIRONMENT);
|
setId(Constants::SETTINGS_ID_INTERFACE);
|
||||||
setDisplayName(tr("Theme"));
|
setDisplayName(tr("Theme"));
|
||||||
setCategory(Constants::SETTINGS_CATEGORY_CORE);
|
setCategory(Constants::SETTINGS_CATEGORY_CORE);
|
||||||
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
|
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
|
||||||
|
|||||||
Reference in New Issue
Block a user