1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-682 fixed two crashes on firmware uploader gadget.

crash 1 :  would happen when clicking Halt and then Boot as soon as the Boot button became enabled.
crash 2 : would happen when clicking Boot and then quickly pressing then Open button.
This commit is contained in:
filnet 2013-01-24 03:53:24 +01:00
parent 1a303aa85f
commit 813aaf5d85
2 changed files with 10 additions and 4 deletions

View File

@ -144,6 +144,8 @@ void deviceWidget::populate()
void deviceWidget::freeze()
{
myDevice->description->setEnabled(false);
myDevice->pbLoad->setEnabled(false);
myDevice->youdont->setEnabled(false);
myDevice->updateButton->setEnabled(false);
myDevice->retrieveButton->setEnabled(false);
}

View File

@ -398,7 +398,7 @@ void UploaderGadgetWidget::systemReset()
delete dfu;
dfu = NULL;
}
m_config->textBrowser->clear();
clearLog();
log("Board Reset initiated.");
goToBootloader();
}
@ -470,8 +470,10 @@ void UploaderGadgetWidget::commonSystemBoot(bool safeboot)
// Freeze the tabs, they are not useful anymore and their buttons
// will cause segfaults or weird stuff if we use them.
for (int i=0; i< m_config->systemElements->count(); i++) {
deviceWidget *qw = (deviceWidget*)m_config->systemElements->widget(i);
qw->freeze();
deviceWidget *qw = dynamic_cast<deviceWidget*>(m_config->systemElements->widget(i));
if (qw) {
qw->freeze();
}
}
}
currentStep = IAP_STATE_READY;
@ -479,6 +481,7 @@ void UploaderGadgetWidget::commonSystemBoot(bool safeboot)
delete dfu; // Frees up the USB/Serial port too
dfu = NULL;
}
bool UploaderGadgetWidget::autoUpdateCapable()
{
return QDir(":/build").exists();
@ -766,9 +769,9 @@ void UploaderGadgetWidget::uploadEnded(bool succeed)
*/
void UploaderGadgetWidget::log(QString str)
{
qDebug() << str;
m_config->textBrowser->append(str);
m_config->textBrowser->repaint();
}
void UploaderGadgetWidget::clearLog()
@ -815,6 +818,7 @@ void UploaderGadgetWidget::error(QString errorString, int errorNumber)
msgBox.exec();
m_config->boardStatus->setText(errorString);
}
/**
Shows a message box with an information string.