Added the option to turn off marking of text changes

This commit is contained in:
Thorbjørn Lindeijer
2009-07-16 11:27:02 +02:00
parent e5377519d6
commit d34bf41a37
6 changed files with 40 additions and 23 deletions

1
dist/changes-1.3.0 vendored
View File

@@ -18,6 +18,7 @@ General:
Editing: Editing:
* Added support for text editor color schemes * Added support for text editor color schemes
* Added highlighting of uses of the symbol under the cursor * Added highlighting of uses of the symbol under the cursor
* Added the option to turn off marking of text changes
Project support: Project support:
* Added support for adding and removing files from a generic Makefile-based * Added support for adding and removing files from a generic Makefile-based

View File

@@ -2449,7 +2449,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
painter.setPen(QPen(Qt::darkGreen, 2)); painter.setPen(QPen(Qt::darkGreen, 2));
else else
painter.setPen(QPen(Qt::red, 2)); painter.setPen(QPen(Qt::red, 2));
painter.drawLine(extraAreaWidth-1, top, extraAreaWidth-1, bottom-1); painter.drawLine(extraAreaWidth - 1, top, extraAreaWidth - 1, bottom - 1);
painter.restore(); painter.restore();
} }
@@ -3921,6 +3921,7 @@ void BaseTextEditor::setDisplaySettings(const DisplaySettings &ds)
setVisibleWrapColumn(ds.m_showWrapColumn ? ds.m_wrapColumn : 0); setVisibleWrapColumn(ds.m_showWrapColumn ? ds.m_wrapColumn : 0);
setCodeFoldingVisible(ds.m_displayFoldingMarkers); setCodeFoldingVisible(ds.m_displayFoldingMarkers);
setHighlightCurrentLine(ds.m_highlightCurrentLine); setHighlightCurrentLine(ds.m_highlightCurrentLine);
setRevisionsVisible(ds.m_markTextChanges);
if (d->m_displaySettings.m_visualizeWhitespace != ds.m_visualizeWhitespace) { if (d->m_displaySettings.m_visualizeWhitespace != ds.m_visualizeWhitespace) {
if (QSyntaxHighlighter *highlighter = baseTextDocument()->syntaxHighlighter()) if (QSyntaxHighlighter *highlighter = baseTextDocument()->syntaxHighlighter())

View File

@@ -44,6 +44,7 @@ static const char * const highlightCurrentLineKey = "HighlightCurrentLineKeyV2";
static const char * const highlightBlocksKey = "HighlightBlocksKey"; static const char * const highlightBlocksKey = "HighlightBlocksKey";
static const char * const animateMatchingParenthesesKey= "AnimateMatchingParenthesesKey"; static const char * const animateMatchingParenthesesKey= "AnimateMatchingParenthesesKey";
static const char * const mouseNavigationKey = "MouseNavigation"; static const char * const mouseNavigationKey = "MouseNavigation";
static const char * const markTextChangesKey = "MarkTextChanges";
static const char * const groupPostfix = "DisplaySettings"; static const char * const groupPostfix = "DisplaySettings";
namespace TextEditor { namespace TextEditor {
@@ -58,7 +59,8 @@ DisplaySettings::DisplaySettings() :
m_highlightCurrentLine(false), m_highlightCurrentLine(false),
m_highlightBlocks(false), m_highlightBlocks(false),
m_animateMatchingParentheses(true), m_animateMatchingParentheses(true),
m_mouseNavigation(true) m_mouseNavigation(true),
m_markTextChanges(true)
{ {
} }
@@ -78,6 +80,7 @@ void DisplaySettings::toSettings(const QString &category, QSettings *s) const
s->setValue(QLatin1String(highlightBlocksKey), m_highlightBlocks); s->setValue(QLatin1String(highlightBlocksKey), m_highlightBlocks);
s->setValue(QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses); s->setValue(QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses);
s->setValue(QLatin1String(mouseNavigationKey), m_mouseNavigation); s->setValue(QLatin1String(mouseNavigationKey), m_mouseNavigation);
s->setValue(QLatin1String(markTextChangesKey), m_markTextChanges);
s->endGroup(); s->endGroup();
} }
@@ -100,6 +103,7 @@ void DisplaySettings::fromSettings(const QString &category, const QSettings *s)
m_highlightBlocks = s->value(group + QLatin1String(highlightBlocksKey), m_highlightBlocks).toBool(); m_highlightBlocks = s->value(group + QLatin1String(highlightBlocksKey), m_highlightBlocks).toBool();
m_animateMatchingParentheses = s->value(group + QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses).toBool(); m_animateMatchingParentheses = s->value(group + QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses).toBool();
m_mouseNavigation = s->value(group + QLatin1String(mouseNavigationKey), m_mouseNavigation).toBool(); m_mouseNavigation = s->value(group + QLatin1String(mouseNavigationKey), m_mouseNavigation).toBool();
m_markTextChanges = s->value(group + QLatin1String(markTextChangesKey), m_markTextChanges).toBool();
} }
bool DisplaySettings::equals(const DisplaySettings &ds) const bool DisplaySettings::equals(const DisplaySettings &ds) const
@@ -114,6 +118,7 @@ bool DisplaySettings::equals(const DisplaySettings &ds) const
&& m_highlightBlocks == ds.m_highlightBlocks && m_highlightBlocks == ds.m_highlightBlocks
&& m_animateMatchingParentheses == ds.m_animateMatchingParentheses && m_animateMatchingParentheses == ds.m_animateMatchingParentheses
&& m_mouseNavigation == ds.m_mouseNavigation && m_mouseNavigation == ds.m_mouseNavigation
&& m_markTextChanges == ds.m_markTextChanges
; ;
} }

