From 8ffc77f537124c6fe0657eb4fb6dc55191a7dbb0 Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 27 Jan 2015 08:43:06 +0100 Subject: [PATCH] OP-1628 Fixed some review issues. Updated some text. --- .../plugins/setupwizard/pages/autoupdatepage.cpp | 8 ++++++-- ground/openpilotgcs/src/plugins/uploader/enums.h | 7 +++++-- .../src/plugins/uploader/rebootdialog.cpp | 4 ++-- .../src/plugins/uploader/uploadergadgetwidget.cpp | 15 +++++++++------ 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp index 077cce5bf..4b886f7ca 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp @@ -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("%1").arg(msg)); break; } diff --git a/ground/openpilotgcs/src/plugins/uploader/enums.h b/ground/openpilotgcs/src/plugins/uploader/enums.h index 9f2d68057..550d87474 100644 --- a/ground/openpilotgcs/src/plugins/uploader/enums.h +++ b/ground/openpilotgcs/src/plugins/uploader/enums.h @@ -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 diff --git a/ground/openpilotgcs/src/plugins/uploader/rebootdialog.cpp b/ground/openpilotgcs/src/plugins/uploader/rebootdialog.cpp index 0e1d74c39..b457ccddf 100644 --- a/ground/openpilotgcs/src/plugins/uploader/rebootdialog.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/rebootdialog.cpp @@ -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("Reboot failed!

Please perform a manual reboot by power cycling the board.
" + ui->label->setText(tr("Reboot failed!

Please perform a manual reboot by power cycling the board.
" "To power cycle the controller remove all batteries and the USB cable for at least 30 seconds.
" "After 30 seconds, plug in the board again and wait for it to connect, this can take a few seconds.
" - "Then press Ok.")); + "Then press Ok.

")); QDialog::exec(); } else { accept(); diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp index 0835824a4..e2bb83fe9 100644 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -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("%1").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("%1").arg(msg)); finishAutoUpdate(); break;