mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Should fix the impossibility to choose a non existing file to download FW to.
This commit is contained in:
parent
6172e45c0d
commit
42c2b7193a
@ -233,7 +233,7 @@ void deviceWidget::downloadFirmware()
|
||||
}
|
||||
|
||||
myDevice->retrieveButton->setEnabled(false);
|
||||
filename = setOpenFileName();
|
||||
filename = setSaveFileName();
|
||||
|
||||
if (filename.isEmpty()) {
|
||||
status("Empty filename", STATUSICON_FAIL);
|
||||
@ -315,3 +315,15 @@ QString deviceWidget::setOpenFileName()
|
||||
options);
|
||||
return fileName;
|
||||
}
|
||||
QString deviceWidget::setSaveFileName()
|
||||
{
|
||||
QFileDialog::Options options;
|
||||
QString selectedFilter;
|
||||
QString fileName = QFileDialog::getSaveFileName(this,
|
||||
tr("Select firmware file"),
|
||||
"",
|
||||
tr("Firmware Files (*.bin)"),
|
||||
&selectedFilter,
|
||||
options);
|
||||
return fileName;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
void freeze();
|
||||
typedef enum { STATUSICON_OK, STATUSICON_RUNNING, STATUSICON_FAIL, STATUSICON_INFO} StatusIcon;
|
||||
QString setOpenFileName();
|
||||
|
||||
QString setSaveFileName();
|
||||
private:
|
||||
Ui_deviceWidget *myDevice;
|
||||
int deviceID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user