/*! * * Copyright (c) 2019-2020 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 VAlert.cpp * \author (last) Peter Lucia * \date (last) 30-Nov-2020 * \author (original) Peter Lucia * \date (original) 30-Nov-2020 * */ #include "VAlert.h" // Project using namespace View; VAlert::VAlert(QObject *parent) : QObject(parent) { // incoming connect(&_GuiController, SIGNAL(didAlertRequest(GuiAlertRequestData)), this, SLOT(onActionReceive(GuiAlertRequestData))); // outgoing connect(this, SIGNAL(didAlertResponse(GuiAlertResponseData)), &_GuiController, SLOT(doAlertResponse(GuiAlertResponseData))); } /*! * \brief VAlert::doUserAlertRequest * Called when the user makes a request through an alert dialog * \param confirmed - (bool) true if user confirms, false if they cancel */ void VAlert::doAlertResponse(const bool &confirmed) { GuiAlertResponseData data; data.id = alertID(); data.confirmed = confirmed; emit didAlertResponse(data); } /*! * \brief VAlert::onActionReceive * Called when a new alert request to show has been received * \param request - (GuiAlertRequest) the alert data to be shown */ void VAlert::onActionReceive(const GuiAlertRequestData &request) { alertID(request.id); title(request.title); description(request.description); acknowledgeOnly(request.acknowledgeOnly); didRequestShowAlert(); }