[librvth] rvth_error.c: Mark RVT-H error strings for Qt localization.

[locale] Update for these changes.

[qrvthtool] Update for localized RVT-H error strings:

- WorkerObject: Don't include the error code in the message when
  emitting finished().

- QRvtHWindow: Handle RVT-H error codes better:
  - If -ECANCELED is returned, show the message as-is, since the operation
    was cancelled.
  - If it's an RVT-H error, use QCoreApplication::translate() with the
    "RvtH|Error" context and rvth_error(err) string.
  - If it's a POSIX error, use rvth_error() anyway for now.

FIXME: Need to properly translate POSIX errors.
This commit is contained in:
David Korth 2025-05-30 18:35:04 -04:00
parent 3a0c7f6632
commit 8d34c3e3dd
7 changed files with 747 additions and 105 deletions

View File

@ -597,6 +597,11 @@ d3f4ul7 15 n0n3, wh1ch r3741n5 7h3 0r161n4l k3y.</translation>
<source>ERROR undeleting Bank %1: %2</source>
<translation>3rr0r und3l371n6 b4nk %1: %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/windows/QRvtHToolWindow.cpp" line="1568"/>
<source>%1: %2</source>
<translation></translation>
</message>
</context>
<context>
<name>QTreeViewOpt</name>
@ -655,6 +660,144 @@ d3f4ul7 15 n0n3, wh1ch r3741n5 7h3 0r161n4l k3y.</translation>
<translation>105</translation>
</message>
</context>
<context>
<name>RvtH|Error</name>
<message>
<location filename="../src/librvth/rvth_error.c" line="35"/>
<source>Success</source>
<translation>5ucc355</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="37"/>
<source>Unrecognized file format</source>
<translation>unr3c06n1z3d f1l3 f0rm47</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="39"/>
<source>Bank table magic is incorrect</source>
<translation>b4nk 74bl3 m461c 15 1nc0rr3c7</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="41"/>
<source>No banks found</source>
<translation>n0 b4nk5 f0und</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="43"/>
<source>Bank status is unknown</source>
<translation>b4nk 5747u5 15 unkn0wn</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="45"/>
<source>Bank is empty</source>
<translation>b4nk 15 3mp7y</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="47"/>
<source>Bank is second bank of a dual-layer image</source>
<translation>b4nk 15 53c0nd b4nk 0f 4 du4l-l4y3r 1m463</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="49"/>
<source>Operation can only be performed on a device, not an image file</source>
<translation>0p3r4710n c4n 0nly b3 p3rf0rm3d 0n 4 d3v1c3, n07 4n 1m463 f1l3</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="51"/>
<source>Bank is deleted</source>
<translation>b4nk 15 d3l373d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="53"/>
<source>Bank is not deleted</source>
<translation>b4nk 15 n07 d3l373d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="55"/>
<source>RVT-H object is not an HDD image</source>
<translation>rv7-h 0bj3c7 15 n07 4n hdd 1m463</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="57"/>
<source>Wii game partition not found</source>
<translation>w11 64m3 p4r71710n n07 f0und</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="59"/>
<source>RVT-H bank count field is invalid</source>
<translation>rv7-h b4nk c0un7 f13ld 15 1nv4l1d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="61"/>
<source>Operation cannot be performed on devices or HDD images</source>
<translation>0p3r4710n c4nn07 b3 p3rf0rm3d 0n d3v1c35 0r hdd 1m4635</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="63"/>
<source>Source image does not fit in an RVT-H bank</source>
<translation>50urc3 1m463 d035 n07 f17 1n 4n rv7-h b4nk</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="65"/>
<source>Destination bank is not empty or deleted</source>
<translation>d3571n4710n b4nk 15 n07 3mp7y 0r d3l373d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="67"/>
<source>Wii-specific operation was requested on a non-Wii image</source>
<translation>w11-5p3c1f1c 0p3r4710n w45 r3qu3573d 0n 4 n0n-w11 1m463</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="69"/>
<source>Image is unencrypted</source>
<translation>1m463 15 un3ncryp73d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="71"/>
<source>Image is encrypted</source>
<translation>1m463 15 3ncryp73d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="73"/>
<source>Wii partition table is corrupted</source>
<translation>w11 p4r71710n 74bl3 15 c0rrup73d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="75"/>
<source>At least one Wii partition header is corrupted</source>
<translation>47 l3457 0n3 w11 p4r71710n h34d3r 15 c0rrup73d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="77"/>
<source>Certificate has an unknown issuer</source>
<translation>c3r71f1c473 h45 4n unkn0wn 155u3r</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="82"/>
<source>Extended Bank Table: Cannot use Bank 1 for a Dual-Layer image.</source>
<translation>3x73nd3d b4nk 74bl3: c4nn07 u53 b4nk 1 f0r 4 du4l-l4y3r 1m463.</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="84"/>
<source>Cannot use the last bank for a Dual-Layer image</source>
<translation>c4nn07 u53 7h3 l457 b4nk f0r 4 du4l-l4y3r 1m463</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="86"/>
<source>The second bank for the Dual-Layer image is not empty or deleted</source>
<translation>7h3 53c0nd b4nk f0r 7h3 du4l-l4y3r 1m463 15 n07 3mp7y 0r d3l373d</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="88"/>
<source>The two banks are not contiguous</source>
<translation>7h3 7w0 b4nk5 4r3 n07 c0n716u0u5</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="93"/>
<source>NDEV headers for GCN are currently not supported.</source>
<translation>nd3v h34d3r5 f0r 6cn 4r3 curr3n7ly n07 5upp0r73d.</translation>
</message>
</context>
<context>
<name>SelectDeviceDialog</name>
<message>
@ -701,15 +844,15 @@ d3f4ul7 15 n0n3, wh1ch r3741n5 7h3 0r161n4l k3y.</translation>
<context>
<name>TranslationManager</name>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="173"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="184"/>
<source>David Korth</source>
<comment>ts-author</comment>
<extracomment>Translation file author. Put your name here.</extracomment>
<translation></translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="176"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="223"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="187"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="233"/>
<source>Default</source>
<comment>ts-language</comment>
<extracomment>Language this translation provides, e.g. &quot;English (US)&quot;.</extracomment>
@ -717,8 +860,8 @@ d3f4ul7 15 n0n3, wh1ch r3741n5 7h3 0r161n4l k3y.</translation>
<translation>1337 5p34k</translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="179"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="216"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="190"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="226"/>
<source>C</source>
<comment>ts-locale</comment>
<extracomment>Locale name, e.g. &quot;en_US&quot;.</extracomment>
@ -749,25 +892,25 @@ d3f4ul7 15 n0n3, wh1ch r3741n5 7h3 0r161n4l k3y.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="277"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="329"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="332"/>
<source>%1() ERROR: rvth object is not set.</source>
<translation>%1() 3rr0r: rv7h 0bj3c7 15 n07 537.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="281"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="333"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="336"/>
<source>%1() ERROR: Bank number is not set.</source>
<translation>%1() 3rr0r: b4nk numb3r 15 n07 537.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="283"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="335"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="338"/>
<source>%1() ERROR: Bank number %2 is out of range.</source>
<translation>%1() 3rr0r: b4nk numb3r %2 15 0u7 0f r4n63.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="288"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="340"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="343"/>
<source>%1() ERROR: gcmFilename is not set.</source>
<translation>%1() 3rr0r: 6cmf1l3n4m3 15 n07 537.</translation>
</message>
@ -778,18 +921,28 @@ d3f4ul7 15 n0n3, wh1ch r3741n5 7h3 0r161n4l k3y.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="309"/>
<source>ERROR extracting Bank %1 into %2: %3</source>
<translation>3rr0r 3x7r4c71n6 b4nk %1 1n70 %2: %3</translation>
<source>Extraction operation cancelled.</source>
<translation>3x7r4c710n 0p3r4710n c4nc3ll3d.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="357"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="312"/>
<source>ERROR extracting Bank %1 into %2</source>
<translation>3rr0r 3x7r4c71n6 b4nk %1 1n70 %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="364"/>
<source>Import operation cancelled.</source>
<translation>1mp0r7 0p3r4710n c4nc3ll3d.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="367"/>
<source>ERROR importing %1 into Bank %2</source>
<translation>3rr0r 1mp0r71n6 %1 1n70 b4nk %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="360"/>
<source>%1 imported into Bank %2 successfully.</source>
<translation>%1 1mp0r73d 1n70 b4nk %2 5ucc355fully.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="361"/>
<source>ERROR importing %1 into Bank %2: %3</source>
<translation>3rr0r 1mp0r71n6 %1 1n70 b4nk %2: %3</translation>
</message>
</context>
</TS>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE" sourcelanguage="en">
<TS version="2.1" language="de_DE" sourcelanguage="en_US">
<context>
<name>AboutDialog</name>
<message>
@ -597,6 +597,11 @@ Standard ist keine, der den Originalschlüssel beibehält.</translation>
<source>ERROR undeleting Bank %1: %2</source>
<translation>FEHLER wiederherstellen-Bank %1: %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/windows/QRvtHToolWindow.cpp" line="1568"/>
<source>%1: %2</source>
<translation>%1: %2</translation>
</message>
</context>
<context>
<name>QTreeViewOpt</name>
@ -655,6 +660,144 @@ Standard ist keine, der den Originalschlüssel beibehält.</translation>
<translation>IOS</translation>
</message>
</context>
<context>
<name>RvtH|Error</name>
<message>
<location filename="../src/librvth/rvth_error.c" line="35"/>
<source>Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="37"/>
<source>Unrecognized file format</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="39"/>
<source>Bank table magic is incorrect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="41"/>
<source>No banks found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="43"/>
<source>Bank status is unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="45"/>
<source>Bank is empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="47"/>
<source>Bank is second bank of a dual-layer image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="49"/>
<source>Operation can only be performed on a device, not an image file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="51"/>
<source>Bank is deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="53"/>
<source>Bank is not deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="55"/>
<source>RVT-H object is not an HDD image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="57"/>
<source>Wii game partition not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="59"/>
<source>RVT-H bank count field is invalid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="61"/>
<source>Operation cannot be performed on devices or HDD images</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="63"/>
<source>Source image does not fit in an RVT-H bank</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="65"/>
<source>Destination bank is not empty or deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="67"/>
<source>Wii-specific operation was requested on a non-Wii image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="69"/>
<source>Image is unencrypted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="71"/>
<source>Image is encrypted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="73"/>
<source>Wii partition table is corrupted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="75"/>
<source>At least one Wii partition header is corrupted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="77"/>
<source>Certificate has an unknown issuer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="82"/>
<source>Extended Bank Table: Cannot use Bank 1 for a Dual-Layer image.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="84"/>
<source>Cannot use the last bank for a Dual-Layer image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="86"/>
<source>The second bank for the Dual-Layer image is not empty or deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="88"/>
<source>The two banks are not contiguous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="93"/>
<source>NDEV headers for GCN are currently not supported.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SelectDeviceDialog</name>
<message>
@ -701,23 +844,23 @@ Standard ist keine, der den Originalschlüssel beibehält.</translation>
<context>
<name>TranslationManager</name>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="173"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="184"/>
<source>David Korth</source>
<comment>ts-author</comment>
<extracomment>Translation file author. Put your name here.</extracomment>
<translation>crediar</translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="176"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="223"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="187"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="233"/>
<source>Default</source>
<comment>ts-language</comment>
<extracomment>Language this translation provides, e.g. &quot;English (US)&quot;.</extracomment>
<translation>Deutsch</translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="179"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="216"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="190"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="226"/>
<source>C</source>
<comment>ts-locale</comment>
<extracomment>Locale name, e.g. &quot;en_US&quot;.</extracomment>
@ -748,25 +891,25 @@ Standard ist keine, der den Originalschlüssel beibehält.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="277"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="329"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="332"/>
<source>%1() ERROR: rvth object is not set.</source>
<translation>%1() FEHLER: rvth Objekt ist nicht gesetzt.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="281"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="333"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="336"/>
<source>%1() ERROR: Bank number is not set.</source>
<translation>%1() FEHLER: Die Banknummer ist nicht gesetzt.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="283"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="335"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="338"/>
<source>%1() ERROR: Bank number %2 is out of range.</source>
<translation>%1() FEHLER: Bank Nummer %2 ist außerhalb des Bereichs.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="288"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="340"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="343"/>
<source>%1() ERROR: gcmFilename is not set.</source>
<translation>%1() FEHLER: gcmFilename ist nicht gesetzt.</translation>
</message>
@ -777,18 +920,28 @@ Standard ist keine, der den Originalschlüssel beibehält.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="309"/>
<source>ERROR extracting Bank %1 into %2: %3</source>
<translation>FEHLER extrahiere Bank %1 in %2: %3</translation>
<source>Extraction operation cancelled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="357"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="312"/>
<source>ERROR extracting Bank %1 into %2</source>
<translation>FEHLER extrahiere Bank %1 in %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="364"/>
<source>Import operation cancelled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="367"/>
<source>ERROR importing %1 into Bank %2</source>
<translation>FEHLER beim Importieren von %1 in Bank %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="360"/>
<source>%1 imported into Bank %2 successfully.</source>
<translation>%1 erfolgreich in Bank %2 importiert.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="361"/>
<source>ERROR importing %1 into Bank %2: %3</source>
<translation>FEHLER beim Importieren von %1 in Bank %2: %3</translation>
</message>
</context>
</TS>

