arrange so that shift-ctrl-s selects search text if focus already in search entry
This commit is contained in:
parent
2bfad4d976
commit
6efeec9d9e
4 changed files with 12 additions and 9 deletions
|
@ -223,8 +223,7 @@ void RclMain::init()
|
|||
// A shortcut to get the focus back to the search entry.
|
||||
QKeySequence seq("Ctrl+Shift+s");
|
||||
QShortcut *sc = new QShortcut(seq, this);
|
||||
connect(sc, SIGNAL (activated()),
|
||||
this, SLOT (focusToSearch()));
|
||||
connect(sc, SIGNAL (activated()), sSearch, SLOT (takeFocus()));
|
||||
|
||||
connect(&m_watcher, SIGNAL(fileChanged(QString)),
|
||||
this, SLOT(idxStatus()));
|
||||
|
@ -466,12 +465,6 @@ void RclMain::viewUrl()
|
|||
}
|
||||
}
|
||||
|
||||
void RclMain::focusToSearch()
|
||||
{
|
||||
LOGDEB(("Giving focus to sSearch\n"));
|
||||
sSearch->queryText->setFocus(Qt::ShortcutFocusReason);
|
||||
}
|
||||
|
||||
void RclMain::setStemLang(QAction *id)
|
||||
{
|
||||
LOGDEB(("RclMain::setStemLang(%p)\n", id));
|
||||
|
|
|
@ -142,7 +142,6 @@ public slots:
|
|||
virtual void catgFilter(int);
|
||||
virtual void initDbOpen();
|
||||
virtual void toggleFullScreen();
|
||||
virtual void focusToSearch();
|
||||
virtual void on_actionSortByDateAsc_toggled(bool on);
|
||||
virtual void on_actionSortByDateDesc_toggled(bool on);
|
||||
virtual void on_actionShowResultsAsTable_toggled(bool on);
|
||||
|
|
|
@ -81,6 +81,15 @@ void SSearch::init()
|
|||
m_keystroke = false;
|
||||
}
|
||||
|
||||
void SSearch::takeFocus()
|
||||
{
|
||||
LOGDEB2(("SSearch: take focus\n"));
|
||||
queryText->setFocus(Qt::ShortcutFocusReason);
|
||||
// If the focus was already in the search entry, the text is not selected.
|
||||
// Do it for consistency
|
||||
queryText->lineEdit()->selectAll();
|
||||
}
|
||||
|
||||
void SSearch::timerDone()
|
||||
{
|
||||
QString qs = queryText->currentText();
|
||||
|
|
|
@ -58,6 +58,8 @@ public slots:
|
|||
virtual void completionTermChosen(const QString& text);
|
||||
virtual void wrapupCompletion();
|
||||
virtual void timerDone();
|
||||
virtual void takeFocus();
|
||||
|
||||
signals:
|
||||
void startSearch(RefCntr<Rcl::SearchData>, bool);
|
||||
void clearSearch();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue