123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- #ifndef ASETTINGS_H
- #define ASETTINGS_H
- #include <QtCore>
- #include <QSettings>
- class ASettings {
- public:
- enum class Setup {
- SetupComplete,
- };
- enum class Main {
- Style,
- StyleSheet,
- };
- enum class LogBook {
- View,
- };
- enum class UserData {
- DisplaySelfAs,
- AcftSortColumn,
- PilSortColumn,
- AcAllowIncomplete,
- };
- enum class FlightLogging {
- Function,
- Approach,
- NightLogging,
- LogIFR,
- FlightNumberPrefix,
- NumberTakeoffs,
- NumberLandings,
- PopupCalendar,
- PilotFlying,
- NightAngle,
- Rules,
- FlightTimeFormat
- };
- enum class NewFlight {
- FunctionComboBox,
- CalendarCheckBox,
- };
-
- static void setup();
- static QVariant read(const Setup key);
- static void write(const Setup key, const QVariant &val);
- static QVariant read(const LogBook key);
- static void write(const LogBook key, const QVariant &val);
- static QVariant read(const Main key);
- static void write(const Main key, const QVariant &val);
- static QVariant read(const FlightLogging key);
- static void write(const UserData key, const QVariant &val);
- static QVariant read(const UserData key);
- static void write(const FlightLogging key, const QVariant &val);
- static QVariant read(const NewFlight key);
- static void write(const NewFlight key, const QVariant &val);
-
-
-
-
-
- static QString groupOfKey(const Main key);
- static QString groupOfKey(const LogBook key);
- static QString groupOfKey(const NewFlight key);
- static QString groupOfKey(const FlightLogging key);
- static QString groupOfKey(const Setup key);
- static QString groupOfKey(const UserData key);
-
- static QString stringOfKey(const Main key);
- static QString stringOfKey(const LogBook key);
- static QString stringOfKey(const NewFlight key);
- static QString stringOfKey(const FlightLogging key);
- static QString stringOfKey(const Setup key);
- static QString stringOfKey(const UserData key);
- static QSettings settings();
- private:
- static QMap<Main, QString> mainMap;
- static QMap<LogBook, QString> logBookMap;
- static QMap<UserData, QString> userDataMap;
- static QMap<FlightLogging, QString> flightLoggingMap;
- static QMap<Setup, QString> setupMap;
- static QMap<NewFlight, QString> newFlightMap;
- #define FOR_CURRENT_VERSION 0
- #if (FOR_CURRENT_VERSION)
-
- enum Setup2 {
- SetupComplete = 0x00'00'00'01,
- };
-
- enum Main2 {
- Theme = 0x00'00'00'02,
- ThemeID = 0x00'00'00'04,
- };
- enum LogBook2 {
- View = 0x00'00'00'08,
- };
- enum UserData2 {
- LastName = 0x00'00'00'10,
- FirstName = 0x00'00'00'20,
- Company = 0x00'00'00'40,
- EmployeeID = 0x00'00'00'80,
- Phone = 0x00'00'01'00,
- Email = 0x00'00'02'00,
- DisplaySelfAs = 0x00'00'04'00,
- Alias = 0x00'00'08'00,
- AcSortColumn = 0x00'00'10'00,
- PilSortColumn = 0x00'00'20'00,
- AcAllowIncomplete = 0x00'00'40'00,
- };
- enum FlightLogging2 {
- Function = 0x00'00'80'00,
- Approach = 0x00'01'00'00,
- NightLogging = 0x00'02'00'00,
- LogIFR = 0x00'04'00'00,
- FlightNumberPrefix = 0x00'08'00'00,
- NumberTakeoffs = 0x00'10'00'00,
- NumberLandings = 0x00'20'00'00,
- PopupCalendar = 0x00'40'00'00,
- PilotFlying = 0x00'80'00'00,
- NightAngle = 0x01'00'00'00,
- Rules = 0x02'00'00'00,
- };
- enum NewFlight2 {
- FunctionComboBox = 0x04'00'00'00,
- CalendarCheckBox = 0x08'00'00'00,
- };
- using Key = int;
- using Keys = int;
-
- QString stringOfKey2(Key k);
- QStringList stringOfKeys2(Keys ks);
- #endif
- #undef FOR_CURRENT_VERSION
- };
- #endif
|