~hmatuschek/+junk/qdmr-package

« back to all changes in this revision

Viewing changes to lib/config.hh

  • Committer: Hannes Matuschek
  • Date: 2020-07-07 14:34:22 UTC
  • mto: (17.1.1 qdmr-package)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: hmatuschek@gmail.com-20200707143422-1djcxrjkem3k5kb1
Tags: upstream-0.3.0
ImportĀ upstreamĀ versionĀ 0.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "scanlist.hh"
20
20
#include "gpssystem.hh"
21
21
 
 
22
// Forward declaration
 
23
class UserDatabase;
22
24
 
23
25
/** The config class, representing the codeplug configuration.
24
26
 *
32
34
 
33
35
public:
34
36
  /** Constructs an empty configuration. */
35
 
        explicit Config(QObject *parent = nullptr);
 
37
  explicit Config(UserDatabase *userdb=nullptr, QObject *parent = nullptr);
36
38
 
37
39
  /** Returns @c true if the config was modified, @see modified. */
38
40
  bool isModified() const;
81
83
  /** Enables/disables the speech synthesis. */
82
84
  void setSpeech(bool enabled);
83
85
 
 
86
  /** Should the UserDB be uploaded. */
 
87
  bool uploadUserDB() const;
 
88
  /** Enables/disables the upload of the user-db. */
 
89
  void setUploadUserDB(bool upload);
 
90
  /** Returns @c true if a user-db is associated with this config. */
 
91
  bool hasUserDB() const;
 
92
  /** Get the user-db to upload. */
 
93
  UserDatabase *userDB() const;
 
94
  /** Sets the user-db to upload. */
 
95
  void setUserDB(UserDatabase *userdb);
 
96
 
84
97
  /** Clears the complete configuration. */
85
98
  void reset();
86
99
 
100
113
protected slots:
101
114
  /** Iternal callback. */
102
115
  void onConfigModified();
 
116
  /** Gets called whenever the UserDB gets deleted. */
 
117
  void onUserDBDeleted();
103
118
 
104
119
protected:
105
120
  /** If @c true, the configuration was modified. */
129
144
  uint _mic_level;
130
145
  /** If @c true, speech synthesis is enabled. */
131
146
  bool _speech;
 
147
  /** If @c true, the user-db should be uploaded. */
 
148
  bool _uploadUserDB;
 
149
  /** Weak reference to the user database. */
 
150
  UserDatabase *_userDB;
132
151
};
133
152
 
134
153
#endif // CONFIG_HH