View File

@@ -55,6 +55,7 @@ struct TEXTEDITOR_EXPORT DisplaySettings
bool m_highlightBlocks; bool m_highlightBlocks;
bool m_animateMatchingParentheses; bool m_animateMatchingParentheses;
bool m_mouseNavigation; bool m_mouseNavigation;
bool m_markTextChanges;
bool equals(const DisplaySettings &ds) const; bool equals(const DisplaySettings &ds) const;
}; };

View File

@@ -125,6 +125,7 @@ void DisplaySettingsPage::settingsFromUI(DisplaySettings &displaySettings) const
displaySettings.m_highlightBlocks = m_d->m_page.highlightBlocks->isChecked(); displaySettings.m_highlightBlocks = m_d->m_page.highlightBlocks->isChecked();
displaySettings.m_animateMatchingParentheses = m_d->m_page.animateMatchingParentheses->isChecked(); displaySettings.m_animateMatchingParentheses = m_d->m_page.animateMatchingParentheses->isChecked();
displaySettings.m_mouseNavigation = m_d->m_page.mouseNavigation->isChecked(); displaySettings.m_mouseNavigation = m_d->m_page.mouseNavigation->isChecked();
displaySettings.m_markTextChanges = m_d->m_page.markTextChanges->isChecked();
} }
void DisplaySettingsPage::settingsToUI() void DisplaySettingsPage::settingsToUI()
@@ -140,6 +141,7 @@ void DisplaySettingsPage::settingsToUI()
m_d->m_page.highlightBlocks->setChecked(displaySettings.m_highlightBlocks); m_d->m_page.highlightBlocks->setChecked(displaySettings.m_highlightBlocks);
m_d->m_page.animateMatchingParentheses->setChecked(displaySettings.m_animateMatchingParentheses); m_d->m_page.animateMatchingParentheses->setChecked(displaySettings.m_animateMatchingParentheses);
m_d->m_page.mouseNavigation->setChecked(displaySettings.m_mouseNavigation); m_d->m_page.mouseNavigation->setChecked(displaySettings.m_mouseNavigation);
m_d->m_page.markTextChanges->setChecked(displaySettings.m_markTextChanges);
} }
DisplaySettings DisplaySettingsPage::displaySettings() const DisplaySettings DisplaySettingsPage::displaySettings() const

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>381</width> <width>448</width>
<height>402</height> <height>330</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
@@ -29,22 +29,43 @@
<property name="title"> <property name="title">
<string>Display</string> <string>Display</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout_2">
<item> <item row="0" column="0">
<widget class="QCheckBox" name="displayLineNumbers"> <widget class="QCheckBox" name="displayLineNumbers">
<property name="text"> <property name="text">
<string>Display line &amp;numbers</string> <string>Display line &amp;numbers</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="QCheckBox" name="highlightCurrentLine">
<property name="text">
<string>Highlight current &amp;line</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="displayFoldingMarkers"> <widget class="QCheckBox" name="displayFoldingMarkers">
<property name="text"> <property name="text">
<string>Display &amp;folding markers</string> <string>Display &amp;folding markers</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="1">
<widget class="QCheckBox" name="highlightBlocks">
<property name="text">
<string>Highlight &amp;blocks</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="markTextChanges">
<property name="text">
<string>Mark text changes</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="visualizeWhitespace"> <widget class="QCheckBox" name="visualizeWhitespace">
<property name="toolTip"> <property name="toolTip">
<string>Show tabs and spaces.</string> <string>Show tabs and spaces.</string>
@@ -54,21 +75,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="1">
<widget class="QCheckBox" name="highlightCurrentLine">
<property name="text">
<string>Highlight current &amp;line</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="highlightBlocks">
<property name="text">
<string>Highlight &amp;blocks</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="animateMatchingParentheses"> <widget class="QCheckBox" name="animateMatchingParentheses">
<property name="text"> <property name="text">
<string>Animate matching parentheses</string> <string>Animate matching parentheses</string>