-
Notifications
You must be signed in to change notification settings - Fork 22
/
MainWindow.h
132 lines (106 loc) · 3.8 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "Models/ProtoModel.h"
#include "Models/ResourceModelMap.h"
#include "Models/TreeModel.h"
#include "Editors/BaseEditor.h"
class MainWindow;
#include "Components/RecentFiles.h"
#include "project.pb.h"
#include "server.pb.h"
#include "event_reader/event_parser.h"
#include "egm.h"
#include <QList>
#include <QMainWindow>
#include <QMdiSubWindow>
#include <QPointer>
#include <QProcess>
#include <QFileInfo>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
static ResourceModelMap* resourceMap;
static MessageModel* resourceModel;
static TreeModel* treeModel;
static QList<buffers::SystemType> systemCache;
explicit MainWindow(QWidget *parent);
~MainWindow();
void openProject(std::unique_ptr<buffers::Project> openedProject);
buffers::Game *Game() const { return this->_project->mutable_game(); }
static QList<QString> EnigmaSearchPaths;
static QFileInfo EnigmaRoot;
static EventData* GetEventData() { return _event_data.get(); }
typedef BaseEditor *EditorFactoryFunction(MessageModel *model, MainWindow *parent);
void openSubWindow(MessageModel *res, EditorFactoryFunction factory_function);
signals:
void CurrentConfigChanged(const buffers::resources::Settings &settings);
public slots:
void openFile(QString fName);
void openNewProject();
void CreateResource(TypeCase typeCase);
void ResourceModelDeleted(MessageModel* m);
static void setCurrentConfig(const buffers::resources::Settings &settings);
private slots:
// file menu
void on_actionNew_triggered();
void on_actionOpen_triggered();
void on_actionClearRecentMenu_triggered();
void on_actionSave_triggered();
void on_actionPreferences_triggered();
void on_actionExit_triggered();
// edit menu
void on_actionDuplicate_triggered();
void on_actionCreateGroup_triggered();
void on_actionExpand_triggered();
void on_actionCollapse_triggered();
void on_actionRename_triggered();
void on_actionProperties_triggered();
void on_actionDelete_triggered();
void on_actionSortByName_triggered();
// resources menu
void on_actionCreateSprite_triggered();
void on_actionCreateSound_triggered();
void on_actionCreateBackground_triggered();
void on_actionCreatePath_triggered();
void on_actionCreateScript_triggered();
void on_actionCreateShader_triggered();
void on_actionCreateFont_triggered();
void on_actionCreateTimeline_triggered();
void on_actionCreateObject_triggered();
void on_actionCreateRoom_triggered();
void on_actionCreateSettings_triggered();
// window menu
void on_actionCascade_triggered();
void on_actionTile_triggered();
void on_actionToggleTabbedView_triggered();
void on_actionCloseAll_triggered();
void on_actionCloseOthers_triggered();
void on_actionNext_triggered();
void on_actionPrevious_triggered();
void updateWindowMenu();
// help menu
void on_actionDocumentation_triggered();
void on_actionWebsite_triggered();
void on_actionCommunity_triggered();
void on_actionSubmitIssue_triggered();
void on_actionExploreENIGMA_triggered();
void on_actionAbout_triggered();
void on_treeView_doubleClicked(const QModelIndex &index);
void on_treeView_customContextMenuRequested(const QPoint &pos);
private:
void closeEvent(QCloseEvent *event) override;
static MainWindow *_instance;
QHash<const MessageModel *, QMdiSubWindow *> _subWindows;
Ui::MainWindow *_ui;
std::unique_ptr<buffers::Project> _project;
QPointer<RecentFiles> _recentFiles;
static std::unique_ptr<EventData> _event_data;
void readSettings();
void writeSettings();
void setTabbedMode(bool enabled);
static QFileInfo getEnigmaRoot();
};
#endif // MAINWINDOW_H