569 self.infoLabel.setText(self.tr("Flash Instructions:")) |
569 self.infoLabel.setText(self.tr("Flash Instructions:")) |
570 |
570 |
571 htmlText = self.tr( |
571 htmlText = self.tr( |
572 "<h4>Flash method 'manual' selected.</h4>" |
572 "<h4>Flash method 'manual' selected.</h4>" |
573 "<p>Follow the instructions below to flash a device by entering" |
573 "<p>Follow the instructions below to flash a device by entering" |
574 "the data manually.</p><ol>" |
574 " the data manually.</p><ol>" |
575 "<li>Change the device to 'bootloader' mode.</li>" |
575 "<li>Change the device to 'bootloader' mode.</li>" |
576 "<li>Wait until the device has entered 'bootloader' mode.</li>" |
576 "<li>Wait until the device has entered 'bootloader' mode.</li>" |
577 "<li>Ensure the boot volume is available (this may require" |
577 "<li>Ensure the boot volume is available (this may require" |
578 " mounting it) and select its path.</li>" |
578 " mounting it) and select its path.</li>" |
579 "<li>Select the firmware file to be flashed and click the" |
579 "<li>Select the firmware file to be flashed and click the" |
644 firmwareType = SupportedUF2Boards[boardType]["firmware"] |
644 firmwareType = SupportedUF2Boards[boardType]["firmware"] |
645 self.infoLabel.setText( |
645 self.infoLabel.setText( |
646 self.tr("Flashing {0}").format(firmwareType)) |
646 self.tr("Flashing {0}").format(firmwareType)) |
647 self.infoEdit.setHtml(self.tr( |
647 self.infoEdit.setHtml(self.tr( |
648 "<p>Flashing the {0} firmware to the device. Please wait" |
648 "<p>Flashing the {0} firmware to the device. Please wait" |
649 " until the device resets automatically</p>." |
649 " until the device resets automatically.</p>" |
650 ).format(firmwareType)) |
650 ).format(firmwareType)) |
651 QCoreApplication.processEvents(QEventLoop.ExcludeUserInputEvents) |
651 QCoreApplication.processEvents(QEventLoop.ExcludeUserInputEvents) |
652 shutil.copy2(firmwarePath, volumePath) |
652 shutil.copy2(firmwarePath, volumePath) |
653 QThread.sleep(1) |
653 QThread.sleep(1) |
654 self.on_refreshButton_clicked() |
654 self.on_refreshButton_clicked() |