Changeset 45328 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 4, 2013 8:49:11 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45325 r45328 633 633 } 634 634 635 bool UIMessageCenter::confirm VMReset(const QString &strNames) const635 bool UIMessageCenter::confirmResetMachine(const QString &strNames) const 636 636 { 637 637 return messageOkCancel(mainWindowShown(), MessageType_Question, … … 640 640 "in applications running inside it to be lost.</p>") 641 641 .arg(strNames), 642 "confirm VMReset" /* auto-confirm id */,642 "confirmResetMachine" /* auto-confirm id */, 643 643 tr("Reset", "machine")); 644 644 } 645 645 646 bool UIMessageCenter::confirm VMACPIShutdown(const QString &strNames) const646 bool UIMessageCenter::confirmACPIShutdownMachine(const QString &strNames) const 647 647 { 648 648 return messageOkCancel(mainWindowShown(), MessageType_Question, … … 650 650 "to the following virtual machines?</p><p><b>%1</b></p>") 651 651 .arg(strNames), 652 "confirm VMACPIShutdown" /* auto-confirm id */,652 "confirmACPIShutdownMachine" /* auto-confirm id */, 653 653 tr("ACPI Shutdown", "machine")); 654 654 } 655 655 656 bool UIMessageCenter::confirm VMPowerOff(const QString &strNames) const656 bool UIMessageCenter::confirmPowerOffMachine(const QString &strNames) const 657 657 { 658 658 return messageOkCancel(mainWindowShown(), MessageType_Question, … … 661 661 "running inside it to be lost.</p>") 662 662 .arg(strNames), 663 "confirm VMPowerOff" /* auto-confirm id */,663 "confirmPowerOffMachine" /* auto-confirm id */, 664 664 tr("Power Off", "machine")); 665 } 666 667 void UIMessageCenter::cannotPauseMachine(const CConsole &console) const 668 { 669 /* Preserve error-info: */ 670 COMResult res(console); 671 /* Show the message: */ 672 message(mainWindowShown(), MessageType_Error, 673 tr("Failed to pause the execution of the virtual machine <b>%1</b>.") 674 .arg(console.GetMachine().GetName()), 675 formatErrorInfo(res)); 676 } 677 678 void UIMessageCenter::cannotResumeMachine(const CConsole &console) const 679 { 680 /* Preserve error-info: */ 681 COMResult res(console); 682 /* Show the message: */ 683 message(mainWindowShown(), MessageType_Error, 684 tr("Failed to resume the execution of the virtual machine <b>%1</b>.") 685 .arg(console.GetMachine().GetName()), 686 formatErrorInfo(res)); 665 687 } 666 688 … … 676 698 } 677 699 678 void UIMessageCenter::cannotStopMachine(const CConsole &console) const 700 void UIMessageCenter::cannotSaveMachineState(const CConsole &console) 701 { 702 /* Preserve error-info: */ 703 COMResult res(console); 704 /* Show the message: */ 705 message(mainWindowShown(), MessageType_Error, 706 tr("Failed to save the state of the virtual machine <b>%1</b>.") 707 .arg(console.GetMachine().GetName()), 708 formatErrorInfo(res)); 709 } 710 711 void UIMessageCenter::cannotSaveMachineState(const CProgress &progress, const QString &strName) 712 { 713 message(mainWindowShown(), MessageType_Error, 714 tr("Failed to save the state of the virtual machine <b>%1</b>.") 715 .arg(strName), 716 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 717 } 718 719 void UIMessageCenter::cannotACPIShutdownMachine(const CConsole &console) const 720 { 721 /* Preserve error-info: */ 722 COMResult res(console); 723 /* Show the message: */ 724 message(mainWindowShown(), MessageType_Error, 725 tr("Failed to send the ACPI Power Button press event to the " 726 "virtual machine <b>%1</b>.") 727 .arg(console.GetMachine().GetName()), 728 formatErrorInfo(res)); 729 } 730 731 void UIMessageCenter::cannotPowerDownMachine(const CConsole &console) const 679 732 { 680 733 /* Preserve error-info: */ … … 685 738 .arg(console.GetMachine().GetName()), 686 739 formatErrorInfo(res)); 740 } 741 742 void UIMessageCenter::cannotPowerDownMachine(const CProgress &progress, const QString &strName) const 743 { 744 message(mainWindowShown(), MessageType_Error, 745 tr("Failed to stop the virtual machine <b>%1</b>.") 746 .arg(strName), 747 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 687 748 } 688 749 … … 742 803 } 743 804 805 void UIMessageCenter::cannotTakeSnapshot(const CConsole &console, const QString &strMachineName, QWidget *pParent /*= 0*/) const 806 { 807 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 808 tr("Failed to create a snapshot of the virtual machine <b>%1</b>.") 809 .arg(strMachineName), 810 formatErrorInfo(console)); 811 } 812 813 void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const 814 { 815 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 816 tr("Failed to create a snapshot of the virtual machine <b>%1</b>.") 817 .arg(strMachineName), 818 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 819 } 820 744 821 void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const 745 822 { … … 1387 1464 } 1388 1465 1389 void UIMessageCenter::showRuntimeError(const CConsole &console, bool fFatal, 1390 const QString &strErrorId, 1391 const QString &strErrorMsg) const 1392 { 1466 void UIMessageCenter::showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const 1467 { 1468 /* Prepare auto-confirm id: */ 1393 1469 QByteArray autoConfimId = "showRuntimeError."; 1394 1470 1471 /* Prepare variables: */ 1395 1472 CConsole console1 = console; 1396 1473 KMachineState state = console1.GetState(); … … 1398 1475 QString severity; 1399 1476 1477 // TODO: Move to Runtime UI! 1478 /* Preprocessing: */ 1400 1479 if (fFatal) 1401 1480 { 1402 /* the machine must be paused on fFatal errors*/1481 /* The machine must be paused on fFatal errors: */ 1403 1482 Assert(state == KMachineState_Paused); 1404 1483 if (state != KMachineState_Paused) 1405 1484 console1.Pause(); 1485 } 1486 1487 /* Compose type, severity, advance confirm id: */ 1488 if (fFatal) 1489 { 1406 1490 type = MessageType_Critical; 1407 1491 severity = tr("<nobr>Fatal Error</nobr>", "runtime error info"); … … 1420 1504 autoConfimId += "warning."; 1421 1505 } 1422 1506 /* Advance auto-confirm id: */ 1423 1507 autoConfimId += strErrorId.toUtf8(); 1424 1508 1509 /* Format error-details: */ 1425 1510 QString formatted("<!--EOM-->"); 1426 1427 1511 if (!strErrorMsg.isEmpty()) 1428 1512 formatted.prepend(QString("<p>%1.</p>").arg(vboxGlobal().emphasize(strErrorMsg))); 1429 1430 1513 if (!strErrorId.isEmpty()) 1431 1514 formatted += QString("<table bgcolor=#EEEEEE border=0 cellspacing=0 " … … 1434 1517 "<tr><td>%3</td><td>%4</td></tr>" 1435 1518 "</table>") 1436 .arg(tr("<nobr>Error ID: </nobr>", "runtime error info"), 1437 strErrorId) 1438 .arg(tr("Severity: ", "runtime error info"), 1439 severity); 1440 1519 .arg(tr("<nobr>Error ID: </nobr>", "runtime error info"), strErrorId) 1520 .arg(tr("Severity: ", "runtime error info"), severity); 1441 1521 if (!formatted.isEmpty()) 1442 1522 formatted = "<qt>" + formatted + "</qt>"; 1443 1523 1444 int rc = 0; 1445 1524 /* Show the message: */ 1446 1525 if (type == MessageType_Critical) 1447 1526 { 1448 rc = message(mainMachineWindowShown(), type, 1449 tr("<p>A fatal error has occurred during virtual machine execution! " 1450 "The virtual machine will be powered off. Please copy the " 1451 "following error message using the clipboard to help diagnose " 1452 "the problem:</p>"), 1453 formatted, autoConfimId.data()); 1454 1455 /* always power down after a fFatal error */ 1527 message(mainMachineWindowShown(), type, 1528 tr("<p>A fatal error has occurred during virtual machine execution! " 1529 "The virtual machine will be powered off. Please copy the following error message " 1530 "using the clipboard to help diagnose the problem:</p>"), 1531 formatted, autoConfimId.data()); 1532 } 1533 else if (type == MessageType_Error) 1534 { 1535 message(mainMachineWindowShown(), type, 1536 tr("<p>An error has occurred during virtual machine execution! " 1537 "The error details are shown below. You may try to correct the error " 1538 "and resume the virtual machine execution.</p>"), 1539 formatted, autoConfimId.data()); 1540 } 1541 else 1542 { 1543 message(mainMachineWindowShown(), type, 1544 tr("<p>The virtual machine execution may run into an error condition as described below. " 1545 "We suggest that you take an appropriate action to avert the error.</p>"), 1546 formatted, autoConfimId.data()); 1547 } 1548 1549 // TODO: Move to Runtime UI! 1550 /* Postprocessing: */ 1551 if (fFatal) 1552 { 1553 /* Power down after a fFatal error: */ 1456 1554 console1.PowerDown(); 1457 1555 } 1458 else if (type == MessageType_Error) 1459 { 1460 rc = message(mainMachineWindowShown(), type, 1461 tr("<p>An error has occurred during virtual machine execution! " 1462 "The error details are shown below. You may try to correct " 1463 "the error and resume the virtual machine " 1464 "execution.</p>"), 1465 formatted, autoConfimId.data()); 1466 } 1556 } 1557 1558 bool UIMessageCenter::warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported) 1559 { 1560 if (fHWVirtExSupported) 1561 return messageOkCancel(mainMachineWindowShown(), MessageType_Error, 1562 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is " 1563 "not operational. Your 64-bit guest will fail to detect a " 1564 "64-bit CPU and will not be able to boot.</p><p>Please ensure " 1565 "that you have enabled VT-x/AMD-V properly in the BIOS of your " 1566 "host computer.</p>"), 1567 0 /* auto-confirm id */, 1568 tr("Close VM"), tr("Continue")); 1467 1569 else 1468 { 1469 rc = message(mainMachineWindowShown(), type, 1470 tr("<p>The virtual machine execution may run into an error " 1471 "condition as described below. " 1472 "We suggest that you take " 1473 "an appropriate action to avert the error." 1474 "</p>"), 1475 formatted, autoConfimId.data()); 1476 } 1477 1478 NOREF(rc); 1479 } 1480 1481 bool UIMessageCenter::warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported) 1570 return messageOkCancel(mainMachineWindowShown(), MessageType_Error, 1571 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. " 1572 "Your 64-bit guest will fail to detect a 64-bit CPU and will " 1573 "not be able to boot."), 1574 0 /* auto-confirm id */, 1575 tr("Close VM"), tr("Continue")); 1576 } 1577 1578 bool UIMessageCenter::warnAboutVirtNotEnabledGuestRequired(bool fHWVirtExSupported) 1482 1579 { 1483 1580 if (fHWVirtExSupported) 1484 return messageOkCancel(mainWindowShown(), MessageType_Error, 1485 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is " 1486 "not operational. Your 64-bit guest will fail to detect a " 1487 "64-bit CPU and will not be able to boot.</p><p>Please ensure " 1488 "that you have enabled VT-x/AMD-V properly in the BIOS of your " 1489 "host computer.</p>"), 1490 0 /* auto-confirm id */, 1491 tr("Close VM"), tr("Continue")); 1581 return messageOkCancel(mainMachineWindowShown(), MessageType_Error, 1582 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. " 1583 "Certain guests (e.g. OS/2 and QNX) require this feature.</p>" 1584 "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"), 1585 0 /* auto-confirm id */, 1586 tr("Close VM"), tr("Continue")); 1492 1587 else 1493 return messageOkCancel(mainWindowShown(), MessageType_Error, 1494 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. " 1495 "Your 64-bit guest will fail to detect a 64-bit CPU and will " 1496 "not be able to boot."), 1497 0 /* auto-confirm id */, 1498 tr("Close VM"), tr("Continue")); 1499 } 1500 1501 bool UIMessageCenter::warnAboutVirtNotEnabledGuestRequired(bool fHWVirtExSupported) 1502 { 1503 if (fHWVirtExSupported) 1504 return messageOkCancel(mainWindowShown(), MessageType_Error, 1505 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is " 1506 "not operational. Certain guests (e.g. OS/2 and QNX) require " 1507 "this feature.</p><p>Please ensure " 1508 "that you have enabled VT-x/AMD-V properly in the BIOS of your " 1509 "host computer.</p>"), 1510 0 /* auto-confirm id */, 1511 tr("Close VM"), tr("Continue")); 1512 else 1513 return messageOkCancel(mainWindowShown(), MessageType_Error, 1514 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. " 1515 "Certain guests (e.g. OS/2 and QNX) require this feature and will " 1516 "fail to boot without it.</p>"), 1517 0 /* auto-confirm id */, 1518 tr("Close VM"), tr("Continue")); 1519 } 1520 1521 bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, 1522 const QString &strIfNames) 1588 return messageOkCancel(mainMachineWindowShown(), MessageType_Error, 1589 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. " 1590 "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"), 1591 0 /* auto-confirm id */, 1592 tr("Close VM"), tr("Continue")); 1593 } 1594 1595 bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames) 1523 1596 { 1524 1597 return messageOkCancel(mainMachineWindowShown(), MessageType_Error, 1525 tr("<p>Could not start the machine <b>%1</b> because the " 1526 "following physical network interfaces were not found:</p>" 1527 "<p><b>%2</b></p>" 1528 "<p>You can either change the machine's network " 1529 "settings or stop the machine.</p>") 1530 .arg(strMachineName) 1531 .arg(strIfNames), 1532 0 /* auto-confirm id */, 1533 tr("Change Network Settings"), 1534 tr("Close Virtual Machine")); 1535 } 1536 1537 void UIMessageCenter::cannotStartMachine(const CConsole &console) 1538 { 1539 /* preserve the current error info before calling the object again */ 1540 COMResult res(console); 1541 1542 message(mainWindowShown(), MessageType_Error, 1543 tr("Failed to start the virtual machine <b>%1</b>.") 1544 .arg(console.GetMachine().GetName()), 1545 formatErrorInfo(res)); 1546 } 1547 1548 void UIMessageCenter::cannotStartMachine(const CProgress &progress) 1549 { 1550 /* Get console: */ 1551 AssertWrapperOk(progress); 1552 CConsole console(CProgress(progress).GetInitiator()); 1553 AssertWrapperOk(console); 1554 /* Show the message: */ 1555 message( 1556 mainWindowShown(), 1557 MessageType_Error, 1558 tr("Failed to start the virtual machine <b>%1</b>.") 1559 .arg(console.GetMachine().GetName()), 1560 formatErrorInfo(progress.GetErrorInfo()) 1561 ); 1562 } 1563 1564 void UIMessageCenter::cannotPauseMachine(const CConsole &console) 1565 { 1566 /* preserve the current error info before calling the object again */ 1567 COMResult res(console); 1568 1569 message(mainWindowShown(), MessageType_Error, 1570 tr("Failed to pause the execution of the virtual machine <b>%1</b>.") 1571 .arg(console.GetMachine().GetName()), 1572 formatErrorInfo(res)); 1573 } 1574 1575 void UIMessageCenter::cannotResumeMachine(const CConsole &console) 1576 { 1577 /* preserve the current error info before calling the object again */ 1578 COMResult res(console); 1579 1580 message(mainWindowShown(), MessageType_Error, 1581 tr("Failed to resume the execution of the virtual machine <b>%1</b>.") 1582 .arg(console.GetMachine().GetName()), 1583 formatErrorInfo(res)); 1584 } 1585 1586 void UIMessageCenter::cannotACPIShutdownMachine(const CConsole &console) 1587 { 1588 /* preserve the current error info before calling the object again */ 1589 COMResult res(console); 1590 1591 message(mainWindowShown(), MessageType_Error, 1592 tr("Failed to send the ACPI Power Button press event to the " 1593 "virtual machine <b>%1</b>.") 1594 .arg(console.GetMachine().GetName()), 1595 formatErrorInfo(res)); 1596 } 1597 1598 void UIMessageCenter::cannotSaveMachineState(const CConsole &console) 1599 { 1600 /* preserve the current error info before calling the object again */ 1601 COMResult res(console); 1602 1603 message(mainWindowShown(), MessageType_Error, 1604 tr("Failed to save the state of the virtual machine <b>%1</b>.") 1605 .arg(console.GetMachine().GetName()), 1606 formatErrorInfo(res)); 1607 } 1608 1609 void UIMessageCenter::cannotSaveMachineState(const CProgress &progress) 1610 { 1611 /* Get console: */ 1612 AssertWrapperOk(progress); 1613 CConsole console(CProgress(progress).GetInitiator()); 1614 AssertWrapperOk(console); 1615 /* Show the message: */ 1616 message( 1617 mainWindowShown(), 1618 MessageType_Error, 1619 tr("Failed to save the state of the virtual machine <b>%1</b>.") 1620 .arg(console.GetMachine().GetName()), 1621 formatErrorInfo(progress.GetErrorInfo()) 1622 ); 1623 } 1624 1625 void UIMessageCenter::cannotTakeSnapshot(const CConsole &console) 1626 { 1627 /* preserve the current error info before calling the object again */ 1628 COMResult res(console); 1629 1630 message(mainWindowShown(), MessageType_Error, 1631 tr("Failed to create a snapshot of the virtual machine <b>%1</b>.") 1632 .arg(console.GetMachine().GetName()), 1633 formatErrorInfo(res)); 1634 } 1635 1636 void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress) 1637 { 1638 /* Get console: */ 1639 AssertWrapperOk(progress); 1640 CConsole console(CProgress(progress).GetInitiator()); 1641 AssertWrapperOk(console); 1642 /* Show the message: */ 1643 message( 1644 mainWindowShown(), 1645 MessageType_Error, 1646 tr("Failed to create a snapshot of the virtual machine <b>%1</b>.") 1647 .arg(console.GetMachine().GetName()), 1648 formatErrorInfo(progress.GetErrorInfo()) 1649 ); 1650 } 1651 1652 void UIMessageCenter::cannotStopMachine(const CProgress &progress) 1653 { 1654 /* Get console: */ 1655 AssertWrapperOk(progress); 1656 CConsole console(CProgress(progress).GetInitiator()); 1657 AssertWrapperOk(console); 1658 /* Show the message: */ 1659 message(mainWindowShown(), MessageType_Error, 1660 tr("Failed to stop the virtual machine <b>%1</b>.") 1661 .arg(console.GetMachine().GetName()), 1662 formatErrorInfo(progress.GetErrorInfo())); 1598 tr("<p>Could not start the machine <b>%1</b> because the following " 1599 "physical network interfaces were not found:</p><p><b>%2</b></p>" 1600 "<p>You can either change the machine's network settings or stop the machine.</p>") 1601 .arg(strMachineName) 1602 .arg(strIfNames), 1603 0 /* auto-confirm id */, 1604 tr("Change Network Settings"), tr("Close VM")); 1605 } 1606 1607 void UIMessageCenter::cannotStartMachine(const CConsole &console, const QString &strName) 1608 { 1609 message(mainMachineWindowShown(), MessageType_Error, 1610 tr("Failed to start the virtual machine <b>%1</b>.") 1611 .arg(strName), 1612 formatErrorInfo(console)); 1613 } 1614 1615 void UIMessageCenter::cannotStartMachine(const CProgress &progress, const QString &strName) 1616 { 1617 message(mainMachineWindowShown(), MessageType_Error, 1618 tr("Failed to start the virtual machine <b>%1</b>.") 1619 .arg(strName), 1620 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1663 1621 } 1664 1622 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45325 r45328 225 225 bool remindAboutInaccessibleMedia() const; 226 226 bool confirmDiscardSavedState(const QString &strNames) const; 227 bool confirmVMReset(const QString &strNames) const; 228 bool confirmVMACPIShutdown(const QString &strNames) const; 229 bool confirmVMPowerOff(const QString &strNames) const; 227 bool confirmResetMachine(const QString &strNames) const; 228 bool confirmACPIShutdownMachine(const QString &strNames) const; 229 bool confirmPowerOffMachine(const QString &strNames) const; 230 void cannotPauseMachine(const CConsole &console) const; 231 void cannotResumeMachine(const CConsole &console) const; 230 232 void cannotDiscardSavedState(const CConsole &console) const; 231 void cannotStopMachine(const CConsole &console) const; 233 void cannotSaveMachineState(const CConsole &console); 234 void cannotSaveMachineState(const CProgress &progress, const QString &strName); 235 void cannotACPIShutdownMachine(const CConsole &console) const; 236 void cannotPowerDownMachine(const CConsole &console) const; 237 void cannotPowerDownMachine(const CProgress &progress, const QString &strName) const; 232 238 233 239 /* API: Snapshot warnings: */ … … 236 242 bool warnAboutSnapshotRemovalFreeSpace(const QString &strSnapshotName, const QString &strTargetImageName, 237 243 const QString &strTargetImageMaxSize, const QString &strTargetFileSystemFree) const; 244 void cannotTakeSnapshot(const CConsole &console, const QString &strMachineName, QWidget *pParent = 0) const; 245 void cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent = 0) const; 238 246 void cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent = 0) const; 239 247 void cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent = 0) const; … … 291 299 292 300 /* API: Runtime UI warnings: */ 293 void showRuntimeError(const CConsole &console, bool fFatal, 294 const QString &strErrorId, 295 const QString &strErrorMsg) const; 301 void showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const; 296 302 bool warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported); 297 303 bool warnAboutVirtNotEnabledGuestRequired(bool fHWVirtExSupported); 298 304 bool cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames); 299 void cannotStartMachine(const CConsole &console); 300 void cannotStartMachine(const CProgress &progress); 301 void cannotPauseMachine(const CConsole &console); 302 void cannotResumeMachine(const CConsole &console); 303 void cannotACPIShutdownMachine(const CConsole &console); 304 void cannotSaveMachineState(const CConsole &console); 305 void cannotSaveMachineState(const CProgress &progress); 306 void cannotTakeSnapshot(const CConsole &console); 307 void cannotTakeSnapshot(const CProgress &progress); 308 void cannotStopMachine(const CProgress &progress); 305 void cannotStartMachine(const CConsole &console, const QString &strName); 306 void cannotStartMachine(const CProgress &progress, const QString &strName); 309 307 void cannotSendACPIToMachine(); 310 308 bool confirmInputCapture(bool *pfAutoConfirmed = NULL); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r45296 r45328 325 325 console.PowerDown(); 326 326 if (!console.isOk()) 327 msgCenter().cannot StopMachine(console);327 msgCenter().cannotPowerDownMachine(console); 328 328 } 329 329 break; … … 1025 1025 /* Show the take-snapshot progress: */ 1026 1026 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_snapshot_create_90px.png", activeMachineWindow()); 1027 if ( progress.GetResultCode() != 0)1028 msgCenter().cannotTakeSnapshot(progress );1027 if (!progress.isOk() || progress.GetResultCode() != 0) 1028 msgCenter().cannotTakeSnapshot(progress, machine.GetName(), activeMachineWindow()); 1029 1029 } 1030 1030 else 1031 msgCenter().cannotTakeSnapshot(console );1031 msgCenter().cannotTakeSnapshot(console, machine.GetName(), activeMachineWindow()); 1032 1032 } 1033 1033 } … … 1125 1125 { 1126 1126 /* Confirm/Reset current console: */ 1127 if (msgCenter().confirmVMReset(0)) 1127 CMachine machine = session().GetMachine(); 1128 if (msgCenter().confirmResetMachine(machine.GetName())) 1128 1129 session().GetConsole().Reset(); 1129 1130 1130 1131 /* TODO_NEW_CORE: On reset the additional screens didn't get a display 1131 1132 update. Emulate this for now until it get fixed. */ 1132 ulong uMonitorCount = session().GetMachine().GetMonitorCount();1133 ulong uMonitorCount = machine.GetMonitorCount(); 1133 1134 for (ulong uScreenId = 1; uScreenId < uMonitorCount; ++uScreenId) 1134 1135 machineWindows().at(uScreenId)->update(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r45314 r45328 209 209 { 210 210 if (vboxGlobal().showStartVMErrors()) 211 msgCenter().cannotStartMachine(console );211 msgCenter().cannotStartMachine(console, machine.GetName()); 212 212 closeRuntimeUI(); 213 213 return; … … 225 225 should be notified about host MachineWindow geometry change */ 226 226 adjustGuestView(); 227 228 227 } 229 228 else … … 231 230 232 231 /* Check for a progress failure: */ 233 if ( progress.GetResultCode() != 0)232 if (!progress.isOk() || progress.GetResultCode() != 0) 234 233 { 235 234 if (vboxGlobal().showStartVMErrors()) 236 msgCenter().cannotStartMachine(progress );235 msgCenter().cannotStartMachine(progress, machine.GetName()); 237 236 closeRuntimeUI(); 238 237 return; … … 282 281 /* Show the power down progress dialog */ 283 282 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png", mainMachineWindow()); 284 if ( progress.GetResultCode() != 0)285 msgCenter().cannot StopMachine(progress);283 if (!progress.isOk() || progress.GetResultCode() != 0) 284 msgCenter().cannotPowerDownMachine(progress, machine.GetName()); 286 285 /* Allow further auto-closing: */ 287 286 if (uimachine()->machineLogic()) … … 289 288 } 290 289 else 291 msgCenter().cannot StopMachine(console);290 msgCenter().cannotPowerDownMachine(console); 292 291 closeRuntimeUI(); 293 292 return; … … 324 323 ":/progress_state_save_90px.png", 325 324 machineLogic()->activeMachineWindow()); 326 if ( progress.GetResultCode() != 0)325 if (!progress.isOk() || progress.GetResultCode() != 0) 327 326 { 328 327 /* Failed in progress: */ 329 msgCenter().cannotSaveMachineState(progress );328 msgCenter().cannotSaveMachineState(progress, machine.GetName()); 330 329 return false; 331 330 } … … 406 405 { 407 406 /* Failed in progress: */ 408 msgCenter().cannot StopMachine(progress);407 msgCenter().cannotPowerDownMachine(progress, machine.GetName()); 409 408 return false; 410 409 } … … 418 417 fServerCrashed = true; 419 418 else 420 msgCenter().cannot StopMachine(console);419 msgCenter().cannotPowerDownMachine(console); 421 420 return false; 422 421 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r45290 r45328 562 562 563 563 /* Confirm reseting VM: */ 564 if (!msgCenter().confirm VMReset(machineNames.join(", ")))564 if (!msgCenter().confirmResetMachine(machineNames.join(", "))) 565 565 return; 566 566 … … 603 603 /* Get session console: */ 604 604 CConsole console = session.GetConsole(); 605 /* Save machine state: */605 /* Prepare machine state saving: */ 606 606 CProgress progress = console.SaveState(); 607 if (!console.isOk()) 608 msgCenter().cannotSaveMachineState(console); 609 else 610 { 611 /* Show the "VM saving" progress dialog: */ 607 if (console.isOk()) 608 { 609 /* Show machine state saving progress: */ 612 610 CMachine machine = session.GetMachine(); 613 611 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_save_90px.png", this); 614 if (progress.GetResultCode() != 0) 615 msgCenter().cannotSaveMachineState(progress); 616 } 612 if (!progress.isOk() || progress.GetResultCode() != 0) 613 msgCenter().cannotSaveMachineState(progress, machine.GetName()); 614 } 615 else 616 msgCenter().cannotSaveMachineState(console); 617 617 618 618 /* Unlock machine finally: */ … … 639 639 640 640 /* Confirm ACPI shutdown current VM: */ 641 if (!msgCenter().confirm VMACPIShutdown(machineNames.join(", ")))641 if (!msgCenter().confirmACPIShutdownMachine(machineNames.join(", "))) 642 642 return; 643 643 … … 654 654 /* ACPI Shutdown: */ 655 655 console.PowerButton(); 656 if (!console.isOk()) 657 msgCenter().cannotACPIShutdownMachine(console); 656 658 657 659 /* Unlock machine finally: */ … … 678 680 679 681 /* Confirm Power Off current VM: */ 680 if (!msgCenter().confirm VMPowerOff(machineNames.join(", ")))682 if (!msgCenter().confirmPowerOffMachine(machineNames.join(", "))) 681 683 return; 682 684 … … 691 693 /* Get session console: */ 692 694 CConsole console = session.GetConsole(); 693 /* Power Off: */ 694 console.PowerDown(); 695 if (!console.isOk()) 696 msgCenter().cannotStopMachine(console); 695 /* Prepare machine power down: */ 696 CProgress progress = console.PowerDown(); 697 if (console.isOk()) 698 { 699 /* Show machine power down progress: */ 700 CMachine machine = session.GetMachine(); 701 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png", this); 702 if (!progress.isOk() || progress.GetResultCode() != 0) 703 msgCenter().cannotPowerDownMachine(progress, machine.GetName()); 704 } 705 else 706 msgCenter().cannotPowerDownMachine(console); 697 707 698 708 /* Unlock machine finally: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r45314 r45328 859 859 { 860 860 /* Show the take-snapshot progress: */ 861 msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_create_90px.png", 862 msgCenter().mainWindowShown(), true); 863 if (progress.GetResultCode() != 0) 861 msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_create_90px.png"); 862 if (!progress.isOk() || progress.GetResultCode() != 0) 864 863 { 865 msgCenter().cannotTakeSnapshot(progress );864 msgCenter().cannotTakeSnapshot(progress, mMachine.GetName()); 866 865 fIsValid = false; 867 866 } … … 869 868 else 870 869 { 871 msgCenter().cannotTakeSnapshot(console );870 msgCenter().cannotTakeSnapshot(console, mMachine.GetName()); 872 871 fIsValid = false; 873 872 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r45325 r45328 88 88 if (!progress.isOk() || progress.GetResultCode() != 0) 89 89 { 90 msgCenter().cannotTakeSnapshot(progress );90 msgCenter().cannotTakeSnapshot(progress, m_machine.GetName(), this); 91 91 return false; 92 92 } … … 94 94 else 95 95 { 96 msgCenter().cannotTakeSnapshot(console );96 msgCenter().cannotTakeSnapshot(console, m_machine.GetName(), this); 97 97 return false; 98 98 }
Note:
See TracChangeset
for help on using the changeset viewer.