Change result table "open and quit" shortcut to use Ctrl+Alt+Shift to avoid conflict with "jump to row". Add "copy text and quit"

This commit is contained in:
Jean-Francois Dockes 2021-08-30 08:56:52 +02:00
parent 3cd8506ff8
commit aae1f07a9f
5 changed files with 45 additions and 16 deletions

View File

@ -428,7 +428,7 @@ alink="#0000FF">
<div class="list-of-tables"> <div class="list-of-tables">
<p><b>List of Tables</b></p> <p><b>List of Tables</b></p>
<dl> <dl>
<dt>3.1. <a href="#idm1472">Keyboard shortcuts</a></dt> <dt>3.1. <a href="#idm1478">Keyboard shortcuts</a></dt>
</dl> </dl>
</div> </div>
<div class="chapter"> <div class="chapter">
@ -4074,8 +4074,16 @@ fs.inotify.max_user_watches=32768
the GUI preferences. Most shortcuts are specific to a the GUI preferences. Most shortcuts are specific to a
given context (e.g. within a preview window, within the given context (e.g. within a preview window, within the
result table).</p> result table).</p>
<p>Most shortcuts can be changed to a preferred value by
using the GUI shortcut editor: <span class=
"guimenu">Preferences</span><span class=
"guimenuitem">GUI configuration</span><span class=
"guimenuitem">Shortcuts</span>. In order to change a
shortcut, just click the corresponding cell in the
<span class="guilabel">Shortcut</span> column, and type
the desired sequence.</p>
<div class="table"> <div class="table">
<a name="idm1472" id="idm1472"></a> <a name="idm1478" id="idm1478"></a>
<p class="title"><b>Table&nbsp;3.1.&nbsp;Keyboard <p class="title"><b>Table&nbsp;3.1.&nbsp;Keyboard
shortcuts</b></p> shortcuts</b></p>
<div class="table-contents"> <div class="table-contents">

View File

@ -2963,6 +2963,14 @@ fs.inotify.max_user_watches=32768
preferences. Most shortcuts are specific to a given context preferences. Most shortcuts are specific to a given context
(e.g. within a preview window, within the result table).</para> (e.g. within a preview window, within the result table).</para>
<para>Most shortcuts can be changed to a preferred value by using the GUI shortcut editor:
<menuchoice>
<guimenu>Preferences</guimenu>
<guimenuitem>GUI configuration</guimenuitem>
<guimenuitem>Shortcuts</guimenuitem>
</menuchoice>. In order to change a shortcut, just click the corresponding cell in
the <guilabel>Shortcut</guilabel> column, and type the desired sequence.</para>
<table frame='all'> <table frame='all'>
<title>Keyboard shortcuts</title> <title>Keyboard shortcuts</title>
<tgroup cols='2' align='left' colsep='1' rowsep='1'> <tgroup cols='2' align='left' colsep='1' rowsep='1'>
@ -3065,13 +3073,18 @@ fs.inotify.max_user_watches=32768
document to the clipboard</entry> <entry>Ctrl+G</entry> document to the clipboard</entry> <entry>Ctrl+G</entry>
</row> </row>
<row> <row>
<entry>Open the current document and exit Recoll</entry> <entry>Copy the text contained in the selected
<entry>Ctrl+Shift+O</entry> document to the clipboard, then exit recoll</entry>
<entry>Ctrl+Alt+Shift+G</entry>
</row> </row>
<row> <row>
<entry>Open the current document</entry> <entry>Open the current document</entry>
<entry>Ctrl+O</entry> <entry>Ctrl+O</entry>
</row> </row>
<row>
<entry>Open the current document and exit Recoll</entry>
<entry>Ctrl+Alst+Shift+O</entry>
</row>
<row> <row>
<entry>Show a full preview for the current document</entry> <entry>Show a full preview for the current document</entry>
<entry>Ctrl+D</entry> <entry>Ctrl+D</entry>

View File

