Changeset 23664 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 10, 2009 12:23:35 AM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r23663 r23664 1511 1511 else 1512 1512 return setError(VBOX_E_INVALID_VM_STATE, 1513 tr("Invalid machine state: % d(must be Running, Paused or Stuck)"),1514 mMachineState);1513 tr("Invalid machine state: %s (must be Running, Paused or Stuck)"), 1514 Global::stringifyMachineState(mMachineState)); 1515 1515 } 1516 1516 … … 1562 1562 if (mMachineState != MachineState_Running) 1563 1563 return setError(VBOX_E_INVALID_VM_STATE, 1564 tr("Invalid machine state: % d"),1565 mMachineState);1564 tr("Invalid machine state: %s"), 1565 Global::stringifyMachineState(mMachineState)); 1566 1566 1567 1567 /* protect mpVM */ … … 1595 1595 if (mMachineState != MachineState_Running) 1596 1596 return setError(VBOX_E_INVALID_VM_STATE, 1597 tr("Invalid machine state: % d)"),1598 mMachineState);1597 tr("Invalid machine state: %s"), 1598 Global::stringifyMachineState(mMachineState)); 1599 1599 1600 1600 /* protect mpVM */ … … 1630 1630 if (mMachineState != MachineState_Paused) 1631 1631 return setError(VBOX_E_INVALID_VM_STATE, 1632 tr("Cannot resume the machine as it is not paused (machine state: % d)"),1633 mMachineState);1632 tr("Cannot resume the machine as it is not paused (machine state: %s)"), 1633 Global::stringifyMachineState(mMachineState)); 1634 1634 1635 1635 /* protect mpVM */ … … 1669 1669 if (mMachineState != MachineState_Running) 1670 1670 return setError(VBOX_E_INVALID_VM_STATE, 1671 tr("Invalid machine state: % d)"),1672 mMachineState);1671 tr("Invalid machine state: %s"), 1672 Global::stringifyMachineState(mMachineState)); 1673 1673 1674 1674 /* protect mpVM */ … … 1710 1710 if (mMachineState != MachineState_Running) 1711 1711 return setError(VBOX_E_INVALID_VM_STATE, 1712 tr("Invalid machine state: % d)"),1713 mMachineState);1712 tr("Invalid machine state: %s"), 1713 Global::stringifyMachineState(mMachineState)); 1714 1714 1715 1715 /* protect mpVM */ … … 1754 1754 if (mMachineState != MachineState_Running) 1755 1755 return setError(VBOX_E_INVALID_VM_STATE, 1756 tr("Invalid machine state % dwhen checking if the guest entered the ACPI mode)"),1757 mMachineState);1756 tr("Invalid machine state %s when checking if the guest entered the ACPI mode)"), 1757 Global::stringifyMachineState(mMachineState)); 1758 1758 1759 1759 /* protect mpVM */ … … 1789 1789 if (mMachineState != MachineState_Running) 1790 1790 return setError(VBOX_E_INVALID_VM_STATE, 1791 tr("Invalid machine state: % d)"),1792 mMachineState);1791 tr("Invalid machine state: %s)"), 1792 Global::stringifyMachineState(mMachineState)); 1793 1793 1794 1794 /* protect mpVM */ … … 1832 1832 { 1833 1833 return setError(VBOX_E_INVALID_VM_STATE, 1834 tr("Cannot save the execution state as the machine is not running or paused (machine state: % d)"),1835 mMachineState);1834 tr("Cannot save the execution state as the machine is not running or paused (machine state: %s)"), 1835 Global::stringifyMachineState(mMachineState)); 1836 1836 } 1837 1837 … … 1969 1969 mMachineState != MachineState_Aborted) 1970 1970 return setError(VBOX_E_INVALID_VM_STATE, 1971 tr("Cannot adopt the saved machine state as the machine is not in Powered Off or Aborted state (machine state: % d)"),1972 mMachineState);1971 tr("Cannot adopt the saved machine state as the machine is not in Powered Off or Aborted state (machine state: %s)"), 1972 Global::stringifyMachineState(mMachineState)); 1973 1973 1974 1974 return mControl->AdoptSavedState(aSavedStateFile); … … 1984 1984 if (mMachineState != MachineState_Saved) 1985 1985 return setError(VBOX_E_INVALID_VM_STATE, 1986 tr("Cannot discard the machine state as the machine is not in the saved state (machine state: % d)"),1987 mMachineState);1986 tr("Cannot discard the machine state as the machine is not in the saved state (machine state: %s)"), 1987 Global::stringifyMachineState(mMachineState)); 1988 1988 1989 1989 HRESULT rc = S_OK; … … 2108 2108 mMachineState != MachineState_Paused) 2109 2109 return setError(VBOX_E_INVALID_VM_STATE, 2110 tr("Cannot attach a USB device to the machine which is not running or paused (machine state: % d)"),2111 mMachineState);2110 tr("Cannot attach a USB device to the machine which is not running or paused (machine state: %s)"), 2111 Global::stringifyMachineState(mMachineState)); 2112 2112 2113 2113 /* protect mpVM */ … … 2286 2286 if (mMachineState > MachineState_Paused) 2287 2287 return setError(VBOX_E_INVALID_VM_STATE, 2288 tr("Cannot create a transient shared folder on the machine while it is changing the state (machine state: % d)"),2289 mMachineState);2288 tr("Cannot create a transient shared folder on the machine while it is changing the state (machine state: %s)"), 2289 Global::stringifyMachineState(mMachineState)); 2290 2290 2291 2291 ComObjPtr<SharedFolder> sharedFolder; … … 2348 2348 if (mMachineState > MachineState_Paused) 2349 2349 return setError(VBOX_E_INVALID_VM_STATE, 2350 tr("Cannot remove a transient shared folder from the machine while it is changing the state (machine state: % d)"),2351 mMachineState);2350 tr("Cannot remove a transient shared folder from the machine while it is changing the state (machine state: %s)"), 2351 Global::stringifyMachineState(mMachineState)); 2352 2352 2353 2353 ComObjPtr<SharedFolder> sharedFolder; … … 2406 2406 if (Global::IsTransient(mMachineState)) 2407 2407 return setError(VBOX_E_INVALID_VM_STATE, 2408 tr("Cannot take a snapshot of the machine while it is changing the state (machine state: % d)"),2409 mMachineState);2408 tr("Cannot take a snapshot of the machine while it is changing the state (machine state: %s)"), 2409 Global::stringifyMachineState(mMachineState)); 2410 2410 2411 2411 HRESULT rc = S_OK; … … 2418 2418 rc = mMachine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(aMediumAttachments)); 2419 2419 if (FAILED(rc)) 2420 return setError(VBOX_E_INVALID_VM_STATE, 2421 tr("Cannot get medium attachments of the machine"), 2422 mMachineState); 2420 return setError(rc, tr("Cannot get medium attachments of the machine")); 2423 2421 2424 2422 ULONG ulMemSize; … … 2530 2528 if (Global::IsOnlineOrTransient(mMachineState)) 2531 2529 return setError(VBOX_E_INVALID_VM_STATE, 2532 tr("Cannot discard a snapshot of the running machine (machine state: % d)"),2533 mMachineState);2530 tr("Cannot discard a snapshot of the running machine (machine state: %s)"), 2531 Global::stringifyMachineState(mMachineState)); 2534 2532 2535 2533 MachineState_T machineState = MachineState_Null; … … 2550 2548 if (Global::IsOnlineOrTransient(mMachineState)) 2551 2549 return setError(VBOX_E_INVALID_VM_STATE, 2552 tr("Cannot discard the current state of the running machine (machine state: % d)"),2553 mMachineState);2550 tr("Cannot discard the current state of the running machine (machine state: %s)"), 2551 Global::stringifyMachineState(mMachineState)); 2554 2552 2555 2553 MachineState_T machineState = MachineState_Null; … … 2570 2568 if (Global::IsOnlineOrTransient(mMachineState)) 2571 2569 return setError(VBOX_E_INVALID_VM_STATE, 2572 tr("Cannot discard the current snapshot and state of the running machine (machine state: % d)"),2573 mMachineState);2570 tr("Cannot discard the current snapshot and state of the running machine (machine state: %s)"), 2571 Global::stringifyMachineState(mMachineState)); 2574 2572 2575 2573 MachineState_T machineState = MachineState_Null; … … 4527 4525 if (Global::IsOnlineOrTransient(mMachineState)) 4528 4526 return setError(VBOX_E_INVALID_VM_STATE, 4529 tr("Virtual machine is already running or busy (machine state: % d)"),4530 mMachineState);4527 tr("Virtual machine is already running or busy (machine state: %s)"), 4528 Global::stringifyMachineState(mMachineState)); 4531 4529 4532 4530 HRESULT rc = S_OK; … … 4796 4794 mMachineState == MachineState_Restoring || 4797 4795 mMachineState == MachineState_Stopping, 4798 ("Invalid machine state: % d\n", mMachineState));4796 ("Invalid machine state: %s\n", Global::stringifyMachineState(mMachineState))); 4799 4797 4800 4798 LogRel(("Console::powerDown(): A request to power off the VM has been issued (mMachineState=%d, InUninit=%d)\n", -
trunk/src/VBox/Main/MachineImpl.cpp
r23600 r23664 1888 1888 ) 1889 1889 return setError(VBOX_E_INVALID_VM_STATE, 1890 tr("The machine is not powered off (state is % d)"),1891 mData->mMachineState);1890 tr("The machine is not powered off (state is %s)"), 1891 Global::stringifyMachineState(mData->mMachineState)); 1892 1892 1893 1893 mUserData.backup(); … … 2040 2040 if (Global::IsOnlineOrTransient(mData->mMachineState)) 2041 2041 return setError(VBOX_E_INVALID_VM_STATE, 2042 tr("Invalid machine state: % d"),2043 mData->mMachineState);2042 tr("Invalid machine state: %s"), 2043 Global::stringifyMachineState(mData->mMachineState)); 2044 2044 2045 2045 /* Check for an existing controller. */ … … 2442 2442 if (Global::IsOnlineOrTransient(mData->mMachineState)) 2443 2443 return setError(VBOX_E_INVALID_VM_STATE, 2444 tr("Invalid machine state: %d"), mData->mMachineState); 2444 tr("Invalid machine state: %s"), 2445 Global::stringifyMachineState(mData->mMachineState)); 2445 2446 2446 2447 MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments, … … 3033 3034 if (mData->mSession.mState != SessionState_Open) 3034 3035 return setError(VBOX_E_INVALID_VM_STATE, 3035 tr("Machine session is not open (session state: % d)"),3036 mData->mSession.mState);3036 tr("Machine session is not open (session state: %s)"), 3037 Global::stringifyMachineState(mData->mSession.mState)); 3037 3038 3038 3039 directControl = mData->mSession.mDirectControl; … … 4628 4629 mData->mMachineState == MachineState_Saved)) 4629 4630 return setError(VBOX_E_INVALID_VM_STATE, 4630 tr("The machine is not mutable (state is % d)"),4631 mData->mMachineState);4631 tr("The machine is not mutable (state is %s)"), 4632 Global::stringifyMachineState(mData->mMachineState)); 4632 4633 break; 4633 4634 } … … 4638 4639 mData->mMachineState > MachineState_Paused)) 4639 4640 return setError(VBOX_E_INVALID_VM_STATE, 4640 tr("The machine is not mutable (state is % d)"),4641 mData->mMachineState);4641 tr("The machine is not mutable (state is %s)"), 4642 Global::stringifyMachineState(mData->mMachineState)); 4642 4643 break; 4643 4644 }
Note:
See TracChangeset
for help on using the changeset viewer.