-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
98 lines (86 loc) · 2.29 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtGui>
#include <QtSql>
#include "sqleditor.h"
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void newQuery();
void updateAllUi();
void updateTablesListView();
void updateQueriesListView();
void updateTitle();
void on_saveQuery(QString name, QString sql, QString oldName);
void on_sqleditorClosed(QCloseEvent *event, QString name);
signals:
void querySaved(QString,QString);
protected:
void closeEvent(QCloseEvent *event);
private:
QMap<QString, sqleditor*> openEditors;
sqleditor* create_sqleditor_window(QString title, QString sql, bool isNew);
void reset_project();
sqleditor *activeSqlEditor();
QMdiSubWindow *findSqlEditor(const QString &queryName);
QString dbFilename;
QString sqlearnFilename;
QSignalMapper* windowMapper;
int newQueryCounter;
bool isNew;
bool isUnsaved;
bool generateTempDbFName();
void reset_ui();
void load_from_file(QString fileName);
void save_to_file(QString fileName);
bool tmp_db_is_open();
void open_tmp_db();
void close_tmp_db();
QByteArray tmp_db_to_byte_array();
void createMenus();
void createActions();
//MainWindowUI *ui;
QListView *tablesListView;
QListView *queriesListView;
QMdiArea *mdiArea;
QMenu *fileMenu;
QMenu *editMenu;
QMenu *queryMenu;
QMenu *windowMenu;
QMenu *helpMenu;
QAction *newAct;
QAction *newQueryAct;
QAction *openAct;
QAction *saveAct;
QAction *saveAsAct;
QAction *closeAct;
QAction *closeSEAct;
QAction *closeAllAct;
QAction *tileAct;
QAction *cascadeAct;
QAction *nextAct;
QAction *previousAct;
QAction *separatorAct;
QAction *exitAct;
QAction *aboutAct;
QAction *aboutQtAct;
QMap<QString, QString> queries;
private slots:
void newFile();
void open();
void save();
void saveAs();
void close();
void about();
void queryListItemDoubleClicked(QModelIndex);
void showQueriesContextMenu(const QPoint& pos);
void setActiveSubWindow(QWidget *window);
void updateWindowMenu();
void switchLayoutDirection();
};
#endif // MAINWINDOW_H