View File

@ -596,6 +596,11 @@ Default is None, which retains the original key.</source>
<source>ERROR undeleting Bank %1: %2</source>
<translation></translation>
</message>
<message>
<location filename="../src/qrvthtool/windows/QRvtHToolWindow.cpp" line="1568"/>
<source>%1: %2</source>
<translation></translation>
</message>
</context>
<context>
<name>QTreeViewOpt</name>
@ -654,6 +659,144 @@ Default is None, which retains the original key.</source>
<translation></translation>
</message>
</context>
<context>
<name>RvtH|Error</name>
<message>
<location filename="../src/librvth/rvth_error.c" line="35"/>
<source>Success</source>
<translation>Success</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="37"/>
<source>Unrecognized file format</source>
<translation>Unrecognized file format</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="39"/>
<source>Bank table magic is incorrect</source>
<translation>Bank table magic is incorrect</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="41"/>
<source>No banks found</source>
<translation>No banks found</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="43"/>
<source>Bank status is unknown</source>
<translation>Bank status is unknown</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="45"/>
<source>Bank is empty</source>
<translation>Bank is empty</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="47"/>
<source>Bank is second bank of a dual-layer image</source>
<translation>Bank is second bank of a dual-layer image</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="49"/>
<source>Operation can only be performed on a device, not an image file</source>
<translation>Operation can only be performed on a device, not an image file</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="51"/>
<source>Bank is deleted</source>
<translation>Bank is deleted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="53"/>
<source>Bank is not deleted</source>
<translation>Bank is not deleted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="55"/>
<source>RVT-H object is not an HDD image</source>
<translation>RVT-H object is not an HDD image</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="57"/>
<source>Wii game partition not found</source>
<translation>Wii game partition not found</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="59"/>
<source>RVT-H bank count field is invalid</source>
<translation>RVT-H bank count field is invalid</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="61"/>
<source>Operation cannot be performed on devices or HDD images</source>
<translation>Operation cannot be performed on devices or HDD images</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="63"/>
<source>Source image does not fit in an RVT-H bank</source>
<translation>Source image does not fit in an RVT-H bank</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="65"/>
<source>Destination bank is not empty or deleted</source>
<translation>Destination bank is not empty or deleted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="67"/>
<source>Wii-specific operation was requested on a non-Wii image</source>
<translation>Wii-specific operation was requested on a non-Wii image</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="69"/>
<source>Image is unencrypted</source>
<translation>Image is unencrypted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="71"/>
<source>Image is encrypted</source>
<translation>Image is encrypted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="73"/>
<source>Wii partition table is corrupted</source>
<translation>Wii partition table is corrupted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="75"/>
<source>At least one Wii partition header is corrupted</source>
<translation>At least one Wii partition header is corrupted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="77"/>
<source>Certificate has an unknown issuer</source>
<translation>Certificate has an unknown issuer</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="82"/>
<source>Extended Bank Table: Cannot use Bank 1 for a Dual-Layer image.</source>
<translation>Extended Bank Table: Cannot use Bank 1 for a Dual-Layer image.</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="84"/>
<source>Cannot use the last bank for a Dual-Layer image</source>
<translation>Cannot use the last bank for a Dual-Layer image</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="86"/>
<source>The second bank for the Dual-Layer image is not empty or deleted</source>
<translation>The second bank for the Dual-Layer image is not empty or deleted</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="88"/>
<source>The two banks are not contiguous</source>
<translation>The two banks are not contiguous</translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="93"/>
<source>NDEV headers for GCN are currently not supported.</source>
<translation>NDEV headers for GCN are currently not supported.</translation>
</message>
</context>
<context>
<name>SelectDeviceDialog</name>
<message>
@ -700,23 +843,23 @@ Default is None, which retains the original key.</source>
<context>
<name>TranslationManager</name>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="173"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="184"/>
<source>David Korth</source>
<comment>ts-author</comment>
<extracomment>Translation file author. Put your name here.</extracomment>
<translation></translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="176"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="223"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="187"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="233"/>
<source>Default</source>
<comment>ts-language</comment>
<extracomment>Language this translation provides, e.g. &quot;English (US)&quot;.</extracomment>
<translation>English (US)</translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="179"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="216"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="190"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="226"/>
<source>C</source>
<comment>ts-locale</comment>
<extracomment>Locale name, e.g. &quot;en_US&quot;.</extracomment>
@ -747,25 +890,25 @@ Default is None, which retains the original key.</source>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="277"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="329"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="332"/>
<source>%1() ERROR: rvth object is not set.</source>
<translation></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="281"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="333"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="336"/>
<source>%1() ERROR: Bank number is not set.</source>
<translation></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="283"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="335"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="338"/>
<source>%1() ERROR: Bank number %2 is out of range.</source>
<translation></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="288"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="340"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="343"/>
<source>%1() ERROR: gcmFilename is not set.</source>
<translation></translation>
</message>
@ -776,18 +919,28 @@ Default is None, which retains the original key.</source>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="309"/>
<source>ERROR extracting Bank %1 into %2: %3</source>
<translation></translation>
<source>Extraction operation cancelled.</source>
<translation>Extraction operation cancelled.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="357"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="312"/>
<source>ERROR extracting Bank %1 into %2</source>
<translation>ERROR extracting Bank %1 into %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="364"/>
<source>Import operation cancelled.</source>
<translation>Import operation cancelled.</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="367"/>
<source>ERROR importing %1 into Bank %2</source>
<translation>ERROR importing %1 into Bank %2</translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="360"/>
<source>%1 imported into Bank %2 successfully.</source>
<translation></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="361"/>
<source>ERROR importing %1 into Bank %2: %3</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -596,6 +596,11 @@ Default is None, which retains the original key.</source>
<source>ERROR undeleting Bank %1: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/windows/QRvtHToolWindow.cpp" line="1568"/>
<source>%1: %2</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QTreeViewOpt</name>
@ -654,6 +659,144 @@ Default is None, which retains the original key.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RvtH|Error</name>
<message>
<location filename="../src/librvth/rvth_error.c" line="35"/>
<source>Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="37"/>
<source>Unrecognized file format</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="39"/>
<source>Bank table magic is incorrect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="41"/>
<source>No banks found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="43"/>
<source>Bank status is unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="45"/>
<source>Bank is empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="47"/>
<source>Bank is second bank of a dual-layer image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="49"/>
<source>Operation can only be performed on a device, not an image file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="51"/>
<source>Bank is deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="53"/>
<source>Bank is not deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="55"/>
<source>RVT-H object is not an HDD image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="57"/>
<source>Wii game partition not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="59"/>
<source>RVT-H bank count field is invalid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="61"/>
<source>Operation cannot be performed on devices or HDD images</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="63"/>
<source>Source image does not fit in an RVT-H bank</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="65"/>
<source>Destination bank is not empty or deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="67"/>
<source>Wii-specific operation was requested on a non-Wii image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="69"/>
<source>Image is unencrypted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="71"/>
<source>Image is encrypted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="73"/>
<source>Wii partition table is corrupted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="75"/>
<source>At least one Wii partition header is corrupted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="77"/>
<source>Certificate has an unknown issuer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="82"/>
<source>Extended Bank Table: Cannot use Bank 1 for a Dual-Layer image.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="84"/>
<source>Cannot use the last bank for a Dual-Layer image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="86"/>
<source>The second bank for the Dual-Layer image is not empty or deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="88"/>
<source>The two banks are not contiguous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/librvth/rvth_error.c" line="93"/>
<source>NDEV headers for GCN are currently not supported.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SelectDeviceDialog</name>
<message>
@ -700,23 +843,23 @@ Default is None, which retains the original key.</source>
<context>
<name>TranslationManager</name>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="173"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="184"/>
<source>David Korth</source>
<comment>ts-author</comment>
<extracomment>Translation file author. Put your name here.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="176"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="223"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="187"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="233"/>
<source>Default</source>
<comment>ts-language</comment>
<extracomment>Language this translation provides, e.g. &quot;English (US)&quot;.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="179"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="216"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="190"/>
<location filename="../src/qrvthtool/TranslationManager.cpp" line="226"/>
<source>C</source>
<comment>ts-locale</comment>
<extracomment>Locale name, e.g. &quot;en_US&quot;.</extracomment>
@ -747,25 +890,25 @@ Default is None, which retains the original key.</source>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="277"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="329"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="332"/>
<source>%1() ERROR: rvth object is not set.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="281"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="333"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="336"/>
<source>%1() ERROR: Bank number is not set.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="283"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="335"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="338"/>
<source>%1() ERROR: Bank number %2 is out of range.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="288"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="340"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="343"/>
<source>%1() ERROR: gcmFilename is not set.</source>
<translation type="unfinished"></translation>
</message>
@ -776,18 +919,28 @@ Default is None, which retains the original key.</source>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="309"/>
<source>ERROR extracting Bank %1 into %2: %3</source>
<source>Extraction operation cancelled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="357"/>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="312"/>
<source>ERROR extracting Bank %1 into %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="364"/>
<source>Import operation cancelled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="367"/>
<source>ERROR importing %1 into Bank %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="360"/>
<source>%1 imported into Bank %2 successfully.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qrvthtool/WorkerObject.cpp" line="361"/>
<source>ERROR importing %1 into Bank %2: %3</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -2,17 +2,21 @@
* RVT-H Tool (librvth) *
* rvth_error.c: RVT-H error codes. *
* *
* Copyright (c) 2018-2019 by David Korth. *
* Copyright (c) 2018-2025 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/
#include "rvth_error.h"
#include "libwiicrypto/common.h"
// C includes.
// C includes
#include <assert.h>
#include <string.h>
#ifndef QT_TRANSLATE_NOOP
# define QT_TRANSLATE_NOOP(context, sourceText) (sourceText)
#endif /* QT_TRANSLATE_NOOP */
/**
* Get a string description of an error number.
* - Negative: POSIX error. (strerror())
@ -28,65 +32,65 @@ const char *rvth_error(int err)
// RvtH_Errors code should be retured instead.
static const char *const errtbl[] = {
// tr: RVTH_ERROR_SUCCESS
"Success",
QT_TRANSLATE_NOOP("RvtH|Error", "Success"),
// tr: RVTH_ERROR_UNRECOGNIZED_FILE
"Unrecognized file format",
QT_TRANSLATE_NOOP("RvtH|Error", "Unrecognized file format"),
// tr: RVTH_ERROR_NHCD_TABLE_MAGIC
"Bank table magic is incorrect",
QT_TRANSLATE_NOOP("RvtH|Error", "Bank table magic is incorrect"),
// tr: RVTH_ERROR_NO_BANKS
"No banks found",
QT_TRANSLATE_NOOP("RvtH|Error", "No banks found"),
// tr: RVTH_ERROR_BANK_UNKNOWN
"Bank status is unknown",
QT_TRANSLATE_NOOP("RvtH|Error", "Bank status is unknown"),
// tr: RVTH_ERROR_BANK_EMPTY
"Bank is empty",
QT_TRANSLATE_NOOP("RvtH|Error", "Bank is empty"),
// tr: RVTH_ERROR_BANK_DL_2
"Bank is second bank of a dual-layer image",
QT_TRANSLATE_NOOP("RvtH|Error", "Bank is second bank of a dual-layer image"),
// tr: RVTH_ERROR_NOT_A_DEVICE
"Operation can only be performed on a device, not an image file",
QT_TRANSLATE_NOOP("RvtH|Error", "Operation can only be performed on a device, not an image file"),
// tr: RVTH_ERROR_BANK_IS_DELETED
"Bank is deleted",
QT_TRANSLATE_NOOP("RvtH|Error", "Bank is deleted"),
// tr: RVTH_ERROR_BANK_NOT_DELETED
"Bank is not deleted",
QT_TRANSLATE_NOOP("RvtH|Error", "Bank is not deleted"),
// tr: RVTH_ERROR_NOT_HDD_IMAGE
"RVT-H object is not an HDD image",
QT_TRANSLATE_NOOP("RvtH|Error", "RVT-H object is not an HDD image"),
// tr: RVTH_ERROR_NO_GAME_PARTITION
"Wii game partition not found",
QT_TRANSLATE_NOOP("RvtH|Error", "Wii game partition not found"),
// tr: RVTH_ERROR_INVALID_BANK_COUNT
"RVT-H bank count field is invalid",
QT_TRANSLATE_NOOP("RvtH|Error", "RVT-H bank count field is invalid"),
// tr: RVTH_ERROR_IS_HDD_IMAGE
"Operation cannot be performed on devices or HDD images",
QT_TRANSLATE_NOOP("RvtH|Error", "Operation cannot be performed on devices or HDD images"),
// tr: RVTH_ERROR_IMAGE_TOO_BIG
"Source image does not fit in an RVT-H bank",
QT_TRANSLATE_NOOP("RvtH|Error", "Source image does not fit in an RVT-H bank"),
// tr: RVTH_ERROR_BANK_NOT_EMPTY_OR_DELETED
"Destination bank is not empty or deleted",
QT_TRANSLATE_NOOP("RvtH|Error", "Destination bank is not empty or deleted"),
// tr: RVTH_ERROR_NOT_WII_IMAGE
"Wii-specific operation was requested on a non-Wii image",
QT_TRANSLATE_NOOP("RvtH|Error", "Wii-specific operation was requested on a non-Wii image"),
// tr: RVTH_ERROR_IS_UNENCRYPTED
"Image is unencrypted",
QT_TRANSLATE_NOOP("RvtH|Error", "Image is unencrypted"),
// tr: RVTH_ERROR_IS_ENCRYPTED
"Image is encrypted",
QT_TRANSLATE_NOOP("RvtH|Error", "Image is encrypted"),
// tr: RVTH_ERROR_PARTITION_TABLE_CORRUPTED
"Wii partition table is corrupted",
QT_TRANSLATE_NOOP("RvtH|Error", "Wii partition table is corrupted"),
// tr: RVTH_ERROR_PARTITION_HEADER_CORRUPTED
"At least one Wii partition header is corrupted",
QT_TRANSLATE_NOOP("RvtH|Error", "At least one Wii partition header is corrupted"),
// tr: RVTH_ERROR_ISSUER_UNKNOWN
"Certificate has an unknown issuer",
QT_TRANSLATE_NOOP("RvtH|Error", "Certificate has an unknown issuer"),
// 'import' command: Dual-Layer errors.
// 'import' command: Dual-Layer errors
// tr: RVTH_ERROR_IMPORT_DL_EXT_NO_BANK1
"Extended Bank Table: Cannot use Bank 1 for a Dual-Layer image.",
QT_TRANSLATE_NOOP("RvtH|Error", "Extended Bank Table: Cannot use Bank 1 for a Dual-Layer image."),
// tr: RVTH_ERROR_IMPORT_DL_LAST_BANK
"Cannot use the last bank for a Dual-Layer image",
QT_TRANSLATE_NOOP("RvtH|Error", "Cannot use the last bank for a Dual-Layer image"),
// tr: RVTH_ERROR_BANK2DL_NOT_EMPTY_OR_DELETED
"The second bank for the Dual-Layer image is not empty or deleted",
QT_TRANSLATE_NOOP("RvtH|Error", "The second bank for the Dual-Layer image is not empty or deleted"),
// tr: RVTH_ERROR_IMPORT_DL_NOT_CONTIGUOUS
"The two banks are not contiguous",
QT_TRANSLATE_NOOP("RvtH|Error", "The two banks are not contiguous"),
// NDEV option.
// NDEV option
// tr: RVTH_ERROR_NDEV_GCN_NOT_SUPPORTED
"NDEV headers for GCN are currently unsupported.",
QT_TRANSLATE_NOOP("RvtH|Error", "NDEV headers for GCN are currently not supported."),
};
static_assert(ARRAY_SIZE(errtbl) == RVTH_ERROR_MAX, "Missing error descriptions!");

View File

@ -304,10 +304,13 @@ void WorkerObject::doExtract(void)
// Successfully extracted.
emit finished(tr("Bank %1 extracted into %2 successfully.")
.arg(d->bank+1).arg(d->gcmFilenameOnly), ret);
} else if (ret == -ECANCELED) {
// Operation cancelled.
emit finished(tr("Extraction operation cancelled."), ret);
} else {
// An error occurred...
emit finished(tr("ERROR extracting Bank %1 into %2: %3")
.arg(d->bank+1).arg(d->gcmFilenameOnly).arg(ret), ret);
emit finished(tr("ERROR extracting Bank %1 into %2")
.arg(d->bank+1).arg(d->gcmFilenameOnly), ret);
}
}
@ -356,9 +359,12 @@ void WorkerObject::doImport(void)
// Successfully extracted.
emit finished(tr("%1 imported into Bank %2 successfully.")
.arg(d->gcmFilenameOnly).arg(d->bank+1), ret);
} else if (ret == -ECANCELED) {
// Operation cancelled.
emit finished(tr("Import operation cancelled."), ret);
} else {
// An error occurred...
emit finished(tr("ERROR importing %1 into Bank %2: %3")
.arg(d->gcmFilenameOnly).arg(d->bank+1).arg(ret), ret);
emit finished(tr("ERROR importing %1 into Bank %2")
.arg(d->gcmFilenameOnly).arg(d->bank+1), ret);
}
}

View File

@ -1535,20 +1535,40 @@ void QRvtHToolWindow::workerObject_updateStatus(const QString &text, int progres
void QRvtHToolWindow::workerObject_finished(const QString &text, int err)
{
Q_D(QRvtHToolWindow);
d->lblMessage->setText(text);
// Hide the Cancel button.
d->btnCancel->setVisible(false);
if (err == 0) {
// Process completed.
d->lblMessage->setText(text);
d->progressBar->setValue(d->progressBar->maximum());
MessageSound::play(QMessageBox::Information, text, this);
} else {
// Process failed.
// TODO: Change progress bar to red?
// TOOD: Critical vs. warning.
MessageSound::play(QMessageBox::Warning, text, this);
if (err == -ECANCELED) {
// Operation was cancelled. Show the message as-is.
d->lblMessage->setText(text);
MessageSound::play(QMessageBox::Warning, text, this);
} else {
// Other error. Append the error message.
QString errmsg;
if (err >= 0) {
errmsg = QCoreApplication::translate("RvtH|Error", rvth_error(err));
} else {
// POSIX error code.
// TODO: QIODevice has some translations, but it requires
// getting the C version first...
errmsg = QString::fromUtf8(rvth_error(err));
}
// tr: %1 == general error from worker object; %2 == actual error message
QString fullmsg = tr("%1: %2").arg(text, errmsg);
d->lblMessage->setText(fullmsg);
MessageSound::play(QMessageBox::Warning, fullmsg, this);
}
}
// TODO: Hide the progress bar on success after 5 seconds.