@ -718,7 +718,7 @@ void ResTable::onNewShortcuts()
tr("Open current result document"),"Ctrl+O", m_opensc, menuEdit); tr("Open current result document"),"Ctrl+O", m_opensc, menuEdit);
SETSHORTCUT(this, "restable:706", tr("Result Table"), SETSHORTCUT(this, "restable:706", tr("Result Table"),
tr("Open current result and quit"), tr("Open current result and quit"),
"Ctrl+Shift+O", m_openquitsc, menuEditAndQuit); "Ctrl+Alt+Shift+O", m_openquitsc, menuEditAndQuit);
SETSHORTCUT(this, "restable:709", tr("Result Table"), tr("Preview"), SETSHORTCUT(this, "restable:709", tr("Result Table"), tr("Preview"),
"Ctrl+D", m_previewsc, menuPreview); "Ctrl+D", m_previewsc, menuPreview);
SETSHORTCUT(this, "restable:711", tr("Result Table"), tr("Show snippets"), SETSHORTCUT(this, "restable:711", tr("Result Table"), tr("Show snippets"),
@ -731,9 +731,12 @@ void ResTable::onNewShortcuts()
SETSHORTCUT(this, "restable:718", tr("Result Table"), SETSHORTCUT(this, "restable:718", tr("Result Table"),
tr("Copy current result text to clipboard"), tr("Copy current result text to clipboard"),
"Ctrl+G", m_copycurtextsc, menuCopyText); "Ctrl+G", m_copycurtextsc, menuCopyText);
SETSHORTCUT(this, "restable:734", tr("Result Table"),
tr("Copy result text and quit"),
"Ctrl+Alt+Shift+G", m_copycurtextquitsc, menuCopyTextAndQuit);
std::vector<QShortcut*> scps={ std::vector<QShortcut*> scps={
m_opensc, m_openquitsc, m_previewsc, m_showsnipssc, m_showheadersc, m_opensc, m_openquitsc, m_previewsc, m_showsnipssc, m_showheadersc,
m_showvheadersc, m_copycurtextsc}; m_showvheadersc, m_copycurtextsc, m_copycurtextquitsc};
for (auto& scp : scps) { for (auto& scp : scps) {
scp->setContext(Qt::WidgetWithChildrenShortcut); scp->setContext(Qt::WidgetWithChildrenShortcut);
} }
@ -1339,6 +1342,14 @@ void ResTable::menuCopyText()
} }
} }
void ResTable::menuCopyTextAndQuit()
{
if (m_detaildocnum >= 0 && rcldb) {
menuCopyText();
m_rclmain->fileExit();
}
}
void ResTable::menuExpand() void ResTable::menuExpand()
{ {
if (m_detaildocnum >= 0) if (m_detaildocnum >= 0)

View File

@ -172,6 +172,7 @@ public slots:
virtual void menuCopyPath(); virtual void menuCopyPath();
virtual void menuCopyURL(); virtual void menuCopyURL();
virtual void menuCopyText(); virtual void menuCopyText();
virtual void menuCopyTextAndQuit();
virtual void menuExpand(); virtual void menuExpand();
virtual void menuPreviewParent(); virtual void menuPreviewParent();
virtual void menuOpenParent(); virtual void menuOpenParent();
@ -229,6 +230,7 @@ private:
QShortcut *m_showheadersc{nullptr}; QShortcut *m_showheadersc{nullptr};
QShortcut *m_showvheadersc{nullptr}; QShortcut *m_showvheadersc{nullptr};
QShortcut *m_copycurtextsc{nullptr}; QShortcut *m_copycurtextsc{nullptr};
QShortcut *m_copycurtextquitsc{nullptr};
std::vector<SCData*> m_rowlinks; std::vector<SCData*> m_rowlinks;
std::vector<QShortcut *> m_rowsc; std::vector<QShortcut *> m_rowsc;
}; };

View File

@ -104,8 +104,7 @@ void UIPrefsDialog::init()
connect(resetscPB, SIGNAL(clicked()), this, SLOT(resetShortcuts())); connect(resetscPB, SIGNAL(clicked()), this, SLOT(resetShortcuts()));
(void)new HelpClient(this); (void)new HelpClient(this);
HelpClient::installMap("sctab", "RCL.SEARCH.GUI.SHORTCUTS"); HelpClient::installMap("tab_shortcuts", "RCL.SEARCH.GUI.SHORTCUTS");
setFromPrefs(); setFromPrefs();
} }
@ -299,14 +298,10 @@ void UIPrefsDialog::readShortcutsInternal(const QStringList& sl)
{ {
shortcutsTB->setRowCount(0); shortcutsTB->setRowCount(0);
shortcutsTB->setColumnCount(4); shortcutsTB->setColumnCount(4);
shortcutsTB->setHorizontalHeaderItem( shortcutsTB->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Context")));
0, new QTableWidgetItem(tr("Context"))); shortcutsTB->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Description")));
shortcutsTB->setHorizontalHeaderItem( shortcutsTB->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Shortcut")));
1, new QTableWidgetItem(tr("Description"))); shortcutsTB->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Default")));
shortcutsTB->setHorizontalHeaderItem(
2, new QTableWidgetItem(tr("Shortcut")));
shortcutsTB->setHorizontalHeaderItem(
3, new QTableWidgetItem(tr("Default")));
int row = 0; int row = 0;
m_scids.clear(); m_scids.clear();
for (int i = 0; i < sl.size();) { for (int i = 0; i < sl.size();) {