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
+13 -2
View File
@@ -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<QShortcut*> 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)
+2
View File
@@ -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<SCData*> m_rowlinks;
std::vector<QShortcut *> m_rowsc;
};
+5 -10
View File
@@ -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();) {