Changeset View
Changeset View
Standalone View
Standalone View
src/view/katestatusbar.cpp
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 208 | { | |||
---|---|---|---|---|---|
219 | } | 219 | } | ||
220 | 220 | | |||
221 | return KateViewBarWidget::eventFilter(obj, event); | 221 | return KateViewBarWidget::eventFilter(obj, event); | ||
222 | } | 222 | } | ||
223 | 223 | | |||
224 | void KateStatusBar::contextMenuEvent(QContextMenuEvent *event) | 224 | void KateStatusBar::contextMenuEvent(QContextMenuEvent *event) | ||
225 | { | 225 | { | ||
226 | QMenu menu(this); | 226 | QMenu menu(this); | ||
227 | QAction *showLines = menu.addAction(QStringLiteral("Show Lines Count"), this, &KateStatusBar::toggleShowLines); | 227 | QAction *showLines = menu.addAction(QStringLiteral("Show line count"), this, &KateStatusBar::toggleShowLines); | ||
228 | showLines->setCheckable(true); | 228 | showLines->setCheckable(true); | ||
229 | showLines->setChecked(KateViewConfig::global()->showLinesCount()); | 229 | showLines->setChecked(KateViewConfig::global()->showLineCount()); | ||
230 | QAction *showWords = menu.addAction(QStringLiteral("Show word count"), this, &KateStatusBar::toggleShowWords); | 230 | QAction *showWords = menu.addAction(QStringLiteral("Show word count"), this, &KateStatusBar::toggleShowWords); | ||
231 | showWords->setCheckable(true); | 231 | showWords->setCheckable(true); | ||
232 | showWords->setChecked(KateViewConfig::global()->showWordCount()); | 232 | showWords->setChecked(KateViewConfig::global()->showWordCount()); | ||
233 | menu.exec(event->globalPos()); | 233 | menu.exec(event->globalPos()); | ||
234 | } | 234 | } | ||
235 | 235 | | |||
236 | void KateStatusBar::toggleShowLines(bool checked) | 236 | void KateStatusBar::toggleShowLines(bool checked) | ||
237 | { | 237 | { | ||
238 | KateViewConfig::global()->setShowLinesCount(checked); | 238 | KateViewConfig::global()->setShowLineCount(checked); | ||
239 | } | 239 | } | ||
240 | 240 | | |||
241 | void KateStatusBar::toggleShowWords(bool checked) | 241 | void KateStatusBar::toggleShowWords(bool checked) | ||
242 | { | 242 | { | ||
243 | KateViewConfig::global()->setShowWordCount(checked); | 243 | KateViewConfig::global()->setShowWordCount(checked); | ||
244 | } | 244 | } | ||
245 | 245 | | |||
246 | void KateStatusBar::updateStatus () | 246 | void KateStatusBar::updateStatus () | ||
Show All 27 Lines | 269 | { | |||
274 | 274 | | |||
275 | m_insertModeLabel->setText(text); | 275 | m_insertModeLabel->setText(text); | ||
276 | } | 276 | } | ||
277 | 277 | | |||
278 | void KateStatusBar::cursorPositionChanged () | 278 | void KateStatusBar::cursorPositionChanged () | ||
279 | { | 279 | { | ||
280 | KTextEditor::Cursor position (m_view->cursorPositionVirtual()); | 280 | KTextEditor::Cursor position (m_view->cursorPositionVirtual()); | ||
281 | 281 | | |||
282 | if( KateViewConfig::global()->showLinesCount() ) | 282 | if( KateViewConfig::global()->showLineCount() ) | ||
283 | m_lineColLabel->setText( | 283 | m_lineColLabel->setText( | ||
284 | i18n("Line %1 of %2, Column %3" | 284 | i18n("Line %1 of %2, Column %3" | ||
285 | , QLocale().toString(position.line() + 1) | 285 | , QLocale().toString(position.line() + 1) | ||
286 | , QLocale().toString(m_view->doc()->lines()) | 286 | , QLocale().toString(m_view->doc()->lines()) | ||
287 | , QLocale().toString(position.column() + 1) | 287 | , QLocale().toString(position.column() + 1) | ||
288 | ) | 288 | ) | ||
289 | ); | 289 | ); | ||
290 | 290 | | |||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |