Index: sources/gui/qml/components/USBButton.qml =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/gui/qml/components/USBButton.qml (.../USBButton.qml) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/gui/qml/components/USBButton.qml (.../USBButton.qml) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,14 +1,15 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * 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 - * \date 2019/12/23 - * \author Behrouz NematiPour + * \author (last) Behrouz NematiPour + * \date (last) 28-Sep-2022 + * \author (original) Behrouz NematiPour + * \date (original) 23-Dec-2019 * */ @@ -20,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 }