Index: sources/view/confirm/VConfirm.h =================================================================== diff -u -rb5afbc61af03dd2e84acf8439cb6be1f022a2921 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision b5afbc61af03dd2e84acf8439cb6be1f022a2921) +++ sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. + * Copyright (c) 2022-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file VConfirm.h * \author (last) Behrouz NematiPour - * \date (last) 22-Sep-2022 + * \date (last) 10-Oct-2022 * \author (original) Behrouz NematiPour - * \date (original) 22-Sep-2022 + * \date (original) 30-Sep-2022 * */ #pragma once @@ -21,6 +21,7 @@ #include "VAdjustmentResponseBase.h" #include "MDuetConfirmHDi.h" #include "MAdjustPowerOff.h" +#include "MSettings.h" namespace View { @@ -39,6 +40,18 @@ // // friends // friend class ::tst_views; + struct ConfirmData { + QString title = ""; + QString message = ""; + QString confirm = ""; + QString cancel = ""; + }; + + QMap _confirms; + + // ********** DYNAMIC PROPERTIES: The properties which need to be updated by each confirm message received. ********** // + READONLY( bool , needConfirm , false) + // disabled coco begin validated: // The property adjustment_Triggered has to be always true // and to always trigger the change event to work as a notifier for GUI @@ -56,16 +69,24 @@ PROPERTY(bool , isReject , 0) PROPERTY(bool , isAccept , 0) - TRIGGER (bool , visible , 0) - PROPERTY(QString , title ,"") - PROPERTY(QString , message ,"") - PROPERTY(QString , confirm ,tr("CONFIRM")) - PROPERTY(QString , cancel ,tr("CANCEL" )) + IDBASED (QString , title ,tr("Confirm" ), confirms, id) + IDBASED (QString , message ,tr("Are you sure?" ), confirms, id) + IDBASED (QString , confirm ,tr("CONFIRM" ), confirms, id) + IDBASED (QString , cancel ,tr("CANCEL" ), confirms, id) + + void setConfirmCommand (const DuetConfirmHDiData &vData); + void setConfirmId (const DuetConfirmHDiData &vData); + + void setPowerOffCommand (); + void setPowerOffId (); + + VIEW_DEC_CLASS (VConfirm ) VIEW_DEC_SLOT (DuetConfirmHDiData ) VIEW_DEC_SLOT (PowerOffData ) + VIEW_DEC_SLOT (SettingsData ) public slots: void doConfirm(bool vConfirm);