aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
commit3565aad630864ecdbe53fdaa501ea708555b3c7c (patch)
treec743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h
parent1fdc150116cad39aae5c5da407c3312b47a59e3a (diff)
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.h28
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();