diff options
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h b/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h index a2ef4f7..642c11a 100644 --- a/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h +++ b/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h @@ -21,18 +21,20 @@ class ViewModifier; class SqlViewModel; CFG_KEY_LIST(ViewWindow, QObject::tr("A view window"), - CFG_KEY_ENTRY(REFRESH_TRIGGERS, Qt::Key_F5, QObject::tr("Refresh view trigger list")) - CFG_KEY_ENTRY(ADD_TRIGGER, Qt::Key_Insert, QObject::tr("Add new trigger")) - CFG_KEY_ENTRY(EDIT_TRIGGER, Qt::Key_Return, QObject::tr("Edit selected trigger")) - CFG_KEY_ENTRY(DEL_TRIGGER, Qt::Key_Delete, QObject::tr("Delete selected trigger")) - CFG_KEY_ENTRY(NEXT_TAB, Qt::ALT + Qt::Key_Right, QObject::tr("Go to next tab")) - CFG_KEY_ENTRY(PREV_TAB, Qt::ALT + Qt::Key_Left, QObject::tr("Go to previous tab")) + CFG_KEY_ENTRY(COMMIT_QUERY, QKeySequence::Save, QObject::tr("Commit the view's query")) + CFG_KEY_ENTRY(ROLLBACK_QUERY, QKeySequence::Cancel, QObject::tr("Rollback pending changes in the view's query")) + CFG_KEY_ENTRY(REFRESH_TRIGGERS, Qt::Key_F5, QObject::tr("Refresh view trigger list")) + CFG_KEY_ENTRY(EXECUTE_QUERY, Qt::Key_F9, QObject::tr("Execute the view's query")) + CFG_KEY_ENTRY(ADD_TRIGGER, Qt::Key_Insert, QObject::tr("Add new trigger")) + CFG_KEY_ENTRY(EDIT_TRIGGER, Qt::Key_Return, QObject::tr("Edit selected trigger")) + CFG_KEY_ENTRY(DEL_TRIGGER, Qt::Key_Delete, QObject::tr("Delete selected trigger")) + CFG_KEY_ENTRY(NEXT_TAB, Qt::ALT + Qt::Key_Right, QObject::tr("Go to next tab")) + CFG_KEY_ENTRY(PREV_TAB, Qt::ALT + Qt::Key_Left, QObject::tr("Go to previous tab")) ) class GUI_API_EXPORT ViewWindow : public MdiChild { - Q_OBJECT - Q_ENUMS(Action) + Q_OBJECT public: enum Action @@ -54,8 +56,10 @@ class GUI_API_EXPORT ViewWindow : public MdiChild DEL_TRIGGER, // All tabs NEXT_TAB, - PREV_TAB + PREV_TAB, + EXECUTE_QUERY }; + Q_ENUM(Action) enum ToolBar { @@ -117,6 +121,7 @@ class GUI_API_EXPORT ViewWindow : public MdiChild int getDataTabIdx() const; int getQueryTabIdx() const; int getDdlTabIdx() const; + void switchToDataAndReload(); Db* db = nullptr; QString database; @@ -137,10 +142,12 @@ class GUI_API_EXPORT ViewWindow : public MdiChild QAction* outputColumnsCheck = nullptr; QAction* outputColumnsSeparator = nullptr; bool tabsMoving = false; + bool loadDataAfterNextCommit = false; private slots: void refreshView(); - void commitView(bool skipWarnings = false); + void executeQuery(); + void commitView(bool skipWarnings = false, bool loadDataAfterNextCommit = false); void rollbackView(); void addTrigger(); void editTrigger(); @@ -168,6 +175,7 @@ class GUI_API_EXPORT ViewWindow : public MdiChild void triggerViewDoubleClicked(const QModelIndex& idx); void updateFont(); void dbChanged(); + void handleObjectModified(Db* db, const QString& database, const QString& object); public slots: void refreshTriggers(); |
