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 <QModelIndex>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
|
#include <QShortcut>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "guiutils.h"
|
#include "guiutils.h"
|
||||||
@ -50,6 +51,7 @@
|
|||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
#include "rcldb.h"
|
#include "rcldb.h"
|
||||||
#include "recoll.h"
|
#include "recoll.h"
|
||||||
|
#include "scbase.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -188,6 +190,14 @@ void SSearch::init()
|
|||||||
SLOT(onCompletionActivated(const QString&)));
|
SLOT(onCompletionActivated(const QString&)));
|
||||||
connect(historyPB, SIGNAL(clicked()), this, SLOT(onHistoryClicked()));
|
connect(historyPB, SIGNAL(clicked()), this, SLOT(onHistoryClicked()));
|
||||||
setupButtons();
|
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()
|
void SSearch::setupButtons()
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
class QShortcut;
|
||||||
|
|
||||||
#include "recoll.h"
|
#include "recoll.h"
|
||||||
#include "searchdata.h"
|
#include "searchdata.h"
|
||||||
@ -96,6 +97,7 @@ public slots:
|
|||||||
// Forget current entry and any state (history)
|
// Forget current entry and any state (history)
|
||||||
virtual void clearAll();
|
virtual void clearAll();
|
||||||
virtual void setPrefs();
|
virtual void setPrefs();
|
||||||
|
virtual void onNewShortcuts();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
virtual void searchTextChanged(const QString&);
|
virtual void searchTextChanged(const QString&);
|
||||||
@ -118,6 +120,7 @@ private:
|
|||||||
|
|
||||||
RclCompleterModel *m_completermodel{nullptr};
|
RclCompleterModel *m_completermodel{nullptr};
|
||||||
QCompleter *m_completer{nullptr};
|
QCompleter *m_completer{nullptr};
|
||||||
|
QShortcut *m_histsc{nullptr};
|
||||||
/* We save multiword entries because the completer replaces them with
|
/* We save multiword entries because the completer replaces them with
|
||||||
the completion */
|
the completion */
|
||||||
QString m_savedEditText;
|
QString m_savedEditText;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user