diff --git a/src/core/serverMasterController/controllers/command-controller.h b/src/core/serverMasterController/controllers/command-controller.h index f3ae2ef48..3574e202b 100644 --- a/src/core/serverMasterController/controllers/command-controller.h +++ b/src/core/serverMasterController/controllers/command-controller.h @@ -1,33 +1,33 @@ #ifndef COMMANDCONTROLLER_H #define COMMANDCONTROLLER_H #include #include -#include "../cm-lib_global.h" -#include "../framework/command.h" +#include +#include namespace cm { namespace controllers { class CMLIBSHARED_EXPORT CommandController : public QObject { Q_OBJECT Q_PROPERTY(QQmlListProperty ui_createClientViewContextCommands READ ui_createClientViewContextCommands CONSTANT) public: explicit CommandController(QObject* _parent = nullptr); ~CommandController(); QQmlListProperty ui_createClientViewContextCommands(); public slots: void onCreateClientSaveExecuted(); private: class Implementation; QScopedPointer implementation; }; }} #endif diff --git a/src/core/serverMasterController/controllers/master-controller.cpp b/src/core/serverMasterController/controllers/master-controller.cpp index 6a16eb903..e977a777b 100644 --- a/src/core/serverMasterController/controllers/master-controller.cpp +++ b/src/core/serverMasterController/controllers/master-controller.cpp @@ -1,40 +1,47 @@ #include "master-controller.h" namespace cm { namespace controllers { class MasterController::Implementation { public: Implementation(MasterController* _masterController) : masterController(_masterController) { + commandController = new CommandController(masterController); navigationController = new NavigationController(masterController); } MasterController* masterController{nullptr}; + CommandController* commandController{nullptr}; NavigationController* navigationController{nullptr}; QString welcomeMessage = "This is MasterController to Major Tom"; }; MasterController::MasterController(QObject* parent) : QObject(parent) { implementation.reset(new Implementation(this)); } MasterController::~MasterController() { } +CommandController* MasterController::commandController() +{ + return implementation->commandController; +} + NavigationController* MasterController::navigationController() { return implementation->navigationController; } const QString& MasterController::welcomeMessage() const { return implementation->welcomeMessage; } }} diff --git a/src/core/serverMasterController/controllers/master-controller.h b/src/core/serverMasterController/controllers/master-controller.h index 6ae8b0fc6..fa6221692 100644 --- a/src/core/serverMasterController/controllers/master-controller.h +++ b/src/core/serverMasterController/controllers/master-controller.h @@ -1,35 +1,38 @@ #ifndef MASTERCONTROLLER_H #define MASTERCONTROLLER_H #include #include #include -#include "cm-lib_global.h" -#include "navigation-controller.h" +#include +#include +#include namespace cm { namespace controllers { class CMLIBSHARED_EXPORT MasterController : public QObject { Q_OBJECT Q_PROPERTY( QString ui_welcomeMessage READ welcomeMessage CONSTANT ) Q_PROPERTY( cm::controllers::NavigationController* ui_navigationController READ navigationController CONSTANT ) + Q_PROPERTY( cm::controllers::CommandController* ui_commandController READ commandController CONSTANT ) public: explicit MasterController(QObject* parent = nullptr); ~MasterController(); + CommandController* commandController(); NavigationController* navigationController(); const QString& welcomeMessage() const; private: class Implementation; QScopedPointer implementation; }; }} #endif diff --git a/src/core/serverMasterController/controllers/navigation-controller.h b/src/core/serverMasterController/controllers/navigation-controller.h index 8af546022..441e6d9b5 100644 --- a/src/core/serverMasterController/controllers/navigation-controller.h +++ b/src/core/serverMasterController/controllers/navigation-controller.h @@ -1,29 +1,30 @@ #ifndef NAVIGATIONCONTROLLER_H #define NAVIGATIONCONTROLLER_H #include -#include "cm-lib_global.h" -#include "../models/client.h" +#include +#include namespace cm { - namespace controllers { - - class CMLIBSHARED_EXPORT NavigationController : public QObject - { - Q_OBJECT - public: - explicit NavigationController(QObject* parent = nullptr) : QObject(parent){} - - signals: - void goCreateClientView(); - void goDashboardView(); - void goEditClientView(cm::models::Client* client); - void goFindClientView(); - void goManagePupilsView(); - void goManageGroupsView(); - }; - } +namespace controllers { + +class CMLIBSHARED_EXPORT NavigationController : public QObject +{ + Q_OBJECT + +public: + explicit NavigationController(QObject* parent = nullptr) : QObject(parent){} + +signals: + void goCreateClientView(); + void goDashboardView(); + void goEditClientView(cm::models::Client* client); + void goFindClientView(); + +}; + +} } #endif diff --git a/src/core/serverMasterController/framework/command.h b/src/core/serverMasterController/framework/command.h index 94b8a7963..fd031901c 100644 --- a/src/core/serverMasterController/framework/command.h +++ b/src/core/serverMasterController/framework/command.h @@ -1,44 +1,44 @@ #ifndef COMMAND_H #define COMMAND_H #include #include #include #include -#include "../cm-lib_global.h" +#include namespace cm { namespace framework { class CMLIBSHARED_EXPORT Command : public QObject { Q_OBJECT Q_PROPERTY( QString ui_iconCharacter READ iconCharacter CONSTANT ) Q_PROPERTY( QString ui_description READ description CONSTANT ) Q_PROPERTY( bool ui_canExecute READ canExecute NOTIFY canExecuteChanged ) public: explicit Command(QObject* parent = nullptr, const QString& iconCharacter = "", const QString& description = "", std::function canExecute = [](){ return true; }); ~Command(); const QString& iconCharacter() const; const QString& description() const; bool canExecute() const; signals: void canExecuteChanged(); void executed(); private: class Implementation; QScopedPointer implementation; }; }} #endif diff --git a/src/core/serverMasterController/models/client.h b/src/core/serverMasterController/models/client.h index d9fa4cd57..cccaa6f4c 100644 --- a/src/core/serverMasterController/models/client.h +++ b/src/core/serverMasterController/models/client.h @@ -1,21 +1,19 @@ #ifndef CLIENT_H #define CLIENT_H -#include "../controllers/cm-lib_global.h" +#include "cm-lib_global.h" namespace cm { namespace models { class CMLIBSHARED_EXPORT Client { public: Client(); }; } } #endif - -