This repository has been archived by the owner on Apr 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathrespeqtsettings.h
270 lines (196 loc) · 6.88 KB
/
respeqtsettings.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
/*
* respeqtsettings.h
*
* Copyright 2015 Joseph Zatarski
* Copyright 2016, 2017 TheMontezuma
* Copyright 2017 blind
*
* This file is copyrighted by either Fatih Aygun, Ray Ataergin, or both.
* However, the years for these copyrights are unfortunately unknown. If you
* know the specific year(s) please let the current maintainer know.
*/
#ifndef RESPEQTSETTINGS_H
#define RESPEQTSETTINGS_H
#include <QSettings>
#define NUM_RECENT_FILES 10
class RespeqtSettings
{
public:
class ImageSettings {
public:
QString fileName;
bool isWriteProtected;
};
RespeqtSettings();
~RespeqtSettings();
bool isFirstTime();
QString serialPortName();
void setSerialPortName(const QString &name);
int serialPortHandshakingMethod();
void setSerialPortHandshakingMethod(int method);
bool serialPortTriggerOnFallingEdge();
void setSerialPortTriggerOnFallingEdge(bool use);
int serialPortMaximumSpeed();
void setSerialPortMaximumSpeed(int speed);
bool serialPortUsePokeyDivisors();
void setSerialPortUsePokeyDivisors(bool use);
int serialPortPokeyDivisor();
void setSerialPortPokeyDivisor(int divisor);
int serialPortWriteDelay();
void setSerialPortWriteDelay(int delay);
int serialPortCompErrDelay();
void setSerialPortCompErrDelay(int delay);
QString atariSioDriverName();
void setAtariSioDriverName(const QString &name);
int atariSioHandshakingMethod();
void setAtariSioHandshakingMethod(int method);
int backend();
void setBackend(int backend);
bool useHighSpeedExeLoader();
void setUseHighSpeedExeLoader(bool use);
bool printerEmulation();
void setPrinterEmulation(bool status);
bool useCustomCasBaud();
void setUseCustomCasBaud(bool use);
int customCasBaud();
void setCustomCasBaud(int baud);
const ImageSettings* getImageSettingsFromName(const QString &fileName);
const ImageSettings& mountedImageSetting(int no);
void setMountedImageSetting(int no, const QString &fileName, bool prot);
void setMountedImageProtection(int no, bool prot);
const ImageSettings& recentImageSetting(int no);
void mountImage(int no, const QString &fileName, bool prot);
void unmountImage(int no);
void swapImages(int no1, int no2);
QString lastDiskImageDir();
void setLastDiskImageDir(const QString &dir);
QString lastFolderImageDir();
void setLastFolderImageDir(const QString &dir);
QString lastSessionDir();
void setLastSessionDir(const QString &dir);
QString lastExeDir();
void setLastExeDir(const QString &dir);
QString lastExtractDir();
void setLastExtractDir(const QString &dir);
QString lastPrinterTextDir();
void setLastPrinterTextDir(const QString &dir);
QString lastCasDir();
void setLastCasDir(const QString &dir);
// Set and restore last mainwindow position and size //
int lastVerticalPos();
void setLastVerticalPos(int lastVpos);
int lastHorizontalPos();
void setLastHorizontalPos(int lastHpos);
int lastWidth();
void setLastWidth(int lastW);
int lastHeight();
void setLastHeight(int lastH);
// Set and restore last mini-window position //
int lastMiniVerticalPos();
void setLastMiniVerticalPos(int lastMVpos);
int lastMiniHorizontalPos();
void setLastMiniHorizontalPos(int lastMHpos);
// Set and restore last printwindow position and size //
int lastPrtVerticalPos();
void setLastPrtVerticalPos(int lastVpos);
int lastPrtHorizontalPos();
void setLastPrtHorizontalPos(int lastHpos);
int lastPrtWidth();
void setLastPrtWidth(int lastW);
int lastPrtHeight();
void setLastPrtHeight(int lastH);
QString i18nLanguage();
void setI18nLanguage(const QString &$lang);
bool minimizeToTray();
void setMinimizeToTray(bool tray);
// Save window positions and sizes option //
bool saveWindowsPos();
void setsaveWindowsPos(bool saveMwp);
// Save drive visibility option //
bool saveDiskVis();
void setsaveDiskVis(bool saveDvis);
// To pass session file name/path //
void setSessionFile(const QString &g_sessionFile, const QString &g_sessionFilePath);
// To manipulate session files //
void saveSessionToFile(const QString &fileName);
void loadSessionFromFile(const QString &fileName);
// To manipulate Main Window Title for Session file names //
void setMainWindowTitle(const QString &g_mainWindowTitle);
// Hide/Show drives D9-DO //
bool D9DOVisible();
void setD9DOVisible(bool dVis);
// Filter special characters from file names in Folder Images
bool filterUnderscore();
void setfilterUnderscore(bool filter);
// CAPITAL letters in file names for PCLINK
bool capitalLettersInPCLINK();
void setCapitalLettersInPCLINK(bool caps);
// URL Submit feature
bool isURLSubmitEnabled();
void setURLSubmit(bool enabled);
// Enable Shade Mode //
bool enableShade();
void setEnableShade(bool shade);
// Use Large Font //
bool useLargeFont();
void setUseLargeFont(bool largeFont);
// Explorer Window On Top
bool explorerOnTop();
void setExplorerOnTop(bool expOnTop);
private:
QSettings *mSettings;
void writeRecentImageSettings();
bool mIsFirstTime;
// To pass values from Mainwindow //
int mMainX;
int mMainY;
int mMainW;
int mMainH;
int mMiniX;
int mMiniY;
int mPrtX;
int mPrtY;
int mPrtW;
int mPrtH;
bool msaveWindowsPos;
bool msaveDiskVis;
bool mdVis;
QString mSessionFileName;
QString mSessionFilePath;
QString mMainWindowTitle;
//
QString mSerialPortName;
int mSerialPortHandshakingMethod;
bool mSerialPortTriggerOnFallingEdge;
int mSerialPortWriteDelay;
int mSerialPortCompErrDelay;
int mSerialPortMaximumSpeed;
bool mSerialPortUsePokeyDivisors;
int mSerialPortPokeyDivisor;
bool mUseHighSpeedExeLoader;
bool mPrinterEmulation;
QString mAtariSioDriverName;
int mAtariSioHandshakingMethod;
int mBackend;
bool mUseCustomCasBaud;
int mCustomCasBaud;
ImageSettings mMountedImageSettings[16]; //
ImageSettings mRecentImageSettings[NUM_RECENT_FILES];
QString mLastDiskImageDir;
QString mLastFolderImageDir;
QString mLastSessionDir;
QString mLastExeDir;
QString mLastExtractDir;
QString mLastPrinterTextDir;
QString mLastCasDir;
QString mI18nLanguage;
bool mMinimizeToTray;
bool mFilterUnderscore;
bool mUseCapitalLettersInPCLINK;
bool mUseURLSubmit;
bool mUseLargeFont;
bool mExplorerOnTop;
bool mEnableShade;
};
extern RespeqtSettings *respeqtSettings;
#endif // RESPEQTSETTINGS_H