/*!
 *
 * 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 SettingsHome.qml
 * \author (last) Behrouz NematiPour
 * \date (last) 25-Aug-2020
 * \author (original) Behrouz NematiPour
 * \date (original) 21-Oct-2019
 *
 */

// Qt
import QtQuick 2.12

// Project
import Gui.Actions 0.1;

//  Qml imports
import "qrc:/globals"
import "qrc:/components"

/*!
 * \brief   SettingsHome is the screen
 * which is the default screen in the "Settings" stack
 */
ScreenItem { id: _root
    USBButton { id: _usbButton
        anchors {
            top         : parent.top
            right       : _exportButton.left
            topMargin   : (Variables.headerHeight - Variables.logoHeight) / 2
            rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2
        }
    }

    ExportButton { id: _exportButton
        width: 150
        height: 50
        anchors {
            top         : parent.top
            right       : _poweroffButton.left
            topMargin   : (Variables.headerHeight - Variables.logoHeight) / 2
            rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2
        }
    }

    TouchRect { id : _poweroffButton
        width: 150
        height: Variables.logoHeight
        animated: true
        anchors {
            top         : parent.top
            right       : parent.right
            topMargin   : (Variables.headerHeight - Variables.logoHeight) / 2
            rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2
        }
        text.text: qsTr("Shutdown")
        button.onPressed: {
            _GuiView.doActionTransmit(GuiActions.ID_PowerOff, GuiActions.NoData)
        }
    }

    TouchRect { id : _endTreatmentButton
        objectName: "_endTreatmentButton"
        width: 200
        height: Variables.logoHeight
        animated: true
        anchors {
            top         : parent.top
            right       : _usbButton.left
            topMargin   : (Variables.headerHeight - Variables.logoHeight) / 2
            rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2
        }
        text.text: qsTr("End Treatment")
        button.onPressed: {
            vTreatmentEnd.doEndTreatmentRequest();
        }
    }
}

/*
    TitleText { id: _titleText
        anchors.horizontalCenter: parent.horizontalCenter;
        anchors.top: parent.top
        anchors.topMargin: 150

        width: parent.width
        text: qsTr("Device Settings")

    }

    Diagnostics {
        id: _diagnostics
        onBackClicked: pop()
    }

    Column {
        anchors.centerIn: parent;

        // add each settings page here.
        SettingsItem { id: _item_diagnostics
            title   : qsTr("Diagnostics")
            onClicked: push(_diagnostics);
        }
    }
*/


