summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJekyll Wu <adaptee@gmail.com>2012-04-20 05:18:28 (GMT)
committerJekyll Wu <adaptee@gmail.com>2012-04-20 05:18:47 (GMT)
commitcce19d8cb859c1d0e3bc2f019f68aa9b864a87f2 (patch)
tree0e8be92d0182618c286a079cf76ba80f8b437862
parentcc8cdd87c805455f3fc86c55cf0eceaa0ed0bad0 (diff)
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:
-rw-r--r--desktop/partui.rc1
-rw-r--r--src/Part.cpp3
-rw-r--r--src/SessionController.cpp27
3 files changed, 20 insertions, 11 deletions
diff --git a/desktop/partui.rc b/desktop/partui.rc
index 3e000d9..cbcc447 100644
--- a/desktop/partui.rc
+++ b/desktop/partui.rc
@@ -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"/>
diff --git a/src/Part.cpp b/src/Part.cpp
index 3e5339e..9e11943 100644
--- a/src/Part.cpp
+++ b/src/Part.cpp
@@ -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;
}
diff --git a/src/SessionController.cpp b/src/SessionController.cpp
index c4cd0d2..0404f1f 100644
--- a/src/SessionController.cpp
+++ b/src/SessionController.cpp
@@ -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();
}