mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
MainWindow: Add Ctrl+Return shortcut for executing SQL and add tooltips
Add the Ctrl+Return shortcut for executing the current SQL again. This needs to be done using C++ code instead of setting it in Qt Designer because setting multiple shortcuts in the latter means defining a key sequence row. Also add the keyboard shortcuts to the tooltips of the buttons as they didn't appear anywhere in the program.
This commit is contained in:
@@ -79,6 +79,11 @@ void MainWindow::init()
|
||||
ui->dbTreeWidget->setColumnHidden(1, true);
|
||||
ui->dbTreeWidget->setColumnWidth(0, 300);
|
||||
|
||||
// Add keyboard shortcuts
|
||||
QList<QKeySequence> shortcuts = ui->actionExecuteSql->shortcuts();
|
||||
shortcuts.push_back(QKeySequence(tr("Ctrl+Return")));
|
||||
ui->actionExecuteSql->setShortcuts(shortcuts);
|
||||
|
||||
// Create the actions for the recently opened dbs list
|
||||
for(int i = 0; i < MaxRecentFiles; ++i) {
|
||||
recentFileActs[i] = new QAction(this);
|
||||
|
||||
@@ -1360,6 +1360,9 @@
|
||||
<property name="text">
|
||||
<string>&Execute SQL</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Execute SQL [F5, Ctrl+Return]</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F5</string>
|
||||
</property>
|
||||
@@ -1402,6 +1405,9 @@
|
||||
<property name="text">
|
||||
<string>Execute current line</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Execute current line [Ctrl+E]</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+E</string>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user