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

OP-1628 Fixed some review issues. Updated some text.

This commit is contained in:
m_thread 2015-01-27 08:43:06 +01:00
parent 205a2d7b7a
commit 8ffc77f537
4 changed files with 22 additions and 12 deletions

View File

@ -86,7 +86,10 @@ void AutoUpdatePage::updateStatus(uploader::ProgressStep status, QVariant value)
ui->statusLabel->setText(tr("Uploading description."));
break;
case uploader::BOOTING:
ui->statusLabel->setText(tr("Booting the board%1. Please wait").arg(value.toString()));
ui->statusLabel->setText(tr("Booting the board. Please wait"));
break;
case uploader::BOOTING_AND_ERASING:
ui->statusLabel->setText(tr("Booting and erasing the board. Please wait"));
break;
case uploader::SUCCESS:
m_isUpdating = false;
@ -98,8 +101,9 @@ void AutoUpdatePage::updateStatus(uploader::ProgressStep status, QVariant value)
enableButtons(true);
QString msg = value.toString();
if (msg.isEmpty()) {
msg = tr("Something went wrong, you will have to manually upgrade the board using the uploader plugin.");
msg = tr("Something went wrong.");
}
msg += tr(" You will have to manually upgrade the board using the uploader plugin.");
ui->statusLabel->setText(QString("<font color='red'>%1</font>").arg(msg));
break;
}

View File

@ -28,7 +28,10 @@
#define ENUMS_H
namespace uploader {
typedef enum { IAP_STATE_READY, IAP_STATE_STEP_1, IAP_STATE_STEP_2, IAP_STEP_RESET, IAP_STATE_BOOTLOADER } IAPStep;
typedef enum { WAITING_DISCONNECT, WAITING_CONNECT, JUMP_TO_BL, LOADING_FW, UPLOADING_FW, UPLOADING_DESC, BOOTING, SUCCESS, FAILURE } ProgressStep;
typedef enum { IAP_STATE_READY, IAP_STATE_STEP_1, IAP_STATE_STEP_2,
IAP_STEP_RESET, IAP_STATE_BOOTLOADER } IAPStep;
typedef enum { WAITING_DISCONNECT, WAITING_CONNECT, JUMP_TO_BL, LOADING_FW,
UPLOADING_FW, UPLOADING_DESC, BOOTING, BOOTING_AND_ERASING,
SUCCESS, FAILURE } ProgressStep;
}
#endif // ENUMS_H

View File

@ -66,10 +66,10 @@ void RebootDialog::progressUpdate(uploader::ProgressStep progress, QVariant mess
if (progress == uploader::FAILURE) {
ui->rebootProgressBar->setVisible(false);
ui->okButton->setVisible(true);
ui->label->setText(tr("<font color='red'>Reboot failed!</font><p> Please perform a manual reboot by power cycling the board.<br>"
ui->label->setText(tr("<font color='red'>Reboot failed!</font><p>Please perform a manual reboot by power cycling the board.<br>"
"To power cycle the controller remove all batteries and the USB cable for at least 30 seconds.<br>"
"After 30 seconds, plug in the board again and wait for it to connect, this can take a few seconds.<br>"
"Then press Ok."));
"Then press Ok.</p>"));
QDialog::exec();
} else {
accept();

View File

@ -807,7 +807,7 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
// Wait for board to connect to GCS again after boot and erase
// For older board like CC3D this can take some time
if (!telemetryManager->isConnected()) {
progressUpdate(BOOTING, erase ? tr(" and erasing settings") : QVariant());
progressUpdate(erase ? BOOTING_AND_ERASING : BOOTING, QVariant());
ResultEventLoop eventLoop;
connect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
@ -1068,21 +1068,24 @@ void UploaderGadgetWidget::autoUpdateStatus(uploader::ProgressStep status, QVari
m_config->autoUpdateLabel->setText(tr("Uploading description of the new firmware to the board."));
break;
case uploader::BOOTING:
m_config->autoUpdateLabel->setText(tr("Rebooting the board%1. Please wait.").arg(value.toString()));
m_config->autoUpdateLabel->setText(tr("Rebooting the board. Please wait."));
break;
case uploader::BOOTING_AND_ERASING:
m_config->autoUpdateLabel->setText(tr("Rebooting and erasing the board. Please wait."));
break;
case uploader::SUCCESS:
m_config->autoUpdateProgressBar->setValue(m_config->autoUpdateProgressBar->maximum());
msg = tr("Board was updated successfully.");
msg += " " + tr("Press OK to finish.");
msg = tr("Board was updated successfully. Press OK to finish.");
m_config->autoUpdateLabel->setText(QString("<font color='green'>%1</font>").arg(msg));
finishAutoUpdate();
break;
case uploader::FAILURE:
msg = value.toString();
if (msg.isEmpty()) {
msg = tr("Something went wrong, you will have to manually upgrade the board.");
msg = tr("Something went wrong.");
}
msg += " " + tr("Press OK to finish, you will have to manually upgrade the board.");
msg += tr(" Press OK to finish, you will have to manually upgrade the board.");
m_config->autoUpdateLabel->setText(QString("<font color='red'>%1</font>").arg(msg));
finishAutoUpdate();
break;