Index: sources/gui/qml/components/USBButton.qml =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/gui/qml/components/USBButton.qml (.../USBButton.qml) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/gui/qml/components/USBButton.qml (.../USBButton.qml) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2019-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 USBButton.qml - * \author (last) Behrouz NematiPour - * \date (last) 08-Jan-2020 - * \author (original) Behrouz NematiPour - * \date (original) 23-Dec-2019 + * \file USBButton.qml + * \author (last) Behrouz NematiPour + * \date (last) 28-Sep-2022 + * \author (original) Behrouz NematiPour + * \date (original) 23-Dec-2019 * */ @@ -21,33 +21,23 @@ import "qrc:/components" TouchRect { id : _root + + property bool disabled : false + width: 50 height: width x: width - 10 - animated: true - loops: Animation.Infinite - duration: 1000 // 1 sec - - text.text: qsTr("USB") + Image { id: _image + width : Variables.iconsDiameter + height : Variables.iconsDiameter + anchors.centerIn: parent + source : disabled ? "qrc:/images/iEjectDisabled" + : "qrc:/images/iEjectEnabled" + } text.font.pixelSize: Fonts.fontPixelButton * 0.75 - button.onPressed: { + onPressed : { _GuiView.doUSBDriveUmount() - animate(true) } - Connections { target: _GuiView - onDidUSBDriveRemove: { - _root.animate(false) - _root.disabled = true - } - onDidUSBDriveMount: { - _root.disabled = false - } - onDidExportLog: { - _root.disabled = true - } - onDidExport: { - _root.disabled = false - } - } + fading: ! _GuiView.usbIsReady && ! _GuiView.usbIsRemoved }