-
Notifications
You must be signed in to change notification settings - Fork 3
/
mainwindow.h
231 lines (207 loc) · 7.63 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtWidgets/QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QtDebug>
#include <QFrame>
#include <QLabel>
#include <QPushButton>
#include <QTranslator>
#include <QSystemTrayIcon>
#include <QTextEdit>
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "createimagedialog.h"
#include "diskeditdialog.h"
#include "serialport.h"
#include "sioworker.h"
#include "textprinterwindow.h"
#include "docdisplaywindow.h"
#define g_numberOfDisks 6
namespace Ui
{
class MainWindow;
}
class DiskWidgets
{
public:
QLabel *fileNameLabel;
QLabel *imagePropertiesLabel;
QAction *saveAction;
QAction *autoSaveAction; //
QAction *bootOptionAction; //
QAction *saveAsAction;
QAction *revertAction;
QAction *mountDiskAction;
QAction *mountFolderAction;
QAction *ejectAction;
QAction *writeProtectAction;
QAction *editAction;
QFrame *frame;
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
QString g_sessionFile;
QString g_sessionFilePath;
QString g_mainWindowTitle;
public slots:
void show();
int firstEmptyDiskSlot(int startFrom = 0, bool createOne = true); //
void mountFileWithDefaultProtection(int no, const QString &fileName); //
void autoCommit(int no); //
void folderPath(int slot); //
private:
int untitledName;
Ui::MainWindow *ui;
SioWorker *sio;
bool shownFirstTime;
DiskWidgets diskWidgets[g_numberOfDisks]; //
QLabel *speedLabel, *onOffLabel, *prtOnOffLabel, *netLabel, *clearMessagesLabel; //
TextPrinterWindow *textPrinterWindow;
DocDisplayWindow *docDisplayWindow; //
QTranslator aspeqt_translator, aspeqt_qt_translator;
QSystemTrayIcon trayIcon;
Qt::WindowFlags oldWindowFlags;
Qt::WindowStates oldWindowStates;
QString lastMessage;
int lastMessageRepeat;
void setSession(); //
void updateRecentFileActions();
int containingDiskSlot(const QPoint &point);
void bootExe(const QString &fileName);
void mountFile(int no, const QString &fileName, bool prot);
void mountDiskImage(int no);
void mountFolderImage(int no);
bool ejectImage(int no, bool ask = true);
void toggleWriteProtection(int no);
void openEditor(int no);
void saveDisk(int no);
void saveDiskAs(int no);
void revertDisk(int no);
QMessageBox::StandardButton saveImageWhenClosing(int no, QMessageBox::StandardButton previousAnswer, int number);
void loadTranslators();
void autoSaveDisk(int no); //
protected:
void mousePressEvent(QMouseEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void dragLeaveEvent(QDragLeaveEvent *);
void dropEvent(QDropEvent *event);
void closeEvent(QCloseEvent *event);
void hideEvent(QHideEvent *event);
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
void resizeEvent(QResizeEvent *);
bool eventFilter(QObject *obj, QEvent *event);
signals:
void logMessage(int type, const QString &msg);
void newSlot (int slot);
void fileMounted(bool mounted);
void takeFolderPath (QString fPath);
void sendLogText (QString logText);
void sendLogTextChange (QString logTextChange);
public:
void doLogMessage(int type, const QString &msg);
private slots:
void on_actionPlaybackCassette_triggered();
void on_actionShowPrinterTextOutput_triggered();
void on_actionBootExe_triggered();
void on_actionSaveSession_triggered();
void on_actionOpenSession_triggered();
void on_actionNewImage_triggered();
void on_actionMountFolder_triggered();
void on_actionMountDisk_triggered();
void on_actionEjectAll_triggered();
void on_actionOptions_triggered();
void on_actionStartEmulation_triggered();
void on_actionPrinterEmulation_triggered();
void on_actionQuit_triggered();
void on_actionAbout_triggered();
void on_actionDocumentation_triggered();
void on_actionMountDisk_1_triggered();
void on_actionMountDisk_2_triggered();
void on_actionMountDisk_3_triggered();
void on_actionMountDisk_4_triggered();
void on_actionMountDisk_5_triggered();
void on_actionMountDisk_6_triggered();
void on_actionMountFolder_1_triggered();
void on_actionMountFolder_2_triggered();
void on_actionMountFolder_3_triggered();
void on_actionMountFolder_4_triggered();
void on_actionMountFolder_5_triggered();
void on_actionMountFolder_6_triggered();
void on_actionEject_1_triggered();
void on_actionEject_2_triggered();
void on_actionEject_3_triggered();
void on_actionEject_4_triggered();
void on_actionEject_5_triggered();
void on_actionEject_6_triggered();
void on_actionWriteProtect_1_triggered();
void on_actionWriteProtect_2_triggered();
void on_actionWriteProtect_3_triggered();
void on_actionWriteProtect_4_triggered();
void on_actionWriteProtect_5_triggered();
void on_actionWriteProtect_6_triggered();
void on_actionMountRecent_0_triggered();
void on_actionMountRecent_1_triggered();
void on_actionMountRecent_2_triggered();
void on_actionMountRecent_3_triggered();
void on_actionMountRecent_4_triggered();
void on_actionMountRecent_5_triggered();
void on_actionMountRecent_6_triggered();
void on_actionMountRecent_7_triggered();
void on_actionMountRecent_8_triggered();
void on_actionMountRecent_9_triggered();
void on_actionEditDisk_1_triggered();
void on_actionEditDisk_2_triggered();
void on_actionEditDisk_3_triggered();
void on_actionEditDisk_4_triggered();
void on_actionEditDisk_5_triggered();
void on_actionEditDisk_6_triggered();
void on_actionSave_1_triggered();
void on_actionSave_2_triggered();
void on_actionSave_3_triggered();
void on_actionSave_4_triggered();
void on_actionSave_5_triggered();
void on_actionSave_6_triggered();
void on_actionAutoSave_1_triggered();
void on_actionAutoSave_2_triggered();
void on_actionAutoSave_3_triggered();
void on_actionAutoSave_4_triggered();
void on_actionAutoSave_5_triggered();
void on_actionAutoSave_6_triggered();
void on_actionSaveAs_1_triggered();
void on_actionSaveAs_2_triggered();
void on_actionSaveAs_3_triggered();
void on_actionSaveAs_4_triggered();
void on_actionSaveAs_5_triggered();
void on_actionSaveAs_6_triggered();
void on_actionRevert_1_triggered();
void on_actionRevert_2_triggered();
void on_actionRevert_3_triggered();
void on_actionRevert_4_triggered();
void on_actionRevert_5_triggered();
void on_actionRevert_6_triggered();
void on_actionBootOption_triggered();
void on_actionToggleMiniMode_triggered();
void on_actionToggleShade_triggered();
void on_actionLogWindow_triggered();
void sioFinished();
void sioStarted();
void sioStatusChanged(QString status);
void textPrinterWindowClosed();
void deviceStatusChanged(int deviceNo);
void uiMessage(int t, const QString message);
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
void keepBootExeOpen();
void saveWindowGeometry();
void saveMiniWindowGeometry();
void logChanged(QString text);
void changeFonts();
};
#endif // MAINWINDOW_H