Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateview.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 485 | if (!doc()->readOnly()) { | |||
---|---|---|---|---|---|
542 | a = ac->addAction(QStringLiteral("tools_toggle_comment")); | 542 | a = ac->addAction(QStringLiteral("tools_toggle_comment")); | ||
543 | a->setText(i18n("Toggle Comment")); | 543 | a->setText(i18n("Toggle Comment")); | ||
544 | ac->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_Slash)); | 544 | ac->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_Slash)); | ||
545 | connect(a, SIGNAL(triggered(bool)), SLOT(toggleComment())); | 545 | connect(a, SIGNAL(triggered(bool)), SLOT(toggleComment())); | ||
546 | 546 | | |||
547 | a = m_toggleWriteLock = new KToggleAction(i18n("&Read Only Mode"), this); | 547 | a = m_toggleWriteLock = new KToggleAction(i18n("&Read Only Mode"), this); | ||
548 | a->setWhatsThis(i18n("Lock/unlock the document for writing")); | 548 | a->setWhatsThis(i18n("Lock/unlock the document for writing")); | ||
549 | a->setChecked(!doc()->isReadWrite()); | 549 | a->setChecked(!doc()->isReadWrite()); | ||
550 | connect(a, SIGNAL(triggered(bool)), SLOT(toggleWriteLock())); | | |||
551 | ac->addAction(QStringLiteral("tools_toggle_write_lock"), a); | 550 | ac->addAction(QStringLiteral("tools_toggle_write_lock"), a); | ||
551 | connect(a, SIGNAL(triggered(bool)), SLOT(toggleWriteLock())); | ||||
552 | connect(document(), &KTextEditor::DocumentPrivate::modifiedChanged, [=] { m_toggleWriteLock->setEnabled(!doc()->isModified()); }); | ||||
552 | 553 | | |||
553 | a = ac->addAction(QStringLiteral("tools_uppercase")); | 554 | a = ac->addAction(QStringLiteral("tools_uppercase")); | ||
554 | a->setIcon(QIcon::fromTheme(QStringLiteral("format-text-uppercase"))); | 555 | a->setIcon(QIcon::fromTheme(QStringLiteral("format-text-uppercase"))); | ||
555 | a->setText(i18n("Uppercase")); | 556 | a->setText(i18n("Uppercase")); | ||
556 | ac->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_U)); | 557 | ac->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_U)); | ||
557 | a->setWhatsThis(i18n("Convert the selection to uppercase, or the character to the " | 558 | a->setWhatsThis(i18n("Convert the selection to uppercase, or the character to the " | ||
558 | "right of the cursor if no text is selected.")); | 559 | "right of the cursor if no text is selected.")); | ||
559 | connect(a, SIGNAL(triggered(bool)), SLOT(uppercase())); | 560 | connect(a, SIGNAL(triggered(bool)), SLOT(uppercase())); | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |