forked from qt-creator/qt-creator
TextEditor: Inline behaviorsettingswidget.ui
Change-Id: I255636d4da8c0282356cfcf307bd6a5a2daaa4fe Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -14,7 +14,7 @@ add_qtc_plugin(TextEditor
|
|||||||
basehoverhandler.cpp basehoverhandler.h
|
basehoverhandler.cpp basehoverhandler.h
|
||||||
behaviorsettings.cpp behaviorsettings.h
|
behaviorsettings.cpp behaviorsettings.h
|
||||||
behaviorsettingspage.cpp behaviorsettingspage.h
|
behaviorsettingspage.cpp behaviorsettingspage.h
|
||||||
behaviorsettingswidget.cpp behaviorsettingswidget.h behaviorsettingswidget.ui
|
behaviorsettingswidget.cpp behaviorsettingswidget.h
|
||||||
blockrange.h
|
blockrange.h
|
||||||
circularclipboard.cpp circularclipboard.h
|
circularclipboard.cpp circularclipboard.h
|
||||||
circularclipboardassist.cpp circularclipboardassist.h
|
circularclipboardassist.cpp circularclipboardassist.h
|
||||||
|
@@ -24,7 +24,6 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "behaviorsettingswidget.h"
|
#include "behaviorsettingswidget.h"
|
||||||
#include "ui_behaviorsettingswidget.h"
|
|
||||||
|
|
||||||
#include "tabsettingswidget.h"
|
#include "tabsettingswidget.h"
|
||||||
|
|
||||||
@@ -35,14 +34,19 @@
|
|||||||
#include <texteditor/storagesettings.h>
|
#include <texteditor/storagesettings.h>
|
||||||
#include <texteditor/behaviorsettings.h>
|
#include <texteditor/behaviorsettings.h>
|
||||||
#include <texteditor/extraencodingsettings.h>
|
#include <texteditor/extraencodingsettings.h>
|
||||||
|
#include <texteditor/simplecodestylepreferenceswidget.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
#include <QList>
|
#include <QApplication>
|
||||||
#include <QString>
|
#include <QCheckBox>
|
||||||
#include <QByteArray>
|
#include <QComboBox>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QTextStream>
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
@@ -50,15 +54,139 @@ namespace TextEditor {
|
|||||||
|
|
||||||
struct BehaviorSettingsWidgetPrivate
|
struct BehaviorSettingsWidgetPrivate
|
||||||
{
|
{
|
||||||
Internal::Ui::BehaviorSettingsWidget m_ui;
|
|
||||||
QList<QTextCodec *> m_codecs;
|
QList<QTextCodec *> m_codecs;
|
||||||
|
|
||||||
|
SimpleCodeStylePreferencesWidget *tabPreferencesWidget;
|
||||||
|
QComboBox *tabKeyBehavior;
|
||||||
|
QComboBox *smartBackspaceBehavior;
|
||||||
|
QCheckBox *autoIndent;
|
||||||
|
QCheckBox *preferSingleLineComments;
|
||||||
|
QGroupBox *groupBoxStorageSettings;
|
||||||
|
QGroupBox *groupBoxTyping;
|
||||||
|
QCheckBox *skipTrailingWhitespace;
|
||||||
|
QLineEdit *ignoreFileTypes;
|
||||||
|
QCheckBox *addFinalNewLine;
|
||||||
|
QCheckBox *cleanWhitespace;
|
||||||
|
QCheckBox *cleanIndentation;
|
||||||
|
QCheckBox *inEntireDocument;
|
||||||
|
QGroupBox *groupBoxEncodings;
|
||||||
|
QComboBox *encodingBox;
|
||||||
|
QComboBox *utf8BomBox;
|
||||||
|
QLabel *defaultLineEndingsLabel;
|
||||||
|
QComboBox *defaultLineEndings;
|
||||||
|
QGroupBox *groupBoxMouse;
|
||||||
|
QCheckBox *mouseHiding;
|
||||||
|
QCheckBox *mouseNavigation;
|
||||||
|
QCheckBox *scrollWheelZooming;
|
||||||
|
QCheckBox *camelCaseNavigation;
|
||||||
|
QCheckBox *smartSelectionChanging;
|
||||||
|
QCheckBox *keyboardTooltips;
|
||||||
|
QComboBox *constrainTooltipsBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, d(new BehaviorSettingsWidgetPrivate)
|
, d(new BehaviorSettingsWidgetPrivate)
|
||||||
{
|
{
|
||||||
d->m_ui.setupUi(this);
|
resize(801, 693);
|
||||||
|
|
||||||
|
d->tabPreferencesWidget = new SimpleCodeStylePreferencesWidget(this);
|
||||||
|
d->tabPreferencesWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); // FIXME: Desirable?
|
||||||
|
|
||||||
|
d->tabKeyBehavior = new QComboBox;
|
||||||
|
d->tabKeyBehavior->addItem(tr("Never"));
|
||||||
|
d->tabKeyBehavior->addItem(tr("Always"));
|
||||||
|
d->tabKeyBehavior->addItem(tr("In Leading White Space"));
|
||||||
|
|
||||||
|
d->smartBackspaceBehavior = new QComboBox;
|
||||||
|
d->smartBackspaceBehavior->addItem(tr("None"));
|
||||||
|
d->smartBackspaceBehavior->addItem(tr("Follows Previous Indents"));
|
||||||
|
d->smartBackspaceBehavior->addItem(tr("Unindents"));
|
||||||
|
d->smartBackspaceBehavior->setToolTip(tr("<html><head/><body>\n"
|
||||||
|
"Specifies how backspace interacts with indentation.\n"
|
||||||
|
"\n"
|
||||||
|
"<ul>\n"
|
||||||
|
"<li>None: No interaction at all. Regular plain backspace behavior.\n"
|
||||||
|
"</li>\n"
|
||||||
|
"\n"
|
||||||
|
"<li>Follows Previous Indents: In leading white space it will take the cursor back to the nearest indentation level used in previous lines.\n"
|
||||||
|
"</li>\n"
|
||||||
|
"\n"
|
||||||
|
"<li>Unindents: If the character behind the cursor is a space it behaves as a backtab.\n"
|
||||||
|
"</li>\n"
|
||||||
|
"</ul></body></html>\n"
|
||||||
|
""));
|
||||||
|
|
||||||
|
d->autoIndent = new QCheckBox(tr("Enable automatic &indentation"));
|
||||||
|
|
||||||
|
d->preferSingleLineComments = new QCheckBox(tr("Prefer single line comments"));
|
||||||
|
|
||||||
|
d->skipTrailingWhitespace = new QCheckBox(tr("Skip clean whitespace for file types:"));
|
||||||
|
d->skipTrailingWhitespace->setToolTip(tr("For the file patterns listed, do not trim trailing whitespace."));
|
||||||
|
d->skipTrailingWhitespace->setEnabled(false);
|
||||||
|
d->skipTrailingWhitespace->setChecked(false);
|
||||||
|
|
||||||
|
d->ignoreFileTypes = new QLineEdit;
|
||||||
|
d->ignoreFileTypes->setEnabled(false);
|
||||||
|
d->ignoreFileTypes->setAcceptDrops(false);
|
||||||
|
d->ignoreFileTypes->setToolTip(tr("List of wildcard-aware file patterns, separated by commas or semicolons."));
|
||||||
|
|
||||||
|
d->addFinalNewLine = new QCheckBox(tr("&Ensure newline at end of file"));
|
||||||
|
d->addFinalNewLine->setToolTip(tr("Always writes a newline character at the end of the file."));
|
||||||
|
|
||||||
|
d->cleanWhitespace = new QCheckBox(tr("&Clean whitespace"));
|
||||||
|
d->cleanWhitespace->setToolTip(tr("Removes trailing whitespace upon saving."));
|
||||||
|
|
||||||
|
d->cleanIndentation = new QCheckBox(tr("Clean indentation"));
|
||||||
|
d->cleanIndentation->setEnabled(false);
|
||||||
|
d->cleanIndentation->setToolTip(tr("Corrects leading whitespace according to tab settings."));
|
||||||
|
|
||||||
|
d->inEntireDocument = new QCheckBox(tr("In entire &document"));
|
||||||
|
d->inEntireDocument->setEnabled(false);
|
||||||
|
d->inEntireDocument->setToolTip(tr("Cleans whitespace in entire document instead of only for changed parts."));
|
||||||
|
|
||||||
|
d->encodingBox = new QComboBox;
|
||||||
|
d->encodingBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
|
||||||
|
d->encodingBox->setMinimumContentsLength(20);
|
||||||
|
|
||||||
|
d->utf8BomBox = new QComboBox;
|
||||||
|
d->utf8BomBox->addItem(tr("Add If Encoding Is UTF-8"));
|
||||||
|
d->utf8BomBox->addItem(tr("Keep If Already Present"));
|
||||||
|
d->utf8BomBox->addItem(tr("Always Delete"));
|
||||||
|
d->utf8BomBox->setToolTip(tr("<html><head/><body>\n"
|
||||||
|
"<p>How text editors should deal with UTF-8 Byte Order Marks. The options are:</p>\n"
|
||||||
|
"<ul ><li><i>Add If Encoding Is UTF-8:</i> always add a BOM when saving a file in UTF-8 encoding. Note that this will not work if the encoding is <i>System</i>, as the text editor does not know what it actually is.</li>\n"
|
||||||
|
"<li><i>Keep If Already Present: </i>save the file with a BOM if it already had one when it was loaded.</li>\n"
|
||||||
|
"<li><i>Always Delete:</i> never write an UTF-8 BOM, possibly deleting a pre-existing one.</li></ul>\n"
|
||||||
|
"<p>Note that UTF-8 BOMs are uncommon and treated incorrectly by some editors, so it usually makes little sense to add any.</p>\n"
|
||||||
|
"<p>This setting does <b>not</b> influence the use of UTF-16 and UTF-32 BOMs.</p></body></html>"));
|
||||||
|
|
||||||
|
d->defaultLineEndings = new QComboBox;
|
||||||
|
d->defaultLineEndings->addItems(ExtraEncodingSettings::lineTerminationModeNames());
|
||||||
|
|
||||||
|
d->mouseHiding = new QCheckBox(tr("Hide mouse cursor while typing"));
|
||||||
|
d->mouseNavigation = new QCheckBox(tr("Enable &mouse navigation"));
|
||||||
|
d->scrollWheelZooming = new QCheckBox(tr("Enable scroll &wheel zooming"));
|
||||||
|
d->camelCaseNavigation = new QCheckBox(tr("Enable built-in camel case &navigation"));
|
||||||
|
|
||||||
|
d->smartSelectionChanging = new QCheckBox(tr("Enable smart selection changing"));
|
||||||
|
d->smartSelectionChanging->setToolTip(tr("Using Select Block Up / Down actions will now provide smarter selections."));
|
||||||
|
|
||||||
|
d->keyboardTooltips = new QCheckBox(tr("Show help tooltips using keyboard shortcut (Alt)"));
|
||||||
|
d->keyboardTooltips->setToolTip(tr("Pressing Alt displays context-sensitive help or type information as tooltips."));
|
||||||
|
|
||||||
|
d->constrainTooltipsBox = new QComboBox;
|
||||||
|
d->constrainTooltipsBox->addItem(tr("On Mouseover"));
|
||||||
|
d->constrainTooltipsBox->addItem(tr("On Shift+Mouseover"));
|
||||||
|
|
||||||
|
d->groupBoxTyping = new QGroupBox(tr("Typing"));
|
||||||
|
|
||||||
|
d->groupBoxStorageSettings = new QGroupBox(tr("Cleanups Upon Saving"));
|
||||||
|
d->groupBoxStorageSettings->setToolTip(tr("Cleanup actions which are automatically performed "
|
||||||
|
"right before the file is saved to disk."));
|
||||||
|
d->groupBoxEncodings = new QGroupBox(tr("File Encodings"));
|
||||||
|
|
||||||
|
d->groupBoxMouse = new QGroupBox(tr("Mouse and Keyboard"));
|
||||||
|
|
||||||
QList<int> mibs = QTextCodec::availableMibs();
|
QList<int> mibs = QTextCodec::availableMibs();
|
||||||
Utils::sort(mibs);
|
Utils::sort(mibs);
|
||||||
@@ -74,57 +202,107 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
|||||||
compoundName += QLatin1String(" / ");
|
compoundName += QLatin1String(" / ");
|
||||||
compoundName += QString::fromLatin1(alias);
|
compoundName += QString::fromLatin1(alias);
|
||||||
}
|
}
|
||||||
d->m_ui.encodingBox->addItem(compoundName);
|
d->encodingBox->addItem(compoundName);
|
||||||
d->m_codecs.append(codec);
|
d->m_codecs.append(codec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Qt5 doesn't list the system locale (QTBUG-34283), so add it manually
|
// Qt5 doesn't list the system locale (QTBUG-34283), so add it manually
|
||||||
const QString system(QLatin1String("System"));
|
const QString system(QLatin1String("System"));
|
||||||
if (d->m_ui.encodingBox->findText(system) == -1) {
|
if (d->encodingBox->findText(system) == -1) {
|
||||||
d->m_ui.encodingBox->insertItem(0, system);
|
d->encodingBox->insertItem(0, system);
|
||||||
d->m_codecs.prepend(QTextCodec::codecForLocale());
|
d->m_codecs.prepend(QTextCodec::codecForLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
d->m_ui.defaultLineEndings->addItems(ExtraEncodingSettings::lineTerminationModeNames());
|
using namespace Utils::Layouting;
|
||||||
|
|
||||||
auto currentIndexChanged = QOverload<int>::of(&QComboBox::currentIndexChanged);
|
const auto indent = [](QWidget *inner) { return Row { Space(30), inner }; };
|
||||||
connect(d->m_ui.autoIndent, &QAbstractButton::toggled,
|
|
||||||
|
Column {
|
||||||
|
d->autoIndent,
|
||||||
|
tr("Backspace indentation:"),
|
||||||
|
indent(d->smartBackspaceBehavior),
|
||||||
|
tr("Tab key performs auto-indent:"),
|
||||||
|
indent(d->tabKeyBehavior),
|
||||||
|
d->preferSingleLineComments
|
||||||
|
}.attachTo(d->groupBoxTyping);
|
||||||
|
|
||||||
|
Column {
|
||||||
|
d->cleanWhitespace,
|
||||||
|
indent(d->inEntireDocument),
|
||||||
|
indent(d->cleanIndentation),
|
||||||
|
Row { Space(30), d->skipTrailingWhitespace, d->ignoreFileTypes },
|
||||||
|
d->addFinalNewLine,
|
||||||
|
}.attachTo(d->groupBoxStorageSettings);
|
||||||
|
|
||||||
|
Row {
|
||||||
|
Form {
|
||||||
|
tr("Default encoding: "), d->encodingBox, br,
|
||||||
|
tr("UTF-8 BOM:"), d->utf8BomBox, br,
|
||||||
|
tr("Default line endings:"), d->defaultLineEndings, br,
|
||||||
|
}, st
|
||||||
|
}.attachTo(d->groupBoxEncodings);
|
||||||
|
|
||||||
|
Column {
|
||||||
|
d->mouseHiding,
|
||||||
|
d->mouseNavigation,
|
||||||
|
d->scrollWheelZooming,
|
||||||
|
d->camelCaseNavigation,
|
||||||
|
d->smartSelectionChanging,
|
||||||
|
d->keyboardTooltips,
|
||||||
|
tr("Show help tooltips using the mouse:"),
|
||||||
|
Row { Space(30), d->constrainTooltipsBox, st }
|
||||||
|
}.attachTo(d->groupBoxMouse);
|
||||||
|
|
||||||
|
Row {
|
||||||
|
Column { d->tabPreferencesWidget, d->groupBoxTyping, st },
|
||||||
|
Column { d->groupBoxStorageSettings, d->groupBoxEncodings, d->groupBoxMouse, st }
|
||||||
|
}.attachTo(this, false);
|
||||||
|
|
||||||
|
connect(d->cleanWhitespace, &QCheckBox::toggled,
|
||||||
|
d->inEntireDocument, &QCheckBox::setEnabled);
|
||||||
|
connect(d->cleanWhitespace, &QCheckBox::toggled,
|
||||||
|
d->cleanIndentation, &QCheckBox::setEnabled);
|
||||||
|
connect(d->cleanWhitespace, &QCheckBox::toggled,
|
||||||
|
d->skipTrailingWhitespace, &QCheckBox::setEnabled);
|
||||||
|
connect(d->cleanWhitespace, &QCheckBox::toggled,
|
||||||
|
d->ignoreFileTypes, &QLineEdit::setEnabled);
|
||||||
|
connect(d->autoIndent, &QAbstractButton::toggled,
|
||||||
this, &BehaviorSettingsWidget::slotTypingSettingsChanged);
|
this, &BehaviorSettingsWidget::slotTypingSettingsChanged);
|
||||||
connect(d->m_ui.smartBackspaceBehavior, currentIndexChanged,
|
connect(d->smartBackspaceBehavior, &QComboBox::currentIndexChanged,
|
||||||
this, &BehaviorSettingsWidget::slotTypingSettingsChanged);
|
this, &BehaviorSettingsWidget::slotTypingSettingsChanged);
|
||||||
connect(d->m_ui.tabKeyBehavior, currentIndexChanged,
|
connect(d->tabKeyBehavior, &QComboBox::currentIndexChanged,
|
||||||
this, &BehaviorSettingsWidget::slotTypingSettingsChanged);
|
this, &BehaviorSettingsWidget::slotTypingSettingsChanged);
|
||||||
connect(d->m_ui.cleanWhitespace, &QAbstractButton::clicked,
|
connect(d->cleanWhitespace, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
||||||
connect(d->m_ui.inEntireDocument, &QAbstractButton::clicked,
|
connect(d->inEntireDocument, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
||||||
connect(d->m_ui.addFinalNewLine, &QAbstractButton::clicked,
|
connect(d->addFinalNewLine, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
||||||
connect(d->m_ui.cleanIndentation, &QAbstractButton::clicked,
|
connect(d->cleanIndentation, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
||||||
connect(d->m_ui.skipTrailingWhitespace, &QAbstractButton::clicked,
|
connect(d->skipTrailingWhitespace, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
this, &BehaviorSettingsWidget::slotStorageSettingsChanged);
|
||||||
connect(d->m_ui.mouseHiding, &QAbstractButton::clicked,
|
connect(d->mouseHiding, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
||||||
connect(d->m_ui.mouseNavigation, &QAbstractButton::clicked,
|
connect(d->mouseNavigation, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
||||||
connect(d->m_ui.scrollWheelZooming, &QAbstractButton::clicked,
|
connect(d->scrollWheelZooming, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
||||||
connect(d->m_ui.camelCaseNavigation, &QAbstractButton::clicked,
|
connect(d->camelCaseNavigation, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
||||||
connect(d->m_ui.utf8BomBox, currentIndexChanged,
|
connect(d->utf8BomBox, &QComboBox::currentIndexChanged,
|
||||||
this, &BehaviorSettingsWidget::slotExtraEncodingChanged);
|
this, &BehaviorSettingsWidget::slotExtraEncodingChanged);
|
||||||
connect(d->m_ui.encodingBox, currentIndexChanged,
|
connect(d->encodingBox, &QComboBox::currentIndexChanged,
|
||||||
this, &BehaviorSettingsWidget::slotEncodingBoxChanged);
|
this, &BehaviorSettingsWidget::slotEncodingBoxChanged);
|
||||||
connect(d->m_ui.constrainTooltipsBox, currentIndexChanged,
|
connect(d->constrainTooltipsBox, &QComboBox::currentIndexChanged,
|
||||||
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
||||||
connect(d->m_ui.keyboardTooltips, &QAbstractButton::clicked,
|
connect(d->keyboardTooltips, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
||||||
connect(d->m_ui.smartSelectionChanging, &QAbstractButton::clicked,
|
connect(d->smartSelectionChanging, &QAbstractButton::clicked,
|
||||||
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
this, &BehaviorSettingsWidget::slotBehaviorSettingsChanged);
|
||||||
|
|
||||||
d->m_ui.mouseHiding->setVisible(!Utils::HostOsInfo::isMacHost());
|
d->mouseHiding->setVisible(!Utils::HostOsInfo::isMacHost());
|
||||||
}
|
}
|
||||||
|
|
||||||
BehaviorSettingsWidget::~BehaviorSettingsWidget()
|
BehaviorSettingsWidget::~BehaviorSettingsWidget()
|
||||||
@@ -134,11 +312,11 @@ BehaviorSettingsWidget::~BehaviorSettingsWidget()
|
|||||||
|
|
||||||
void BehaviorSettingsWidget::setActive(bool active)
|
void BehaviorSettingsWidget::setActive(bool active)
|
||||||
{
|
{
|
||||||
d->m_ui.tabPreferencesWidget->setEnabled(active);
|
d->tabPreferencesWidget->setEnabled(active);
|
||||||
d->m_ui.groupBoxTyping->setEnabled(active);
|
d->groupBoxTyping->setEnabled(active);
|
||||||
d->m_ui.groupBoxEncodings->setEnabled(active);
|
d->groupBoxEncodings->setEnabled(active);
|
||||||
d->m_ui.groupBoxMouse->setEnabled(active);
|
d->groupBoxMouse->setEnabled(active);
|
||||||
d->m_ui.groupBoxStorageSettings->setEnabled(active);
|
d->groupBoxStorageSettings->setEnabled(active);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::setAssignedCodec(QTextCodec *codec)
|
void BehaviorSettingsWidget::setAssignedCodec(QTextCodec *codec)
|
||||||
@@ -149,8 +327,8 @@ void BehaviorSettingsWidget::setAssignedCodec(QTextCodec *codec)
|
|||||||
int rememberedSystemPosition = -1;
|
int rememberedSystemPosition = -1;
|
||||||
for (int i = 0; i < d->m_codecs.size(); ++i) {
|
for (int i = 0; i < d->m_codecs.size(); ++i) {
|
||||||
if (codec == d->m_codecs.at(i)) {
|
if (codec == d->m_codecs.at(i)) {
|
||||||
if (d->m_ui.encodingBox->itemText(i) == codecName) {
|
if (d->encodingBox->itemText(i) == codecName) {
|
||||||
d->m_ui.encodingBox->setCurrentIndex(i);
|
d->encodingBox->setCurrentIndex(i);
|
||||||
return;
|
return;
|
||||||
} else { // we've got System matching encoding - but have explicitly set the codec
|
} else { // we've got System matching encoding - but have explicitly set the codec
|
||||||
rememberedSystemPosition = i;
|
rememberedSystemPosition = i;
|
||||||
@@ -158,123 +336,123 @@ void BehaviorSettingsWidget::setAssignedCodec(QTextCodec *codec)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rememberedSystemPosition != -1)
|
if (rememberedSystemPosition != -1)
|
||||||
d->m_ui.encodingBox->setCurrentIndex(rememberedSystemPosition);
|
d->encodingBox->setCurrentIndex(rememberedSystemPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray BehaviorSettingsWidget::assignedCodecName() const
|
QByteArray BehaviorSettingsWidget::assignedCodecName() const
|
||||||
{
|
{
|
||||||
return d->m_ui.encodingBox->currentIndex() == 0
|
return d->encodingBox->currentIndex() == 0
|
||||||
? QByteArray("System") // we prepend System to the available codecs
|
? QByteArray("System") // we prepend System to the available codecs
|
||||||
: d->m_codecs.at(d->m_ui.encodingBox->currentIndex())->name();
|
: d->m_codecs.at(d->encodingBox->currentIndex())->name();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::setCodeStyle(ICodeStylePreferences *preferences)
|
void BehaviorSettingsWidget::setCodeStyle(ICodeStylePreferences *preferences)
|
||||||
{
|
{
|
||||||
d->m_ui.tabPreferencesWidget->setPreferences(preferences);
|
d->tabPreferencesWidget->setPreferences(preferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::setAssignedTypingSettings(const TypingSettings &typingSettings)
|
void BehaviorSettingsWidget::setAssignedTypingSettings(const TypingSettings &typingSettings)
|
||||||
{
|
{
|
||||||
d->m_ui.autoIndent->setChecked(typingSettings.m_autoIndent);
|
d->autoIndent->setChecked(typingSettings.m_autoIndent);
|
||||||
d->m_ui.smartBackspaceBehavior->setCurrentIndex(typingSettings.m_smartBackspaceBehavior);
|
d->smartBackspaceBehavior->setCurrentIndex(typingSettings.m_smartBackspaceBehavior);
|
||||||
d->m_ui.tabKeyBehavior->setCurrentIndex(typingSettings.m_tabKeyBehavior);
|
d->tabKeyBehavior->setCurrentIndex(typingSettings.m_tabKeyBehavior);
|
||||||
|
|
||||||
d->m_ui.preferSingleLineComments->setChecked(typingSettings.m_preferSingleLineComments);
|
d->preferSingleLineComments->setChecked(typingSettings.m_preferSingleLineComments);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::assignedTypingSettings(TypingSettings *typingSettings) const
|
void BehaviorSettingsWidget::assignedTypingSettings(TypingSettings *typingSettings) const
|
||||||
{
|
{
|
||||||
typingSettings->m_autoIndent = d->m_ui.autoIndent->isChecked();
|
typingSettings->m_autoIndent = d->autoIndent->isChecked();
|
||||||
typingSettings->m_smartBackspaceBehavior =
|
typingSettings->m_smartBackspaceBehavior =
|
||||||
(TypingSettings::SmartBackspaceBehavior)(d->m_ui.smartBackspaceBehavior->currentIndex());
|
(TypingSettings::SmartBackspaceBehavior)(d->smartBackspaceBehavior->currentIndex());
|
||||||
typingSettings->m_tabKeyBehavior =
|
typingSettings->m_tabKeyBehavior =
|
||||||
(TypingSettings::TabKeyBehavior)(d->m_ui.tabKeyBehavior->currentIndex());
|
(TypingSettings::TabKeyBehavior)(d->tabKeyBehavior->currentIndex());
|
||||||
|
|
||||||
typingSettings->m_preferSingleLineComments = d->m_ui.preferSingleLineComments->isChecked();
|
typingSettings->m_preferSingleLineComments = d->preferSingleLineComments->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::setAssignedStorageSettings(const StorageSettings &storageSettings)
|
void BehaviorSettingsWidget::setAssignedStorageSettings(const StorageSettings &storageSettings)
|
||||||
{
|
{
|
||||||
d->m_ui.cleanWhitespace->setChecked(storageSettings.m_cleanWhitespace);
|
d->cleanWhitespace->setChecked(storageSettings.m_cleanWhitespace);
|
||||||
d->m_ui.inEntireDocument->setChecked(storageSettings.m_inEntireDocument);
|
d->inEntireDocument->setChecked(storageSettings.m_inEntireDocument);
|
||||||
d->m_ui.cleanIndentation->setChecked(storageSettings.m_cleanIndentation);
|
d->cleanIndentation->setChecked(storageSettings.m_cleanIndentation);
|
||||||
d->m_ui.addFinalNewLine->setChecked(storageSettings.m_addFinalNewLine);
|
d->addFinalNewLine->setChecked(storageSettings.m_addFinalNewLine);
|
||||||
d->m_ui.skipTrailingWhitespace->setChecked(storageSettings.m_skipTrailingWhitespace);
|
d->skipTrailingWhitespace->setChecked(storageSettings.m_skipTrailingWhitespace);
|
||||||
d->m_ui.ignoreFileTypes->setText(storageSettings.m_ignoreFileTypes);
|
d->ignoreFileTypes->setText(storageSettings.m_ignoreFileTypes);
|
||||||
d->m_ui.ignoreFileTypes->setEnabled(d->m_ui.skipTrailingWhitespace->isChecked());
|
d->ignoreFileTypes->setEnabled(d->skipTrailingWhitespace->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::assignedStorageSettings(StorageSettings *storageSettings) const
|
void BehaviorSettingsWidget::assignedStorageSettings(StorageSettings *storageSettings) const
|
||||||
{
|
{
|
||||||
storageSettings->m_cleanWhitespace = d->m_ui.cleanWhitespace->isChecked();
|
storageSettings->m_cleanWhitespace = d->cleanWhitespace->isChecked();
|
||||||
storageSettings->m_inEntireDocument = d->m_ui.inEntireDocument->isChecked();
|
storageSettings->m_inEntireDocument = d->inEntireDocument->isChecked();
|
||||||
storageSettings->m_cleanIndentation = d->m_ui.cleanIndentation->isChecked();
|
storageSettings->m_cleanIndentation = d->cleanIndentation->isChecked();
|
||||||
storageSettings->m_addFinalNewLine = d->m_ui.addFinalNewLine->isChecked();
|
storageSettings->m_addFinalNewLine = d->addFinalNewLine->isChecked();
|
||||||
storageSettings->m_skipTrailingWhitespace = d->m_ui.skipTrailingWhitespace->isChecked();
|
storageSettings->m_skipTrailingWhitespace = d->skipTrailingWhitespace->isChecked();
|
||||||
storageSettings->m_ignoreFileTypes = d->m_ui.ignoreFileTypes->text();
|
storageSettings->m_ignoreFileTypes = d->ignoreFileTypes->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::updateConstrainTooltipsBoxTooltip() const
|
void BehaviorSettingsWidget::updateConstrainTooltipsBoxTooltip() const
|
||||||
{
|
{
|
||||||
if (d->m_ui.constrainTooltipsBox->currentIndex() == 0) {
|
if (d->constrainTooltipsBox->currentIndex() == 0) {
|
||||||
d->m_ui.constrainTooltipsBox->setToolTip(
|
d->constrainTooltipsBox->setToolTip(
|
||||||
tr("Displays context-sensitive help or type information on mouseover."));
|
tr("Displays context-sensitive help or type information on mouseover."));
|
||||||
} else {
|
} else {
|
||||||
d->m_ui.constrainTooltipsBox->setToolTip(
|
d->constrainTooltipsBox->setToolTip(
|
||||||
tr("Displays context-sensitive help or type information on Shift+Mouseover."));
|
tr("Displays context-sensitive help or type information on Shift+Mouseover."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::setAssignedBehaviorSettings(const BehaviorSettings &behaviorSettings)
|
void BehaviorSettingsWidget::setAssignedBehaviorSettings(const BehaviorSettings &behaviorSettings)
|
||||||
{
|
{
|
||||||
d->m_ui.mouseHiding->setChecked(behaviorSettings.m_mouseHiding);
|
d->mouseHiding->setChecked(behaviorSettings.m_mouseHiding);
|
||||||
d->m_ui.mouseNavigation->setChecked(behaviorSettings.m_mouseNavigation);
|
d->mouseNavigation->setChecked(behaviorSettings.m_mouseNavigation);
|
||||||
d->m_ui.scrollWheelZooming->setChecked(behaviorSettings.m_scrollWheelZooming);
|
d->scrollWheelZooming->setChecked(behaviorSettings.m_scrollWheelZooming);
|
||||||
d->m_ui.constrainTooltipsBox->setCurrentIndex(behaviorSettings.m_constrainHoverTooltips ? 1 : 0);
|
d->constrainTooltipsBox->setCurrentIndex(behaviorSettings.m_constrainHoverTooltips ? 1 : 0);
|
||||||
d->m_ui.camelCaseNavigation->setChecked(behaviorSettings.m_camelCaseNavigation);
|
d->camelCaseNavigation->setChecked(behaviorSettings.m_camelCaseNavigation);
|
||||||
d->m_ui.keyboardTooltips->setChecked(behaviorSettings.m_keyboardTooltips);
|
d->keyboardTooltips->setChecked(behaviorSettings.m_keyboardTooltips);
|
||||||
d->m_ui.smartSelectionChanging->setChecked(behaviorSettings.m_smartSelectionChanging);
|
d->smartSelectionChanging->setChecked(behaviorSettings.m_smartSelectionChanging);
|
||||||
updateConstrainTooltipsBoxTooltip();
|
updateConstrainTooltipsBoxTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::assignedBehaviorSettings(BehaviorSettings *behaviorSettings) const
|
void BehaviorSettingsWidget::assignedBehaviorSettings(BehaviorSettings *behaviorSettings) const
|
||||||
{
|
{
|
||||||
behaviorSettings->m_mouseHiding = d->m_ui.mouseHiding->isChecked();
|
behaviorSettings->m_mouseHiding = d->mouseHiding->isChecked();
|
||||||
behaviorSettings->m_mouseNavigation = d->m_ui.mouseNavigation->isChecked();
|
behaviorSettings->m_mouseNavigation = d->mouseNavigation->isChecked();
|
||||||
behaviorSettings->m_scrollWheelZooming = d->m_ui.scrollWheelZooming->isChecked();
|
behaviorSettings->m_scrollWheelZooming = d->scrollWheelZooming->isChecked();
|
||||||
behaviorSettings->m_constrainHoverTooltips = (d->m_ui.constrainTooltipsBox->currentIndex() == 1);
|
behaviorSettings->m_constrainHoverTooltips = (d->constrainTooltipsBox->currentIndex() == 1);
|
||||||
behaviorSettings->m_camelCaseNavigation = d->m_ui.camelCaseNavigation->isChecked();
|
behaviorSettings->m_camelCaseNavigation = d->camelCaseNavigation->isChecked();
|
||||||
behaviorSettings->m_keyboardTooltips = d->m_ui.keyboardTooltips->isChecked();
|
behaviorSettings->m_keyboardTooltips = d->keyboardTooltips->isChecked();
|
||||||
behaviorSettings->m_smartSelectionChanging = d->m_ui.smartSelectionChanging->isChecked();
|
behaviorSettings->m_smartSelectionChanging = d->smartSelectionChanging->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::setAssignedExtraEncodingSettings(
|
void BehaviorSettingsWidget::setAssignedExtraEncodingSettings(
|
||||||
const ExtraEncodingSettings &encodingSettings)
|
const ExtraEncodingSettings &encodingSettings)
|
||||||
{
|
{
|
||||||
d->m_ui.utf8BomBox->setCurrentIndex(encodingSettings.m_utf8BomSetting);
|
d->utf8BomBox->setCurrentIndex(encodingSettings.m_utf8BomSetting);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::assignedExtraEncodingSettings(
|
void BehaviorSettingsWidget::assignedExtraEncodingSettings(
|
||||||
ExtraEncodingSettings *encodingSettings) const
|
ExtraEncodingSettings *encodingSettings) const
|
||||||
{
|
{
|
||||||
encodingSettings->m_utf8BomSetting =
|
encodingSettings->m_utf8BomSetting =
|
||||||
(ExtraEncodingSettings::Utf8BomSetting)d->m_ui.utf8BomBox->currentIndex();
|
(ExtraEncodingSettings::Utf8BomSetting)d->utf8BomBox->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::setAssignedLineEnding(int lineEnding)
|
void BehaviorSettingsWidget::setAssignedLineEnding(int lineEnding)
|
||||||
{
|
{
|
||||||
d->m_ui.defaultLineEndings->setCurrentIndex(lineEnding);
|
d->defaultLineEndings->setCurrentIndex(lineEnding);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BehaviorSettingsWidget::assignedLineEnding() const
|
int BehaviorSettingsWidget::assignedLineEnding() const
|
||||||
{
|
{
|
||||||
return d->m_ui.defaultLineEndings->currentIndex();
|
return d->defaultLineEndings->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
TabSettingsWidget *BehaviorSettingsWidget::tabSettingsWidget() const
|
TabSettingsWidget *BehaviorSettingsWidget::tabSettingsWidget() const
|
||||||
{
|
{
|
||||||
return d->m_ui.tabPreferencesWidget->tabSettingsWidget();
|
return d->tabPreferencesWidget->tabSettingsWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BehaviorSettingsWidget::slotTypingSettingsChanged()
|
void BehaviorSettingsWidget::slotTypingSettingsChanged()
|
||||||
@@ -289,8 +467,8 @@ void BehaviorSettingsWidget::slotStorageSettingsChanged()
|
|||||||
StorageSettings settings;
|
StorageSettings settings;
|
||||||
assignedStorageSettings(&settings);
|
assignedStorageSettings(&settings);
|
||||||
|
|
||||||
bool ignoreFileTypesEnabled = d->m_ui.cleanWhitespace->isChecked() && d->m_ui.skipTrailingWhitespace->isChecked();
|
bool ignoreFileTypesEnabled = d->cleanWhitespace->isChecked() && d->skipTrailingWhitespace->isChecked();
|
||||||
d->m_ui.ignoreFileTypes->setEnabled(ignoreFileTypesEnabled);
|
d->ignoreFileTypes->setEnabled(ignoreFileTypesEnabled);
|
||||||
|
|
||||||
emit storageSettingsChanged(settings);
|
emit storageSettingsChanged(settings);
|
||||||
}
|
}
|
||||||
|
@@ -1,623 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>TextEditor::Internal::BehaviorSettingsWidget</class>
|
|
||||||
<widget class="QWidget" name="TextEditor::Internal::BehaviorSettingsWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>801</width>
|
|
||||||
<height>693</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="TextEditor::SimpleCodeStylePreferencesWidget" name="tabPreferencesWidget" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBoxTyping">
|
|
||||||
<property name="title">
|
|
||||||
<string>Typing</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QComboBox" name="tabKeyBehavior">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Never</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Always</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>In Leading White Space</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QComboBox" name="smartBackspaceBehavior">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body>
|
|
||||||
Specifies how backspace interacts with indentation.
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>None: No interaction at all. Regular plain backspace behavior.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>Follows Previous Indents: In leading white space it will take the cursor back to the nearest indentation level used in previous lines.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>Unindents: If the character behind the cursor is a space it behaves as a backtab.
|
|
||||||
</li>
|
|
||||||
</ul></body></html>
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>None</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Follows Previous Indents</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Unindents</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="autoIndent">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable automatic &indentation</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="tabKeyBehaviorLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Tab key performs auto-indent:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="smartBackspaceLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Backspace indentation:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<spacer name="horizontalSpacer_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="preferSingleLineComments">
|
|
||||||
<property name="text">
|
|
||||||
<string>Prefer single line comments</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>28</width>
|
|
||||||
<height>13</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBoxStorageSettings">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Cleanup actions which are automatically performed right before the file is saved to disk.</string>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Cleanups Upon Saving</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QWidget" name="widget" native="true">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="skipTrailingWhitespace">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>For the file patterns listed, do not trim trailing whitespace.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Skip clean whitespace for file types:</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="tristate">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="ignoreFileTypes">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="acceptDrops">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>List of wildcard-aware file patterns, separated by commas or semicolons.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="addFinalNewLine">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Always writes a newline character at the end of the file.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Ensure newline at end of file</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="cleanWhitespace">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Removes trailing whitespace upon saving.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Clean whitespace</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QCheckBox" name="cleanIndentation">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Corrects leading whitespace according to tab settings.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Clean indentation</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QCheckBox" name="inEntireDocument">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Cleans whitespace in entire document instead of only for changed parts.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>In entire &document</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBoxEncodings">
|
|
||||||
<property name="title">
|
|
||||||
<string>File Encodings</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="encodingLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Default encoding: </string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="encodingBox">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="sizeAdjustPolicy">
|
|
||||||
<enum>QComboBox::AdjustToMinimumContentsLengthWithIcon</enum>
|
|
||||||
</property>
|
|
||||||
<property name="minimumContentsLength">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<spacer name="horizontalSpacer_6">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>285</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QComboBox" name="utf8BomBox">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body>
|
|
||||||
<p>How text editors should deal with UTF-8 Byte Order Marks. The options are:</p>
|
|
||||||
<ul ><li><i>Add If Encoding Is UTF-8:</i> always add a BOM when saving a file in UTF-8 encoding. Note that this will not work if the encoding is <i>System</i>, as the text editor does not know what it actually is.</li>
|
|
||||||
<li><i>Keep If Already Present: </i>save the file with a BOM if it already had one when it was loaded.</li>
|
|
||||||
<li><i>Always Delete:</i> never write an UTF-8 BOM, possibly deleting a pre-existing one.</li></ul>
|
|
||||||
<p>Note that UTF-8 BOMs are uncommon and treated incorrectly by some editors, so it usually makes little sense to add any.</p>
|
|
||||||
<p>This setting does <b>not</b> influence the use of UTF-16 and UTF-32 BOMs.</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add If Encoding Is UTF-8</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Keep If Already Present</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Always Delete</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="utf8BomLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>UTF-8 BOM:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="defaultLineEndingsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Default line endings:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QComboBox" name="defaultLineEndings"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBoxMouse">
|
|
||||||
<property name="title">
|
|
||||||
<string>Mouse and Keyboard</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="mouseHiding">
|
|
||||||
<property name="text">
|
|
||||||
<string>Hide mouse cursor while typing</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="mouseNavigation">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable &mouse navigation</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="scrollWheelZooming">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable scroll &wheel zooming</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="camelCaseNavigation">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable built-in camel case &navigation</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="smartSelectionChanging">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Using Select Block Up / Down actions will now provide smarter selections.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable smart selection changing</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="keyboardTooltips">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Pressing Alt displays context-sensitive help or type information as tooltips.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Show help tooltips using keyboard shortcut (Alt)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="helpTooltipsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Show help tooltips using the mouse:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="constrainTooltipsBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>On Mouseover</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>On Shift+Mouseover</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>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>TextEditor::SimpleCodeStylePreferencesWidget</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">texteditor/simplecodestylepreferenceswidget.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>autoIndent</tabstop>
|
|
||||||
<tabstop>smartBackspaceBehavior</tabstop>
|
|
||||||
<tabstop>tabKeyBehavior</tabstop>
|
|
||||||
<tabstop>cleanWhitespace</tabstop>
|
|
||||||
<tabstop>inEntireDocument</tabstop>
|
|
||||||
<tabstop>cleanIndentation</tabstop>
|
|
||||||
<tabstop>addFinalNewLine</tabstop>
|
|
||||||
<tabstop>encodingBox</tabstop>
|
|
||||||
<tabstop>utf8BomBox</tabstop>
|
|
||||||
<tabstop>mouseHiding</tabstop>
|
|
||||||
<tabstop>mouseNavigation</tabstop>
|
|
||||||
<tabstop>scrollWheelZooming</tabstop>
|
|
||||||
<tabstop>camelCaseNavigation</tabstop>
|
|
||||||
<tabstop>smartSelectionChanging</tabstop>
|
|
||||||
<tabstop>keyboardTooltips</tabstop>
|
|
||||||
<tabstop>constrainTooltipsBox</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>cleanWhitespace</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>inEntireDocument</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>87</x>
|
|
||||||
<y>323</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>205</x>
|
|
||||||
<y>353</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>cleanWhitespace</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>cleanIndentation</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>60</x>
|
|
||||||
<y>323</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>134</x>
|
|
||||||
<y>384</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>cleanWhitespace</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>skipTrailingWhitespace</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>530</x>
|
|
||||||
<y>48</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>548</x>
|
|
||||||
<y>144</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>cleanWhitespace</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>ignoreFileTypes</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>530</x>
|
|
||||||
<y>48</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>556</x>
|
|
||||||
<y>177</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
@@ -32,7 +32,6 @@ Project {
|
|||||||
"behaviorsettingspage.h",
|
"behaviorsettingspage.h",
|
||||||
"behaviorsettingswidget.cpp",
|
"behaviorsettingswidget.cpp",
|
||||||
"behaviorsettingswidget.h",
|
"behaviorsettingswidget.h",
|
||||||
"behaviorsettingswidget.ui",
|
|
||||||
"blockrange.h",
|
"blockrange.h",
|
||||||
"circularclipboard.cpp",
|
"circularclipboard.cpp",
|
||||||
"circularclipboard.h",
|
"circularclipboard.h",
|
||||||
|
Reference in New Issue
Block a user