|
|
|
@ -294,6 +294,12 @@ void ViewManager::setupActions() |
|
|
|
connect(action, &QAction::triggered, this, &ViewManager::toggleSemanticHints); |
|
|
|
connect(action, &QAction::triggered, this, &ViewManager::toggleSemanticHints); |
|
|
|
_viewContainer->addAction(action); |
|
|
|
_viewContainer->addAction(action); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
action = new QAction(i18nc("@action Shortcut entry", "Toggle line numbers display"), this); |
|
|
|
|
|
|
|
collection->addAction(QStringLiteral("toggle-line-numbers"), action); |
|
|
|
|
|
|
|
collection->setDefaultShortcut(action, Qt::CTRL | Qt::ALT | Qt::Key_Backslash); |
|
|
|
|
|
|
|
connect(action, &QAction::triggered, this, &ViewManager::toggleLineNumbers); |
|
|
|
|
|
|
|
_viewContainer->addAction(action); |
|
|
|
|
|
|
|
|
|
|
|
action = new QAction(this); |
|
|
|
action = new QAction(this); |
|
|
|
action->setText(i18nc("@action:inmenu", "Equal size to all views")); |
|
|
|
action->setText(i18nc("@action:inmenu", "Equal size to all views")); |
|
|
|
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_Backslash); |
|
|
|
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_Backslash); |
|
|
|
@ -522,6 +528,22 @@ void ViewManager::toggleSemanticHints() |
|
|
|
activeTerminalDisplay->update(); |
|
|
|
activeTerminalDisplay->update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewManager::toggleLineNumbers() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int currentSessionId = currentSession(); |
|
|
|
|
|
|
|
Q_ASSERT(currentSessionId >= 0); |
|
|
|
|
|
|
|
Session *activeSession = SessionManager::instance()->idToSession(currentSessionId); |
|
|
|
|
|
|
|
Q_ASSERT(activeSession); |
|
|
|
|
|
|
|
auto profile = SessionManager::instance()->sessionProfile(activeSession); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profile->setProperty(Profile::LineNumbers, (profile->lineNumbers() + 1) % 3); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto activeTerminalDisplay = _viewContainer->activeViewSplitter()->activeTerminalDisplay(); |
|
|
|
|
|
|
|
const char *names[3] = {"Never", "Sometimes", "Always"}; |
|
|
|
|
|
|
|
activeTerminalDisplay->showNotification(i18n("Line numbers ") + i18n(names[profile->lineNumbers()])); |
|
|
|
|
|
|
|
activeTerminalDisplay->update(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QHash<TerminalDisplay *, Session *> ViewManager::forgetAll(ViewSplitter *splitter) |
|
|
|
QHash<TerminalDisplay *, Session *> ViewManager::forgetAll(ViewSplitter *splitter) |
|
|
|
{ |
|
|
|
{ |
|
|
|
splitter->setParent(nullptr); |
|
|
|
splitter->setParent(nullptr); |
|
|
|
|