Make Ctrl+T shortcut to work for "Open tab" in "Execute SQL"

This shortcut was set for the following actions, making it ambiguous:
"View > DB Toolbar" and "Open tab" in "Execute SQL". Additionally it was
used by QScintilla for transposing lines.

Shortcut for "View > DB Toolbar" has been removed, since it's not
considered a frequently used action and there are other toolbars without
shortcut. The shortcut for QScintilla has been changed to "Ctrl+Shift+Up".

The now working shortcut is added to the "Open tab" action's tool-tip for
documentation purposes.

See issue #1647
This commit is contained in:
mgrojo
2018-12-28 13:04:17 +01:00
parent 0ffed5e287
commit 8f59d3aed6
3 changed files with 5 additions and 3 deletions
+1
View File
@@ -512,6 +512,7 @@ void MainWindow::init()
addShortcutsTooltip(ui->buttonRefresh, {shortcutBrowseRefreshF5->key(), shortcutBrowseRefreshCtrlR->key()});
addShortcutsTooltip(ui->buttonPrintTable, {shortcutPrint->key()});
addShortcutsTooltip(ui->actionSqlOpenTab);
addShortcutsTooltip(ui->actionSqlPrint);
addShortcutsTooltip(ui->actionExecuteSql, {shortcutBrowseRefreshF5->key(), shortcutBrowseRefreshCtrlR->key()});
addShortcutsTooltip(ui->actionSqlExecuteLine);
-3
View File
@@ -1684,9 +1684,6 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed
<property name="whatsThis">
<string>Shows or hides the Database toolbar.</string>
</property>
<property name="shortcut">
<string>Ctrl+T</string>
</property>
<property name="menuRole">
<enum>QAction::NoRole</enum>
</property>
+4
View File
@@ -34,6 +34,10 @@ SqlTextEdit::SqlTextEdit(QWidget* parent) :
command = standardCommands()->boundTo(Qt::ControlModifier+Qt::ShiftModifier+Qt::Key_Slash);
command->setKey(0);
// Change command binding for Ctrl+T so it doesn't interfere with "Open tab"
command = standardCommands()->boundTo(Qt::ControlModifier+Qt::Key_T);
command->setKey(Qt::ControlModifier+Qt::ShiftModifier+Qt::Key_Up);
QShortcut* shortcutToggleComment = new QShortcut(QKeySequence(tr("Ctrl+/")), this, nullptr, nullptr, Qt::WidgetShortcut);
connect(shortcutToggleComment, &QShortcut::activated, this, &SqlTextEdit::toggleBlockComment);