1
0
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:
zedamota 2011-04-29 21:50:58 +01:00
parent 6172e45c0d
commit 42c2b7193a
2 changed files with 14 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;