add keyboard accelerators for the result table Ctrl+r -> switch focus to results. Ctrl+o Open current result. Ctrl+Shft+o Open and close recoll. Ctrl+d preview (draft)
This commit is contained in:
parent
47cbf44d19
commit
51b7f63c00
@ -1639,10 +1639,14 @@ void RclMain::on_actionShowResultsAsTable_toggled(bool on)
|
||||
restable->setVisible(on);
|
||||
reslist->setVisible(!on);
|
||||
actionSaveResultsAsCSV->setEnabled(on);
|
||||
static QShortcut tablefocseq(QKeySequence("Ctrl+r"), this);
|
||||
if (!on) {
|
||||
int docnum = restable->getDetailDocNumOrTopRow();
|
||||
if (docnum >= 0)
|
||||
reslist->resultPageFor(docnum);
|
||||
disconnect(&tablefocseq, SIGNAL(activated()),
|
||||
restable, SLOT(takeFocus()));
|
||||
sSearch->takeFocus();
|
||||
} else {
|
||||
int docnum = reslist->pageFirstDocNum();
|
||||
if (docnum >= 0) {
|
||||
@ -1651,6 +1655,8 @@ void RclMain::on_actionShowResultsAsTable_toggled(bool on)
|
||||
nextPageAction->setEnabled(false);
|
||||
prevPageAction->setEnabled(false);
|
||||
firstPageAction->setEnabled(false);
|
||||
connect(&tablefocseq, SIGNAL(activated()),
|
||||
restable, SLOT(takeFocus()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -486,6 +486,9 @@ void ResTable::init()
|
||||
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
tableView->setItemDelegate(new ResTableDelegate(this));
|
||||
tableView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
new QShortcut(QKeySequence("Ctrl+o"), this, SLOT(menuEdit()));
|
||||
new QShortcut(QKeySequence("Ctrl+Shift+o"), this, SLOT(menuEditAndQuit()));
|
||||
new QShortcut(QKeySequence("Ctrl+p"), this, SLOT(menuPreview()));
|
||||
connect(tableView, SIGNAL(customContextMenuRequested(const QPoint&)),
|
||||
this, SLOT(createPopupMenu(const QPoint&)));
|
||||
|
||||
@ -651,6 +654,12 @@ void ResTable::on_tableView_entered(const QModelIndex& index)
|
||||
onTableView_currentChanged(index);
|
||||
}
|
||||
|
||||
void ResTable::takeFocus()
|
||||
{
|
||||
// LOGDEB(("resTable: take focus\n"));
|
||||
tableView->setFocus(Qt::ShortcutFocusReason);
|
||||
}
|
||||
|
||||
void ResTable::setDocSource(RefCntr<DocSequence> nsource)
|
||||
{
|
||||
LOGDEB(("ResTable::setDocSource\n"));
|
||||
@ -908,6 +917,13 @@ void ResTable::menuEdit()
|
||||
if (m_detaildocnum >= 0)
|
||||
emit editRequested(m_detaildoc);
|
||||
}
|
||||
void ResTable::menuEditAndQuit()
|
||||
{
|
||||
if (m_detaildocnum >= 0) {
|
||||
emit editRequested(m_detaildoc);
|
||||
m_rclmain->fileExit();
|
||||
}
|
||||
}
|
||||
void ResTable::menuOpenWith(QAction *act)
|
||||
{
|
||||
if (act == 0)
|
||||
|
||||
@ -137,6 +137,7 @@ public slots:
|
||||
virtual void menuSaveToFile();
|
||||
virtual void menuSaveSelection();
|
||||
virtual void menuEdit();
|
||||
virtual void menuEditAndQuit();
|
||||
virtual void menuOpenWith(QAction *);
|
||||
virtual void menuCopyFN();
|
||||
virtual void menuCopyURL();
|
||||
@ -152,6 +153,7 @@ public slots:
|
||||
virtual void saveAsCSV();
|
||||
virtual void linkWasClicked(const QUrl&);
|
||||
virtual void makeRowVisible(int row);
|
||||
virtual void takeFocus();
|
||||
|
||||
signals:
|
||||
void docPreviewClicked(int, Rcl::Doc, int);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user