Commit 3f0638e7 authored by Shubham  .'s avatar Shubham . Committed by Christoph Cullmann
Browse files

Implemented displaying of total lines in kate

GUI: new option to display total lines in the status bar

BUG: 387362
parent 9012713f
......@@ -679,6 +679,7 @@ KateViewDefaultsConfig::KateViewDefaultsConfig(QWidget *parent)
connect(textareaUi->chkAnimateBracketMatching, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
connect(textareaUi->chkFoldFirstLine, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
connect(textareaUi->chkShowWordCount, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
connect(textareaUi->chkShowLinesCount, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
connect(bordersUi->chkIconBorder, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
connect(bordersUi->chkScrollbarMarks, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
......@@ -737,6 +738,7 @@ void KateViewDefaultsConfig::apply()
KateRendererConfig::global()->setAnimateBracketMatching(textareaUi->chkAnimateBracketMatching->isChecked());
KateViewConfig::global()->setFoldFirstLine(textareaUi->chkFoldFirstLine->isChecked());
KateViewConfig::global()->setShowWordCount(textareaUi->chkShowWordCount->isChecked());
KateViewConfig::global()->setShowLinesCount(textareaUi->chkShowLinesCount->isChecked());
KateRendererConfig::global()->configEnd();
KateViewConfig::global()->configEnd();
......@@ -768,6 +770,7 @@ void KateViewDefaultsConfig::reload()
textareaUi->chkAnimateBracketMatching->setChecked(KateRendererConfig::global()->animateBracketMatching());
textareaUi->chkFoldFirstLine->setChecked(KateViewConfig::global()->foldFirstLine());
textareaUi->chkShowWordCount->setChecked(KateViewConfig::global()->showWordCount());
textareaUi->chkShowLinesCount->setChecked(KateViewConfig::global()->showLinesCount());
}
void KateViewDefaultsConfig::reset()
......
......@@ -193,6 +193,16 @@ beginning of a file.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkShowLinesCount">
<property name="toolTip">
<string>Show/hide Lines count in status bar</string>
</property>
<property name="text">
<string>Show Lines Count</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -1260,6 +1260,7 @@ KateViewConfig::KateViewConfig()
m_wordCompletionRemoveTailSet(false),
m_foldFirstLineSet (false),
m_showWordCountSet(false),
m_showLinesCountSet(false),
m_autoBracketsSet(false),
m_backspaceRemoveComposedSet(false)
......@@ -1351,6 +1352,7 @@ const char KEY_WORD_COMPLETION_REMOVE_TAIL[] = "Word Completion Remove Tail";
const char KEY_SMART_COPY_CUT[] = "Smart Copy Cut";
const char KEY_SCROLL_PAST_END[] = "Scroll Past End";
const char KEY_FOLD_FIRST_LINE[] = "Fold First Line";
const char KEY_SHOW_LINES_COUNT[] = "Show Lines Count";
const char KEY_SHOW_WORD_COUNT[] = "Show Word Count";
const char KEY_AUTO_BRACKETS[] = "Auto Brackets";
const char KEY_BACKSPACE_REMOVE_COMPOSED[] = "Backspace Remove Composed Characters";
......@@ -1413,6 +1415,7 @@ void KateViewConfig::readConfig(const KConfigGroup &config)
setSmartCopyCut(config.readEntry(KEY_SMART_COPY_CUT, false));
setScrollPastEnd(config.readEntry(KEY_SCROLL_PAST_END, false));
setFoldFirstLine(config.readEntry(KEY_FOLD_FIRST_LINE, false));
setShowLinesCount(config.readEntry(KEY_SHOW_LINES_COUNT, false));
setShowWordCount(config.readEntry(KEY_SHOW_WORD_COUNT, false));
setAutoBrackets(config.readEntry(KEY_AUTO_BRACKETS, false));
......@@ -1477,6 +1480,7 @@ void KateViewConfig::writeConfig(KConfigGroup &config)
config.writeEntry(KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys());
config.writeEntry(KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers());
config.writeEntry(KEY_SHOW_LINES_COUNT, showLinesCount());
config.writeEntry(KEY_SHOW_WORD_COUNT, showWordCount());
config.writeEntry(KEY_AUTO_BRACKETS, autoBrackets());
......@@ -2244,6 +2248,27 @@ void KateViewConfig::setShowWordCount(bool on)
configEnd();
}
bool KateViewConfig::showLinesCount()
{
if (m_showLinesCountSet || isGlobal()) {
return m_showLinesCount;
}
return s_global->showLinesCount();
}
void KateViewConfig::setShowLinesCount(bool on)
{
if (m_showLinesCountSet && m_showLinesCount == on) {
return;
}
configStart();
m_showLinesCountSet = true;
m_showLinesCount = on;
configEnd();
}
bool KateViewConfig::backspaceRemoveComposed() const
{
if (m_backspaceRemoveComposedSet || isGlobal()) {
......
......@@ -572,6 +572,9 @@ public:
bool showWordCount();
void setShowWordCount(bool on);
bool showLinesCount();
void setShowLinesCount(bool on);
bool autoBrackets() const;
void setAutoBrackets(bool on);
......@@ -611,6 +614,7 @@ private:
bool m_scrollPastEnd;
bool m_foldFirstLine;
bool m_showWordCount = false;
bool m_showLinesCount = false;
bool m_autoBrackets;
bool m_backspaceRemoveComposed;
......@@ -646,6 +650,7 @@ private:
bool m_wordCompletionRemoveTailSet : 1;
bool m_foldFirstLineSet : 1;
bool m_showWordCountSet : 1;
bool m_showLinesCountSet : 1;
bool m_autoBracketsSet : 1;
bool m_backspaceRemoveComposedSet : 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment