diff --git a/ScStwLibraries/ScStwLibraries.pri b/ScStwLibraries/ScStwLibraries.pri index e34d9f9..903b9bc 100644 --- a/ScStwLibraries/ScStwLibraries.pri +++ b/ScStwLibraries/ScStwLibraries.pri @@ -4,6 +4,11 @@ SCSTWLIBRARIES_LIB = 1 ScStwLibraries_QML { QT += qml quickcontrols2 DEFINES += ScStwLibraries_QML + + ScStwLibraries_Styling { + DEFINES += ScStwLibraries_Styling + } + } ScStwLibraries_ClientLibs { @@ -14,28 +19,54 @@ INCLUDEPATH += $$PWD/headers $$PWD SOURCES += \ $$PWD/sources/ScStw.cpp \ + $$PWD/sources/scstwsettings.cpp \ $$PWD/sources/scstwsoundplayer.cpp \ $$PWD/sources/scstwlibraries.cpp \ $$PWD/sources/scstwrace.cpp \ - $$PWD/sources/scstwtimer.cpp + $$PWD/sources/scstwtimer.cpp \ + $$PWD/sources/scstwsetting.cpp HEADERS += \ $$PWD/headers/ScStw.hpp \ $$PWD/headers/ScStwLibraries_global.h \ $$PWD/headers/scstwlibraries.h \ $$PWD/headers/scstwrace.h \ + $$PWD/headers/scstwsettings.h \ $$PWD/headers/scstwsoundplayer.h \ - $$PWD/headers/scstwtimer.h + $$PWD/headers/scstwtimer.h \ + $$PWD/headers/scstwsetting.h ScStwLibraries_ClientLibs { -SOURCES += \ - $$PWD/sources/scstwclient.cpp - $$PWD/sources/scstwremotemonitorrace.cpp + SOURCES += \ + $$PWD/sources/client/scstwclient.cpp \ + $$PWD/sources/client/scstwremotesettings.cpp \ + $$PWD/sources/client/scstwremotemonitorrace.cpp -HEADERS += \ - $$PWD/headers/scstwclient.h \ - $$PWD/headers/scstwremotemonitorrace.h + HEADERS += \ + $$PWD/headers/client/scstwclient.h \ + $$PWD/headers/client/scstwremotesettings.h \ + $$PWD/headers/client/scstwremotemonitorrace.h + + INCLUDEPATH += $$PWD/headers/client +} + +ScStwLibraries_QML { + ScStwLibraries_Styling { + SOURCES += \ + $$PWD/sources/styling/scstwapptheme.cpp \ + $$PWD/sources/styling/scstwappthememanager.cpp + + HEADERS += \ + $$PWD/headers/styling/scstwapptheme.h \ + $$PWD/headers/styling/scstwappthememanager.h + + RESOURCES += \ + $$PWD/resources/qml/ScStwStylingQml.qrc \ + $$PWD/resources/shared/ScStwStylingShared.qrc \ + + INCLUDEPATH += $$PWD/headers/styling + } } RESOURCES += \ - $$PWD/resources/ScStwLibrariesShared.qrc + $$PWD/resources/shared/ScStwLibrariesShared.qrc diff --git a/ScStwLibraries/headers/ScStw.hpp b/ScStwLibraries/headers/ScStw.hpp index 263c951..11e5a4c 100644 --- a/ScStwLibraries/headers/ScStw.hpp +++ b/ScStwLibraries/headers/ScStw.hpp @@ -38,23 +38,9 @@ * git submodule update --init --recursive * \endcode * - * Add to the list of libraries for the Qt-Secret assembly. For an example you can create Main.Pro in which connect Qt-Secret and your project.pro files as subprojects. - * - * Main.pro: - * \code{.pro} - * TEMPLATE = subdirs - * CONFIG += ordered - * - * SUBDIRS += \ - * ScStwLibraries \ - * MyProject - * - * ScStwLibraries.file = shared-libraries/ScStwLibraries/ScStwLibraries.pro - * \endcode - * * And in your MyProject.pro include the .pri file: * \code{.pro} - * include($$PWD/../shared-libraries/ScStwLibraries/ScStwLibraries.pri) + * include($$PWD/shared-libraries/ScStwLibraries/ScStwLibraries.pri) * \endcode */ @@ -75,28 +61,11 @@ public: RaceStateChanged = 9000, TimersChanged = 9001, ExtensionsChanged = 9002, - NextStartActionChanged = 9003 /*, ProfilesChanged*/ + NextStartActionChanged = 9003, /*, ProfilesChanged*/ + SettingChanged = 9004 }; Q_ENUM(SignalKey) - /*! - * \brief The BaseStationSetting enum contains all settings of the base station that can be changed by a client - * - * \see ScStw::baseStationSettingFromInt() - * \see ScStw::baseStationSettingToString() - * \see ScStw::baseStationSettingFromString() - * \see ScStw::baseStationSettings - */ - enum BaseStationSetting { - InvalidSetting = -1, - ReadySoundEnableSetting, - ReadySoundDelaySetting, - AtYourMarksSoundEnableSetting, - AtYourMarksSoundDelaySetting, - SoundVolumeSetting - }; - Q_ENUM(BaseStationSetting) - /*! * \brief The SocketCommand enum contains all commands the base station can handle * @@ -107,9 +76,9 @@ public: InitializeSessionCommand = 1, - StartTimersCommand = 1000, - StopTimersCommand = 1001, - ResetTimersCommand = 1002, + StartRaceCommand = 1000, + StopRaceCommand = 1001, + ResetRaceCommand = 1002, GetRaceStateCommand = 2000, GetNextStartActionCommand = 2005, @@ -171,44 +140,6 @@ public: */ static const char* SOCKET_MESSAGE_END_KEY; - /*! - * \brief baseStationSettings contains a string with reference to all BaseStationSetting values - * - * \see ScStw::BaseStationSetting - * \see ScStw::baseStationSettingToString() - * \see ScStw::baseStationSettingFromString() - */ - static const QMap baseStationSettings; - - /*! - * \brief Function to convert an int to a BaseStationSetting - * \param i the int to convert - * \return a BaseStationSetting - * - * \see ScStw::BaseStationSetting - */ - static BaseStationSetting baseStationSettingfromInt(int i); - - /*! - * \brief Function to convert a QString to a BaseStationSetting - * \param s the string to convert - * \return a BaseStationSetting - * - * \see ScStw::BaseStationSetting - * \see ScStw::baseStationSettingToString() - */ - static BaseStationSetting baseStationSettingFromString(QString s); - - /*! - * \brief Function to convert BaseStationSetting to a QString - * \param s the BaseStationSetting to convert - * \return a QString - * - * \see ScStw::BaseStationSetting - * \see ScStw::baseStationSettingFromString() - */ - Q_INVOKABLE static QString baseStationSettingToString(BaseStationSetting s); - /*! * \brief Function to convert an int to a SignalKey * \param i the int to convert diff --git a/ScStwLibraries/headers/scstwclient.h b/ScStwLibraries/headers/client/scstwclient.h similarity index 95% rename from ScStwLibraries/headers/scstwclient.h rename to ScStwLibraries/headers/client/scstwclient.h index 60c3684..99e8dc3 100644 --- a/ScStwLibraries/headers/scstwclient.h +++ b/ScStwLibraries/headers/client/scstwclient.h @@ -33,6 +33,7 @@ #include #include "ScStw.hpp" +#include "scstwsettings.h" /*! * This class is used to connect and talk to the ScStw basestation. @@ -59,7 +60,10 @@ public: * * \brief ScStwClient */ - explicit ScStwClient(QObject *parent = nullptr); + explicit ScStwClient( + QObject *parent = nullptr, + QList signalSubscriptions = {ScStw::ExtensionsChanged} + ); enum State {DISCONNECTED, CONNECTING, INITIALISING, CONNECTED}; Q_ENUM(State); @@ -75,6 +79,8 @@ private: QVariantList extensions; + QList signalSubscriptions; + //---general status values---// // some meta data of the base station @@ -139,14 +145,14 @@ public slots: * \param value the value to write to * \return the status code returned by the command */ - ScStw::StatusCode writeRemoteSetting(ScStw::BaseStationSetting key, QString value); + ScStw::StatusCode writeRemoteSetting(ScStwSettings::BaseStationSetting key, QVariant value); /*! * \brief Function to read a setting on the base station * \param key the key to read from * \return the value of the key or "false" if the key is not found or an error occured */ - QString readRemoteSetting(ScStw::BaseStationSetting key); + QVariant readRemoteSetting(ScStwSettings::BaseStationSetting key); /*! Getter fuctions */ @@ -199,6 +205,8 @@ public slots: */ void setIP(QString ipAdress); + void addSignalSubscription(ScStw::SignalKey key); + private slots: /*! * \brief called when timeout timer times out diff --git a/ScStwLibraries/headers/scstwremotemonitorrace.h b/ScStwLibraries/headers/client/scstwremotemonitorrace.h similarity index 100% rename from ScStwLibraries/headers/scstwremotemonitorrace.h rename to ScStwLibraries/headers/client/scstwremotemonitorrace.h diff --git a/ScStwStyling/sources/scstwstyling.cpp b/ScStwLibraries/headers/client/scstwremotesettings.h similarity index 50% rename from ScStwStyling/sources/scstwstyling.cpp rename to ScStwLibraries/headers/client/scstwremotesettings.h index 05dff74..af3beb9 100644 --- a/ScStwStyling/sources/scstwstyling.cpp +++ b/ScStwLibraries/headers/client/scstwremotesettings.h @@ -1,5 +1,5 @@ /**************************************************************************** - ** ScStw Styling + ** ScStw Libraries ** Copyright (C) 2020 Itsblue development ** ** This program is free software: you can redistribute it and/or modify @@ -16,15 +16,38 @@ ** along with this program. If not, see . ****************************************************************************/ -#include "../headers/scstwstyling.h" +#ifndef SCSTWREMOTESETTINGS_H +#define SCSTWREMOTESETTINGS_H -ScStwStyling::ScStwStyling(QObject *parent) : QObject(parent) +#include +#include "scstwsettings.h" +#include "scstwclient.h" +#include + +class ScStwRemoteSettings : public ScStwSettings { + Q_OBJECT +public: + ScStwRemoteSettings(ScStwClient * scStwClient, QObject * parent = nullptr); -} + enum SettingsMode { + LOCAL, + REMOTE + }; -void ScStwStyling::init(QQmlApplicationEngine *engine) { - qmlRegisterUncreatableType("de.itsblue.ScStw.Styling", 2, 0, "ScStwAppTheme", "The ScStwAppTheme has to be managed by a ScStwAppTheme manager and is therefore not creatable"); - qmlRegisterType("de.itsblue.ScStw.Styling", 2, 0, "ScStwAppThemeManager"); - engine->addImportPath(":/lib"); -} +protected: + QVariant readSetting(QString key, int keyInt, int keyLevel); + bool writeSetting(QString key, QVariant value, int keyInt,int keyLevel = -1); + bool setDefaultSetting(QString key, QVariant defaultVariant, int keyInt,int keyLevel = -1); + +private: + ScStwClient * scStwClient; + + SettingsMode getMode(); + +private slots: + void handleClientStateChange(); + void handleBaseStationSignal(ScStw::SignalKey key, QVariant data); +}; + +#endif // SCSTWREMOTESETTINGS_H diff --git a/ScStwLibraries/headers/scstwlibraries.h b/ScStwLibraries/headers/scstwlibraries.h index f6b1857..e7c495e 100644 --- a/ScStwLibraries/headers/scstwlibraries.h +++ b/ScStwLibraries/headers/scstwlibraries.h @@ -22,10 +22,18 @@ #include #ifdef ScStwLibraries_QML #include + +#ifdef ScStwLibraries_Styling +#include "scstwappthememanager.h" +#include "scstwapptheme.h" +#endif + #endif #include "scstwtimer.h" #include "scstwrace.h" +#include "scstwsettings.h" #ifdef ScStwLibraries_ClientLibs +#include "scstwsetting.h" #include "scstwremotemonitorrace.h" #include "scstwclient.h" #endif @@ -37,6 +45,12 @@ class ScStwLibraries : public QObject public: static void init(); +#ifdef ScStwLibraries_QML +#ifdef ScStwLibraries_Styling + static void initStyling(QQmlApplicationEngine *engine); +#endif +#endif + private: explicit ScStwLibraries(QObject *parent = nullptr); diff --git a/ScStwStyling/headers/scstwstyling.h b/ScStwLibraries/headers/scstwsetting.h similarity index 58% rename from ScStwStyling/headers/scstwstyling.h rename to ScStwLibraries/headers/scstwsetting.h index 1902e0a..72818b7 100644 --- a/ScStwStyling/headers/scstwstyling.h +++ b/ScStwLibraries/headers/scstwsetting.h @@ -1,5 +1,5 @@ /**************************************************************************** - ** ScStw Styling + ** ScStw Libraries ** Copyright (C) 2020 Itsblue development ** ** This program is free software: you can redistribute it and/or modify @@ -16,28 +16,40 @@ ** along with this program. If not, see . ****************************************************************************/ -#ifndef SCSTWSTYLING_H -#define SCSTWSTYLING_H +#ifndef SCSTWQMLSETTING_H +#define SCSTWQMLSETTING_H #include -#include +#include -#include "scstwapptheme.h" -#include "scstwappthememanager.h" - - -class ScStwStyling : public QObject +class ScStwSetting : public QObject { Q_OBJECT + Q_PROPERTY(QVariant value READ getValue WRITE setValue NOTIFY valueChanged) -public: - static void init(QQmlApplicationEngine *engine); +protected: + explicit ScStwSetting(QObject *parent = nullptr); + + int key; + int keyLevel; + bool hasToReload; + + virtual bool writeSetting(int, int, QVariant) = 0; + virtual QVariant readSetting(int, int) = 0; private: - explicit ScStwStyling(QObject *parent = nullptr); + QVariant valueCache; + +public slots: + QVariant getValue(); + void setValue(QVariant value); + +protected slots: + void handleSettingChange(int key, int keyLevel, QVariant value); signals: + void valueChanged(); }; -#endif // SCSTWSTYLING_H +#endif // SCSTWQMLSETTING_H diff --git a/ScStwLibraries/headers/scstwsettings.h b/ScStwLibraries/headers/scstwsettings.h new file mode 100644 index 0000000..71787a3 --- /dev/null +++ b/ScStwLibraries/headers/scstwsettings.h @@ -0,0 +1,126 @@ +/**************************************************************************** + ** ScStw Libraries + ** Copyright (C) 2020 Itsblue development + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program. If not, see . + ****************************************************************************/ + +#ifndef SCSTWSETTINGS_H +#define SCSTWSETTINGS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ScStwSettings : public QObject +{ + Q_OBJECT +public: + explicit ScStwSettings(QObject *parent = nullptr); + + typedef QString(*keyToStringConverter)(int); + + /*! + * \brief The BaseStationSetting enum contains all settings of the base station that can be changed by a client + * + * \see ScStw::baseStationSettingFromInt() + * \see ScStw::baseStationSettingToString() + * \see ScStw::baseStationSettingFromString() + * \see ScStw::baseStationSettings + */ + enum BaseStationSetting { + InvalidSetting = -1, + ReadySoundEnableSetting, + ReadySoundDelaySetting, + AtYourMarksSoundEnableSetting, + AtYourMarksSoundDelaySetting, + SoundVolumeSetting + }; + Q_ENUM(BaseStationSetting) + + enum KeyLevelEnum { + KeyLevel = 0 + }; + Q_ENUM(KeyLevelEnum) + + virtual QVariant readSetting(BaseStationSetting key); + Q_INVOKABLE virtual QVariant readSetting(int key, int keyLevel); + virtual bool writeSetting(BaseStationSetting key, QVariant value); + Q_INVOKABLE virtual bool writeSetting(int key, int keyLevel, QVariant value); + virtual bool setDefaultSetting(BaseStationSetting key, QVariant defaultValue); + Q_INVOKABLE virtual bool setDefaultSetting(int key, int keyLevel, QVariant defaultValue); + + Q_INVOKABLE ScStwSetting * getSetting(int key, int keyLevel); + + static BaseStationSetting keyFromInt(int i) { + QMetaEnum enumeration = QMetaEnum::fromType(); + return static_cast(enumeration.keyToValue(enumeration.valueToKey(i))); + } + + static QString keyToString(int key) { + return QMetaEnum::fromType().valueToKey(key); + } + +protected: + virtual QVariant readSetting(QString key, int keyInt = -1, int keyLevel = -1); + virtual bool writeSetting(QString key, QVariant value, int keyInt = -1,int keyLevel = -1); + virtual bool setDefaultSetting(QString key, QVariant defaultValue, int keyInt,int keyLevel = -1); + bool registerKeyLevelHandler(int keyLevel, keyToStringConverter); + +private: + QFile * settingsFile; + QVariantMap settingsCache; + + bool loadSettingsFromFile(); + + class ScStwSettingInternal: public ScStwSetting { + public: + ScStwSettingInternal(int key, int keyLevel, ScStwSettings*scStwSettings, QObject *parent):ScStwSetting(parent) { + this->scStwSettings = scStwSettings; + connect(this->scStwSettings, &ScStwSettings::settingChanged, this, &ScStwSettingInternal::handleSettingChange); + this->key = key; + this->keyLevel = keyLevel; + this->handleSettingChange(-1, 0, QVariant()); + } + protected: + ScStwSettings *scStwSettings; + + bool writeSetting(int key, int keyLevel, QVariant value) { + return this->scStwSettings->writeSetting(key, keyLevel, value); + } + + QVariant readSetting(int key, int keyLevel) { + return this->scStwSettings->readSetting(key, keyLevel); + } + }; + + QMap keyToStringConverters; + QMap> internalSettingHandlers; + +private slots: + bool writeSettingsToFile(); + +signals: + void settingChanged(int key, int keyLevel, QVariant value); + +}; + +#endif // SCSTWSETTINGS_H diff --git a/ScStwStyling/headers/scstwapptheme.h b/ScStwLibraries/headers/styling/scstwapptheme.h similarity index 100% rename from ScStwStyling/headers/scstwapptheme.h rename to ScStwLibraries/headers/styling/scstwapptheme.h diff --git a/ScStwStyling/headers/scstwappthememanager.h b/ScStwLibraries/headers/styling/scstwappthememanager.h similarity index 100% rename from ScStwStyling/headers/scstwappthememanager.h rename to ScStwLibraries/headers/styling/scstwappthememanager.h diff --git a/ScStwStyling/resources/qml/ScStwStylingQml.qrc b/ScStwLibraries/resources/qml/ScStwStylingQml.qrc similarity index 100% rename from ScStwStyling/resources/qml/ScStwStylingQml.qrc rename to ScStwLibraries/resources/qml/ScStwStylingQml.qrc diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml similarity index 100% rename from ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml rename to ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/FadeAnimation.qml b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/FadeAnimation.qml similarity index 100% rename from ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/FadeAnimation.qml rename to ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/FadeAnimation.qml diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Icon.qml b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Icon.qml similarity index 100% rename from ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Icon.qml rename to ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Icon.qml diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Test.qml b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Test.qml similarity index 100% rename from ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Test.qml rename to ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/Test.qml diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml similarity index 100% rename from ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml rename to ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/qmldir b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/qmldir similarity index 100% rename from ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/qmldir rename to ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/qmldir diff --git a/ScStwLibraries/resources/ScStwLibrariesShared.qrc b/ScStwLibraries/resources/shared/ScStwLibrariesShared.qrc similarity index 100% rename from ScStwLibraries/resources/ScStwLibrariesShared.qrc rename to ScStwLibraries/resources/shared/ScStwLibrariesShared.qrc diff --git a/ScStwStyling/resources/shared/ScStwStylingShared.qrc b/ScStwLibraries/resources/shared/ScStwStylingShared.qrc similarity index 100% rename from ScStwStyling/resources/shared/ScStwStylingShared.qrc rename to ScStwLibraries/resources/shared/ScStwStylingShared.qrc diff --git a/ScStwStyling/resources/shared/fonts/PTMono-Regular.ttf b/ScStwLibraries/resources/shared/fonts/PTMono-Regular.ttf similarity index 100% rename from ScStwStyling/resources/shared/fonts/PTMono-Regular.ttf rename to ScStwLibraries/resources/shared/fonts/PTMono-Regular.ttf diff --git a/ScStwStyling/resources/shared/fonts/fa5brands.woff b/ScStwLibraries/resources/shared/fonts/fa5brands.woff similarity index 100% rename from ScStwStyling/resources/shared/fonts/fa5brands.woff rename to ScStwLibraries/resources/shared/fonts/fa5brands.woff diff --git a/ScStwStyling/resources/shared/fonts/fa5regular.woff b/ScStwLibraries/resources/shared/fonts/fa5regular.woff similarity index 100% rename from ScStwStyling/resources/shared/fonts/fa5regular.woff rename to ScStwLibraries/resources/shared/fonts/fa5regular.woff diff --git a/ScStwStyling/resources/shared/fonts/fa5solid.woff b/ScStwLibraries/resources/shared/fonts/fa5solid.woff similarity index 100% rename from ScStwStyling/resources/shared/fonts/fa5solid.woff rename to ScStwLibraries/resources/shared/fonts/fa5solid.woff diff --git a/ScStwStyling/resources/shared/images/BaseStationBlack.png b/ScStwLibraries/resources/shared/images/BaseStationBlack.png similarity index 100% rename from ScStwStyling/resources/shared/images/BaseStationBlack.png rename to ScStwLibraries/resources/shared/images/BaseStationBlack.png diff --git a/ScStwStyling/resources/shared/images/BaseStationWhite.png b/ScStwLibraries/resources/shared/images/BaseStationWhite.png similarity index 100% rename from ScStwStyling/resources/shared/images/BaseStationWhite.png rename to ScStwLibraries/resources/shared/images/BaseStationWhite.png diff --git a/ScStwStyling/resources/shared/images/SpeedHoldBlack.png b/ScStwLibraries/resources/shared/images/SpeedHoldBlack.png similarity index 100% rename from ScStwStyling/resources/shared/images/SpeedHoldBlack.png rename to ScStwLibraries/resources/shared/images/SpeedHoldBlack.png diff --git a/ScStwStyling/resources/shared/images/SpeedHoldWhite.png b/ScStwLibraries/resources/shared/images/SpeedHoldWhite.png similarity index 100% rename from ScStwStyling/resources/shared/images/SpeedHoldWhite.png rename to ScStwLibraries/resources/shared/images/SpeedHoldWhite.png diff --git a/ScStwLibraries/resources/sound/AtYourMarksSound.wav b/ScStwLibraries/resources/shared/sound/AtYourMarksSound.wav similarity index 100% rename from ScStwLibraries/resources/sound/AtYourMarksSound.wav rename to ScStwLibraries/resources/shared/sound/AtYourMarksSound.wav diff --git a/ScStwLibraries/resources/sound/FalseStartSound.wav b/ScStwLibraries/resources/shared/sound/FalseStartSound.wav similarity index 100% rename from ScStwLibraries/resources/sound/FalseStartSound.wav rename to ScStwLibraries/resources/shared/sound/FalseStartSound.wav diff --git a/ScStwLibraries/resources/sound/IFSC frequenzy and duration conform false start sound.wav b/ScStwLibraries/resources/shared/sound/IFSC frequenzy and duration conform false start sound.wav similarity index 100% rename from ScStwLibraries/resources/sound/IFSC frequenzy and duration conform false start sound.wav rename to ScStwLibraries/resources/shared/sound/IFSC frequenzy and duration conform false start sound.wav diff --git a/ScStwLibraries/resources/sound/ReadySound.wav b/ScStwLibraries/resources/shared/sound/ReadySound.wav similarity index 100% rename from ScStwLibraries/resources/sound/ReadySound.wav rename to ScStwLibraries/resources/shared/sound/ReadySound.wav diff --git a/ScStwLibraries/resources/sound/StartsignalSound.wav b/ScStwLibraries/resources/shared/sound/StartsignalSound.wav similarity index 100% rename from ScStwLibraries/resources/sound/StartsignalSound.wav rename to ScStwLibraries/resources/shared/sound/StartsignalSound.wav diff --git a/ScStwLibraries/resources/sound/StartsignalSoundExtended.wav b/ScStwLibraries/resources/shared/sound/StartsignalSoundExtended.wav similarity index 100% rename from ScStwLibraries/resources/sound/StartsignalSoundExtended.wav rename to ScStwLibraries/resources/shared/sound/StartsignalSoundExtended.wav diff --git a/ScStwLibraries/sources/ScStw.cpp b/ScStwLibraries/sources/ScStw.cpp index f01abb2..2cc19f0 100644 --- a/ScStwLibraries/sources/ScStw.cpp +++ b/ScStwLibraries/sources/ScStw.cpp @@ -21,38 +21,6 @@ const char *ScStw::SOCKET_MESSAGE_START_KEY = ""; const char *ScStw::SOCKET_MESSAGE_END_KEY = ""; -const QMap ScStw::baseStationSettings = { - {"ReadySoundEnable", ScStw::ReadySoundEnableSetting}, - {"ReadySoundDelay", ScStw::ReadySoundDelaySetting}, - {"AtYourMarksSoundEnable", ScStw::AtYourMarksSoundEnableSetting}, - {"AtYourMarksSoundDelay", ScStw::AtYourMarksSoundDelaySetting}, - {"SoundVolume", ScStw::SoundVolumeSetting} -}; - -ScStw::BaseStationSetting ScStw::baseStationSettingFromString(QString s) { - if(!ScStw::baseStationSettings.contains(s)) - return ScStw::InvalidSetting; - - return ScStw::baseStationSettings[s]; -} - -QString ScStw::baseStationSettingToString(ScStw::BaseStationSetting s) { - for(QString key: ScStw::baseStationSettings.keys()) { - if(ScStw::baseStationSettings[key] == s) - return key; - } - return "Invalid"; -} - -ScStw::BaseStationSetting ScStw::baseStationSettingfromInt(int i) { - bool ok; - BaseStationSetting s = ScStw::toEnumValue(i, &ok); - if(!ok) - return InvalidSetting; - else - return s; -} - ScStw::SignalKey ScStw::signalKeyFromInt(int i) { bool ok; ScStw::SignalKey k = ScStw::toEnumValue(i, &ok); diff --git a/ScStwLibraries/sources/scstwclient.cpp b/ScStwLibraries/sources/client/scstwclient.cpp similarity index 92% rename from ScStwLibraries/sources/scstwclient.cpp rename to ScStwLibraries/sources/client/scstwclient.cpp index bc5b077..2fed168 100644 --- a/ScStwLibraries/sources/scstwclient.cpp +++ b/ScStwLibraries/sources/client/scstwclient.cpp @@ -16,15 +16,16 @@ ** along with this program. If not, see . ****************************************************************************/ -#include "../headers/scstwclient.h" +#include "scstwclient.h" ScStwClient * pGlobalScStwClient = nullptr; -ScStwClient::ScStwClient(QObject * parent) : QObject(parent) +ScStwClient::ScStwClient(QObject * parent, QList signalSubscriptions) : QObject(parent) { this->state = DISCONNECTED; this->nextConnectionId = 1; this->extensions = QVariantList({}); + this->signalSubscriptions = signalSubscriptions; this->socket = new QTcpSocket(this); @@ -72,9 +73,13 @@ bool ScStwClient::init() { this->setState(INITIALISING); this->timeoutTimer->stop(); + QJsonArray signalSubs; + foreach (ScStw::SignalKey key, this->signalSubscriptions) { + signalSubs.append(key); + } + // init remote session - QJsonArray updateSubs = {ScStw::RaceStateChanged, ScStw::TimersChanged, ScStw::ExtensionsChanged, ScStw::NextStartActionChanged}; - QJsonObject sessionParams = {{"updateSubs", updateSubs}, {"init", true}, {"usingTerminationKeys", true}}; + QJsonObject sessionParams = {{"signalSubscriptions", signalSubs}, {"init", true}, {"usingTerminationKeys", true}}; QVariantMap initResponse = this->sendCommand(1, sessionParams, 3000, false); @@ -86,7 +91,7 @@ bool ScStwClient::init() { this->apiVersion = initResponse["data"].toMap()["apiVersion"].toString(); qDebug() << "[INFO][CLIENT] base station api version is: " << this->apiVersion; int compareResult = ScStw::firmwareCompare(this->API_VERSION, this->apiVersion); - qDebug() << "compare result is: " << compareResult; + //qDebug() << "compare result is: " << compareResult; if( compareResult == -3 ){ // the client version is out of date!! this->closeConnection(); @@ -392,19 +397,19 @@ void ScStwClient::handleSignal(QVariantMap data) { // --- helper functions --- // ------------------------ -ScStw::StatusCode ScStwClient::writeRemoteSetting(ScStw::BaseStationSetting key, QString value) { +ScStw::StatusCode ScStwClient::writeRemoteSetting(ScStwSettings::BaseStationSetting key, QVariant value) { QJsonArray requestData; - requestData.append(key); - requestData.append(value); + requestData.append(int(key)); + requestData.append(QJsonValue::fromVariant(value)); return ScStw::StatusCode(this->sendCommand(3000, requestData)["status"].toInt()); } -QString ScStwClient::readRemoteSetting(ScStw::BaseStationSetting key) { - QVariantMap reply = this->sendCommand(3001, key); +QVariant ScStwClient::readRemoteSetting(ScStwSettings::BaseStationSetting key) { + QVariantMap reply = this->sendCommand(3001, int(key)); if(reply["status"] != 200){ return "false"; } - return reply["data"].toString(); + return reply["data"]; } void ScStwClient::setIP(QString newIp){ @@ -452,3 +457,9 @@ void ScStwClient::setExtensions(QVariantList extensions) { emit this->extensionsChanged(); } } + + +void ScStwClient::addSignalSubscription(ScStw::SignalKey key) { + if(!this->signalSubscriptions.contains(key)) + this->signalSubscriptions.append(key); +} diff --git a/ScStwLibraries/sources/scstwremotemonitorrace.cpp b/ScStwLibraries/sources/client/scstwremotemonitorrace.cpp similarity index 96% rename from ScStwLibraries/sources/scstwremotemonitorrace.cpp rename to ScStwLibraries/sources/client/scstwremotemonitorrace.cpp index 56d6f4e..b286927 100644 --- a/ScStwLibraries/sources/scstwremotemonitorrace.cpp +++ b/ScStwLibraries/sources/client/scstwremotemonitorrace.cpp @@ -16,12 +16,16 @@ ** along with this program. If not, see . ****************************************************************************/ -#include "../headers/scstwremotemonitorrace.h" +#include "scstwremotemonitorrace.h" ScStwRemoteMonitorRace::ScStwRemoteMonitorRace(ScStwClient *monitorClient, QObject *parent) : ScStwRace(parent) { this->scStwClient = monitorClient; + this->scStwClient->addSignalSubscription(ScStw::RaceStateChanged); + this->scStwClient->addSignalSubscription(ScStw::TimersChanged); + this->scStwClient->addSignalSubscription(ScStw::NextStartActionChanged); + connect(this->scStwClient, &ScStwClient::stateChanged, this, &ScStwRemoteMonitorRace::handleClientStateChanged); connect(this->scStwClient, &ScStwClient::gotSignal, this, &ScStwRemoteMonitorRace::handleBaseStationSignal); } diff --git a/ScStwLibraries/sources/client/scstwremotesettings.cpp b/ScStwLibraries/sources/client/scstwremotesettings.cpp new file mode 100644 index 0000000..5fb46f7 --- /dev/null +++ b/ScStwLibraries/sources/client/scstwremotesettings.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** + ** ScStw Libraries + ** Copyright (C) 2020 Itsblue development + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program. If not, see . + ****************************************************************************/ + +#include "../../headers/client/scstwremotesettings.h" + +ScStwRemoteSettings::ScStwRemoteSettings(ScStwClient * scStwClient, QObject * parent) : ScStwSettings(parent) +{ + this->scStwClient = scStwClient; + this->scStwClient->addSignalSubscription(ScStw::SettingChanged); + + connect(this->scStwClient, &ScStwClient::gotSignal, this, &ScStwRemoteSettings::handleBaseStationSignal); +} + +ScStwRemoteSettings::SettingsMode ScStwRemoteSettings::getMode() { + if(this->scStwClient->getState() == ScStwClient::CONNECTED) + return ScStwRemoteSettings::REMOTE; + else + return ScStwRemoteSettings::LOCAL; +} + +QVariant ScStwRemoteSettings::readSetting(QString key, int keyInt, int keyLevel) { + if(this->getMode() == LOCAL || keyLevel > ScStwSettings::KeyLevel) + return ScStwSettings::readSetting(key, keyInt, keyLevel); + + return this->scStwClient->readRemoteSetting(ScStwSettings::BaseStationSetting(keyInt)); +} + +bool ScStwRemoteSettings::writeSetting(QString key, QVariant value, int keyInt, int keyLevel) { + if(this->getMode() == LOCAL || keyLevel > ScStwSettings::KeyLevel) + return ScStwSettings::writeSetting(key, value, keyInt, keyLevel); + + ScStw::StatusCode res = this->scStwClient->writeRemoteSetting(ScStwSettings::BaseStationSetting(keyInt), value); + + return res == ScStw::Success; +} + +bool ScStwRemoteSettings::setDefaultSetting(QString key, QVariant defaultVariant, int keyInt, int keyLevel) { + if(this->getMode() == LOCAL || keyLevel > ScStwSettings::KeyLevel) + return ScStwSettings::setDefaultSetting(key, defaultVariant, keyInt, keyLevel); + + return false; +} + +void ScStwRemoteSettings::handleClientStateChange() { + if(this->scStwClient->getState() == ScStwClient::DISCONNECTED) + emit this->settingChanged(-1, 0, QVariant()); +} + +void ScStwRemoteSettings::handleBaseStationSignal(ScStw::SignalKey key, QVariant data) { + switch (key) { + case ScStw::SettingChanged: + emit this->settingChanged(data.toMap()["key"].toInt(), ScStwSettings::KeyLevel, data.toMap()["value"]); + default: + break; +} +} diff --git a/ScStwLibraries/sources/scstwlibraries.cpp b/ScStwLibraries/sources/scstwlibraries.cpp index 427078c..2c1c0fb 100644 --- a/ScStwLibraries/sources/scstwlibraries.cpp +++ b/ScStwLibraries/sources/scstwlibraries.cpp @@ -26,7 +26,7 @@ ScStwLibraries::ScStwLibraries(QObject *parent) : QObject(parent) void ScStwLibraries::init() { #ifdef ScStwLibraries_QML qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStw"); - qRegisterMetaType("ScStw::BaseStationSetting"); + qRegisterMetaType("ScStwSettings::BaseStationSetting"); qRegisterMetaType("ScStw::SocketCommand"); qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStwRace"); @@ -34,6 +34,19 @@ void ScStwLibraries::init() { #ifdef ScStwLibraries_ClientLibs qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStwClient"); + qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStwSettings"); + qmlRegisterUncreatableType("de.itsblue.ScStw", 2, 0, "ScStwSetting", "The ScStwSetting is manage by a ScStwSettings instance and therefore not creatable"); #endif #endif } + + +#ifdef ScStwLibraries_QML +#ifdef ScStwLibraries_Styling +void ScStwLibraries::initStyling(QQmlApplicationEngine *engine) { + qmlRegisterUncreatableType("de.itsblue.ScStw.Styling", 2, 0, "ScStwAppTheme", "The ScStwAppTheme has to be managed by a ScStwAppTheme manager and is therefore not creatable"); + qmlRegisterType("de.itsblue.ScStw.Styling", 2, 0, "ScStwAppThemeManager"); + engine->addImportPath(":/lib"); +} +#endif +#endif diff --git a/ScStwLibraries/sources/scstwsetting.cpp b/ScStwLibraries/sources/scstwsetting.cpp new file mode 100644 index 0000000..1c10f53 --- /dev/null +++ b/ScStwLibraries/sources/scstwsetting.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** + ** ScStw Libraries + ** Copyright (C) 2020 Itsblue development + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program. If not, see . + ****************************************************************************/ + +#include "scstwsetting.h" +#include + +ScStwSetting::ScStwSetting(QObject *parent) : QObject(parent) +{ +} + +QVariant ScStwSetting::getValue() { + if(this->hasToReload) { + this->valueCache = this->readSetting(this->key, this->keyLevel); + this->hasToReload = false; + } + return this->valueCache; +} +void ScStwSetting::setValue(QVariant value) { + if(value != this->valueCache) { + this->writeSetting(this->key, this->keyLevel, value); + } +} + +void ScStwSetting::handleSettingChange(int key, int keyLevel, QVariant value) { + if(keyLevel == this->keyLevel && key == this->key) { + this->valueCache = value; + qDebug() << "value changed!!! key: " << key << " new value " << value; + emit this->valueChanged(); + } + else if(key == -1 && this->key != -1 && this->keyLevel != -1 && this->keyLevel == keyLevel) { + this->hasToReload = true; + emit this->valueChanged(); + } +} diff --git a/ScStwLibraries/sources/scstwsettings.cpp b/ScStwLibraries/sources/scstwsettings.cpp new file mode 100644 index 0000000..45844a0 --- /dev/null +++ b/ScStwLibraries/sources/scstwsettings.cpp @@ -0,0 +1,140 @@ +/**************************************************************************** + ** ScStw Libraries + ** Copyright (C) 2020 Itsblue development + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program. If not, see . + ****************************************************************************/ + +#include "../headers/scstwsettings.h" + +ScStwSettings::ScStwSettings(QObject *parent) : QObject(parent) +{ + QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); + QDir dir(path); + this->settingsFile = new QFile(path + "/settings.json"); + if(!this->settingsFile->exists()) + if(!dir.mkpath(path)) + qFatal("[FATAL] Couldn't create settings dir %s", qPrintable(path)); + + if(!this->settingsFile->open(QFile::ReadWrite)) + qFatal("[FATAL] Couldn't open settings file %s", qPrintable(path + "/settings.json")); + + if(!this->loadSettingsFromFile() && this->settingsFile->size() != 0) + qFatal("[FATAL] Settings file (%s) is of invalid format!", qPrintable(path + "/settings.json")); + + connect(this, &ScStwSettings::settingChanged, this, &ScStwSettings::writeSettingsToFile); + + this->registerKeyLevelHandler(ScStwSettings::KeyLevel, &ScStwSettings::keyToString); +} + +QVariant ScStwSettings::readSetting(BaseStationSetting key) { + return this->readSetting(key, 0); +} + +QVariant ScStwSettings::readSetting(int key, int keyLevel) { + if(this->keyToStringConverters.contains(keyLevel)) + return this->readSetting(this->keyToStringConverters[keyLevel](key), key, keyLevel); + else + return QVariant(); +} + +bool ScStwSettings::writeSetting(BaseStationSetting key, QVariant value) { + return this->writeSetting(key, 0, value); +} + +bool ScStwSettings::writeSetting(int key, int keyLevel, QVariant value) { + if(this->keyToStringConverters.contains(keyLevel)) + return this->writeSetting(this->keyToStringConverters[keyLevel](key), value, key, keyLevel); + else + return false; +} + +bool ScStwSettings::setDefaultSetting(BaseStationSetting key, QVariant defaultValue) { + return this->setDefaultSetting(key, 0, defaultValue); +} + +bool ScStwSettings::setDefaultSetting(int key, int keyLevel, QVariant defaultValue) { + if(this->keyToStringConverters.contains(keyLevel)) + return this->setDefaultSetting(this->keyToStringConverters[keyLevel](key), defaultValue, key, keyLevel); + else + return false; +} + +QVariant ScStwSettings::readSetting(QString key, int keyInt, int keyLevel) { + Q_UNUSED(keyInt) + Q_UNUSED(keyLevel) + return this->settingsCache[key]; +} + +bool ScStwSettings::writeSetting(QString key, QVariant value, int keyInt, int keyLevel) { + if(!this->settingsCache.contains(key)) + this->settingsCache.insert(key, value); + else if (this->settingsCache[key] == value) + return true; + else + this->settingsCache[key] = value; + + emit this->settingChanged(keyInt, keyLevel, value); + + return true; +} + +bool ScStwSettings::setDefaultSetting(QString key, QVariant defaultValue, int keyInt, int keyLevel) { + if(!this->settingsCache.contains(key)) + return this->writeSetting(key, defaultValue, keyInt, keyLevel); + return true; +} + +ScStwSetting * ScStwSettings::getSetting(int key, int keyLevel) { + if(!this->internalSettingHandlers.contains(keyLevel)) + this->internalSettingHandlers.insert(keyLevel, {}); + + if(!this->internalSettingHandlers[keyLevel].contains(key)) + this->internalSettingHandlers[keyLevel].insert(key, new ScStwSettingInternal(key, keyLevel, this, this)); + + return this->internalSettingHandlers[keyLevel][key]; +} + +bool ScStwSettings::registerKeyLevelHandler(int keyLevel, keyToStringConverter converterFunction) { + if(this->keyToStringConverters.contains(keyLevel)) + return false; + + this->keyToStringConverters.insert(keyLevel, converterFunction); + return true; +} + +/* + * File handling + */ + +bool ScStwSettings::writeSettingsToFile() { + QJsonDocument doc = QJsonDocument::fromVariant(this->settingsCache); + + // overwrite file + this->settingsFile->reset(); + this->settingsFile->write(doc.toJson(QJsonDocument::Indented)); + this->settingsFile->flush(); + + return true; +} + +bool ScStwSettings::loadSettingsFromFile() { + QJsonDocument doc = QJsonDocument::fromJson(this->settingsFile->readAll()); + + if(doc.toVariant().type() != QVariant::Map) + return false; + + this->settingsCache = doc.toVariant().toMap(); + return true; +} diff --git a/ScStwStyling/sources/scstwapptheme.cpp b/ScStwLibraries/sources/styling/scstwapptheme.cpp similarity index 97% rename from ScStwStyling/sources/scstwapptheme.cpp rename to ScStwLibraries/sources/styling/scstwapptheme.cpp index 2e30539..49c79a2 100644 --- a/ScStwStyling/sources/scstwapptheme.cpp +++ b/ScStwLibraries/sources/styling/scstwapptheme.cpp @@ -16,7 +16,7 @@ ** along with this program. If not, see . ****************************************************************************/ -#include "headers/scstwapptheme.h" +#include "scstwapptheme.h" ScStwAppTheme::ScStwAppTheme(QString name, QVariantMap colors, QVariantMap icons, QVariantMap fonts, QVariantMap images, QObject *parent) : QObject(parent) { diff --git a/ScStwStyling/sources/scstwappthememanager.cpp b/ScStwLibraries/sources/styling/scstwappthememanager.cpp similarity index 99% rename from ScStwStyling/sources/scstwappthememanager.cpp rename to ScStwLibraries/sources/styling/scstwappthememanager.cpp index 00fef82..b8d3145 100644 --- a/ScStwStyling/sources/scstwappthememanager.cpp +++ b/ScStwLibraries/sources/styling/scstwappthememanager.cpp @@ -16,7 +16,7 @@ ** along with this program. If not, see . ****************************************************************************/ -#include "../headers/scstwappthememanager.h" +#include "scstwappthememanager.h" ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) { diff --git a/ScStwStyling/.gitignore b/ScStwStyling/.gitignore deleted file mode 100644 index 84c048a..0000000 --- a/ScStwStyling/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build/ diff --git a/ScStwStyling/ScStwStyling.pri b/ScStwStyling/ScStwStyling.pri deleted file mode 100644 index f15a69e..0000000 --- a/ScStwStyling/ScStwStyling.pri +++ /dev/null @@ -1,21 +0,0 @@ -!isEmpty(SCSTWSTYLING_LIB):error("ScStwLibraries.pri already included") -SCSTWSTYLING_LIB = 1 - -#DEPENDS -CONFIG(release, debug|release): { - SCSTWSTYLING_LIB_OUTPUT_DIR="$$PWD/build/release" -} else { - SCSTWSTYLING_LIB_OUTPUT_DIR="$$PWD/build/debug" -} - -unix:LIBS += -L$$SCSTWSTYLING_LIB_OUTPUT_DIR -lScStwStyling - -win32:LIBS += -L$$SCSTWSTYLING_LIB_OUTPUT_DIR -lScStwStyling1 - -android { - ANDROID_EXTRA_LIBS += $$SCSTWSTYLING_LIB_OUTPUT_DIR/libScStwStyling.so -} - -QML_IMPORT_PATH = "$$PWD/resources/qml/lib" -INCLUDEPATH += "$$PWD" -INCLUDEPATH += "$$PWD"/headers diff --git a/ScStwStyling/ScStwStyling.pro b/ScStwStyling/ScStwStyling.pro deleted file mode 100644 index 5e3704e..0000000 --- a/ScStwStyling/ScStwStyling.pro +++ /dev/null @@ -1,42 +0,0 @@ -QT += gui qml - -TEMPLATE = lib -DEFINES += SCSTWSTYLING_LIBRARY - -CONFIG += c++11 - -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -SOURCES += \ - sources/scstwapptheme.cpp \ - sources/scstwappthememanager.cpp \ - sources/scstwstyling.cpp - -HEADERS += \ - headers/scstwapptheme.h \ - headers/scstwappthememanager.h \ - headers/scstwstyling.h - -RESOURCES += \ - resources/qml/ScStwStylingQml.qrc \ - resources/shared/ScStwStylingShared.qrc \ - -#DEPENDS -CONFIG(release, debug|release): { - DESTDIR="$$PWD/build/release" -} else { - DESTDIR="$$PWD/build/debug" -} - -# Default rules for deployment. -target.path = /usr/local/lib -!isEmpty(target.path): INSTALLS += target diff --git a/favicon.xcf b/favicon.xcf deleted file mode 100644 index a2c5522..0000000 Binary files a/favicon.xcf and /dev/null differ diff --git a/release/build.sh b/release/build.sh deleted file mode 100755 index 8b95bbb..0000000 --- a/release/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -dpkg-deb --build debian -mv debian.deb libScStwSharedLibraries.deb diff --git a/release/debian/DEBIAN/control b/release/debian/DEBIAN/control deleted file mode 100644 index d02e8bb..0000000 --- a/release/debian/DEBIAN/control +++ /dev/null @@ -1,9 +0,0 @@ -Package: libScStwSharedLibraries -Version: 1.1.0 -Section: base -Priority: optional -Architecture: armhf -Depends: libqt5raspi-5.12.5 (>=1.0) -Maintainer: Dorian Zedler -Description: ScStwSharedLibraries - This package contains all libraries used in the ScStw Project diff --git a/release/debian/DEBIAN/postinst b/release/debian/DEBIAN/postinst deleted file mode 100755 index ddb3626..0000000 --- a/release/debian/DEBIAN/postinst +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# reload ld path -ldconfig diff --git a/release/debian/usr/local/lib/libQt-Secret.so b/release/debian/usr/local/lib/libQt-Secret.so deleted file mode 120000 index 12e65b5..0000000 --- a/release/debian/usr/local/lib/libQt-Secret.so +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libQt-Secret.so.1 b/release/debian/usr/local/lib/libQt-Secret.so.1 deleted file mode 120000 index 12e65b5..0000000 --- a/release/debian/usr/local/lib/libQt-Secret.so.1 +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libQt-Secret.so.1.2 b/release/debian/usr/local/lib/libQt-Secret.so.1.2 deleted file mode 120000 index 12e65b5..0000000 --- a/release/debian/usr/local/lib/libQt-Secret.so.1.2 +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libQt-Secret.so.1.2.0 b/release/debian/usr/local/lib/libQt-Secret.so.1.2.0 deleted file mode 100755 index 8491753..0000000 Binary files a/release/debian/usr/local/lib/libQt-Secret.so.1.2.0 and /dev/null differ diff --git a/release/debian/usr/local/lib/libScStwLibraries.so b/release/debian/usr/local/lib/libScStwLibraries.so deleted file mode 120000 index c342963..0000000 --- a/release/debian/usr/local/lib/libScStwLibraries.so +++ /dev/null @@ -1 +0,0 @@ -libScStwLibraries.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwLibraries.so.1 b/release/debian/usr/local/lib/libScStwLibraries.so.1 deleted file mode 120000 index c342963..0000000 --- a/release/debian/usr/local/lib/libScStwLibraries.so.1 +++ /dev/null @@ -1 +0,0 @@ -libScStwLibraries.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwLibraries.so.1.0 b/release/debian/usr/local/lib/libScStwLibraries.so.1.0 deleted file mode 120000 index c342963..0000000 --- a/release/debian/usr/local/lib/libScStwLibraries.so.1.0 +++ /dev/null @@ -1 +0,0 @@ -libScStwLibraries.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwLibraries.so.1.0.0 b/release/debian/usr/local/lib/libScStwLibraries.so.1.0.0 deleted file mode 100755 index a04d0ce..0000000 Binary files a/release/debian/usr/local/lib/libScStwLibraries.so.1.0.0 and /dev/null differ diff --git a/release/debian/usr/local/lib/libScStwStyling.so b/release/debian/usr/local/lib/libScStwStyling.so deleted file mode 120000 index c42ad2d..0000000 --- a/release/debian/usr/local/lib/libScStwStyling.so +++ /dev/null @@ -1 +0,0 @@ -libScStwStyling.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwStyling.so.1 b/release/debian/usr/local/lib/libScStwStyling.so.1 deleted file mode 120000 index c42ad2d..0000000 --- a/release/debian/usr/local/lib/libScStwStyling.so.1 +++ /dev/null @@ -1 +0,0 @@ -libScStwStyling.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwStyling.so.1.0 b/release/debian/usr/local/lib/libScStwStyling.so.1.0 deleted file mode 120000 index c42ad2d..0000000 --- a/release/debian/usr/local/lib/libScStwStyling.so.1.0 +++ /dev/null @@ -1 +0,0 @@ -libScStwStyling.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwStyling.so.1.0.0 b/release/debian/usr/local/lib/libScStwStyling.so.1.0.0 deleted file mode 100755 index e9c474f..0000000 Binary files a/release/debian/usr/local/lib/libScStwStyling.so.1.0.0 and /dev/null differ diff --git a/release/libScStwSharedLibraries.deb b/release/libScStwSharedLibraries.deb deleted file mode 100644 index 1771d9b..0000000 Binary files a/release/libScStwSharedLibraries.deb and /dev/null differ diff --git a/release/libScStwSharedLibraries_1.0.0.deb b/release/libScStwSharedLibraries_1.0.0.deb deleted file mode 100644 index 2d36372..0000000 Binary files a/release/libScStwSharedLibraries_1.0.0.deb and /dev/null differ diff --git a/test b/test deleted file mode 100644 index 499f093..0000000 --- a/test +++ /dev/null @@ -1,3 +0,0 @@ -test for submodule -test2 -test3