Don't show the update firmware button until the firmware is downloaded

if the firmware is not downloaded when the user presses the update button the application would show an error and the user would need to replug the m1k.
This change is preventing this to happen

Signed-off-by: Claudiu Pop <Claudiu.Pop@analog.com>
This commit is contained in:
Claudiu Pop committed 2018-02-06 12:22:09 +02:00
1 parent e53e408a81
commit 59f7df9176
3 files changed
+7 -1

No files matched your search

+1
View File
@@ -167,6 +167,7 @@ void SessionItem::handleDownloadedFirmware()
{
FileIO f;
f.writeRawByFilename(getTmpPathForFirmware() + "/firmware.bin", m_firmware_fd->downloadedData());
emit firmwareDownloaded();
disconnect(m_firmware_fd, SIGNAL(downloaded()), this, SLOT(handleDownloadedFirmware()));
}
+1
View File
@@ -63,6 +63,7 @@ signals:
void finished(unsigned status);
void attached(smu::Device* device);
void detached(smu::Device* device);
void firmwareDownloaded();
protected slots:
void onFinished();
+5 -1
View File
@@ -11,6 +11,7 @@ ColumnLayout {
property bool updateNeeded: false
property bool justUpdated: false
property bool firmwareDownloaded: false
function addProgModeDeviceToList()
{
devicesModel.insert(devicesModel.count,
@@ -348,6 +349,9 @@ ColumnLayout {
onDevicesChanged: {
deviceManagerListFill();
}
onFirmwareDownloaded:{
firmwareDownloaded = true;
}
}
}
Rectangle {
@@ -360,7 +364,7 @@ ColumnLayout {
width: 145
radius: 4
color: 'grey'
visible: updateNeeded === true
visible: updateNeeded === true && firmwareDownloaded === true
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter