VirtualBox

Ignore:
Timestamp:
Apr 4, 2013 8:49:11 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Message-center cleanup (part 25): Runtime stuff.

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  
    633633}
    634634
    635 bool UIMessageCenter::confirmVMReset(const QString &strNames) const
     635bool UIMessageCenter::confirmResetMachine(const QString &strNames) const
    636636{
    637637    return messageOkCancel(mainWindowShown(), MessageType_Question,
     
    640640                              "in applications running inside it to be lost.</p>")
    641641                              .arg(strNames),
    642                            "confirmVMReset" /* auto-confirm id */,
     642                           "confirmResetMachine" /* auto-confirm id */,
    643643                           tr("Reset", "machine"));
    644644}
    645645
    646 bool UIMessageCenter::confirmVMACPIShutdown(const QString &strNames) const
     646bool UIMessageCenter::confirmACPIShutdownMachine(const QString &strNames) const
    647647{
    648648    return messageOkCancel(mainWindowShown(), MessageType_Question,
     
    650650                              "to the following virtual machines?</p><p><b>%1</b></p>")
    651651                              .arg(strNames),
    652                            "confirmVMACPIShutdown" /* auto-confirm id */,
     652                           "confirmACPIShutdownMachine" /* auto-confirm id */,
    653653                           tr("ACPI Shutdown", "machine"));
    654654}
    655655
    656 bool UIMessageCenter::confirmVMPowerOff(const QString &strNames) const
     656bool UIMessageCenter::confirmPowerOffMachine(const QString &strNames) const
    657657{
    658658    return messageOkCancel(mainWindowShown(), MessageType_Question,
     
    661661                              "running inside it to be lost.</p>")
    662662                              .arg(strNames),
    663                            "confirmVMPowerOff" /* auto-confirm id */,
     663                           "confirmPowerOffMachine" /* auto-confirm id */,
    664664                           tr("Power Off", "machine"));
     665}
     666
     667void 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
     678void 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));
    665687}
    666688
     
    676698}
    677699
    678 void UIMessageCenter::cannotStopMachine(const CConsole &console) const
     700void 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
     711void 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
     719void 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
     731void UIMessageCenter::cannotPowerDownMachine(const CConsole &console) const
    679732{
    680733    /* Preserve error-info: */
     
    685738               .arg(console.GetMachine().GetName()),
    686739            formatErrorInfo(res));
     740}
     741
     742void 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()));
    687748}
    688749
     
    742803}
    743804
     805void 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
     813void 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
    744821void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    745822{
     
    13871464}
    13881465
    1389 void UIMessageCenter::showRuntimeError(const CConsole &console, bool fFatal,
    1390                                        const QString &strErrorId,
    1391                                        const QString &strErrorMsg) const
    1392 {
     1466void UIMessageCenter::showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const
     1467{
     1468    /* Prepare auto-confirm id: */
    13931469    QByteArray autoConfimId = "showRuntimeError.";
    13941470
     1471    /* Prepare variables: */
    13951472    CConsole console1 = console;
    13961473    KMachineState state = console1.GetState();
     
    13981475    QString severity;
    13991476
     1477    // TODO: Move to Runtime UI!
     1478    /* Preprocessing: */
    14001479    if (fFatal)
    14011480    {
    1402         /* the machine must be paused on fFatal errors */
     1481        /* The machine must be paused on fFatal errors: */
    14031482        Assert(state == KMachineState_Paused);
    14041483        if (state != KMachineState_Paused)
    14051484            console1.Pause();
     1485    }
     1486
     1487    /* Compose type, severity, advance confirm id: */
     1488    if (fFatal)
     1489    {
    14061490        type = MessageType_Critical;
    14071491        severity = tr("<nobr>Fatal Error</nobr>", "runtime error info");
     
    14201504        autoConfimId += "warning.";
    14211505    }
    1422 
     1506    /* Advance auto-confirm id: */
    14231507    autoConfimId += strErrorId.toUtf8();
    14241508
     1509    /* Format error-details: */
    14251510    QString formatted("<!--EOM-->");
    1426 
    14271511    if (!strErrorMsg.isEmpty())
    14281512        formatted.prepend(QString("<p>%1.</p>").arg(vboxGlobal().emphasize(strErrorMsg)));
    1429 
    14301513    if (!strErrorId.isEmpty())
    14311514        formatted += QString("<table bgcolor=#EEEEEE border=0 cellspacing=0 "
     
    14341517                             "<tr><td>%3</td><td>%4</td></tr>"
    14351518                             "</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);
    14411521    if (!formatted.isEmpty())
    14421522        formatted = "<qt>" + formatted + "</qt>";
    14431523
    1444     int rc = 0;
    1445 
     1524    /* Show the message: */
    14461525    if (type == MessageType_Critical)
    14471526    {
    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: */
    14561554        console1.PowerDown();
    14571555    }
    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
     1558bool 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"));
    14671569    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
     1578bool UIMessageCenter::warnAboutVirtNotEnabledGuestRequired(bool fHWVirtExSupported)
    14821579{
    14831580    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"));
    14921587    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
     1595bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames)
    15231596{
    15241597    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
     1607void 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
     1615void 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()));
    16631621}
    16641622
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r45325 r45328  
    225225    bool remindAboutInaccessibleMedia() const;
    226226    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;
    230232    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;
    232238
    233239    /* API: Snapshot warnings: */
     
    236242    bool warnAboutSnapshotRemovalFreeSpace(const QString &strSnapshotName, const QString &strTargetImageName,
    237243                                           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;
    238246    void cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent = 0) const;
    239247    void cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent = 0) const;
     
    291299
    292300    /* 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;
    296302    bool warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported);
    297303    bool warnAboutVirtNotEnabledGuestRequired(bool fHWVirtExSupported);
    298304    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);
    309307    void cannotSendACPIToMachine();
    310308    bool confirmInputCapture(bool *pfAutoConfirmed = NULL);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r45296 r45328  
    325325                console.PowerDown();
    326326                if (!console.isOk())
    327                     msgCenter().cannotStopMachine(console);
     327                    msgCenter().cannotPowerDownMachine(console);
    328328            }
    329329            break;
     
    10251025                /* Show the take-snapshot progress: */
    10261026                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());
    10291029            }
    10301030            else
    1031                 msgCenter().cannotTakeSnapshot(console);
     1031                msgCenter().cannotTakeSnapshot(console, machine.GetName(), activeMachineWindow());
    10321032        }
    10331033    }
     
    11251125{
    11261126    /* Confirm/Reset current console: */
    1127     if (msgCenter().confirmVMReset(0))
     1127    CMachine machine = session().GetMachine();
     1128    if (msgCenter().confirmResetMachine(machine.GetName()))
    11281129        session().GetConsole().Reset();
    11291130
    11301131    /* TODO_NEW_CORE: On reset the additional screens didn't get a display
    11311132       update. Emulate this for now until it get fixed. */
    1132     ulong uMonitorCount = session().GetMachine().GetMonitorCount();
     1133    ulong uMonitorCount = machine.GetMonitorCount();
    11331134    for (ulong uScreenId = 1; uScreenId < uMonitorCount; ++uScreenId)
    11341135        machineWindows().at(uScreenId)->update();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r45314 r45328  
    209209    {
    210210        if (vboxGlobal().showStartVMErrors())
    211             msgCenter().cannotStartMachine(console);
     211            msgCenter().cannotStartMachine(console, machine.GetName());
    212212        closeRuntimeUI();
    213213        return;
     
    225225           should be notified about host MachineWindow geometry change */
    226226        adjustGuestView();
    227 
    228227    }
    229228    else
     
    231230
    232231    /* Check for a progress failure: */
    233     if (progress.GetResultCode() != 0)
     232    if (!progress.isOk() || progress.GetResultCode() != 0)
    234233    {
    235234        if (vboxGlobal().showStartVMErrors())
    236             msgCenter().cannotStartMachine(progress);
     235            msgCenter().cannotStartMachine(progress, machine.GetName());
    237236        closeRuntimeUI();
    238237        return;
     
    282281                /* Show the power down progress dialog */
    283282                msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png", mainMachineWindow());
    284                 if (progress.GetResultCode() != 0)
    285                     msgCenter().cannotStopMachine(progress);
     283                if (!progress.isOk() || progress.GetResultCode() != 0)
     284                    msgCenter().cannotPowerDownMachine(progress, machine.GetName());
    286285                /* Allow further auto-closing: */
    287286                if (uimachine()->machineLogic())
     
    289288            }
    290289            else
    291                 msgCenter().cannotStopMachine(console);
     290                msgCenter().cannotPowerDownMachine(console);
    292291            closeRuntimeUI();
    293292            return;
     
    324323                                            ":/progress_state_save_90px.png",
    325324                                            machineLogic()->activeMachineWindow());
    326         if (progress.GetResultCode() != 0)
     325        if (!progress.isOk() || progress.GetResultCode() != 0)
    327326        {
    328327            /* Failed in progress: */
    329             msgCenter().cannotSaveMachineState(progress);
     328            msgCenter().cannotSaveMachineState(progress, machine.GetName());
    330329            return false;
    331330        }
     
    406405        {
    407406            /* Failed in progress: */
    408             msgCenter().cannotStopMachine(progress);
     407            msgCenter().cannotPowerDownMachine(progress, machine.GetName());
    409408            return false;
    410409        }
     
    418417            fServerCrashed = true;
    419418        else
    420             msgCenter().cannotStopMachine(console);
     419            msgCenter().cannotPowerDownMachine(console);
    421420        return false;
    422421    }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r45290 r45328  
    562562
    563563    /* Confirm reseting VM: */
    564     if (!msgCenter().confirmVMReset(machineNames.join(", ")))
     564    if (!msgCenter().confirmResetMachine(machineNames.join(", ")))
    565565        return;
    566566
     
    603603        /* Get session console: */
    604604        CConsole console = session.GetConsole();
    605         /* Save machine state: */
     605        /* Prepare machine state saving: */
    606606        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: */
    612610            CMachine machine = session.GetMachine();
    613611            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);
    617617
    618618        /* Unlock machine finally: */
     
    639639
    640640    /* Confirm ACPI shutdown current VM: */
    641     if (!msgCenter().confirmVMACPIShutdown(machineNames.join(", ")))
     641    if (!msgCenter().confirmACPIShutdownMachine(machineNames.join(", ")))
    642642        return;
    643643
     
    654654        /* ACPI Shutdown: */
    655655        console.PowerButton();
     656        if (!console.isOk())
     657            msgCenter().cannotACPIShutdownMachine(console);
    656658
    657659        /* Unlock machine finally: */
     
    678680
    679681    /* Confirm Power Off current VM: */
    680     if (!msgCenter().confirmVMPowerOff(machineNames.join(", ")))
     682    if (!msgCenter().confirmPowerOffMachine(machineNames.join(", ")))
    681683        return;
    682684
     
    691693        /* Get session console: */
    692694        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);
    697707
    698708        /* Unlock machine finally: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp

    r45314 r45328  
    859859                    {
    860860                        /* 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)
    864863                        {
    865                             msgCenter().cannotTakeSnapshot(progress);
     864                            msgCenter().cannotTakeSnapshot(progress, mMachine.GetName());
    866865                            fIsValid = false;
    867866                        }
     
    869868                    else
    870869                    {
    871                         msgCenter().cannotTakeSnapshot(console);
     870                        msgCenter().cannotTakeSnapshot(console, mMachine.GetName());
    872871                        fIsValid = false;
    873872                    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp

    r45325 r45328  
    8888            if (!progress.isOk() || progress.GetResultCode() != 0)
    8989            {
    90                 msgCenter().cannotTakeSnapshot(progress);
     90                msgCenter().cannotTakeSnapshot(progress, m_machine.GetName(), this);
    9191                return false;
    9292            }
     
    9494        else
    9595        {
    96             msgCenter().cannotTakeSnapshot(console);
     96            msgCenter().cannotTakeSnapshot(console, m_machine.GetName(), this);
    9797            return false;
    9898        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette