|
|
|
@ -457,6 +457,13 @@ void SessionController::updateCopyAction(const bool selectionEmpty) |
|
|
|
// copy action is meaningful only when some text is selected.
|
|
|
|
// copy action is meaningful only when some text is selected.
|
|
|
|
copyAction->setEnabled(!selectionEmpty); |
|
|
|
copyAction->setEnabled(!selectionEmpty); |
|
|
|
copyContextMenu->setVisible(!selectionEmpty); |
|
|
|
copyContextMenu->setVisible(!selectionEmpty); |
|
|
|
|
|
|
|
QAction *Action = actionCollection()->action(QStringLiteral("edit_copy_contextmenu_in")); |
|
|
|
|
|
|
|
bool hasRepl = view() && view()->screenWindow() && view()->screenWindow()->screen() && view()->screenWindow()->screen()->hasRepl(); |
|
|
|
|
|
|
|
Action->setVisible(!selectionEmpty && hasRepl); |
|
|
|
|
|
|
|
Action = actionCollection()->action(QStringLiteral("edit_copy_contextmenu_out")); |
|
|
|
|
|
|
|
Action->setVisible(!selectionEmpty && hasRepl); |
|
|
|
|
|
|
|
Action = actionCollection()->action(QStringLiteral("edit_copy_contextmenu_in_out")); |
|
|
|
|
|
|
|
Action->setVisible(!selectionEmpty && hasRepl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SessionController::updateWebSearchMenu() |
|
|
|
void SessionController::updateWebSearchMenu() |
|
|
|
@ -639,6 +646,24 @@ void SessionController::setupCommonActions() |
|
|
|
action->setVisible(false); |
|
|
|
action->setVisible(false); |
|
|
|
connect(action, &QAction::triggered, this, &SessionController::copy); |
|
|
|
connect(action, &QAction::triggered, this, &SessionController::copy); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
action = collection->addAction(QStringLiteral("edit_copy_contextmenu_in_out")); |
|
|
|
|
|
|
|
action->setText(i18n("Copy except propmts")); |
|
|
|
|
|
|
|
action->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy"))); |
|
|
|
|
|
|
|
action->setVisible(false); |
|
|
|
|
|
|
|
connect(action, &QAction::triggered, this, &SessionController::copyInputOutput); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
action = collection->addAction(QStringLiteral("edit_copy_contextmenu_in")); |
|
|
|
|
|
|
|
action->setText(i18n("Copy user input")); |
|
|
|
|
|
|
|
action->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy"))); |
|
|
|
|
|
|
|
action->setVisible(false); |
|
|
|
|
|
|
|
connect(action, &QAction::triggered, this, &SessionController::copyInput); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
action = collection->addAction(QStringLiteral("edit_copy_contextmenu_out")); |
|
|
|
|
|
|
|
action->setText(i18n("Copy command output")); |
|
|
|
|
|
|
|
action->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy"))); |
|
|
|
|
|
|
|
action->setVisible(false); |
|
|
|
|
|
|
|
connect(action, &QAction::triggered, this, &SessionController::copyOutput); |
|
|
|
|
|
|
|
|
|
|
|
action = KStandardAction::paste(this, &SessionController::paste, collection); |
|
|
|
action = KStandardAction::paste(this, &SessionController::paste, collection); |
|
|
|
QList<QKeySequence> pasteShortcut; |
|
|
|
QList<QKeySequence> pasteShortcut; |
|
|
|
pasteShortcut.append(QKeySequence(Konsole::ACCEL | Qt::Key_V)); |
|
|
|
pasteShortcut.append(QKeySequence(Konsole::ACCEL | Qt::Key_V)); |
|
|
|
@ -1122,6 +1147,21 @@ void SessionController::copy() |
|
|
|
view()->copyToClipboard(); |
|
|
|
view()->copyToClipboard(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SessionController::copyInput() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
view()->copyToClipboard(Screen::ExcludePrompt | Screen::ExcludeOutput); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SessionController::copyOutput() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
view()->copyToClipboard(Screen::ExcludePrompt | Screen::ExcludeInput); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SessionController::copyInputOutput() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
view()->copyToClipboard(Screen::ExcludePrompt); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SessionController::paste() |
|
|
|
void SessionController::paste() |
|
|
|
{ |
|
|
|
{ |
|
|
|
view()->pasteFromClipboard(); |
|
|
|
view()->pasteFromClipboard(); |
|
|
|
|