| 1 | // SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-only |
| 4 | |
| 5 | #include "bmhandler.h" |
| 6 | |
| 7 | #include <DSysInfo> |
| 8 | |
| 9 | const QString BMHandler::errorString(BMHandler::ErrorType et) |
| 10 | { |
| 11 | QString strErr; |
| 12 | |
| 13 | switch (et) { |
| 14 | case NoError: |
| 15 | strErr = ""; |
| 16 | break; |
| 17 | case USBFormatError: |
| 18 | if ((DTK_NAMESPACE::DCORE_NAMESPACE::DSysInfo::uosEditionType() == DTK_NAMESPACE::DCORE_NAMESPACE::DSysInfo::UosProfessional) || |
| 19 | (DTK_NAMESPACE::DCORE_NAMESPACE::DSysInfo::uosEditionType() == DTK_NAMESPACE::DCORE_NAMESPACE::DSysInfo::UosHome)) { |
| 20 | strErr = BMHandler::tr("Disk Format Error: Please reformat it or disable \"Auto scan USB storage devices\" in Security Center"); |
| 21 | } |
| 22 | else { |
| 23 | strErr = BMHandler::tr("Disk Format Error: Please reformat it"); |
| 24 | } |
| 25 | |
| 26 | break; |
| 27 | case USBSizeError: |
| 28 | strErr = BMHandler::tr("Insufficient disk Space: Ensure that the disk has enough free space"); |
| 29 | break; |
| 30 | case USBMountFailed: |
| 31 | strErr = BMHandler::tr("Disk Mount Error: Insert the disk again or reboot to retry"); |
| 32 | break; |
| 33 | case ExtractImgeFailed: |
| 34 | strErr = BMHandler::tr("Image Decompression Error: Verify md5 checksum of the image to ensure its integrity"); |
| 35 | break; |
| 36 | default: |
| 37 | strErr = BMHandler::tr("Internal Error"); |
| 38 | break; |
| 39 | } |
| 40 | |
| 41 | return strErr; |
| 42 | } |