diff options
| author | 2018-07-27 23:51:12 -0400 | |
|---|---|---|
| committer | 2018-07-27 23:51:12 -0400 | |
| commit | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (patch) | |
| tree | 1e50f5f666f419143f510d5ded00fe2006b7bd85 /SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.h | |
| parent | d9aa870e5d509cc7309ab82dd102a937ab58613a (diff) | |
New upstream version 3.2.1+dfsg1upstream/3.2.1+dfsg1
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.h b/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.h index 12486a8..296a9e2 100644 --- a/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.h +++ b/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.h @@ -24,14 +24,15 @@ class SqlQueryItem; class SqlEditor; CFG_KEY_LIST(EditorWindow, QObject::tr("SQL editor window"), - CFG_KEY_ENTRY(EXEC_QUERY, Qt::Key_F9, QObject::tr("Execute query")) - CFG_KEY_ENTRY(EXPLAIN_QUERY, Qt::Key_F8, QObject::tr("Execute \"%1\" query").arg("EXPLAIN")) - CFG_KEY_ENTRY(PREV_DB, Qt::CTRL + Qt::Key_Up, QObject::tr("Switch current working database to previous on the list")) - CFG_KEY_ENTRY(NEXT_DB, Qt::CTRL + Qt::Key_Down, QObject::tr("Switch current working database to next on the list")) - CFG_KEY_ENTRY(SHOW_NEXT_TAB, Qt::ALT + Qt::Key_Right, QObject::tr("Go to next editor tab")) - CFG_KEY_ENTRY(SHOW_PREV_TAB, Qt::ALT + Qt::Key_Left, QObject::tr("Go to previous editor tab")) - CFG_KEY_ENTRY(FOCUS_RESULTS_BELOW, Qt::ALT + Qt::Key_PageDown, QObject::tr("Move keyboard input focus to the results view below")) - CFG_KEY_ENTRY(FOCUS_EDITOR_ABOVE, Qt::ALT + Qt::Key_PageUp, QObject::tr("Move keyboard input focus to the SQL editor above")) + CFG_KEY_ENTRY(EXEC_QUERY, Qt::Key_F9, QObject::tr("Execute query")) + CFG_KEY_ENTRY(EXPLAIN_QUERY, Qt::Key_F8, QObject::tr("Execute \"%1\" query").arg("EXPLAIN")) + CFG_KEY_ENTRY(PREV_DB, Qt::CTRL + Qt::Key_Up, QObject::tr("Switch current working database to previous on the list")) + CFG_KEY_ENTRY(NEXT_DB, Qt::CTRL + Qt::Key_Down, QObject::tr("Switch current working database to next on the list")) + CFG_KEY_ENTRY(SHOW_NEXT_TAB, Qt::ALT + Qt::Key_Right, QObject::tr("Go to next editor tab")) + CFG_KEY_ENTRY(SHOW_PREV_TAB, Qt::ALT + Qt::Key_Left, QObject::tr("Go to previous editor tab")) + CFG_KEY_ENTRY(FOCUS_RESULTS_BELOW, Qt::ALT + Qt::Key_PageDown, QObject::tr("Move keyboard input focus to the results view below")) + CFG_KEY_ENTRY(FOCUS_EDITOR_ABOVE, Qt::ALT + Qt::Key_PageUp, QObject::tr("Move keyboard input focus to the SQL editor above")) + CFG_KEY_ENTRY(DELETE_SINGLE_HISTORY_SQL, QKeySequence::Delete, QObject::tr("Delete selected SQL history entries")) ) class GUI_API_EXPORT EditorWindow : public MdiChild @@ -61,7 +62,8 @@ class GUI_API_EXPORT EditorWindow : public MdiChild FOCUS_EDITOR_ABOVE, CLEAR_HISTORY, EXPORT_RESULTS, - CREATE_VIEW_FROM_QUERY + CREATE_VIEW_FROM_QUERY, + DELETE_SINGLE_HISTORY_SQL }; enum ToolBar @@ -114,6 +116,8 @@ class GUI_API_EXPORT EditorWindow : public MdiChild void setupDefShortcuts(); void selectCurrentQuery(bool fallBackToPreviousIfNecessary = false); void updateShortcutTips(); + void setupSqlHistoryMenu(); + bool processBindParams(QString& sql, QHash<QString, QVariant>& queryParams); static const int queryLimitForSmartExecution = 100; @@ -129,6 +133,7 @@ class GUI_API_EXPORT EditorWindow : public MdiChild int sqlEditorNum = 1; qint64 lastQueryHistoryId = 0; QString lastSuccessfulQuery; + QMenu* sqlHistoryMenu = nullptr; private slots: void execQuery(bool explain = false); @@ -146,7 +151,9 @@ class GUI_API_EXPORT EditorWindow : public MdiChild void focusEditorAbove(); void historyEntrySelected(const QModelIndex& current, const QModelIndex& previous); void historyEntryActivated(const QModelIndex& current); + void deleteSelectedSqlHistory(); void clearHistory(); + void sqlHistoryContextMenuRequested(const QPoint &pos); void exportResults(); void createViewFromQuery(); void updateState(); |
