Avoid ambiguity for Ctrl+F in the Execute SQL tab

When the Ctrl+F was used in the Scintilla widgets of the SQL Log or Edit
Database Cell docks, the shortcut was ambiguous with the search find bar
action, which had window context. Now the later has widget context and a
new widget-context shortcut is explicitly connected to the action in the
editors of each new SQL tab.

See issue #1746
This commit is contained in:
mgrojo
2019-04-05 20:54:09 +02:00
parent 5ca95a57bc
commit 9e6bd05f35
2 changed files with 7 additions and 0 deletions

View File

@@ -2264,6 +2264,10 @@ int MainWindow::openSqlTab(bool resetCounter)
w->getEditor()->setFocus();
connect(w, SIGNAL(findFrameVisibilityChanged(bool)), ui->actionSqlFind, SLOT(setChecked(bool)));
// Connect now the find shortcut to the editor with widget context, so it isn't ambiguous with other Scintilla Widgets.
QShortcut* shortcutFind = new QShortcut(ui->actionSqlFind->shortcut(), w->getEditor(), nullptr, nullptr, Qt::WidgetShortcut);
connect(shortcutFind, SIGNAL(activated()), ui->actionSqlFind, SLOT(toggle()));
return index;
}

View File

@@ -2115,6 +2115,9 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed
<property name="shortcut">
<string>Ctrl+F</string>
</property>
<property name="shortcutContext">
<enum>Qt::WidgetShortcut</enum>
</property>
</action>
<action name="actionSqlFindReplace">
<property name="checkable">