From aae1f07a9f7f4aa7192b09c8e6c84e382f6644c1 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Mon, 30 Aug 2021 08:56:52 +0200 Subject: [PATCH] Change result table "open and quit" shortcut to use Ctrl+Alt+Shift to avoid conflict with "jump to row". Add "copy text and quit" --- src/doc/user/usermanual.html | 12 ++++++++++-- src/doc/user/usermanual.xml | 17 +++++++++++++++-- src/qtgui/restable.cpp | 15 +++++++++++++-- src/qtgui/restable.h | 2 ++ src/qtgui/uiprefs_w.cpp | 15 +++++---------- 5 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/doc/user/usermanual.html b/src/doc/user/usermanual.html index b5f6d94a..7e34fd73 100644 --- a/src/doc/user/usermanual.html +++ b/src/doc/user/usermanual.html @@ -428,7 +428,7 @@ alink="#0000FF">

List of Tables

-
3.1. Keyboard shortcuts
+
3.1. Keyboard shortcuts
@@ -4074,8 +4074,16 @@ fs.inotify.max_user_watches=32768 the GUI preferences. Most shortcuts are specific to a given context (e.g. within a preview window, within the result table).

+

Most shortcuts can be changed to a preferred value by + using the GUI shortcut editor: PreferencesGUI configurationShortcuts. In order to change a + shortcut, just click the corresponding cell in the + Shortcut column, and type + the desired sequence.

- +

Table 3.1. Keyboard shortcuts

diff --git a/src/doc/user/usermanual.xml b/src/doc/user/usermanual.xml index c8b801e5..856bcedd 100644 --- a/src/doc/user/usermanual.xml +++ b/src/doc/user/usermanual.xml @@ -2963,6 +2963,14 @@ fs.inotify.max_user_watches=32768 preferences. Most shortcuts are specific to a given context (e.g. within a preview window, within the result table). + Most shortcuts can be changed to a preferred value by using the GUI shortcut editor: + + Preferences + GUI configuration + Shortcuts + . In order to change a shortcut, just click the corresponding cell in + the Shortcut column, and type the desired sequence. + Keyboard shortcuts @@ -3065,13 +3073,18 @@ fs.inotify.max_user_watches=32768 document to the clipboard Ctrl+G - Open the current document and exit Recoll - Ctrl+Shift+O + Copy the text contained in the selected + document to the clipboard, then exit recoll + Ctrl+Alt+Shift+G Open the current document Ctrl+O + + Open the current document and exit Recoll + Ctrl+Alst+Shift+O + Show a full preview for the current document Ctrl+D diff --git a/src/qtgui/restable.cpp b/src/qtgui/restable.cpp index 051984b4..95c26cd9 100644 --- a/src/qtgui/restable.cpp +++ b/src/qtgui/restable.cpp @@ -718,7 +718,7 @@ void ResTable::onNewShortcuts() tr("Open current result document"),"Ctrl+O", m_opensc, menuEdit); SETSHORTCUT(this, "restable:706", tr("Result Table"), 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"), "Ctrl+D", m_previewsc, menuPreview); SETSHORTCUT(this, "restable:711", tr("Result Table"), tr("Show snippets"), @@ -731,9 +731,12 @@ void ResTable::onNewShortcuts() SETSHORTCUT(this, "restable:718", tr("Result Table"), tr("Copy current result text to clipboard"), "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 scps={ m_opensc, m_openquitsc, m_previewsc, m_showsnipssc, m_showheadersc, - m_showvheadersc, m_copycurtextsc}; + m_showvheadersc, m_copycurtextsc, m_copycurtextquitsc}; for (auto& scp : scps) { 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() { if (m_detaildocnum >= 0) diff --git a/src/qtgui/restable.h b/src/qtgui/restable.h index a1cca9c3..ed4e3249 100644 --- a/src/qtgui/restable.h +++ b/src/qtgui/restable.h @@ -172,6 +172,7 @@ public slots: virtual void menuCopyPath(); virtual void menuCopyURL(); virtual void menuCopyText(); + virtual void menuCopyTextAndQuit(); virtual void menuExpand(); virtual void menuPreviewParent(); virtual void menuOpenParent(); @@ -229,6 +230,7 @@ private: QShortcut *m_showheadersc{nullptr}; QShortcut *m_showvheadersc{nullptr}; QShortcut *m_copycurtextsc{nullptr}; + QShortcut *m_copycurtextquitsc{nullptr}; std::vector m_rowlinks; std::vector m_rowsc; }; diff --git a/src/qtgui/uiprefs_w.cpp b/src/qtgui/uiprefs_w.cpp index 16507180..0ccd7458 100644 --- a/src/qtgui/uiprefs_w.cpp +++ b/src/qtgui/uiprefs_w.cpp @@ -104,8 +104,7 @@ void UIPrefsDialog::init() connect(resetscPB, SIGNAL(clicked()), this, SLOT(resetShortcuts())); (void)new HelpClient(this); - HelpClient::installMap("sctab", "RCL.SEARCH.GUI.SHORTCUTS"); - + HelpClient::installMap("tab_shortcuts", "RCL.SEARCH.GUI.SHORTCUTS"); setFromPrefs(); } @@ -299,14 +298,10 @@ void UIPrefsDialog::readShortcutsInternal(const QStringList& sl) { shortcutsTB->setRowCount(0); shortcutsTB->setColumnCount(4); - shortcutsTB->setHorizontalHeaderItem( - 0, new QTableWidgetItem(tr("Context"))); - shortcutsTB->setHorizontalHeaderItem( - 1, new QTableWidgetItem(tr("Description"))); - shortcutsTB->setHorizontalHeaderItem( - 2, new QTableWidgetItem(tr("Shortcut"))); - shortcutsTB->setHorizontalHeaderItem( - 3, new QTableWidgetItem(tr("Default"))); + shortcutsTB->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Context"))); + shortcutsTB->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Description"))); + shortcutsTB->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Shortcut"))); + shortcutsTB->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Default"))); int row = 0; m_scids.clear(); for (int i = 0; i < sl.size();) {