Index: sources/gui/qml/pages/settings/SettingsDateTime.qml =================================================================== diff -u -r65558208e4968de9a5470ff5fda1ee2a9d00c793 -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) +++ sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2023 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 SettingsDateTimeSet.qml - * \author (last) Peter Lucia - * \date (last) 14-Mar-2021 - * \author (original) Peter Lucia - * \date (original) 14-Mar-2021 + * \file SettingsDateTime.qml + * \author (last) Behrouz NematiPour + * \date (last) 23-May-2021 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 * */ @@ -27,20 +27,23 @@ * \brief SettingsDateTimeSet is used to adjust the * date and time on the device */ -SettingsBase { id: _root +SettingsBase { id: _root + itemIndex : SettingsStack.SetDateTime - property int labelWidth : 275 + labelWidth : 275 + entryWidth : 100 + readonly property bool isValid : _year .textInput.acceptableInput && _month .textInput.acceptableInput && _day .textInput.acceptableInput && _hours .textInput.acceptableInput && _minutes.textInput.acceptableInput - confirmEnabled: isValid - + confirmEnabled : isValid + firstFocusInput : _hours notificationText: vDateTime.status - onConfirmClicked: { + onConfirmClicked: { vDateTime.doConfirm( _year .textInput.text , _month .textInput.text , @@ -72,99 +75,81 @@ font.pixelSize: Fonts.fontPixelTextRectExtra } - TextEntry { id: _hours - label.visible: false - width: Variables.textInputLineWidth - validator : IntValidator{ - bottom : 0 - top : 24 + TextEntry { id : _hours + nextInput : _minutes + label.visible : false + width : entryWidth + validator : IntValidator { + bottom : 0 + top : 23 } - onEnterPressed: { - if (textInput.acceptableInput) { - _minutes.textInput.forceActiveFocus() - } - } } - Text { id: _colon - text: qsTr(":") - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTextRectExtra + Text { id : _colon + text : qsTr(":") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra } - TextEntry { id: _minutes - label.visible: false - validator : IntValidator{ - bottom : 0 - top : 59 + TextEntry { id : _minutes + nextInput : _month + label.visible : false + width : entryWidth + validator : IntValidator { + bottom : 0 + top : 59 } - onEnterPressed: { - if (textInput.acceptableInput) { - _month.textInput.forceActiveFocus() - } - } } } Row { // date spacing: 5 - Text { id: _dateLabel - width: labelWidth - text: qsTr("Date (MM/DD/YYYY)") - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTextRectExtra + Text { id : _dateLabel + width : labelWidth + text : qsTr("Date (MM/DD/YYYY)") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra } - TextEntry { id: _month - label.visible: false - width: Variables.textInputLineWidth - validator : IntValidator{ - bottom : 1 - top : 12 + TextEntry { id : _month + nextInput : _day + label.visible : false + width : entryWidth + validator : IntValidator { + bottom : 1 + top : 12 } - onEnterPressed: { - if (textInput.acceptableInput) { - _day.textInput.forceActiveFocus() - } - } } - Text { id: _slashMonthDay - text: qsTr("/") - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTextRectExtra + Text { id : _slashMonthDay + text : qsTr("/") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra } - TextEntry { id: _day - label.visible: false - width: Variables.textInputLineWidth - validator : IntValidator{ - bottom : 1 - top : 31 + TextEntry { id : _day + nextInput : _year + label.visible : false + width : entryWidth + validator : IntValidator { + bottom : 1 + top : 31 } - onEnterPressed: { - if (textInput.acceptableInput) { - _year.textInput.forceActiveFocus() - } - } } - Text { id: _slashDayYear - text: qsTr("/") - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTextRectExtra + Text { id : _slashDayYear + text : qsTr("/") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra } - TextEntry { id: _year - label.visible: false - validator : IntValidator { - bottom : 1970 + TextEntry { id : _year + label.visible : false + width : entryWidth + validator : IntValidator { + bottom : 1970 + top : 2100 // seems date command is not accepting more than 2100 } - onEnterPressed: { - if (textInput.acceptableInput) { - _keyboard.setVisible(true) - } - } } } }