Add Commit and Rollback buttons to the Query Tool. Fixes #2418

This commit is contained in:
Akshay Joshi
2019-02-22 14:28:05 +00:00
committed by Dave Page
parent 0766b17726
commit 38b034ec3c
19 changed files with 453 additions and 110 deletions

View File

@@ -181,6 +181,8 @@ function keyboardShortcutsQueryTool(
let nextPanelKeys = sqlEditorController.preferences.move_next;
let previousPanelKeys = sqlEditorController.preferences.move_previous;
let toggleCaseKeys = sqlEditorController.preferences.toggle_case;
let commitKeys = sqlEditorController.preferences.commit_transaction;
let rollbackKeys = sqlEditorController.preferences.rollback_transaction;
if (this.validateShortcutKeys(executeKeys, event)) {
this._stopEventPropagation(event);
@@ -197,6 +199,18 @@ function keyboardShortcutsQueryTool(
} else if (this.validateShortcutKeys(toggleCaseKeys, event)) {
this._stopEventPropagation(event);
queryToolActions.toggleCaseOfSelectedText(sqlEditorController);
} else if (this.validateShortcutKeys(commitKeys, event)) {
// If transaction buttons are disabled then no need to execute commit.
if (!sqlEditorController.is_transaction_buttons_disabled) {
this._stopEventPropagation(event);
queryToolActions.executeCommit(sqlEditorController);
}
} else if (this.validateShortcutKeys(rollbackKeys, event)) {
// If transaction buttons are disabled then no need to execute rollback.
if (!sqlEditorController.is_transaction_buttons_disabled) {
this._stopEventPropagation(event);
queryToolActions.executeRollback(sqlEditorController);
}
} else if ((
(this.isMac() && event.metaKey) ||
(!this.isMac() && event.ctrlKey)