1 #ifndef __MAINWINDOW_H__
2 #define __MAINWINDOW_H__
13 class BlockLibraryWidget;
19 #define MAGIC_STRING "opentrace"
20 #define VERSION_MAJ (quint8)0 // major version code
21 #define VERSION_MIN (quint8)2 // minor version number
22 #define REVISION (quint8)1 // revision number of current version
26 #define TRACE_MENU (quint8)1
28 // defines for actions
29 #define NONE_ACT (quint16)0
31 #define PROJECT_NEW (quint16)1
32 #define PROJECT_OPEN (quint16)2
33 #define PROJECT_SAVE (quint16)4
34 #define PROJECT_SAVEAS (quint16)8
35 #define PROJECT_CLOSE (quint16)16
36 #define PROJECT_LIB (quint16)32
38 #define OP_ADD (quint8)0
39 #define OP_REM (quint8)1
40 #define OP_RAZ (quint8)2
46 class MainWindow : public QMainWindow {
51 explicit MainWindow(QWidget *parent = 0);
55 void addTopGroup(GroupWidget* _topGroup);
56 void removeTopGroup(); // called when closing project
59 inline BlockLibraryWidget *getLibrary(){return library;}
63 void closeEvent(QCloseEvent *);
64 void mousePressEvent(QMouseEvent *e);
65 void focusInEvent(QFocusEvent *e);
69 GroupWidget* topGroup;
70 QStackedWidget *stackedWidget;
71 Dispatcher *dispatcher;
73 BlockLibraryWidget *library;
75 QString absoluteFilename;
77 QString checkNewVersion;
79 void save(QString absoluteFilename);
91 quint16 projectMenuEnb;
97 QAction* saveAsProject;
98 QAction* closeProject;
101 QAction *newBlockWidgetAct;
102 QAction *graphValidation;
105 // versioning related
111 void enableProjectActions(bool enbMenu, quint16 mask = 0, quint8 op = 0); // default : add nothing
114 void slotNewProject();
115 void slotLoadProject();
116 void slotSaveProject();
117 void slotSaveAsProject();
118 bool slotCloseProject();
119 void slotOpenBlockLibrary();
121 void slotNewBlockWidget();
122 void slotGraphValidation();
124 void slotCheckNewVersion(QNetworkReply *reply);
127 #endif // MAINWINDOW_H