simple search: add Ctrl+H as keyboard shortcut for "show history"
This commit is contained in:
parent
275a1210e0
commit
6b22d38a3e
@ -38,6 +38,7 @@
|
||||
#include <QModelIndex>
|
||||
#include <QTimer>
|
||||
#include <QListView>
|
||||
#include <QShortcut>
|
||||
|
||||
#include "log.h"
|
||||
#include "guiutils.h"
|
||||
@ -50,6 +51,7 @@
|
||||
#include "smallut.h"
|
||||
#include "rcldb.h"
|
||||
#include "recoll.h"
|
||||
#include "scbase.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -188,6 +190,14 @@ void SSearch::init()
|
||||
SLOT(onCompletionActivated(const QString&)));
|
||||
connect(historyPB, SIGNAL(clicked()), this, SLOT(onHistoryClicked()));
|
||||
setupButtons();
|
||||
onNewShortcuts();
|
||||
connect(&SCBase::scBase(), SIGNAL(shortcutsChanged()),this, SLOT(onNewShortcuts()));
|
||||
}
|
||||
|
||||
void SSearch::onNewShortcuts()
|
||||
{
|
||||
SETSHORTCUT(this, "ssearch:197", tr("Simple search"), tr("History"),
|
||||
"Ctrl+H", m_histsc, onHistoryClicked);
|
||||
}
|
||||
|
||||
void SSearch::setupButtons()
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#include <QPixmap>
|
||||
|
||||
class QTimer;
|
||||
class QShortcut;
|
||||
|
||||
#include "recoll.h"
|
||||
#include "searchdata.h"
|
||||
@ -96,6 +97,7 @@ public slots:
|
||||
// Forget current entry and any state (history)
|
||||
virtual void clearAll();
|
||||
virtual void setPrefs();
|
||||
virtual void onNewShortcuts();
|
||||
|
||||
private slots:
|
||||
virtual void searchTextChanged(const QString&);
|
||||
@ -118,6 +120,7 @@ private:
|
||||
|
||||
RclCompleterModel *m_completermodel{nullptr};
|
||||
QCompleter *m_completer{nullptr};
|
||||
QShortcut *m_histsc{nullptr};
|
||||
/* We save multiword entries because the completer replaces them with
|
||||
the completion */
|
||||
QString m_savedEditText;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user