src/baseconfiguration.h

Wed, 08 Mar 2017 22:09:48 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 08 Mar 2017 22:09:48 +0200
changeset 1205
4597f9fc8738
parent 1204
1d25231dd7c9
child 1206
743dc95e0be6
permissions
-rw-r--r--

Whoops

1204
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 /*
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 * Copyright (C) 2013 - 2017 Teemu Piippo
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 *
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 * (at your option) any later version.
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 *
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 * GNU General Public License for more details.
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 *
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 */
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 #pragma once
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 #include <QObject>
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 #include <QSettings>
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 #include "basics.h"
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 class BaseConfiguration : public QObject
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 {
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 Q_OBJECT
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 public:
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29 BaseConfiguration();
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30 ~BaseConfiguration();
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
31
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32 bool existsEntry(const QString& name);
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33 QVariant defaultValueByName(const QString& name);
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34 virtual void initDefaults();
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
35
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
36 signals:
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
37 void configurationChanged(QString, QVariant, QVariant);
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
38
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
39 protected:
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
40 QMap<QString, QVariant> m_defaults;
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
41 class QSettings* m_settings;
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
42
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
43 private:
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
44 bool m_isInitialized = false;
1d25231dd7c9 Split the configuration main interface to a new class, BaseInterface, so that moc can properly deal with it.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
45 };

mercurial