Commit cce19d8c authored by Jekyll Wu's avatar Jekyll Wu

Allow searching scrollback in konsolepart

No keyboard shortcuts are provided because they often conflict with
actions from hosting applications. The only way to use this searching
feature is from context menu

FEATURE: 162319
FIXED-IN: 4.9.0
REVIEW: 104608

DIGEST:
parent cc8cdd87
......@@ -7,6 +7,7 @@
<Action name="web-search"/>
<Action name="open-browser"/>
<Separator/>
<Action name="edit_find"/>
<Menu name="history"><text>S&amp;crollback</text>
<Action name="file_save_as" group="session-history-operations"/>
<Separator group="session-history-operations"/>
......
......@@ -260,6 +260,9 @@ void Part::activeViewChanged(SessionController* controller)
disconnect(controller->view(), displaySignal, this, partSlot);
connect(controller->view(), displaySignal, this, partSlot);
// set the current session's search bar
controller->setSearchBar(_viewManager->searchBar());
_pluggedController = controller;
}
......
......@@ -582,6 +582,19 @@ void SessionController::setupCommonActions()
collection->addAction("switch-profile", _switchProfileMenu);
connect(_switchProfileMenu->menu(), SIGNAL(aboutToShow()), this, SLOT(prepareSwitchProfileMenu()));
// History
_searchToggleAction = KStandardAction::find(this, 0, collection);
_searchToggleAction->setShortcut(QKeySequence());
_searchToggleAction->setCheckable(true);
connect(_searchToggleAction, SIGNAL(toggled(bool)), this, SLOT(searchHistory(bool)));
_findNextAction = KStandardAction::findNext(this, SLOT(findNextInHistory()), collection);
_findNextAction->setShortcut(QKeySequence());
_findNextAction->setEnabled(false);
_findPreviousAction = KStandardAction::findPrev(this, SLOT(findPreviousInHistory()), collection);
_findPreviousAction->setShortcut(QKeySequence());
_findPreviousAction->setEnabled(false);
}
void SessionController::setupExtraActions()
......@@ -662,18 +675,10 @@ void SessionController::setupExtraActions()
action->setIcon(KIcon("format-font-size-less"));
action->setShortcut(KShortcut(Qt::CTRL | Qt::Key_Minus));
// History
_searchToggleAction = KStandardAction::find(this, 0, collection);
_searchToggleAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_F));
_searchToggleAction->setCheckable(true);
connect(_searchToggleAction, SIGNAL(toggled(bool)), this, SLOT(searchHistory(bool)));
_findNextAction = KStandardAction::findNext(this, SLOT(findNextInHistory()), collection);
_findNextAction->setEnabled(false);
_findPreviousAction = KStandardAction::findPrev(this, SLOT(findPreviousInHistory()), collection);
_findPreviousAction->setShortcut(QKeySequence(Qt::Key_F3));
_findPreviousAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F3));
_findPreviousAction->setEnabled(false);
}
void SessionController::switchProfile(Profile::Ptr profile)
......@@ -995,7 +1000,7 @@ void SessionController::listenForScreenWindowUpdates()
void SessionController::updateSearchFilter()
{
if (_searchFilter) {
Q_ASSERT(searchBar() && searchBar()->isVisible());
Q_ASSERT(searchBar());
_view->processFilters();
}
......
Markdown is supported
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