Changeset 92372 in vbox for trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
- Timestamp:
- Nov 11, 2021 2:45:18 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r82968 r92372 39 39 using namespace com; 40 40 41 DECLARE_TRANSLATION_CONTEXT(Storage); 41 42 42 43 // funcs … … 165 166 devTypeRequested = DeviceType_DVD; 166 167 else 167 return errorArgument( "Invalid --type argument '%s'", ValueUnion.psz);168 return errorArgument(Storage::tr("Invalid --type argument '%s'"), ValueUnion.psz); 168 169 } 169 170 else … … 304 305 int vrc = parseMediumType(ValueUnion.psz, &enmMediumType); 305 306 if (RT_FAILURE(vrc)) 306 return errorArgument( "Invalid medium type '%s'", ValueUnion.psz);307 return errorArgument(Storage::tr("Invalid medium type '%s'"), ValueUnion.psz); 307 308 fSetMediumType = true; 308 309 break; … … 326 327 327 328 if (!pszCtl) 328 return errorSyntax(USAGE_STORAGEATTACH, "Storage controller name not specified");329 return errorSyntax(USAGE_STORAGEATTACH, Storage::tr("Storage controller name not specified")); 329 330 330 331 /* get the virtualbox system properties */ … … 346 347 { 347 348 if (pszPassThrough) 348 throw Utf8Str( "Drive passthrough state cannot be changed while the VM is running\n");349 throw Utf8Str(Storage::tr("Drive passthrough state cannot be changed while the VM is running\n")); 349 350 else if (pszBandwidthGroup) 350 throw Utf8Str( "Bandwidth group cannot be changed while the VM is running\n");351 throw Utf8Str(Storage::tr("Bandwidth group cannot be changed while the VM is running\n")); 351 352 } 352 353 … … 355 356 storageCtl.asOutParam()); 356 357 if (FAILED(rc)) 357 throw Utf8StrFmt( "Could not find a controller named '%s'\n", pszCtl);358 throw Utf8StrFmt(Storage::tr("Could not find a controller named '%s'\n"), pszCtl); 358 359 359 360 StorageBus_T storageBus = StorageBus_Null; … … 369 370 port = 0; 370 371 else 371 return errorSyntax(USAGE_STORAGEATTACH, "Port not specified");372 return errorSyntax(USAGE_STORAGEATTACH, Storage::tr("Port not specified")); 372 373 } 373 374 if (device == ~0U) … … 376 377 device = 0; 377 378 else 378 return errorSyntax(USAGE_STORAGEATTACH, "Device not specified");379 return errorSyntax(USAGE_STORAGEATTACH, Storage::tr("Device not specified")); 379 380 } 380 381 … … 440 441 || deviceType == DeviceType_Floppy) 441 442 ) 442 throw Utf8StrFmt( "No DVD/Floppy Drive attached to the controller '%s'"443 "at the port: %u, device: %u", pszCtl, port, device);443 throw Utf8StrFmt(Storage::tr("No DVD/Floppy Drive attached to the controller '%s'" 444 "at the port: %u, device: %u"), pszCtl, port, device); 444 445 445 446 } … … 460 461 461 462 if (!driveCheck) 462 throw Utf8StrFmt( "The attachment is not supported by the storage controller '%s'", pszCtl);463 throw Utf8StrFmt(Storage::tr("The attachment is not supported by the storage controller '%s'"), pszCtl); 463 464 464 465 if (storageBus == StorageBus_Floppy) … … 515 516 strIso = Utf8Str(bstrIso); 516 517 if (strIso.isEmpty()) 517 throw Utf8Str( "Cannot find the Guest Additions ISO image\n");518 throw Utf8Str(Storage::tr("Cannot find the Guest Additions ISO image\n")); 518 519 pszMedium = strIso.c_str(); 519 520 if (devTypeRequested == DeviceType_Null) … … 541 542 542 543 if (devTypeRequested == DeviceType_Null) // still the initializer value? 543 throw Utf8Str( "Argument --type must be specified\n");544 throw Utf8Str(Storage::tr("Argument --type must be specified\n")); 544 545 545 546 /* check if the device type is supported by the controller */ … … 555 556 driveCheck++; 556 557 if (!driveCheck) 557 throw Utf8StrFmt( "The given attachment is not supported by the storage controller '%s'", pszCtl);558 throw Utf8StrFmt(Storage::tr("The given attachment is not supported by the storage controller '%s'"), pszCtl); 558 559 } 559 560 else … … 577 578 char szPathReal[RTPATH_MAX]; 578 579 if (RT_FAILURE(RTPathReal(pszMedium + 5, szPathReal, sizeof(szPathReal)))) 579 throw Utf8StrFmt( "Invalid host DVD drive name \"%s\"", pszMedium + 5);580 throw Utf8StrFmt(Storage::tr("Invalid host DVD drive name \"%s\""), pszMedium + 5); 580 581 rc = host->FindHostDVDDrive(Bstr(szPathReal).raw(), 581 582 pMedium2Mount.asOutParam()); 582 583 if (!pMedium2Mount) 583 throw Utf8StrFmt( "Invalid host DVD drive name \"%s\"", pszMedium + 5);584 throw Utf8StrFmt(Storage::tr("Invalid host DVD drive name \"%s\""), pszMedium + 5); 584 585 } 585 586 } … … 590 591 pMedium2Mount.asOutParam()); 591 592 if (!pMedium2Mount) 592 throw Utf8StrFmt( "Invalid host floppy drive name \"%s\"", pszMedium + 5);593 throw Utf8StrFmt(Storage::tr("Invalid host floppy drive name \"%s\""), pszMedium + 5); 593 594 } 594 595 } … … 597 598 /* check for required options */ 598 599 if (bstrServer.isEmpty() || bstrTarget.isEmpty()) 599 throw Utf8StrFmt( "Parameters --server and --target are required for iSCSI media");600 throw Utf8StrFmt(Storage::tr("Parameters --server and --target are required for iSCSI media")); 600 601 601 602 /** @todo move the location stuff to Main, which can use pfnComposeName … … 664 665 CHECK_ERROR(pMedium2Mount, COMGETTER(Id)(guid.asOutParam())); 665 666 if (FAILED(rc)) goto leave; 666 RTPrintf( "iSCSI disk created. UUID: %s\n", Utf8Str(guid).c_str());667 RTPrintf(Storage::tr("iSCSI disk created. UUID: %s\n"), Utf8Str(guid).c_str()); 667 668 } 668 669 else … … 675 676 mediumAttachment.asOutParam()); 676 677 if (FAILED(rc)) 677 throw Utf8Str( "Missing --medium argument");678 throw Utf8Str(Storage::tr("Missing --medium argument")); 678 679 } 679 680 else … … 684 685 fSetNewUuid, false /* fSilent */); 685 686 if (FAILED(rc) || !pMedium2Mount) 686 throw Utf8StrFmt( "Invalid UUID or filename \"%s\"", pszMedium);687 throw Utf8StrFmt(Storage::tr("Invalid UUID or filename \"%s\""), pszMedium); 687 688 } 688 689 } … … 694 695 fSetNewParentUuid, bstrNewParentUuid.raw())); 695 696 if (FAILED(rc)) 696 throw Utf8Str( "Failed to set the medium/parent medium UUID");697 throw Utf8Str(Storage::tr("Failed to set the medium/parent medium UUID")); 697 698 } 698 699 … … 708 709 CHECK_ERROR(pMedium2Mount, COMSETTER(Type)(enmMediumType)); 709 710 if (FAILED(rc)) 710 throw Utf8Str( "Failed to set the medium type");711 throw Utf8Str(Storage::tr("Failed to set the medium type")); 711 712 } 712 713 } … … 803 804 } 804 805 else 805 throw Utf8StrFmt( "Invalid --passthrough argument '%s'", pszPassThrough);806 } 807 else 808 throw Utf8StrFmt( "Couldn't find the controller attachment for the controller '%s'\n", pszCtl);806 throw Utf8StrFmt(Storage::tr("Invalid --passthrough argument '%s'"), pszPassThrough); 807 } 808 else 809 throw Utf8StrFmt(Storage::tr("Couldn't find the controller attachment for the controller '%s'\n"), pszCtl); 809 810 } 810 811 … … 829 830 } 830 831 else 831 throw Utf8StrFmt( "Invalid --tempeject argument '%s'", pszTempEject);832 } 833 else 834 throw Utf8StrFmt( "Couldn't find the controller attachment for the controller '%s'\n", pszCtl);832 throw Utf8StrFmt(Storage::tr("Invalid --tempeject argument '%s'"), pszTempEject); 833 } 834 else 835 throw Utf8StrFmt(Storage::tr("Couldn't find the controller attachment for the controller '%s'\n"), pszCtl); 835 836 } 836 837 … … 855 856 } 856 857 else 857 throw Utf8StrFmt( "Invalid --nonrotational argument '%s'", pszNonRotational);858 } 859 else 860 throw Utf8StrFmt( "Couldn't find the controller attachment for the controller '%s'\n", pszCtl);858 throw Utf8StrFmt(Storage::tr("Invalid --nonrotational argument '%s'"), pszNonRotational); 859 } 860 else 861 throw Utf8StrFmt(Storage::tr("Couldn't find the controller attachment for the controller '%s'\n"), pszCtl); 861 862 } 862 863 … … 881 882 } 882 883 else 883 throw Utf8StrFmt( "Invalid --discard argument '%s'", pszDiscard);884 } 885 else 886 throw Utf8StrFmt( "Couldn't find the controller attachment for the controller '%s'\n", pszCtl);884 throw Utf8StrFmt(Storage::tr("Invalid --discard argument '%s'"), pszDiscard); 885 } 886 else 887 throw Utf8StrFmt(Storage::tr("Couldn't find the controller attachment for the controller '%s'\n"), pszCtl); 887 888 } 888 889 … … 907 908 } 908 909 else 909 throw Utf8StrFmt( "Invalid --hotpluggable argument '%s'", pszHotPluggable);910 } 911 else 912 throw Utf8StrFmt( "Couldn't find the controller attachment for the controller '%s'\n", pszCtl);910 throw Utf8StrFmt(Storage::tr("Invalid --hotpluggable argument '%s'"), pszHotPluggable); 911 } 912 else 913 throw Utf8StrFmt(Storage::tr("Couldn't find the controller attachment for the controller '%s'\n"), pszCtl); 913 914 } 914 915 … … 989 990 990 991 if (a->argc < 4) 991 return errorSyntax(USAGE_STORAGECONTROLLER, "Too few parameters");992 return errorSyntax(USAGE_STORAGECONTROLLER, Storage::tr("Too few parameters")); 992 993 993 994 RTGetOptInit (&GetState, a->argc, a->argv, g_aStorageControllerOptions, … … 1055 1056 /* it's important to always close sessions */ 1056 1057 a->session->UnlockMachine(); 1057 return errorSyntax(USAGE_STORAGECONTROLLER, "Storage controller name not specified\n");1058 return errorSyntax(USAGE_STORAGECONTROLLER, Storage::tr("Storage controller name not specified\n")); 1058 1059 } 1059 1060 … … 1118 1119 else 1119 1120 { 1120 errorArgument( "Invalid --add argument '%s'", pszBusType);1121 errorArgument(Storage::tr("Invalid --add argument '%s'"), pszBusType); 1121 1122 rc = E_FAIL; 1122 1123 } … … 1179 1180 else 1180 1181 { 1181 errorArgument( "Invalid --type argument '%s'", pszCtlType);1182 rc = E_FAIL; 1183 } 1184 } 1185 else 1186 { 1187 errorArgument( "Couldn't find the controller with the name: '%s'\n", pszCtl);1182 errorArgument(Storage::tr("Invalid --type argument '%s'"), pszCtlType); 1183 rc = E_FAIL; 1184 } 1185 } 1186 else 1187 { 1188 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1188 1189 rc = E_FAIL; 1189 1190 } … … 1204 1205 else 1205 1206 { 1206 errorArgument( "Couldn't find the controller with the name: '%s'\n", pszCtl);1207 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1207 1208 rc = E_FAIL; 1208 1209 } … … 1229 1230 else 1230 1231 { 1231 errorArgument( "Invalid --hostiocache argument '%s'", pszHostIOCache);1232 rc = E_FAIL; 1233 } 1234 } 1235 else 1236 { 1237 errorArgument( "Couldn't find the controller with the name: '%s'\n", pszCtl);1232 errorArgument(Storage::tr("Invalid --hostiocache argument '%s'"), pszHostIOCache); 1233 rc = E_FAIL; 1234 } 1235 } 1236 else 1237 { 1238 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1238 1239 rc = E_FAIL; 1239 1240 } … … 1255 1256 else 1256 1257 { 1257 errorArgument( "Invalid --bootable argument '%s'", pszBootable);1258 rc = E_FAIL; 1259 } 1260 } 1261 else 1262 { 1263 errorArgument( "Couldn't find the controller with the name: '%s'\n", pszCtl);1258 errorArgument(Storage::tr("Invalid --bootable argument '%s'"), pszBootable); 1259 rc = E_FAIL; 1260 } 1261 } 1262 else 1263 { 1264 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1264 1265 rc = E_FAIL; 1265 1266 } … … 1280 1281 else 1281 1282 { 1282 errorArgument( "Couldn't find the controller with the name: '%s'\n", pszCtl);1283 errorArgument(Storage::tr("Couldn't find the controller with the name: '%s'\n"), pszCtl); 1283 1284 rc = E_FAIL; 1284 1285 } … … 1298 1299 1299 1300 #endif /* !VBOX_ONLY_DOCS */ 1300
Note:
See TracChangeset
for help on using the changeset viewer.