Index: sources/main.h =================================================================== diff -u -rec7f919fdb70ff29a8de627937e4ad7008e59c1c -ra04fd119778f0483cba5139a11e3c6bad7f2324a --- sources/main.h (.../main.h) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) +++ sources/main.h (.../main.h) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) @@ -138,6 +138,10 @@ } \ } //--------------------------------------------------------------------------------// +#define PROPERTY_POST_CONNECTION( vCLASS, vVARIABLE ) \ + connect(this, &vCLASS::vVARIABLE##Changed \ + , &vCLASS::vVARIABLE##_post ); + #define PROPERTY_BASE(vTYPE , vVARIABLE , vDEFVALUE, vSIGNAL) \ /*! \brief Qt Property declaration \details The Qt Property definition by Q_PROPERTY documentation. @@ -156,6 +160,8 @@ */\ void vVARIABLE##vSIGNAL( const vTYPE & v##vVARIABLE ); \ private: \ + void vVARIABLE##_post ( const vTYPE & v##vVARIABLE ); \ + private: \ vTYPE _##vVARIABLE = vDEFVALUE; \ bool _##vVARIABLE##Changed = false; \ protected: \ @@ -259,7 +265,46 @@ emit vVARIABLE##Notified( _##vVARIABLE ); \ } //--------------------------------------------------------------------------------// +#define SETTINGS_BASE( vVARIABLE , vCATEGORY , vGROUP , vKEY) \ + private: \ + /*! \brief Settings identifier + \details identifies the settings by the given information + \param vCategory - The category of the setting which includes on-level folder and the file name (without .conf extension) + \param vGroup - The group setting key/value belongs to + \param vKey - The key of the setting + */\ + bool is##vVARIABLE(const QString &vCategory , \ + const QString &vGroup , \ + const QString &vKey ) { \ + return vCategory == vVARIABLE##Category() && \ + vGroup == vVARIABLE##Group () && \ + vKey == vVARIABLE##Key (); \ + } \ + /*! \brief Settings property category getter + \details returns the category of the setting + */\ + QString vVARIABLE##Category() { \ + return vCATEGORY; \ + } \ + /*! \brief Settings property group getter + \details returns the group of the setting + */\ + QString vVARIABLE##Group() { \ + return vGROUP; \ + } \ + /*! \brief Settings property key getter + \details returns the key of the setting + */\ + QString vVARIABLE##Key() { \ + return vKEY; \ + } //--------------------------------------------------------------------------------// +#define SETTINGS( vTYPE , vVARIABLE , vDEFVALUE , vCATEGORY , vGROUP , vKEY) \ + PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Changed ) \ + PROPERTY_SLOT( vTYPE , vVARIABLE ) \ + SETTINGS_BASE( vVARIABLE , vCATEGORY , vGROUP , vKEY) +//--------------------------------------------------------------------------------// +//--------------------------------------------------------------------------------// #define ACTION_VIEW_CONNECTION(vTYPE) \ connect(&_GuiController, SIGNAL(didActionReceive(const vTYPE &)), \ this, SLOT( onActionReceive(const vTYPE &)));