forked from engor/Jentos.Code
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmainwindow.h
executable file
·301 lines (221 loc) · 6.73 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/*
Ted, a simple text editor/IDE.
Copyright 2012, Blitz Research Ltd.
See LICENSE.TXT for licensing terms.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "std.h"
class CodeEditor;
class ProjectTreeModel;
class DebugTreeModel;
class FindDialog;
class Process;
class FindInFilesDialog;
class QuickHelp;
namespace Ui {
class MainWindow;
}
class Prefs;
class PrefsDialog;
class QuickHelp;
class TabWidgetDrop;
class MainWindow : public QMainWindow{
Q_OBJECT
public:
MainWindow( QWidget *parent=0 );
~MainWindow();
void cdebug( const QString &str );
static bool isValidMonkeyPath(const QString &path , QString &trans);
void updateTheme();
private:
void updateCodeViews(QTreeView *tree, QListView* list);
void parseAppArgs();
void initKeywords();
bool isBuildable( CodeEditor *editor );
QString widgetPath( QWidget *widget );
CodeEditor *editorWithPath( const QString &path );
QWidget *newFile( const QString &path );
QWidget *openFile( const QString &path,bool addToRecent );
bool saveFile( QWidget *widget,const QString &path );
bool closeFile( QWidget *widget,bool remove=true );
void enumTargets();
void readSettings();
void writeSettings();
void updateWindowTitle();
void updateTabLabel( QWidget *widget );
void updateActions();
void print(const QString &str , QString kind);
void runCommand( QString cmd,QWidget *fileWidget );
void build( QString mode,QString pathmonkey);
bool confirmQuit();
void closeEvent( QCloseEvent *event );
protected:
void showEvent(QShowEvent * event);
public slots:
void onStyleChanged(bool b);
void onCodeTreeViewClicked( const QModelIndex &index );
void onSourceListViewClicked( const QModelIndex &index );
void onLowerUpperCase();
void onNetworkFinished(QNetworkReply *reply);
void onCheckForUpdates();
void onCheckForUpdatesSilent();
void onOpenUrl();
void onKeyEscapePressed();
//File menu
void onFileNew();
void onFileOpen();
void onFileOpenRecent();
void onFileClose();
void onFileCloseAll();
void onFileCloseOthers();
void onFileSave();
void onFileSaveAs();
void onFileSaveAll();
void onFileNext();
void onFilePrevious();
void onFilePrefs();
void onFileQuit();
//Edit menu
void onEditUndo();
void onEditRedo();
void onEditCut();
void onEditCopy();
void onEditPaste();
void onEditDelete();
void onEditSelectAll();
void onEditFind();
void onEditFindNext();
void onEditFindPrev();
void onEditReplace();
void onEditReplaceAll();
void onFindReplace( int how );
void onEditGoto();
void onEditFindInFiles();
//View menu
void onViewToolBar();
void onViewWindow();
//
void onCommentUncommentBlock();
void onToggleBookmark();
void onPreviousBookmark();
void onNextBookmark();
void onFoldAll();
void onUnfoldAll();
void onGoBack();
void onGoForward();
//
//Build/Debug menu
void onBuildBuild();
void onBuildRun();
void onBuildCheck();
void onBuildUpdate();
void onDebugStep();
void onDebugStepInto();
void onDebugStepOut();
void onDebugKill();
void onBuildTarget();
void onBuildConfig();
void onBuildLockFile();
void onBuildUnlockFile();
void onBuildAddProject();
//Window menu
void onSwitchFullscreen();
//Help menu
void onHelpHome();
void onHelpBack();
void onHelpForward();
void onHelpQuickHelp();
void onHelpAbout();
void onHelpRebuild();
void onHelpOnlineDocs();
void onHelpMonkeyHomepage();
void onOpenCodeFile(const QString &file, const QString &folder, const int &lineNumber );
void onDropFiles( const QStringList &list );
void onCodeAnalyze();
void onClearOutput();
void onCloseSearch();
void onChangeAnalyzerProperties(bool toggle=false);
void onTabsCloseTab();
void onTabsCloseOtherTabs();
void onTabsCloseAllTabs();
void onThemeAndroidStudio();
void onThemeNetBeans();
void onThemeQtCreator();
void onFindUsages();
void onLinkClicked( const QUrl &url );
void onDocsZoomChanged(int);
private slots:
void onShowHelp( const QString &text );
void onCloseUsagesTab(int index);
void onUsagesJumpToLine(QTreeWidgetItem *item, int column);
void onCloseMainTab( int index );
void onMainTabChanged( int index );
void onDockVisibilityChanged( bool visible );
void onEditorMenu(const QPoint &pos);
void onTabsMenu( const QPoint &pos );
void onProjectMenu( const QPoint &pos );
void onFileClicked( const QModelIndex &index );
void onSourceMenu( const QPoint &pos );
void onUsagesMenu( const QPoint &pos );
void onTextChanged();
void onCursorPositionChanged();
void onShowCode(const QString &path, int line , bool error=false);
void onShowCode( const QString &path,int pos,int len );
void onProcStdout();
void onProcStderr();
void onProcLineAvailable( int channel );
void onProcFinished();
void onStatusBarChanged(const QString &text);
void onAutoformatAll();
void onUsagesRename();
void onUsagesSelectAll();
void onUsagesUnselectAll();
void on_actionLock_Target_triggered();
void on_actionLock_Target_toggled(bool arg1);
void on_webView_selectionChanged();
void on_docsDockWidget_allowedAreasChanged(const Qt::DockWidgetAreas &allowedAreas);
void on_actionClose_all_Tabs_triggered();
void on_actionThemeMonokaiDarkSoda_triggered();
void on_actionThemeLightTable_triggered();
void on_actionThemeMondayMorning_triggered();
private:
QNetworkAccessManager *_networkManager;
bool _showMsgbox;
Ui::MainWindow *_ui;
QString _defaultDir;
QString _blitzmaxPath;
QString _buildBmxCmd;
QString _runBmxCmd;
static QString _monkeyPath, _transPath;
bool _isShowHelpInDock;
QString _buildMonkeyCmd;
QString _runMonkeyCmd;
QString _transVersion;
TabWidgetDrop *_mainTabWidget;
Process *_consoleProc;
ProjectTreeModel *_projectTreeModel;
DebugTreeModel *_debugTreeModel;
CodeEditor *_codeEditor;
CodeEditor *_lockedEditor;
QWebView *_helpWidget;
PrefsDialog *_prefsDialog;
//FindDialog *_findDialog;
FindInFilesDialog *_findInFilesDialog;
QMenu *_tabsPopupMenu;
QMenu *_projectPopupMenu;
QMenu *_dirPopupMenu;
QMenu *_filePopupMenu;
QMenu *_fileImagePopupMenu;
QMenu *_fileMonkeyPopupMenu;
QMenu *_sourcePopupMenu;
QMenu *_editorPopupMenu;
QMenu *_usagesPopupMenu;
QLabel *_statusWidget;
QComboBox *_targetsWidget;
QComboBox *_configsWidget;
QComboBox *_indexWidget;
QString _lastHelpIdent;
int _lastHelpCursorPos;
};
#endif // MAINWINDOW_H