Index: sources/gui/guicontroller.h =================================================================== diff -u -r9a3ee027dbc33f39ee7df2a9dc5a7897c6b1854d -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc --- sources/gui/guicontroller.h (.../guicontroller.h) (revision 9a3ee027dbc33f39ee7df2a9dc5a7897c6b1854d) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. * \copyright \n * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n * IN PART OR IN WHOLE, \n @@ -18,7 +18,7 @@ // Project #include "main.h" -#include "guiactions.h" +#include "guiglobals.h" // define #define _GuiController GuiController::I() @@ -30,27 +30,52 @@ { Q_OBJECT -SINGLETON_DECL(GuiController) -public: - void init(); + QThread *_thread = nullptr; + bool _init = false; +// singleton +SINGLETON(GuiController) + +public slots: + bool init(); + bool init(QThread &vThread); + +private slots: + void quit(); + private: - void connection(); + void initConnections(); + void initThread(QThread &vThread); + void quitThread(); + + bool handleTransmit(GuiActionType vAction, const QVariantList &vData); + public slots: - void doActionRequest (GuiActionType vAction); // UI => HD/DG - void doActionPerform (GuiActionType vAction, GuiActionInfo vInfo); // UI => HD/DG + void doActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG + void doUSBDriveUmount(); // UI => OS + void doExportLog (); // UI => OS + + private slots: // Should be private for thread safety and is connected internally. - void onActionConfirm (GuiActionType vAction, GuiActionInfo vInfo); // UI <= HD/DG - void onActionCommand (GuiActionType vAction); // UI <= HD/DG + void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG + void onUSBDriveMount (); // OS => UI + void onUSBDriveRemove(); // OS => UI + + void onExport (); // OS => UI + signals: - void didActionRequest(GuiActionType vAction ); // UI => HD/DG - void didActionConfirm(GuiActionType vAction, GuiActionInfo vInfo); // UI <= HD/DG + void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG + void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG - void didActionCommand(GuiActionType vAction ); // UI <= HD/DG - void didActionPerform(GuiActionType vAction, GuiActionInfo vInfo); // UI => HD/DG + void didUSBDriveMount (); + void didUSBDriveUmount(); + void didUSBDriveRemove(); + + void didExportLog(); + void didExport (); }; }