Commit ab0f3110 authored by dockes's avatar dockes
Browse files

CR->search in advanced dialog. ^W close tab in preview

parent 0d4ebfb3
......@@ -407,6 +407,36 @@
<receiver>advsearch</receiver>
<slot>addFiltypPB_clicked()</slot>
</connection>
<connection>
<sender>andWordsLE</sender>
<signal>returnPressed()</signal>
<receiver>advsearch</receiver>
<slot>searchPB_clicked()</slot>
</connection>
<connection>
<sender>orWordsLE</sender>
<signal>returnPressed()</signal>
<receiver>advsearch</receiver>
<slot>searchPB_clicked()</slot>
</connection>
<connection>
<sender>noWordsLE</sender>
<signal>returnPressed()</signal>
<receiver>advsearch</receiver>
<slot>searchPB_clicked()</slot>
</connection>
<connection>
<sender>phraseLE</sender>
<signal>returnPressed()</signal>
<receiver>advsearch</receiver>
<slot>searchPB_clicked()</slot>
</connection>
<connection>
<sender>subtreeLE</sender>
<signal>returnPressed()</signal>
<receiver>advsearch</receiver>
<slot>searchPB_clicked()</slot>
</connection>
</connections>
<includes>
<include location="local" impldecl="in declaration">recoll.h</include>
......
......@@ -181,10 +181,11 @@
<slot>nextPressed()</slot>
<slot>prevPressed()</slot>
<slot>currentChanged( QWidget * tw )</slot>
<slot>closeCurrentTab()</slot>
</slots>
<functions>
<function access="private" specifier="non virtual">init()</function>
<function returnType="void">closeEvent( QCloseEvent * e)</function>
<function>closeEvent( QCloseEvent * e )</function>
<function returnType="bool">eventFilter( QObject * target, QEvent * event )</function>
</functions>
<layoutdefaults spacing="6" margin="11"/>
......
......@@ -38,6 +38,11 @@ bool Preview::eventFilter(QObject *target, QEvent *event)
QKeyEvent *keyEvent = (QKeyEvent *)event;
if (keyEvent->key() == Key_Q && (keyEvent->state() & ControlButton)) {
recollNeedsExit = 1;
return true;
} else if (keyEvent->key() ==Key_W &&(keyEvent->state() & ControlButton)) {
// LOGDEB(("Preview::eventFilter: got ^W\n"));
closeCurrentTab();
return true;
} else if (dynSearchActive) {
if (keyEvent->key() == Key_F3) {
doSearch(true, false);
......@@ -160,3 +165,15 @@ void Preview::currentChanged(QWidget * tw)
((QWidget*)o)->setFocus();
}
}
void Preview::closeCurrentTab()
{
if (pvTab->count() > 1) {
QWidget *tw = pvTab->currentPage();
if (tw)
pvTab->removePage(tw);
} else {
close();
}
}
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