AppSettings.h 5.8 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10 11
#ifndef AppSettings_H
#define AppSettings_H
12

13
#include "SettingsGroup.h"
14

15
class AppSettings : public SettingsGroup
16 17 18 19
{
    Q_OBJECT
    
public:
20
    AppSettings(QObject* parent = NULL);
21

22 23 24 25 26 27
    Q_PROPERTY(Fact* offlineEditingFirmwareType         READ offlineEditingFirmwareType         CONSTANT)
    Q_PROPERTY(Fact* offlineEditingVehicleType          READ offlineEditingVehicleType          CONSTANT)
    Q_PROPERTY(Fact* offlineEditingCruiseSpeed          READ offlineEditingCruiseSpeed          CONSTANT)
    Q_PROPERTY(Fact* offlineEditingHoverSpeed           READ offlineEditingHoverSpeed           CONSTANT)
    Q_PROPERTY(Fact* batteryPercentRemainingAnnounce    READ batteryPercentRemainingAnnounce    CONSTANT)
    Q_PROPERTY(Fact* defaultMissionItemAltitude         READ defaultMissionItemAltitude         CONSTANT)
28 29
    Q_PROPERTY(Fact* telemetrySave                      READ telemetrySave                      CONSTANT)
    Q_PROPERTY(Fact* telemetrySaveNotArmed              READ telemetrySaveNotArmed              CONSTANT)
30
    Q_PROPERTY(Fact* audioMuted                         READ audioMuted                         CONSTANT)
31 32 33
    Q_PROPERTY(Fact* virtualJoystick                    READ virtualJoystick                    CONSTANT)
    Q_PROPERTY(Fact* appFontPointSize                   READ appFontPointSize                   CONSTANT)
    Q_PROPERTY(Fact* indoorPalette                      READ indoorPalette                      CONSTANT)
34
    Q_PROPERTY(Fact* showLargeCompass                   READ showLargeCompass                   CONSTANT)
35 36
    Q_PROPERTY(Fact* savePath                           READ savePath                           CONSTANT)
    Q_PROPERTY(Fact* autoLoadMissions                   READ autoLoadMissions                   CONSTANT)
37
    Q_PROPERTY(Fact* automaticMissionUpload             READ automaticMissionUpload             CONSTANT)
38 39 40 41 42 43 44 45

    Q_PROPERTY(QString missionSavePath      READ missionSavePath    NOTIFY savePathsChanged)
    Q_PROPERTY(QString parameterSavePath    READ parameterSavePath  NOTIFY savePathsChanged)
    Q_PROPERTY(QString telemetrySavePath    READ telemetrySavePath  NOTIFY savePathsChanged)

    Q_PROPERTY(QString missionFileExtension     MEMBER missionFileExtension     CONSTANT)
    Q_PROPERTY(QString parameterFileExtension   MEMBER parameterFileExtension   CONSTANT)
    Q_PROPERTY(QString telemetryFileExtension   MEMBER telemetryFileExtension   CONSTANT)
46 47 48 49 50 51 52

    Fact* offlineEditingFirmwareType        (void);
    Fact* offlineEditingVehicleType         (void);
    Fact* offlineEditingCruiseSpeed         (void);
    Fact* offlineEditingHoverSpeed          (void);
    Fact* batteryPercentRemainingAnnounce   (void);
    Fact* defaultMissionItemAltitude        (void);
53 54
    Fact* telemetrySave                     (void);
    Fact* telemetrySaveNotArmed             (void);
55 56 57 58
    Fact* audioMuted                        (void);
    Fact* virtualJoystick                   (void);
    Fact* appFontPointSize                  (void);
    Fact* indoorPalette                     (void);
59
    Fact* showLargeCompass                  (void);
60 61
    Fact* savePath                          (void);
    Fact* autoLoadMissions                  (void);
62
    Fact* automaticMissionUpload            (void);
63 64 65 66

    QString missionSavePath     (void);
    QString parameterSavePath   (void);
    QString telemetrySavePath   (void);
67

68
    static const char* appSettingsGroupName;
69 70 71 72 73 74 75

    static const char* offlineEditingFirmwareTypeSettingsName;
    static const char* offlineEditingVehicleTypeSettingsName;
    static const char* offlineEditingCruiseSpeedSettingsName;
    static const char* offlineEditingHoverSpeedSettingsName;
    static const char* batteryPercentRemainingAnnounceSettingsName;
    static const char* defaultMissionItemAltitudeSettingsName;
76 77
    static const char* telemetrySaveName;
    static const char* telemetrySaveNotArmedName;
78
    static const char* audioMutedName;
79 80 81
    static const char* virtualJoystickName;
    static const char* appFontPointSizeName;
    static const char* indoorPaletteName;
82
    static const char* showLargeCompassName;
83 84
    static const char* savePathName;
    static const char* autoLoadMissionsName;
85
    static const char* automaticMissionUploadName;
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

    // Application wide file extensions
    static const char* parameterFileExtension;
    static const char* missionFileExtension;
    static const char* fenceFileExtension;
    static const char* rallyPointFileExtension;
    static const char* telemetryFileExtension;

    // Child directories of savePath for specific file types
    static const char* parameterDirectory;
    static const char* telemetryDirectory;
    static const char* missionDirectory;

signals:
    void savePathsChanged(void);
101 102 103

private slots:
    void _indoorPaletteChanged(void);
104
    void _checkSavePathDirectories(void);
105 106 107 108 109 110 111 112

private:
    SettingsFact* _offlineEditingFirmwareTypeFact;
    SettingsFact* _offlineEditingVehicleTypeFact;
    SettingsFact* _offlineEditingCruiseSpeedFact;
    SettingsFact* _offlineEditingHoverSpeedFact;
    SettingsFact* _batteryPercentRemainingAnnounceFact;
    SettingsFact* _defaultMissionItemAltitudeFact;
113 114
    SettingsFact* _telemetrySaveFact;
    SettingsFact* _telemetrySaveNotArmedFact;
115 116 117 118
    SettingsFact* _audioMutedFact;
    SettingsFact* _virtualJoystickFact;
    SettingsFact* _appFontPointSizeFact;
    SettingsFact* _indoorPaletteFact;
119
    SettingsFact* _showLargeCompassFact;
120 121
    SettingsFact* _savePathFact;
    SettingsFact* _autoLoadMissionsFact;
122
    SettingsFact* _automaticMissionUpload;
123 124 125
};

#endif