VirtualBox

Changeset 45368 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 5, 2013 1:06:15 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Message-center: Classifying message types.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r45364 r45368  
    8686int UIMessageCenter::message(QWidget *pParent, MessageType type,
    8787                             const QString &strMessage,
    88                              const QString &strDetails /* = QString() */,
     88                             const QString &strDetails,
    8989                             const char *pcszAutoConfirmId /*= 0*/,
    9090                             int iButton1 /*= 0*/,
     
    116116}
    117117
    118 int UIMessageCenter::message(QWidget *pParent, MessageType type,
     118void UIMessageCenter::error(QWidget *pParent, MessageType type,
     119                           const QString &strMessage,
     120                           const QString &strDetails,
     121                           const char *pcszAutoConfirmId /*= 0*/) const
     122{
     123    message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
     124            AlertButton_Ok | AlertButtonOption_Default);
     125}
     126
     127bool UIMessageCenter::errorWithQuestion(QWidget *pParent, MessageType type,
     128                                        const QString &strMessage,
     129                                        const QString &strDetails,
     130                                        const char *pcszAutoConfirmId /*= 0*/,
     131                                        const QString &strOkButtonText /*= QString()*/,
     132                                        const QString &strCancelButtonText /*= QString()*/) const
     133{
     134    return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
     135                    AlertButton_Ok | AlertButtonOption_Default,
     136                    AlertButton_Cancel | AlertButtonOption_Escape,
     137                    0 /* third button */,
     138                    strOkButtonText,
     139                    strCancelButtonText,
     140                    QString() /* third button */) &
     141            AlertButtonMask) == AlertButton_Ok;
     142}
     143
     144void UIMessageCenter::alert(QWidget *pParent, MessageType type,
     145                           const QString &strMessage,
     146                           const char *pcszAutoConfirmId /*= 0*/) const
     147{
     148    error(pParent, type, strMessage, QString(), pcszAutoConfirmId);
     149}
     150
     151int UIMessageCenter::question(QWidget *pParent, MessageType type,
    119152                              const QString &strMessage,
    120                               const char *pcszAutoConfirmId,
     153                              const char *pcszAutoConfirmId/* = 0*/,
    121154                              int iButton1 /*= 0*/,
    122155                              int iButton2 /*= 0*/,
     
    130163}
    131164
    132 bool UIMessageCenter::messageOkCancel(QWidget *pParent, MessageType type,
    133                                       const QString &strMessage,
    134                                       const QString &strDetails /*= QString()*/,
    135                                       const char *pcszAutoConfirmId /*= 0*/,
    136                                       const QString &strOkButtonText /*= QString()*/,
    137                                       const QString &strCancelButtonText /*= QString()*/,
    138                                       bool fOkByDefault /*= true*/) const
    139 {
    140     /* Which button will be the default one? Ok or Cancel? */
    141     int iOkButton = fOkByDefault ? AlertButton_Ok | AlertButtonOption_Default :
    142                                    AlertButton_Ok;
    143     int iCancelButton = fOkByDefault ? AlertButton_Cancel | AlertButtonOption_Escape :
    144                                        AlertButton_Cancel | AlertButtonOption_Escape | AlertButtonOption_Default;
    145     /* Show the message wrapping main function: */
    146     return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
    147                     iOkButton, iCancelButton, 0, strOkButtonText, strCancelButtonText, QString()) &
     165bool UIMessageCenter::questionBinary(QWidget *pParent, MessageType type,
     166                                     const QString &strMessage,
     167                                     const char *pcszAutoConfirmId /*= 0*/,
     168                                     const QString &strOkButtonText /*= QString()*/,
     169                                     const QString &strCancelButtonText /*= QString()*/) const
     170{
     171    return (question(pParent, type, strMessage, pcszAutoConfirmId,
     172                     AlertButton_Ok | AlertButtonOption_Default,
     173                     AlertButton_Cancel | AlertButtonOption_Escape,
     174                     0 /* third button */,
     175                     strOkButtonText,
     176                     strCancelButtonText,
     177                     QString() /* third button */) &
    148178            AlertButtonMask) == AlertButton_Ok;
    149179}
    150180
    151 bool UIMessageCenter::messageOkCancel(QWidget *pParent, MessageType type,
    152                                       const QString &strMessage,
    153                                       const char *pcszAutoConfirmId,
    154                                       const QString &strOkButtonText /*= QString()*/,
    155                                       const QString &strCancelButtonText /*= QString()*/,
    156                                       bool fOkByDefault /*= true*/) const
    157 {
    158     return messageOkCancel(pParent, type, strMessage, QString(), pcszAutoConfirmId,
    159                            strOkButtonText, strCancelButtonText, fOkByDefault);
     181int UIMessageCenter::questionTrinary(QWidget *pParent, MessageType type,
     182                                     const QString &strMessage,
     183                                     const char *pcszAutoConfirmId /*= 0*/,
     184                                     const QString &strChoice1ButtonText /*= QString()*/,
     185                                     const QString &strChoice2ButtonText /*= QString()*/,
     186                                     const QString &strCancelButtonText /*= QString()*/) const
     187{
     188    return question(pParent, type, strMessage, pcszAutoConfirmId,
     189                    AlertButton_Choice1,
     190                    AlertButton_Choice2 | AlertButtonOption_Default,
     191                    AlertButton_Cancel | AlertButtonOption_Escape,
     192                    strChoice1ButtonText,
     193                    strChoice2ButtonText,
     194                    strCancelButtonText);
    160195}
    161196
     
    164199                                       const QString &strOptionText,
    165200                                       bool fDefaultOptionValue /* = true */,
    166                                        const QString &strDetails /* = QString() */,
    167201                                       int iButton1 /*= 0*/,
    168202                                       int iButton2 /*= 0*/,
     
    228262    if (!strButtonName3.isNull())
    229263        pBox->setButtonText(2, strButtonName3);
    230     if (!strDetails.isEmpty())
    231         pBox->setDetailsText(strDetails);
    232264
    233265    /* Show box: */
     
    331363void UIMessageCenter::warnAboutWrongUSBMounted() const
    332364{
    333     message(mainWindowShown(), MessageType_Warning,
    334             tr("You seem to have the USBFS filesystem mounted at /sys/bus/usb/drivers. "
    335                "We strongly recommend that you change this, as it is a severe mis-configuration of "
    336                "your system which could cause USB devices to fail in unexpected ways."),
    337             "checkForMountedWrongUSB");
     365    alert(mainWindowShown(), MessageType_Warning,
     366          tr("You seem to have the USBFS filesystem mounted at /sys/bus/usb/drivers. "
     367             "We strongly recommend that you change this, as it is a severe mis-configuration of "
     368             "your system which could cause USB devices to fail in unexpected ways."),
     369          "checkForMountedWrongUSB");
    338370}
    339371#endif /* RT_OS_LINUX */
     
    341373void UIMessageCenter::cannotStartSelector() const
    342374{
    343     message(0, MessageType_Critical,
    344             tr("<p>Cannot start VirtualBox Manager due to local restrictions.</p>"
    345                "<p>The application will now terminate.</p>"));
     375    alert(0, MessageType_Critical,
     376          tr("<p>Cannot start VirtualBox Manager due to local restrictions.</p>"
     377             "<p>The application will now terminate.</p>"));
    346378}
    347379
    348380void UIMessageCenter::showBETAWarning() const
    349381{
    350     message(0, MessageType_Warning,
    351             tr("You are running a prerelease version of VirtualBox. "
    352                "This version is not suitable for production use."));
     382    alert(0, MessageType_Warning,
     383          tr("You are running a prerelease version of VirtualBox. "
     384             "This version is not suitable for production use."));
    353385}
    354386
    355387void UIMessageCenter::showBEBWarning() const
    356388{
    357     message(0, MessageType_Warning,
    358             tr("You are running an EXPERIMENTAL build of VirtualBox. "
    359                "This version is not suitable for production use."));
     389    alert(0, MessageType_Warning,
     390          tr("You are running an EXPERIMENTAL build of VirtualBox. "
     391             "This version is not suitable for production use."));
    360392}
    361393
    362394void UIMessageCenter::cannotInitUserHome(const QString &strUserHome) const
    363395{
    364     message(0, MessageType_Critical,
    365             tr("<p>Failed to initialize COM because the VirtualBox global "
    366                "configuration directory <b><nobr>%1</nobr></b> is not accessible. "
    367                "Please check the permissions of this directory and of its parent directory.</p>"
    368                "<p>The application will now terminate.</p>")
    369                .arg(strUserHome),
    370             formatErrorInfo(COMErrorInfo()));
     396    error(0, MessageType_Critical,
     397          tr("<p>Failed to initialize COM because the VirtualBox global "
     398             "configuration directory <b><nobr>%1</nobr></b> is not accessible. "
     399             "Please check the permissions of this directory and of its parent directory.</p>"
     400             "<p>The application will now terminate.</p>")
     401             .arg(strUserHome),
     402          formatErrorInfo(COMErrorInfo()));
    371403}
    372404
    373405void UIMessageCenter::cannotInitCOM(HRESULT rc) const
    374406{
    375     message(0, MessageType_Critical,
    376             tr("<p>Failed to initialize COM or to find the VirtualBox COM server. "
    377                "Most likely, the VirtualBox server is not running or failed to start.</p>"
    378                "<p>The application will now terminate.</p>"),
    379             formatErrorInfo(COMErrorInfo(), rc));
     407    error(0, MessageType_Critical,
     408          tr("<p>Failed to initialize COM or to find the VirtualBox COM server. "
     409             "Most likely, the VirtualBox server is not running or failed to start.</p>"
     410             "<p>The application will now terminate.</p>"),
     411          formatErrorInfo(COMErrorInfo(), rc));
    380412}
    381413
    382414void UIMessageCenter::cannotCreateVirtualBox(const CVirtualBox &vbox) const
    383415{
    384     message(0, MessageType_Critical,
    385             tr("<p>Failed to create the VirtualBox COM object.</p>"
    386                "<p>The application will now terminate.</p>"),
    387             formatErrorInfo(vbox));
     416    error(0, MessageType_Critical,
     417          tr("<p>Failed to create the VirtualBox COM object.</p>"
     418             "<p>The application will now terminate.</p>"),
     419          formatErrorInfo(vbox));
    388420}
    389421
    390422void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const
    391423{
    392     message(0, MessageType_Error,
    393             tr("<p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>"
    394                "<p>The language will be temporarily reset to the system default language. "
    395                "Please go to the <b>Preferences</b> dialog which you can open from the <b>File</b> menu "
    396                "of the main VirtualBox window, and select one of the existing languages on the <b>Language</b> page.</p>")
    397                .arg(strLangId).arg(strNlsPath));
     424    alert(0, MessageType_Error,
     425          tr("<p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>"
     426             "<p>The language will be temporarily reset to the system default language. "
     427             "Please go to the <b>Preferences</b> dialog which you can open from the <b>File</b> menu "
     428             "of the main VirtualBox window, and select one of the existing languages on the <b>Language</b> page.</p>")
     429             .arg(strLangId).arg(strNlsPath));
    398430}
    399431
    400432void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile) const
    401433{
    402     message(0, MessageType_Error,
    403             tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. "
    404                "<p>The language will be temporarily reset to English (built-in). "
    405                "Please go to the <b>Preferences</b> dialog which you can open from the <b>File</b> menu "
    406                "of the main VirtualBox window, and select one of the existing languages on the <b>Language</b> page.</p>")
    407                .arg(strLangFile));
     434    alert(0, MessageType_Error,
     435          tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. "
     436             "<p>The language will be temporarily reset to English (built-in). "
     437             "Please go to the <b>Preferences</b> dialog which you can open from the <b>File</b> menu "
     438             "of the main VirtualBox window, and select one of the existing languages on the <b>Language</b> page.</p>")
     439             .arg(strLangFile));
    408440}
    409441
     
    412444    /* Preserve error-info: */
    413445    COMResult res(vbox);
    414     /* Show the message: */
    415     message(0, MessageType_Critical,
    416             tr("<p>Failed to load the global GUI configuration from <b><nobr>%1</nobr></b>.</p>"
    417                "<p>The application will now terminate.</p>")
    418                .arg(vbox.GetSettingsFilePath()),
    419             !res.isOk() ? formatErrorInfo(res) : QString("<!--EOM--><p>%1</p>").arg(vboxGlobal().emphasize(strError)));
     446    /* Show the error: */
     447    error(0, MessageType_Critical,
     448          tr("<p>Failed to load the global GUI configuration from <b><nobr>%1</nobr></b>.</p>"
     449             "<p>The application will now terminate.</p>")
     450             .arg(vbox.GetSettingsFilePath()),
     451          !res.isOk() ? formatErrorInfo(res) : QString("<!--EOM--><p>%1</p>").arg(vboxGlobal().emphasize(strError)));
    420452}
    421453
     
    424456    /* Preserve error-info: */
    425457    COMResult res(vbox);
    426     /* Show the message: */
    427     message(0, MessageType_Critical,
    428             tr("<p>Failed to save the global GUI configuration to <b><nobr>%1</nobr></b>.</p>"
    429                "<p>The application will now terminate.</p>")
    430                .arg(vbox.GetSettingsFilePath()),
    431             formatErrorInfo(res));
     458    /* Show the error: */
     459    error(0, MessageType_Critical,
     460          tr("<p>Failed to save the global GUI configuration to <b><nobr>%1</nobr></b>.</p>"
     461             "<p>The application will now terminate.</p>")
     462             .arg(vbox.GetSettingsFilePath()),
     463          formatErrorInfo(res));
    432464}
    433465
    434466void UIMessageCenter::cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const
    435467{
    436     message(0, MessageType_Error,
    437             tr("There is no virtual machine named <b>%1</b>.")
    438                .arg(strName),
    439             formatErrorInfo(vbox));
     468    error(0, MessageType_Error,
     469          tr("There is no virtual machine named <b>%1</b>.")
     470             .arg(strName),
     471          formatErrorInfo(vbox));
    440472}
    441473
    442474void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const QString &strId) const
    443475{
    444     message(0, MessageType_Error,
    445             tr("There is no virtual machine with id <b>%1</b>.")
    446                .arg(strId),
    447             formatErrorInfo(vbox));
     476    error(0, MessageType_Error,
     477          tr("There is no virtual machine with id <b>%1</b>.")
     478             .arg(strId),
     479          formatErrorInfo(vbox));
    448480}
    449481
    450482void UIMessageCenter::cannotOpenSession(const CSession &session) const
    451483{
    452     /* Show the message: */
    453     message(mainWindowShown(), MessageType_Error,
    454             tr("Failed to create a new session."),
    455             formatErrorInfo(session));
     484    error(mainWindowShown(), MessageType_Error,
     485          tr("Failed to create a new session."),
     486          formatErrorInfo(session));
    456487}
    457488
     
    460491    /* Preserve error-info: */
    461492    QString strErrorInfo = formatErrorInfo(machine);
    462     /* Show the message: */
    463     message(mainWindowShown(), MessageType_Error,
    464             tr("Failed to open a session for the virtual machine <b>%1</b>.")
    465                .arg(machine.GetName()),
    466             strErrorInfo);
     493    /* Show the error: */
     494    error(mainWindowShown(), MessageType_Error,
     495          tr("Failed to open a session for the virtual machine <b>%1</b>.")
     496             .arg(machine.GetName()),
     497          strErrorInfo);
    467498}
    468499
    469500void UIMessageCenter::cannotOpenSession(const CProgress &progress, const QString &strMachineName) const
    470501{
    471     message(mainWindowShown(), MessageType_Error,
    472             tr("Failed to open a session for the virtual machine <b>%1</b>.")
    473                .arg(strMachineName),
    474             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     502    error(mainWindowShown(), MessageType_Error,
     503          tr("Failed to open a session for the virtual machine <b>%1</b>.")
     504             .arg(strMachineName),
     505          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    475506}
    476507
    477508void UIMessageCenter::cannotGetMediaAccessibility(const UIMedium &medium) const
    478509{
    479     message(mainWindowShown(), MessageType_Error,
    480             tr("Failed to determine the accessibility state of the medium <nobr><b>%1</b></nobr>.")
    481                .arg(medium.location()),
    482             formatErrorInfo(medium.result()));
     510    error(mainWindowShown(), MessageType_Error,
     511          tr("Failed to determine the accessibility state of the medium <nobr><b>%1</b></nobr>.")
     512             .arg(medium.location()),
     513          formatErrorInfo(medium.result()));
    483514}
    484515
    485516void UIMessageCenter::cannotOpenURL(const QString &strUrl) const
    486517{
    487     message(mainWindowShown(), MessageType_Error,
    488             tr("Failed to open <tt>%1</tt>. "
    489                "Make sure your desktop environment can properly handle URLs of this type.")
    490                .arg(strUrl));
     518    alert(mainWindowShown(), MessageType_Error,
     519          tr("Failed to open <tt>%1</tt>. "
     520             "Make sure your desktop environment can properly handle URLs of this type.")
     521             .arg(strUrl));
    491522}
    492523
    493524void UIMessageCenter::cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath) const
    494525{
    495     message(mainWindowShown(), MessageType_Error,
    496             tr("Failed to open virtual machine located in %1.")
    497                .arg(strMachinePath),
    498             formatErrorInfo(vbox));
     526    error(mainWindowShown(), MessageType_Error,
     527          tr("Failed to open virtual machine located in %1.")
     528             .arg(strMachinePath),
     529          formatErrorInfo(vbox));
    499530}
    500531
    501532void UIMessageCenter::cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName) const
    502533{
    503     message(mainWindowShown(), MessageType_Error,
    504             tr("Failed to add virtual machine <b>%1</b> located in <i>%2</i> because its already present.")
    505                .arg(strMachineName).arg(strMachinePath));
     534    alert(mainWindowShown(), MessageType_Error,
     535          tr("Failed to add virtual machine <b>%1</b> located in <i>%2</i> because its already present.")
     536             .arg(strMachineName).arg(strMachinePath));
    506537}
    507538
    508539void UIMessageCenter::cannotResolveCollisionAutomatically(const QString &strName, const QString &strGroupName) const
    509540{
    510     message(mainWindowShown(), MessageType_Error,
    511             tr("<p>You are trying to move machine <nobr><b>%1</b></nobr> "
    512                "to group <nobr><b>%2</b></nobr> which already have sub-group <nobr><b>%1</b></nobr>.</p>"
    513                "<p>Please resolve this name-conflict and try again.</p>")
    514                .arg(strName, strGroupName));
     541    alert(mainWindowShown(), MessageType_Error,
     542          tr("<p>You are trying to move machine <nobr><b>%1</b></nobr> "
     543             "to group <nobr><b>%2</b></nobr> which already have sub-group <nobr><b>%1</b></nobr>.</p>"
     544             "<p>Please resolve this name-conflict and try again.</p>")
     545             .arg(strName, strGroupName));
    515546}
    516547
    517548bool UIMessageCenter::confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName) const
    518549{
    519     return messageOkCancel(mainWindowShown(), MessageType_Question,
    520                            tr("<p>You are trying to move group <nobr><b>%1</b></nobr> "
    521                               "to group <nobr><b>%2</b></nobr> which already have another item with the same name.</p>"
    522                               "<p>Would you like to automatically rename it?</p>")
    523                               .arg(strName, strGroupName),
    524                            0 /* auto-confirm id */,
    525                            tr("Rename"));
     550    return questionBinary(mainWindowShown(), MessageType_Question,
     551                          tr("<p>You are trying to move group <nobr><b>%1</b></nobr> "
     552                             "to group <nobr><b>%2</b></nobr> which already have another item with the same name.</p>"
     553                             "<p>Would you like to automatically rename it?</p>")
     554                             .arg(strName, strGroupName),
     555                          0 /* auto-confirm id */,
     556                          tr("Rename"));
    526557}
    527558
     
    534565    if (strName.isEmpty())
    535566        strName = QFileInfo(machine.GetSettingsFilePath()).baseName();
    536     /* Show the message: */
    537     message(mainWindowShown(), MessageType_Error,
    538             tr("Failed to set groups of the virtual machine <b>%1</b>.")
    539                .arg(strName),
    540             formatErrorInfo(res));
     567    /* Show the error: */
     568    error(mainWindowShown(), MessageType_Error,
     569          tr("Failed to set groups of the virtual machine <b>%1</b>.")
     570             .arg(strName),
     571          formatErrorInfo(res));
    541572}
    542573
    543574bool UIMessageCenter::confirmMachineItemRemoval(const QStringList &names) const
    544575{
    545     return messageOkCancel(mainWindowShown(), MessageType_Question,
    546                            tr("<p>You are about to remove following virtual machine items from the machine list:</p>"
    547                               "<p><b>%1</b></p><p>Do you wish to proceed?</p>")
    548                               .arg(names.join(", ")),
    549                            0 /* auto-confirm id */,
    550                            tr("Remove"));
     576    return questionBinary(mainWindowShown(), MessageType_Question,
     577                          tr("<p>You are about to remove following virtual machine items from the machine list:</p>"
     578                             "<p><b>%1</b></p><p>Do you wish to proceed?</p>")
     579                             .arg(names.join(", ")),
     580                          0 /* auto-confirm id */,
     581                          tr("Remove"));
    551582}
    552583
     
    616647    return cInacessibleMachineCount == machines.size() ?
    617648           message(mainWindowShown(), MessageType_Question,
    618                    strText, 0 /* auto-confirm id */,
     649                   strText, QString(),
     650                   0 /* auto-confirm id */,
    619651                   AlertButton_Ok | AlertButtonOption_Default,
    620652                   AlertButton_Cancel | AlertButtonOption_Escape,
     
    622654                   tr("Remove")) :
    623655           message(mainWindowShown(), MessageType_Question,
    624                    strText, 0 /* auto-confirm id */,
     656                   strText, QString(),
     657                   0 /* auto-confirm id */,
    625658                   AlertButton_Choice1,
    626659                   AlertButton_Choice2 | AlertButtonOption_Default,
     
    634667    /* Preserve error-info: */
    635668    COMResult res(machine);
    636     /* Show the message: */
    637     message(mainWindowShown(),
    638             MessageType_Error,
    639             tr("Failed to remove the virtual machine <b>%1</b>.")
    640                .arg(machine.GetName()),
    641             !machine.isOk() ? formatErrorInfo(machine) : formatErrorInfo(res));
     669    /* Show the error: */
     670    error(mainWindowShown(), MessageType_Error,
     671          tr("Failed to remove the virtual machine <b>%1</b>.")
     672             .arg(machine.GetName()),
     673          !machine.isOk() ? formatErrorInfo(machine) : formatErrorInfo(res));
    642674}
    643675
    644676void UIMessageCenter::cannotRemoveMachine(const CMachine &machine, const CProgress &progress) const
    645677{
    646     message(mainWindowShown(),
    647             MessageType_Error,
    648             tr("Failed to remove the virtual machine <b>%1</b>.")
    649                .arg(machine.GetName()),
    650             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     678    error(mainWindowShown(), MessageType_Error,
     679          tr("Failed to remove the virtual machine <b>%1</b>.")
     680             .arg(machine.GetName()),
     681          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    651682}
    652683
    653684bool UIMessageCenter::warnAboutInaccessibleMedia() const
    654685{
    655     return messageOkCancel(mainWindowShown(), MessageType_Warning,
    656                            tr("<p>One or more virtual hard disks, CD/DVD or "
    657                               "floppy media are not currently accessible. As a result, you will "
    658                               "not be able to operate virtual machines that use these media until "
    659                               "they become accessible later.</p>"
    660                               "<p>Press <b>Check</b> to open the Virtual Media Manager window and "
    661                               "see what media are inaccessible, or press <b>Ignore</b> to "
    662                               "ignore this message.</p>"),
    663                            "warnAboutInaccessibleMedia",
    664                            tr("Ignore"), tr("Check", "inaccessible media message box"));
     686    return questionBinary(mainWindowShown(), MessageType_Warning,
     687                          tr("<p>One or more virtual hard disks, CD/DVD or "
     688                             "floppy media are not currently accessible. As a result, you will "
     689                             "not be able to operate virtual machines that use these media until "
     690                             "they become accessible later.</p>"
     691                             "<p>Press <b>Check</b> to open the Virtual Media Manager window and "
     692                             "see what media are inaccessible, or press <b>Ignore</b> to "
     693                             "ignore this message.</p>"),
     694                          "warnAboutInaccessibleMedia",
     695                          tr("Ignore"), tr("Check", "inaccessible media message box"));
    665696}
    666697
    667698bool UIMessageCenter::confirmDiscardSavedState(const QString &strNames) const
    668699{
    669     return messageOkCancel(mainWindowShown(), MessageType_Question,
    670                            tr("<p>Are you sure you want to discard the saved state of "
    671                               "the following virtual machines?</p><p><b>%1</b></p>"
    672                               "<p>This operation is equivalent to resetting or powering off "
    673                               "the machine without doing a proper shutdown of the guest OS.</p>")
    674                               .arg(strNames),
    675                            0 /* auto-confirm id */,
    676                            tr("Discard", "saved state"));
     700    return questionBinary(mainWindowShown(), MessageType_Question,
     701                          tr("<p>Are you sure you want to discard the saved state of "
     702                             "the following virtual machines?</p><p><b>%1</b></p>"
     703                             "<p>This operation is equivalent to resetting or powering off "
     704                             "the machine without doing a proper shutdown of the guest OS.</p>")
     705                             .arg(strNames),
     706                          0 /* auto-confirm id */,
     707                          tr("Discard", "saved state"));
    677708}
    678709
    679710bool UIMessageCenter::confirmResetMachine(const QString &strNames) const
    680711{
    681     return messageOkCancel(mainWindowShown(), MessageType_Question,
    682                            tr("<p>Do you really want to reset the following virtual machines?</p>"
    683                               "<p><b>%1</b></p><p>This will cause any unsaved data "
    684                               "in applications running inside it to be lost.</p>")
    685                               .arg(strNames),
    686                            "confirmResetMachine" /* auto-confirm id */,
    687                            tr("Reset", "machine"));
     712    return questionBinary(mainWindowShown(), MessageType_Question,
     713                          tr("<p>Do you really want to reset the following virtual machines?</p>"
     714                             "<p><b>%1</b></p><p>This will cause any unsaved data "
     715                             "in applications running inside it to be lost.</p>")
     716                             .arg(strNames),
     717                          "confirmResetMachine" /* auto-confirm id */,
     718                          tr("Reset", "machine"));
    688719}
    689720
    690721bool UIMessageCenter::confirmACPIShutdownMachine(const QString &strNames) const
    691722{
    692     return messageOkCancel(mainWindowShown(), MessageType_Question,
    693                            tr("<p>Do you really want to send an ACPI shutdown signal "
    694                               "to the following virtual machines?</p><p><b>%1</b></p>")
    695                               .arg(strNames),
    696                            "confirmACPIShutdownMachine" /* auto-confirm id */,
    697                            tr("ACPI Shutdown", "machine"));
     723    return questionBinary(mainWindowShown(), MessageType_Question,
     724                          tr("<p>Do you really want to send an ACPI shutdown signal "
     725                             "to the following virtual machines?</p><p><b>%1</b></p>")
     726                             .arg(strNames),
     727                          "confirmACPIShutdownMachine" /* auto-confirm id */,
     728                          tr("ACPI Shutdown", "machine"));
    698729}
    699730
    700731bool UIMessageCenter::confirmPowerOffMachine(const QString &strNames) const
    701732{
    702     return messageOkCancel(mainWindowShown(), MessageType_Question,
    703                            tr("<p>Do you really want to power off the following virtual machines?</p>"
    704                               "<p><b>%1</b></p><p>This will cause any unsaved data in applications "
    705                               "running inside it to be lost.</p>")
    706                               .arg(strNames),
    707                            "confirmPowerOffMachine" /* auto-confirm id */,
    708                            tr("Power Off", "machine"));
     733    return questionBinary(mainWindowShown(), MessageType_Question,
     734                          tr("<p>Do you really want to power off the following virtual machines?</p>"
     735                             "<p><b>%1</b></p><p>This will cause any unsaved data in applications "
     736                             "running inside it to be lost.</p>")
     737                             .arg(strNames),
     738                          "confirmPowerOffMachine" /* auto-confirm id */,
     739                          tr("Power Off", "machine"));
    709740}
    710741
     
    713744    /* Preserve error-info: */
    714745    COMResult res(console);
    715     /* Show the message: */
    716     message(mainWindowShown(), MessageType_Error,
    717             tr("Failed to pause the execution of the virtual machine <b>%1</b>.")
    718                .arg(console.GetMachine().GetName()),
    719             formatErrorInfo(res));
     746    /* Show the error: */
     747    error(mainWindowShown(), MessageType_Error,
     748          tr("Failed to pause the execution of the virtual machine <b>%1</b>.")
     749             .arg(console.GetMachine().GetName()),
     750          formatErrorInfo(res));
    720751}
    721752
     
    724755    /* Preserve error-info: */
    725756    COMResult res(console);
    726     /* Show the message: */
    727     message(mainWindowShown(), MessageType_Error,
    728             tr("Failed to resume the execution of the virtual machine <b>%1</b>.")
    729                .arg(console.GetMachine().GetName()),
    730             formatErrorInfo(res));
     757    /* Show the error: */
     758    error(mainWindowShown(), MessageType_Error,
     759          tr("Failed to resume the execution of the virtual machine <b>%1</b>.")
     760             .arg(console.GetMachine().GetName()),
     761          formatErrorInfo(res));
    731762}
    732763
     
    735766    /* Preserve error-info: */
    736767    COMResult res(console);
    737     /* Show the message: */
    738     message(mainWindowShown(), MessageType_Error,
    739             tr("Failed to discard the saved state of the virtual machine <b>%1</b>.")
    740                .arg(console.GetMachine().GetName()),
    741             formatErrorInfo(res));
     768    /* Show the error: */
     769    error(mainWindowShown(), MessageType_Error,
     770          tr("Failed to discard the saved state of the virtual machine <b>%1</b>.")
     771             .arg(console.GetMachine().GetName()),
     772          formatErrorInfo(res));
    742773}
    743774
     
    746777    /* Preserve error-info: */
    747778    COMResult res(console);
    748     /* Show the message: */
    749     message(mainWindowShown(), MessageType_Error,
    750             tr("Failed to save the state of the virtual machine <b>%1</b>.")
    751                .arg(console.GetMachine().GetName()),
    752             formatErrorInfo(res));
     779    /* Show the error: */
     780    error(mainWindowShown(), MessageType_Error,
     781          tr("Failed to save the state of the virtual machine <b>%1</b>.")
     782             .arg(console.GetMachine().GetName()),
     783          formatErrorInfo(res));
    753784}
    754785
    755786void UIMessageCenter::cannotSaveMachineState(const CProgress &progress, const QString &strName)
    756787{
    757     message(mainWindowShown(), MessageType_Error,
    758             tr("Failed to save the state of the virtual machine <b>%1</b>.")
    759                .arg(strName),
    760             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     788    error(mainWindowShown(), MessageType_Error,
     789          tr("Failed to save the state of the virtual machine <b>%1</b>.")
     790             .arg(strName),
     791          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    761792}
    762793
     
    765796    /* Preserve error-info: */
    766797    COMResult res(console);
    767     /* Show the message: */
    768     message(mainWindowShown(), MessageType_Error,
    769             tr("Failed to send the ACPI Power Button press event to the "
    770                "virtual machine <b>%1</b>.")
    771                .arg(console.GetMachine().GetName()),
    772             formatErrorInfo(res));
     798    /* Show the error: */
     799    error(mainWindowShown(), MessageType_Error,
     800          tr("Failed to send the ACPI Power Button press event to the "
     801             "virtual machine <b>%1</b>.")
     802             .arg(console.GetMachine().GetName()),
     803          formatErrorInfo(res));
    773804}
    774805
     
    777808    /* Preserve error-info: */
    778809    COMResult res(console);
    779     /* Show the message: */
    780     message(mainWindowShown(), MessageType_Error,
    781             tr("Failed to stop the virtual machine <b>%1</b>.")
    782                .arg(console.GetMachine().GetName()),
    783             formatErrorInfo(res));
     810    /* Show the error: */
     811    error(mainWindowShown(), MessageType_Error,
     812          tr("Failed to stop the virtual machine <b>%1</b>.")
     813             .arg(console.GetMachine().GetName()),
     814          formatErrorInfo(res));
    784815}
    785816
    786817void UIMessageCenter::cannotPowerDownMachine(const CProgress &progress, const QString &strName) const
    787818{
    788     message(mainWindowShown(), MessageType_Error,
    789             tr("Failed to stop the virtual machine <b>%1</b>.")
    790                 .arg(strName),
    791             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     819    error(mainWindowShown(), MessageType_Error,
     820          tr("Failed to stop the virtual machine <b>%1</b>.")
     821              .arg(strName),
     822          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    792823}
    793824
     
    802833                             tr("Create a snapshot of the current machine state"),
    803834                             !vboxGlobal().virtualBox().GetExtraDataStringList(GUI_InvertMessageOption).contains("confirmSnapshotRestoring"),
    804                              QString() /* details */,
    805835                             AlertButton_Ok | AlertButtonOption_Default,
    806836                             AlertButton_Cancel | AlertButtonOption_Escape,
     
    810840                   tr("<p>Are you sure you want to restore snapshot <nobr><b>%1</b></nobr>?</p>")
    811841                      .arg(strSnapshotName),
     842                   QString() /* details */,
    812843                   0 /* auto-confirm id */,
    813844                   AlertButton_Ok | AlertButtonOption_Default,
     
    819850bool UIMessageCenter::confirmSnapshotRemoval(const QString &strSnapshotName) const
    820851{
    821     return messageOkCancel(mainWindowShown(), MessageType_Question,
    822                            tr("<p>Deleting the snapshot will cause the state information saved in it to be lost, and disk data spread over "
    823                               "several image files that VirtualBox has created together with the snapshot will be merged into one file. "
    824                               "This can be a lengthy process, and the information in the snapshot cannot be recovered.</p>"
    825                               "</p>Are you sure you want to delete the selected snapshot <b>%1</b>?</p>")
    826                               .arg(strSnapshotName),
    827                            0 /* auto-confirm id */,
    828                            tr("Delete"));
     852    return questionBinary(mainWindowShown(), MessageType_Question,
     853                          tr("<p>Deleting the snapshot will cause the state information saved in it to be lost, and disk data spread over "
     854                             "several image files that VirtualBox has created together with the snapshot will be merged into one file. "
     855                             "This can be a lengthy process, and the information in the snapshot cannot be recovered.</p>"
     856                             "</p>Are you sure you want to delete the selected snapshot <b>%1</b>?</p>")
     857                             .arg(strSnapshotName),
     858                          0 /* auto-confirm id */,
     859                          tr("Delete"));
    829860}
    830861
     
    834865                                                        const QString &strTargetFileSystemFree) const
    835866{
    836     return messageOkCancel(mainWindowShown(), MessageType_Question,
    837                            tr("<p>Deleting the snapshot %1 will temporarily need more disk space. In the worst case the size of image %2 will grow by %3, "
    838                                "however on this filesystem there is only %4 free.</p><p>Running out of disk space during the merge operation can result in "
    839                                "corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting "
    840                                "the snapshot at your own risk.</p>")
    841                                .arg(strSnapshotName)
    842                                .arg(strTargetImageName)
    843                                .arg(strTargetImageMaxSize)
    844                                .arg(strTargetFileSystemFree),
    845                            0 /* auto-confirm id */,
    846                            tr("Delete"));
     867    return questionBinary(mainWindowShown(), MessageType_Question,
     868                          tr("<p>Deleting the snapshot %1 will temporarily need more disk space. In the worst case the size of image %2 will grow by %3, "
     869                              "however on this filesystem there is only %4 free.</p><p>Running out of disk space during the merge operation can result in "
     870                              "corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting "
     871                              "the snapshot at your own risk.</p>")
     872                              .arg(strSnapshotName, strTargetImageName, strTargetImageMaxSize, strTargetFileSystemFree),
     873                          0 /* auto-confirm id */,
     874                          tr("Delete"));
    847875}
    848876
    849877void UIMessageCenter::cannotTakeSnapshot(const CConsole &console, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    850878{
    851     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    852             tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    853                .arg(strMachineName),
    854             formatErrorInfo(console));
     879    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     880          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
     881             .arg(strMachineName),
     882          formatErrorInfo(console));
    855883}
    856884
    857885void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    858886{
    859     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    860             tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    861                .arg(strMachineName),
    862             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     887    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     888          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
     889             .arg(strMachineName),
     890          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    863891}
    864892
    865893void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    866894{
    867     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    868             tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    869                .arg(strSnapshotName, strMachineName),
    870             formatErrorInfo(console));
     895    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     896          tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     897             .arg(strSnapshotName, strMachineName),
     898          formatErrorInfo(console));
    871899}
    872900
    873901void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    874902{
    875     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    876             tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    877                .arg(strSnapshotName, strMachineName),
    878             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     903    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     904          tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     905             .arg(strSnapshotName, strMachineName),
     906          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    879907}
    880908
    881909void UIMessageCenter::cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName) const
    882910{
    883     message(mainWindowShown(), MessageType_Error,
    884             tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    885                .arg(strSnapshotName, strMachineName),
    886             formatErrorInfo(console));
     911    error(mainWindowShown(), MessageType_Error,
     912          tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     913             .arg(strSnapshotName, strMachineName),
     914          formatErrorInfo(console));
    887915}
    888916
    889917void UIMessageCenter::cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const
    890918{
    891     message(mainWindowShown(), MessageType_Error,
    892             tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    893                .arg(strSnapshotName).arg(strMachineName),
    894             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     919    error(mainWindowShown(), MessageType_Error,
     920          tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     921             .arg(strSnapshotName).arg(strMachineName),
     922          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    895923}
    896924
    897925bool UIMessageCenter::confirmHostInterfaceRemoval(const QString &strName, QWidget *pParent /*= 0*/) const
    898926{
    899     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
    900                            tr("<p>Deleting this host-only network will remove "
    901                               "the host-only interface this network is based on. Do you want to "
    902                               "remove the (host-only network) interface <nobr><b>%1</b>?</nobr></p>"
    903                               "<p><b>Note:</b> this interface may be in use by one or more "
    904                               "virtual network adapters belonging to one of your VMs. "
    905                               "After it is removed, these adapters will no longer be usable until "
    906                               "you correct their settings by either choosing a different interface "
    907                               "name or a different adapter attachment type.</p>")
    908                               .arg(strName),
    909                            0 /* auto-confirm id */,
    910                            tr("Remove"));
     927    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     928                          tr("<p>Deleting this host-only network will remove "
     929                             "the host-only interface this network is based on. Do you want to "
     930                             "remove the (host-only network) interface <nobr><b>%1</b>?</nobr></p>"
     931                             "<p><b>Note:</b> this interface may be in use by one or more "
     932                             "virtual network adapters belonging to one of your VMs. "
     933                             "After it is removed, these adapters will no longer be usable until "
     934                             "you correct their settings by either choosing a different interface "
     935                             "name or a different adapter attachment type.</p>")
     936                             .arg(strName),
     937                          0 /* auto-confirm id */,
     938                          tr("Remove"));
    911939}
    912940
    913941void UIMessageCenter::cannotCreateHostInterface(const CHost &host, QWidget *pParent /*= 0*/)
    914942{
    915     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    916             tr("Failed to create the host network interface."),
    917             formatErrorInfo(host));
     943    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     944          tr("Failed to create the host network interface."),
     945          formatErrorInfo(host));
    918946}
    919947
    920948void UIMessageCenter::cannotCreateHostInterface(const CProgress &progress, QWidget *pParent /*= 0*/)
    921949{
    922     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    923             tr("Failed to create the host network interface."),
    924             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     950    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     951          tr("Failed to create the host network interface."),
     952          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    925953}
    926954
    927955void UIMessageCenter::cannotRemoveHostInterface(const CHost &host, const QString &strName, QWidget *pParent /*= 0*/)
    928956{
    929     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    930             tr("Failed to remove the host network interface <b>%1</b>.")
    931                .arg(strName),
    932             formatErrorInfo(host));
     957    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     958          tr("Failed to remove the host network interface <b>%1</b>.")
     959             .arg(strName),
     960          formatErrorInfo(host));
    933961}
    934962
    935963void UIMessageCenter::cannotRemoveHostInterface(const CProgress &progress, const QString &strName, QWidget *pParent /*= 0*/)
    936964{
    937     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    938             tr("Failed to remove the host network interface <b>%1</b>.")
    939                .arg(strName),
    940             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     965    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     966          tr("Failed to remove the host network interface <b>%1</b>.")
     967             .arg(strName),
     968          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    941969}
    942970
    943971void UIMessageCenter::cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent /*= 0*/) const
    944972{
    945     message(pParent ? pParent : mainWindowShown(), MessageType_Critical,
    946             tr("Failed to set global VirtualBox properties."),
    947             formatErrorInfo(properties));
     973    error(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     974          tr("Failed to set global VirtualBox properties."),
     975          formatErrorInfo(properties));
    948976}
    949977
     
    956984    if (res.rc() == E_NOTIMPL)
    957985        return;
    958     /* Show the message: */
    959     message(pParent ? pParent : mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error,
    960             tr("Failed to access the USB subsystem."),
    961             formatErrorInfo(res),
    962             "warnAboutUnaccessibleUSB");
     986    /* Show the error: */
     987    error(pParent ? pParent : mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error,
     988          tr("Failed to access the USB subsystem."),
     989          formatErrorInfo(res),
     990          "warnAboutUnaccessibleUSB");
    963991}
    964992
     
    969997    setWarningShown("warnAboutUnsupportedUSB2", true);
    970998
    971     message(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
    972             tr("<p>USB 2.0 is currently enabled for this virtual machine. "
    973                "However, this requires the <b><nobr>%1</nobr></b> to be installed.</p>"
    974                "<p>Please install the Extension Pack from the VirtualBox download site. "
    975                "After this you will be able to re-enable USB 2.0. "
    976                "It will be disabled in the meantime unless you cancel the current settings changes.</p>")
    977                .arg(strExtPackName));
     999    alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
     1000          tr("<p>USB 2.0 is currently enabled for this virtual machine. "
     1001             "However, this requires the <b><nobr>%1</nobr></b> to be installed.</p>"
     1002             "<p>Please install the Extension Pack from the VirtualBox download site. "
     1003             "After this you will be able to re-enable USB 2.0. "
     1004             "It will be disabled in the meantime unless you cancel the current settings changes.</p>")
     1005             .arg(strExtPackName));
    9781006
    9791007    setWarningShown("warnAboutUnsupportedUSB2", false);
     
    9861014        return;
    9871015    setWarningShown("warnAboutStateChange", true);
    988     /* Show the message: */
    989     message(pParent ? pParent : mainWindowShown(), MessageType_Warning,
    990             tr("The virtual machine that you are changing has been started. "
    991                "Only certain settings can be changed while a machine is running. "
    992                "All other changes will be lost if you close this window now."));
     1016    /* Show the error: */
     1017    alert(pParent ? pParent : mainWindowShown(), MessageType_Warning,
     1018          tr("The virtual machine that you are changing has been started. "
     1019             "Only certain settings can be changed while a machine is running. "
     1020             "All other changes will be lost if you close this window now."));
    9931021    /* Allow to show this async warning: */
    9941022    setWarningShown("warnAboutStateChange", false);
     
    9971025bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /*= 0*/) const
    9981026{
    999     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1000                            tr("<p>The machine settings were changed while you were editing them. "
    1001                               "You currently have unsaved setting changes.</p>"
    1002                               "<p>Would you like to reload the changed settings or to keep your own changes?</p>"),
     1027    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1028                          tr("<p>The machine settings were changed while you were editing them. "
     1029                             "You currently have unsaved setting changes.</p>"
     1030                             "<p>Would you like to reload the changed settings or to keep your own changes?</p>"),
     1031                          0 /* auto-confirm id */,
     1032                          tr("Reload settings"), tr("Keep changes"));
     1033}
     1034
     1035int UIMessageCenter::confirmHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
     1036{
     1037    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1038                           tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>"
     1039                              "<p>Would you like to create a new, empty file to hold the disk contents or select an existing one?</p>")
     1040                              .arg(strControllerName),
    10031041                           0 /* auto-confirm id */,
    1004                            tr("Reload settings"), tr("Keep changes"));
    1005 }
    1006 
    1007 int UIMessageCenter::confirmHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
    1008 {
    1009     return message(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1010                    tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>"
    1011                       "<p>Would you like to create a new, empty file to hold the disk contents or select an existing one?</p>")
    1012                       .arg(strControllerName),
    1013                    0 /* auto-confirm id */,
    1014                    AlertButton_Choice1,
    1015                    AlertButton_Choice2 | AlertButtonOption_Default,
    1016                    AlertButton_Cancel | AlertButtonOption_Escape,
    1017                    tr("Create &new disk", "add attachment routine"),
    1018                    tr("&Choose existing disk", "add attachment routine"));
     1042                           tr("Create &new disk", "add attachment routine"),
     1043                           tr("&Choose existing disk", "add attachment routine"));
    10191044}
    10201045
    10211046int UIMessageCenter::confirmOpticalAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
    10221047{
    1023     return message(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1024                    tr("<p>You are about to add a new CD/DVD drive to controller <b>%1</b>.</p>"
    1025                       "<p>Would you like to choose a virtual CD/DVD disk to put in the drive "
    1026                       "or to leave it empty for now?</p>")
    1027                       .arg(strControllerName),
    1028                    0 /* auto-confirm id */,
    1029                    AlertButton_Choice1 | AlertButtonOption_Default,
    1030                    AlertButton_Choice2,
    1031                    AlertButton_Cancel | AlertButtonOption_Escape,
    1032                    tr("&Choose disk", "add attachment routine"),
    1033                    tr("Leave &empty", "add attachment routine"));
     1048    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1049                           tr("<p>You are about to add a new CD/DVD drive to controller <b>%1</b>.</p>"
     1050                              "<p>Would you like to choose a virtual CD/DVD disk to put in the drive "
     1051                              "or to leave it empty for now?</p>")
     1052                              .arg(strControllerName),
     1053                           0 /* auto-confirm id */,
     1054                           tr("Leave &empty", "add attachment routine"),
     1055                           tr("&Choose disk", "add attachment routine"));
    10341056}
    10351057
    10361058int UIMessageCenter::confirmFloppyAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
    10371059{
    1038     return message(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1039                    tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>"
    1040                       "<p>Would you like to choose a virtual floppy disk to put in the drive "
    1041                       "or to leave it empty for now?</p>")
    1042                       .arg(strControllerName),
    1043                    0 /* auto-confirm id */,
    1044                    AlertButton_Choice1 | AlertButtonOption_Default,
    1045                    AlertButton_Choice2,
    1046                    AlertButton_Cancel | AlertButtonOption_Escape,
    1047                    tr("&Choose disk", "add attachment routine"),
    1048                    tr("Leave &empty", "add attachment routine"));
     1060    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1061                           tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>"
     1062                              "<p>Would you like to choose a virtual floppy disk to put in the drive "
     1063                              "or to leave it empty for now?</p>")
     1064                              .arg(strControllerName),
     1065                           0 /* auto-confirm id */,
     1066                           tr("Leave &empty", "add attachment routine"),
     1067                           tr("&Choose disk", "add attachment routine"));
    10491068}
    10501069
    10511070int UIMessageCenter::confirmRemovingOfLastDVDDevice(QWidget *pParent /*= 0*/) const
    10521071{
    1053     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Info,
    1054                            tr("<p>Are you sure you want to delete the CD/DVD-ROM device?</p>"
    1055                               "<p>You will not be able to mount any CDs or ISO images "
    1056                               "or install the Guest Additions without it!</p>"),
    1057                            0 /* auto-confirm id */,
    1058                            tr("&Remove", "medium"));
     1072    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Info,
     1073                          tr("<p>Are you sure you want to delete the CD/DVD-ROM device?</p>"
     1074                             "<p>You will not be able to mount any CDs or ISO images "
     1075                             "or install the Guest Additions without it!</p>"),
     1076                          0 /* auto-confirm id */,
     1077                          tr("&Remove", "medium"));
    10591078}
    10601079
     
    10871106            break;
    10881107    }
    1089     message(pParent ? pParent : mainWindowShown(), MessageType_Error, strMessage, formatErrorInfo(machine));
     1108    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1109          strMessage, formatErrorInfo(machine));
    10901110}
    10911111
    10921112void UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /*= 0*/) const
    10931113{
    1094     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1095             tr("The current port forwarding rules are not valid. "
    1096                "None of the host or guest port values may be set to zero."));
     1114    alert(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1115          tr("The current port forwarding rules are not valid. "
     1116             "None of the host or guest port values may be set to zero."));
    10971117}
    10981118
    10991119bool UIMessageCenter::confirmCancelingPortForwardingDialog(QWidget *pParent /*= 0*/) const
    11001120{
    1101     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1102                            tr("<p>There are unsaved changes in the port forwarding configuration.</p>"
    1103                               "<p>If you proceed your changes will be discarded.</p>"));
     1121    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1122                          tr("<p>There are unsaved changes in the port forwarding configuration.</p>"
     1123                             "<p>If you proceed your changes will be discarded.</p>"));
    11041124}
    11051125
     
    11081128                                               QWidget *pParent /*= 0*/)
    11091129{
    1110     message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
    1111             tr("Failed to create the shared folder <b>%1</b> (pointing to "
    1112                "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
    1113                .arg(strName, strPath, strMachineName),
    1114             formatErrorInfo(machine));
     1130    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1131          tr("Failed to create the shared folder <b>%1</b> (pointing to "
     1132             "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
     1133             .arg(strName, strPath, strMachineName),
     1134          formatErrorInfo(machine));
    11151135}
    11161136
     
    11191139                                               QWidget *pParent /*= 0*/)
    11201140{
    1121     message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
    1122             tr("Failed to create the shared folder <b>%1</b> (pointing to "
    1123                "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
    1124                .arg(strName, strPath, strMachineName),
    1125             formatErrorInfo(console));
     1141    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1142          tr("Failed to create the shared folder <b>%1</b> (pointing to "
     1143             "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
     1144             .arg(strName, strPath, strMachineName),
     1145          formatErrorInfo(console));
    11261146}
    11271147
     
    11301150                                               QWidget *pParent /*= 0*/)
    11311151{
    1132     message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
    1133             tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
    1134                "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
    1135                "<p>Please close all programs in the guest OS that "
    1136                "may be using this shared folder and try again.</p>")
    1137                .arg(strName, strPath, strMachineName),
    1138             formatErrorInfo(machine));
     1152    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1153          tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
     1154             "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
     1155             "<p>Please close all programs in the guest OS that "
     1156             "may be using this shared folder and try again.</p>")
     1157             .arg(strName, strPath, strMachineName),
     1158          formatErrorInfo(machine));
    11391159}
    11401160
     
    11431163                                               QWidget *pParent /*= 0*/)
    11441164{
    1145     message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
    1146             tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
    1147                "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
    1148                "<p>Please close all programs in the guest OS that "
    1149                "may be using this shared folder and try again.</p>")
    1150                .arg(strName, strPath, strMachineName),
    1151             formatErrorInfo(console));
     1165    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1166          tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
     1167             "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
     1168             "<p>Please close all programs in the guest OS that "
     1169             "may be using this shared folder and try again.</p>")
     1170             .arg(strName, strPath, strMachineName),
     1171          formatErrorInfo(console));
    11521172}
    11531173
     
    11561176    /* Preserve error-info: */
    11571177    COMResult res(machine);
    1158     /* Show the message: */
    1159     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1160             tr("Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.")
    1161                .arg(machine.GetName(), machine.GetSettingsFilePath()),
    1162             formatErrorInfo(res));
     1178    /* Show the error: */
     1179    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1180          tr("Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.")
     1181             .arg(machine.GetName(), machine.GetSettingsFilePath()),
     1182          formatErrorInfo(res));
    11631183}
    11641184
     
    11661186                                             QWidget *pParent /*= 0*/) const
    11671187{
    1168     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1169             tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>")
    1170                .arg(gpConverter->toString(oldMediumType)).arg(gpConverter->toString(newMediumType)),
    1171             formatErrorInfo(medium));
     1188    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1189          tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>")
     1190             .arg(gpConverter->toString(oldMediumType)).arg(gpConverter->toString(newMediumType)),
     1191          formatErrorInfo(medium));
    11721192}
    11731193
     
    11991219            break;
    12001220    }
    1201     /* Show the message: */
    1202     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1203                            strMessage.arg(medium.location(), strUsage),
    1204                            0 /* auto-confirm id */, tr("Release", "detach medium"));
     1221    /* Show the question: */
     1222    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1223                          strMessage.arg(medium.location(), strUsage),
     1224                          0 /* auto-confirm id */, tr("Release", "detach medium"));
    12051225}
    12061226
     
    12491269            break;
    12501270    }
    1251     /* Show the message: */
    1252     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1253                            strMessage.arg(medium.location()),
    1254                            "confirmMediumRemoval" /* auto-confirm id */, tr("Remove", "medium"));
     1271    /* Show the question: */
     1272    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1273                          strMessage.arg(medium.location()),
     1274                          "confirmMediumRemoval" /* auto-confirm id */, tr("Remove", "medium"));
    12551275}
    12561276
    12571277int UIMessageCenter::confirmDeleteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const
    12581278{
    1259     return message(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1260                    tr("<p>Do you want to delete the storage unit of the hard disk "
    1261                       "<nobr><b>%1</b></nobr>?</p>"
    1262                       "<p>If you select <b>Delete</b> then the specified storage unit "
    1263                       "will be permanently deleted. This operation <b>cannot be "
    1264                       "undone</b>.</p>"
    1265                       "<p>If you select <b>Keep</b> then the hard disk will be only "
    1266                       "removed from the list of known hard disks, but the storage unit "
    1267                       "will be left untouched which makes it possible to add this hard "
    1268                       "disk to the list later again.</p>")
    1269                       .arg(strLocation),
    1270                    0 /* auto-confirm id */,
    1271                    AlertButton_Choice1,
    1272                    AlertButton_Choice2 | AlertButtonOption_Default,
    1273                    AlertButton_Cancel | AlertButtonOption_Escape,
    1274                    tr("Delete", "hard disk storage"),
    1275                    tr("Keep", "hard disk storage"));
     1279    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1280                           tr("<p>Do you want to delete the storage unit of the hard disk "
     1281                              "<nobr><b>%1</b></nobr>?</p>"
     1282                              "<p>If you select <b>Delete</b> then the specified storage unit "
     1283                              "will be permanently deleted. This operation <b>cannot be "
     1284                              "undone</b>.</p>"
     1285                              "<p>If you select <b>Keep</b> then the hard disk will be only "
     1286                              "removed from the list of known hard disks, but the storage unit "
     1287                              "will be left untouched which makes it possible to add this hard "
     1288                              "disk to the list later again.</p>")
     1289                              .arg(strLocation),
     1290                           0 /* auto-confirm id */,
     1291                           tr("Delete", "hard disk storage"),
     1292                           tr("Keep", "hard disk storage"));
    12761293}
    12771294
    12781295void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const
    12791296{
    1280     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1281             tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    1282                .arg(strLocation),
    1283             formatErrorInfo(medium));
     1297    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1298          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
     1299             .arg(strLocation),
     1300          formatErrorInfo(medium));
    12841301}
    12851302
    12861303void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const
    12871304{
    1288     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1289             tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    1290                .arg(strLocation),
    1291             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1305    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1306          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
     1307             .arg(strLocation),
     1308          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    12921309}
    12931310
     
    13211338            break;
    13221339    }
    1323     /* Show the message: */
    1324     message(pParent ? pParent : mainWindowShown(), MessageType_Error, strMessage, strErrorInfo);
    1325 }
    1326 
    1327 int UIMessageCenter::cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent /*= 0*/) const
     1340    /* Show the error: */
     1341    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1342          strMessage, strErrorInfo);
     1343}
     1344
     1345bool UIMessageCenter::cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent /*= 0*/) const
    13281346{
    13291347    /* Preserve error-info: */
     
    13701388    /* Show the messsage: */
    13711389    if (fRetry)
    1372         return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
    1373                                strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
    1374                                strErrorInfo,
    1375                                0 /* Auto Confirm ID */,
    1376                                tr("Force Unmount"));
    1377     return message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1378                    strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
    1379                    strErrorInfo);
     1390        return errorWithQuestion(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1391                                 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
     1392                                 strErrorInfo,
     1393                                 0 /* Auto Confirm ID */,
     1394                                 tr("Force Unmount"));
     1395    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1396          strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
     1397          strErrorInfo);
     1398    return false;
    13801399}
    13811400
     
    14041423            break;
    14051424    }
    1406     /* Show the message: */
    1407     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1408             strMessage.arg(strLocation), formatErrorInfo(vbox));
     1425    /* Show the error: */
     1426    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1427          strMessage.arg(strLocation), formatErrorInfo(vbox));
    14091428}
    14101429
     
    14331452            break;
    14341453    }
    1435     /* Show the message: */
    1436     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1437             strMessage.arg(medium.location()), formatErrorInfo(rc));
     1454    /* Show the error: */
     1455    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1456          strMessage.arg(medium.location()), formatErrorInfo(rc));
    14381457}
    14391458
    14401459bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /*= 0*/) const
    14411460{
    1442     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Warning,
    1443                            tr("You are about to create a new virtual machine without a hard drive. "
    1444                               "You will not be able to install an operating system on the machine "
    1445                               "until you add one. In the mean time you will only be able to start the "
    1446                               "machine using a virtual optical disk or from the network."),
    1447                            0 /* auto-confirm id */,
    1448                            tr("Continue", "no hard disk attached"),
    1449                            tr("Go Back", "no hard disk attached"));
     1461    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning,
     1462                          tr("You are about to create a new virtual machine without a hard drive. "
     1463                             "You will not be able to install an operating system on the machine "
     1464                             "until you add one. In the mean time you will only be able to start the "
     1465                             "machine using a virtual optical disk or from the network."),
     1466                          0 /* auto-confirm id */,
     1467                          tr("Continue", "no hard disk attached"),
     1468                          tr("Go Back", "no hard disk attached"));
    14501469}
    14511470
    14521471void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /*= 0*/) const
    14531472{
    1454     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1455             tr("Failed to create a new virtual machine."),
    1456             formatErrorInfo(vbox));
     1473    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1474          tr("Failed to create a new virtual machine."),
     1475          formatErrorInfo(vbox));
    14571476}
    14581477
    14591478void UIMessageCenter::cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    14601479{
    1461     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1462             tr("Failed to register the virtual machine <b>%1</b>.")
    1463                .arg(strMachineName),
    1464             formatErrorInfo(vbox));
     1480    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1481          tr("Failed to register the virtual machine <b>%1</b>.")
     1482             .arg(strMachineName),
     1483          formatErrorInfo(vbox));
    14651484}
    14661485
     
    14691488    /* Preserve error-info: */
    14701489    QString strErrorInfo = formatErrorInfo(machine);
    1471     /* Show the message: */
    1472     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1473             tr("Failed to clone the virtual machine <b>%1</b>.")
    1474                .arg(machine.GetName()),
    1475             strErrorInfo);
     1490    /* Show the error: */
     1491    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1492          tr("Failed to clone the virtual machine <b>%1</b>.")
     1493             .arg(machine.GetName()),
     1494          strErrorInfo);
    14761495}
    14771496
    14781497void UIMessageCenter::cannotCreateClone(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    14791498{
    1480     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1481             tr("Failed to clone the virtual machine <b>%1</b>.")
    1482                .arg(strMachineName),
    1483             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1499    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1500          tr("Failed to clone the virtual machine <b>%1</b>.")
     1501             .arg(strMachineName),
     1502          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    14841503}
    14851504
    14861505void UIMessageCenter::cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const
    14871506{
    1488     message(pParent ? pParent : mainWindowShown(), MessageType_Info,
    1489             tr("<p>The hard disk storage unit at location <b>%1</b> already exists. "
    1490                "You cannot create a new virtual hard disk that uses this location "
    1491                "because it can be already used by another virtual hard disk.</p>"
    1492                "<p>Please specify a different location.</p>")
    1493                .arg(strLocation));
     1507    alert(pParent ? pParent : mainWindowShown(), MessageType_Info,
     1508          tr("<p>The hard disk storage unit at location <b>%1</b> already exists. "
     1509             "You cannot create a new virtual hard disk that uses this location "
     1510             "because it can be already used by another virtual hard disk.</p>"
     1511             "<p>Please specify a different location.</p>")
     1512             .arg(strLocation));
    14941513}
    14951514
    14961515void UIMessageCenter::cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation, QWidget *pParent /*= 0*/) const
    14971516{
    1498     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1499             tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    1500                .arg(strLocation),
    1501             formatErrorInfo(vbox));
     1517    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1518          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
     1519             .arg(strLocation),
     1520          formatErrorInfo(vbox));
    15021521}
    15031522
    15041523void UIMessageCenter::cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const
    15051524{
    1506     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1507             tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    1508                .arg(strLocation),
    1509             formatErrorInfo(medium));
     1525    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1526          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
     1527             .arg(strLocation),
     1528          formatErrorInfo(medium));
    15101529}
    15111530
    15121531void UIMessageCenter::cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const
    15131532{
    1514     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1515             tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    1516                .arg(strLocation),
    1517             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1533    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1534          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
     1535             .arg(strLocation),
     1536          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    15181537}
    15191538
     
    15211540{
    15221541    QFileInfo fi(strFolderName);
    1523     message(pParent ? pParent : mainWindowShown(), MessageType_Critical,
    1524             tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>"
    1525                "<p>Please check that this folder really exists and that you have permissions to remove it.</p>")
    1526                .arg(fi.fileName()));
     1542    alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     1543          tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>"
     1544             "<p>Please check that this folder really exists and that you have permissions to remove it.</p>")
     1545             .arg(fi.fileName()));
    15271546}
    15281547
     
    15301549{
    15311550    QFileInfo fi(strFolderName);
    1532     message(pParent ? pParent : mainWindowShown(), MessageType_Critical,
    1533             tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
    1534                "<p>This folder already exists and possibly belongs to another machine.</p>")
    1535                .arg(fi.fileName()).arg(fi.absolutePath()));
     1551    alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     1552          tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
     1553             "<p>This folder already exists and possibly belongs to another machine.</p>")
     1554             .arg(fi.fileName()).arg(fi.absolutePath()));
    15361555}
    15371556
     
    15391558{
    15401559    QFileInfo fi(strFolderName);
    1541     message(pParent ? pParent : mainWindowShown(), MessageType_Critical,
    1542             tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
    1543                "<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>")
    1544                .arg(fi.fileName()).arg(fi.absolutePath()));
     1560    alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     1561          tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
     1562             "<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>")
     1563             .arg(fi.fileName()).arg(fi.absolutePath()));
    15451564}
    15461565
     
    15551574    if (!strWarningInfo.isEmpty())
    15561575        strWarningInfo = "<br />" + strWarningInfo;
    1557     /* Show the message: */
    1558     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1559             tr("Failed to open/interpret appliance <b>%1</b>.")
    1560                .arg(appliance.GetPath()),
    1561             strWarningInfo + strErrorInfo);
     1576    /* Show the error: */
     1577    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1578          tr("Failed to open/interpret appliance <b>%1</b>.")
     1579             .arg(appliance.GetPath()),
     1580          strWarningInfo + strErrorInfo);
    15621581}
    15631582
    15641583void UIMessageCenter::cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const
    15651584{
    1566     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1567             tr("Failed to import appliance <b>%1</b>.")
    1568                .arg(strPath),
    1569             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1585    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1586          tr("Failed to import appliance <b>%1</b>.")
     1587             .arg(strPath),
     1588          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    15701589}
    15711590
    15721591void UIMessageCenter::cannotCheckFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const
    15731592{
    1574     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1575             tr("Failed to check files."),
    1576             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1593    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1594          tr("Failed to check files."),
     1595          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    15771596}
    15781597
    15791598void UIMessageCenter::cannotRemoveFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const
    15801599{
    1581     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1582             tr("Failed to remove file."),
    1583             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1600    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1601          tr("Failed to remove file."),
     1602          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    15841603}
    15851604
    15861605bool UIMessageCenter::confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent /*= 0*/) const
    15871606{
    1588     return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Warning,
    1589                            tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>"
    1590                               "<p>If you continue the runtime state of the exported machine(s) will be discarded. "
    1591                               "The other machine(s) will not be changed.</p>",
    1592                               "This text is never used with n == 0. Feel free to drop the %n where possible, "
    1593                               "we only included it because of problems with Qt Linguist "
    1594                               "(but the user can see how many machines are in the list and doesn't need to be told).",
    1595                               machineNames.size())
    1596                               .arg(machineNames.join(", ")),
    1597                            0 /* auto-confirm id */,
    1598                            tr("Continue"));
     1607    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning,
     1608                          tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>"
     1609                             "<p>If you continue the runtime state of the exported machine(s) will be discarded. "
     1610                             "The other machine(s) will not be changed.</p>",
     1611                             "This text is never used with n == 0. Feel free to drop the %n where possible, "
     1612                             "we only included it because of problems with Qt Linguist (but the user can see "
     1613                             "how many machines are in the list and doesn't need to be told).", machineNames.size())
     1614                             .arg(machineNames.join(", ")),
     1615                          0 /* auto-confirm id */,
     1616                          tr("Continue"));
    15991617}
    16001618
     
    16031621    /* Preserve error-info: */
    16041622    QString strErrorInfo = formatErrorInfo(appliance);
    1605     /* Show the message: */
    1606     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1607             tr("Failed to prepare the export of the appliance <b>%1</b>.")
    1608                .arg(appliance.GetPath()),
    1609             strErrorInfo);
     1623    /* Show the error: */
     1624    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1625          tr("Failed to prepare the export of the appliance <b>%1</b>.")
     1626             .arg(appliance.GetPath()),
     1627          strErrorInfo);
    16101628}
    16111629
    16121630void UIMessageCenter::cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent /*= 0*/) const
    16131631{
    1614     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1615             tr("Failed to prepare the export of the appliance <b>%1</b>.")
    1616                .arg(strPath),
    1617             formatErrorInfo(machine));
     1632    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1633          tr("Failed to prepare the export of the appliance <b>%1</b>.")
     1634             .arg(strPath),
     1635          formatErrorInfo(machine));
    16181636}
    16191637
    16201638void UIMessageCenter::cannotExportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const
    16211639{
    1622     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1623             tr("Failed to export appliance <b>%1</b>.")
    1624                .arg(strPath),
    1625             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1640    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1641          tr("Failed to export appliance <b>%1</b>.")
     1642             .arg(strPath),
     1643          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    16261644}
    16271645
    16281646void UIMessageCenter::cannotFindSnapshotByName(const CMachine &machine, const QString &strName, QWidget *pParent /*= 0*/) const
    16291647{
    1630     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    1631             tr("Can't find snapshot named <b>%1</b>.")
    1632                .arg(strName),
    1633             formatErrorInfo(machine));
     1648    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1649          tr("Can't find snapshot named <b>%1</b>.")
     1650             .arg(strName),
     1651          formatErrorInfo(machine));
    16341652}
    16351653
     
    16921710        formatted = "<qt>" + formatted + "</qt>";
    16931711
    1694     /* Show the message: */
     1712    /* Show the error: */
    16951713    if (type == MessageType_Critical)
    16961714    {
    1697         message(mainMachineWindowShown(), type,
    1698                 tr("<p>A fatal error has occurred during virtual machine execution! "
    1699                    "The virtual machine will be powered off. Please copy the following error message "
    1700                    "using the clipboard to help diagnose the problem:</p>"),
    1701                 formatted, autoConfimId.data());
     1715        error(mainMachineWindowShown(), type,
     1716              tr("<p>A fatal error has occurred during virtual machine execution! "
     1717                 "The virtual machine will be powered off. Please copy the following error message "
     1718                 "using the clipboard to help diagnose the problem:</p>"),
     1719              formatted, autoConfimId.data());
    17021720    }
    17031721    else if (type == MessageType_Error)
    17041722    {
    1705         message(mainMachineWindowShown(), type,
    1706                 tr("<p>An error has occurred during virtual machine execution! "
    1707                    "The error details are shown below. You may try to correct the error "
    1708                    "and resume the virtual machine execution.</p>"),
    1709                 formatted, autoConfimId.data());
     1723        error(mainMachineWindowShown(), type,
     1724              tr("<p>An error has occurred during virtual machine execution! "
     1725                 "The error details are shown below. You may try to correct the error "
     1726                 "and resume the virtual machine execution.</p>"),
     1727              formatted, autoConfimId.data());
    17101728    }
    17111729    else
    17121730    {
    1713         message(mainMachineWindowShown(), type,
    1714                 tr("<p>The virtual machine execution may run into an error condition as described below. "
    1715                    "We suggest that you take an appropriate action to avert the error.</p>"),
    1716                 formatted, autoConfimId.data());
     1731        error(mainMachineWindowShown(), type,
     1732              tr("<p>The virtual machine execution may run into an error condition as described below. "
     1733                 "We suggest that you take an appropriate action to avert the error.</p>"),
     1734              formatted, autoConfimId.data());
    17171735    }
    17181736
     
    17281746bool UIMessageCenter::remindAboutGuruMeditation(const QString &strLogFolder)
    17291747{
    1730     return messageOkCancel(mainMachineWindowShown(), MessageType_GuruMeditation,
    1731                            tr("<p>A critical error has occurred while running the virtual "
    1732                               "machine and the machine execution has been stopped.</p>"
    1733                               ""
    1734                               "<p>For help, please see the Community section on "
    1735                               "<a href=http://www.virtualbox.org>http://www.virtualbox.org</a> "
    1736                               "or your support contract. Please provide the contents of the "
    1737                               "log file <tt>VBox.log</tt> and the image file <tt>VBox.png</tt>, "
    1738                               "which you can find in the <nobr><b>%1</b></nobr> directory, "
    1739                               "as well as a description of what you were doing when this error happened. "
    1740                               ""
    1741                               "Note that you can also access the above files by selecting <b>Show Log</b> "
    1742                               "from the <b>Machine</b> menu of the main VirtualBox window.</p>"
    1743                               ""
    1744                               "<p>Press <b>OK</b> if you want to power off the machine "
    1745                               "or press <b>Ignore</b> if you want to leave it as is for debugging. "
    1746                               "Please note that debugging requires special knowledge and tools, "
    1747                               "so it is recommended to press <b>OK</b> now.</p>")
    1748                               .arg(strLogFolder),
    1749                            0 /* auto-confirm id */,
    1750                            QIMessageBox::tr("OK"),
    1751                            tr("Ignore"));
     1748    return questionBinary(mainMachineWindowShown(), MessageType_GuruMeditation,
     1749                          tr("<p>A critical error has occurred while running the virtual "
     1750                             "machine and the machine execution has been stopped.</p>"
     1751                             ""
     1752                             "<p>For help, please see the Community section on "
     1753                             "<a href=http://www.virtualbox.org>http://www.virtualbox.org</a> "
     1754                             "or your support contract. Please provide the contents of the "
     1755                             "log file <tt>VBox.log</tt> and the image file <tt>VBox.png</tt>, "
     1756                             "which you can find in the <nobr><b>%1</b></nobr> directory, "
     1757                             "as well as a description of what you were doing when this error happened. "
     1758                             ""
     1759                             "Note that you can also access the above files by selecting <b>Show Log</b> "
     1760                             "from the <b>Machine</b> menu of the main VirtualBox window.</p>"
     1761                             ""
     1762                             "<p>Press <b>OK</b> if you want to power off the machine "
     1763                             "or press <b>Ignore</b> if you want to leave it as is for debugging. "
     1764                             "Please note that debugging requires special knowledge and tools, "
     1765                             "so it is recommended to press <b>OK</b> now.</p>")
     1766                             .arg(strLogFolder),
     1767                          0 /* auto-confirm id */,
     1768                          QIMessageBox::tr("OK"),
     1769                          tr("Ignore"));
    17521770}
    17531771
     
    17551773{
    17561774    if (fHWVirtExSupported)
    1757         return messageOkCancel(mainMachineWindowShown(), MessageType_Error,
    1758                                tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is "
    1759                                   "not operational. Your 64-bit guest will fail to detect a "
    1760                                   "64-bit CPU and will not be able to boot.</p><p>Please ensure "
    1761                                   "that you have enabled VT-x/AMD-V properly in the BIOS of your "
    1762                                   "host computer.</p>"),
    1763                                0 /* auto-confirm id */,
    1764                                tr("Close VM"), tr("Continue"));
     1775        return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1776                              tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is "
     1777                                 "not operational. Your 64-bit guest will fail to detect a "
     1778                                 "64-bit CPU and will not be able to boot.</p><p>Please ensure "
     1779                                 "that you have enabled VT-x/AMD-V properly in the BIOS of your "
     1780                                 "host computer.</p>"),
     1781                              0 /* auto-confirm id */,
     1782                              tr("Close VM"), tr("Continue"));
    17651783    else
    1766         return messageOkCancel(mainMachineWindowShown(), MessageType_Error,
    1767                                tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
    1768                                   "Your 64-bit guest will fail to detect a 64-bit CPU and will "
    1769                                   "not be able to boot."),
    1770                                0 /* auto-confirm id */,
    1771                                tr("Close VM"), tr("Continue"));
     1784        return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1785                              tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
     1786                                 "Your 64-bit guest will fail to detect a 64-bit CPU and will "
     1787                                 "not be able to boot."),
     1788                              0 /* auto-confirm id */,
     1789                              tr("Close VM"), tr("Continue"));
    17721790}
    17731791
     
    17751793{
    17761794    if (fHWVirtExSupported)
    1777         return messageOkCancel(mainMachineWindowShown(), MessageType_Error,
    1778                                tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
    1779                                   "Certain guests (e.g. OS/2 and QNX) require this feature.</p>"
    1780                                   "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),
    1781                                0 /* auto-confirm id */,
    1782                                tr("Close VM"), tr("Continue"));
     1795        return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1796                              tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
     1797                                 "Certain guests (e.g. OS/2 and QNX) require this feature.</p>"
     1798                                 "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),
     1799                              0 /* auto-confirm id */,
     1800                              tr("Close VM"), tr("Continue"));
    17831801    else
    1784         return messageOkCancel(mainMachineWindowShown(), MessageType_Error,
    1785                                tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
    1786                                   "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"),
    1787                                0 /* auto-confirm id */,
    1788                                tr("Close VM"), tr("Continue"));
     1802        return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1803                              tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
     1804                                 "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"),
     1805                              0 /* auto-confirm id */,
     1806                              tr("Close VM"), tr("Continue"));
    17891807}
    17901808
    17911809bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames) const
    17921810{
    1793     return messageOkCancel(mainMachineWindowShown(), MessageType_Error,
    1794                            tr("<p>Could not start the machine <b>%1</b> because the following "
    1795                               "physical network interfaces were not found:</p><p><b>%2</b></p>"
    1796                               "<p>You can either change the machine's network settings or stop the machine.</p>")
    1797                               .arg(strMachineName)
    1798                               .arg(strIfNames),
    1799                            0 /* auto-confirm id */,
    1800                            tr("Change Network Settings"), tr("Close VM"));
     1811    return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1812                          tr("<p>Could not start the machine <b>%1</b> because the following "
     1813                             "physical network interfaces were not found:</p><p><b>%2</b></p>"
     1814                             "<p>You can either change the machine's network settings or stop the machine.</p>")
     1815                             .arg(strMachineName, strIfNames),
     1816                          0 /* auto-confirm id */,
     1817                          tr("Change Network Settings"), tr("Close VM"));
    18011818}
    18021819
    18031820void UIMessageCenter::cannotStartMachine(const CConsole &console, const QString &strName) const
    18041821{
    1805     message(mainMachineWindowShown(), MessageType_Error,
    1806             tr("Failed to start the virtual machine <b>%1</b>.")
    1807                .arg(strName),
    1808             formatErrorInfo(console));
     1822    error(mainMachineWindowShown(), MessageType_Error,
     1823          tr("Failed to start the virtual machine <b>%1</b>.")
     1824             .arg(strName),
     1825          formatErrorInfo(console));
    18091826}
    18101827
    18111828void UIMessageCenter::cannotStartMachine(const CProgress &progress, const QString &strName) const
    18121829{
    1813     message(mainMachineWindowShown(), MessageType_Error,
    1814             tr("Failed to start the virtual machine <b>%1</b>.")
    1815                .arg(strName),
    1816             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     1830    error(mainMachineWindowShown(), MessageType_Error,
     1831          tr("Failed to start the virtual machine <b>%1</b>.")
     1832             .arg(strName),
     1833          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    18171834}
    18181835
    18191836void UIMessageCenter::cannotSendACPIToMachine() const
    18201837{
    1821     message(mainMachineWindowShown(),  MessageType_Warning,
    1822             tr("You are trying to shut down the guest with the ACPI power button. "
    1823                "This is currently not possible because the guest does not support software shutdown."));
     1838    alert(mainMachineWindowShown(),  MessageType_Warning,
     1839          tr("You are trying to shut down the guest with the ACPI power button. "
     1840             "This is currently not possible because the guest does not support software shutdown."));
    18241841}
    18251842
    18261843bool UIMessageCenter::confirmInputCapture(bool &fAutoConfirmed) const
    18271844{
    1828     int rc = message(mainMachineWindowShown(), MessageType_Info,
    1829                      tr("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display or pressed the <b>host key</b>. "
    1830                         "This will cause the Virtual Machine to <b>capture</b> the host mouse pointer (only if the mouse pointer "
    1831                         "integration is not currently supported by the guest OS) and the keyboard, which will make them "
    1832                         "unavailable to other applications running on your host machine.</p>"
    1833                         "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the keyboard and mouse "
    1834                         "(if it is captured) and return them to normal operation. "
    1835                         "The currently assigned host key is shown on the status bar at the bottom of the Virtual Machine window, "
    1836                         "next to the&nbsp;<img src=:/hostkey_16px.png/>&nbsp;icon. "
    1837                         "This icon, together with the mouse icon placed nearby, indicate the current keyboard and mouse capture state.</p>") +
    1838                      tr("<p>The host key is currently defined as <b>%1</b>.</p>", "additional message box paragraph")
    1839                         .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
    1840                      "confirmInputCapture",
    1841                      AlertButton_Ok | AlertButtonOption_Default,
    1842                      AlertButton_Cancel | AlertButtonOption_Escape,
    1843                      0,
    1844                      tr("Capture", "do input capture"));
     1845    int rc = question(mainMachineWindowShown(), MessageType_Info,
     1846                      tr("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display or pressed the <b>host key</b>. "
     1847                         "This will cause the Virtual Machine to <b>capture</b> the host mouse pointer (only if the mouse pointer "
     1848                         "integration is not currently supported by the guest OS) and the keyboard, which will make them "
     1849                         "unavailable to other applications running on your host machine.</p>"
     1850                         "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the keyboard and mouse "
     1851                         "(if it is captured) and return them to normal operation. "
     1852                         "The currently assigned host key is shown on the status bar at the bottom of the Virtual Machine window, "
     1853                         "next to the&nbsp;<img src=:/hostkey_16px.png/>&nbsp;icon. "
     1854                         "This icon, together with the mouse icon placed nearby, indicate the current keyboard and mouse capture state.</p>") +
     1855                      tr("<p>The host key is currently defined as <b>%1</b>.</p>", "additional message box paragraph")
     1856                         .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
     1857                      "confirmInputCapture",
     1858                      AlertButton_Ok | AlertButtonOption_Default,
     1859                      AlertButton_Cancel | AlertButtonOption_Escape,
     1860                      0,
     1861                      tr("Capture", "do input capture"));
    18451862    /* Was the message auto-confirmed? */
    18461863    fAutoConfirmed = (rc & AutoConfirmed);
     
    18511868void UIMessageCenter::remindAboutAutoCapture() const
    18521869{
    1853     message(mainMachineWindowShown(), MessageType_Info,
    1854             tr("<p>You have the <b>Auto capture keyboard</b> option turned on. "
    1855                "This will cause the Virtual Machine to automatically <b>capture</b> "
    1856                "the keyboard every time the VM window is activated and make it "
    1857                "unavailable to other applications running on your host machine: "
    1858                "when the keyboard is captured, all keystrokes (including system ones "
    1859                "like Alt-Tab) will be directed to the VM.</p>"
    1860                "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the "
    1861                "keyboard and mouse (if it is captured) and return them to normal "
    1862                "operation. The currently assigned host key is shown on the status bar "
    1863                "at the bottom of the Virtual Machine window, next to the&nbsp;"
    1864                "<img src=:/hostkey_16px.png/>&nbsp;icon. This icon, together "
    1865                "with the mouse icon placed nearby, indicate the current keyboard "
    1866                "and mouse capture state.</p>") +
    1867             tr("<p>The host key is currently defined as <b>%1</b>.</p>",
    1868                "additional message box paragraph")
    1869                 .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
    1870             "remindAboutAutoCapture");
     1870    alert(mainMachineWindowShown(), MessageType_Info,
     1871          tr("<p>You have the <b>Auto capture keyboard</b> option turned on. "
     1872             "This will cause the Virtual Machine to automatically <b>capture</b> "
     1873             "the keyboard every time the VM window is activated and make it "
     1874             "unavailable to other applications running on your host machine: "
     1875             "when the keyboard is captured, all keystrokes (including system ones "
     1876             "like Alt-Tab) will be directed to the VM.</p>"
     1877             "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the "
     1878             "keyboard and mouse (if it is captured) and return them to normal "
     1879             "operation. The currently assigned host key is shown on the status bar "
     1880             "at the bottom of the Virtual Machine window, next to the&nbsp;"
     1881             "<img src=:/hostkey_16px.png/>&nbsp;icon. This icon, together "
     1882             "with the mouse icon placed nearby, indicate the current keyboard "
     1883             "and mouse capture state.</p>") +
     1884          tr("<p>The host key is currently defined as <b>%1</b>.</p>",
     1885             "additional message box paragraph")
     1886             .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
     1887          "remindAboutAutoCapture");
    18711888}
    18721889
     
    18861903    if (fSupportsAbsolute)
    18871904    {
    1888         message(mainMachineWindowShown(), MessageType_Info,
    1889                 tr("<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. "
    1890                    "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- "
    1891                    "all mouse actions you perform when the mouse pointer is over the Virtual Machine's display "
    1892                    "are directly sent to the guest OS. If the mouse is currently captured, it will be automatically uncaptured.</p>"
    1893                    "<p>The mouse icon on the status bar will look like&nbsp;<img src=:/mouse_seamless_16px.png/>&nbsp;to inform you "
    1894                    "that mouse pointer integration is supported by the guest OS and is currently turned on.</p>"
    1895                    "<p><b>Note</b>: Some applications may behave incorrectly in mouse pointer integration mode. "
    1896                    "You can always disable it for the current session (and enable it again) "
    1897                    "by selecting the corresponding action from the menu bar.</p>"),
    1898                 kNames [1] /* auto-confirm id */);
     1905        alert(mainMachineWindowShown(), MessageType_Info,
     1906              tr("<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. "
     1907                 "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- "
     1908                 "all mouse actions you perform when the mouse pointer is over the Virtual Machine's display "
     1909                 "are directly sent to the guest OS. If the mouse is currently captured, it will be automatically uncaptured.</p>"
     1910                 "<p>The mouse icon on the status bar will look like&nbsp;<img src=:/mouse_seamless_16px.png/>&nbsp;to inform you "
     1911                 "that mouse pointer integration is supported by the guest OS and is currently turned on.</p>"
     1912                 "<p><b>Note</b>: Some applications may behave incorrectly in mouse pointer integration mode. "
     1913                 "You can always disable it for the current session (and enable it again) "
     1914                 "by selecting the corresponding action from the menu bar.</p>"),
     1915              kNames [1] /* auto-confirm id */);
    18991916    }
    19001917    else
    19011918    {
    1902         message(mainMachineWindowShown(), MessageType_Info,
    1903                 tr("<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> "
    1904                    "in the current video mode. You need to capture the mouse (by clicking over the VM display "
    1905                    "or pressing the host key) in order to use the mouse inside the guest OS.</p>"),
    1906                 kNames [0] /* auto-confirm id */);
     1919        alert(mainMachineWindowShown(), MessageType_Info,
     1920              tr("<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> "
     1921                 "in the current video mode. You need to capture the mouse (by clicking over the VM display "
     1922                 "or pressing the host key) in order to use the mouse inside the guest OS.</p>"),
     1923              kNames [0] /* auto-confirm id */);
    19071924    }
    19081925
     
    19111928}
    19121929
    1913 bool UIMessageCenter::remindAboutPausedVMInput() const
    1914 {
    1915     int rc = message(mainMachineWindowShown(), MessageType_Info,
    1916                      tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and "
    1917                         "not able to see any keyboard or mouse input. If you want to "
    1918                         "continue to work inside the VM, you need to resume it by selecting the "
    1919                         "corresponding action from the menu bar.</p>"),
    1920                         "remindAboutPausedVMInput");
    1921     return !(rc & AutoConfirmed);
     1930void UIMessageCenter::remindAboutPausedVMInput() const
     1931{
     1932    alert(mainMachineWindowShown(), MessageType_Info,
     1933          tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and "
     1934             "not able to see any keyboard or mouse input. If you want to "
     1935             "continue to work inside the VM, you need to resume it by selecting the "
     1936             "corresponding action from the menu bar.</p>"),
     1937             "remindAboutPausedVMInput");
    19221938}
    19231939
    19241940bool UIMessageCenter::confirmGoingFullscreen(const QString &strHotKey) const
    19251941{
    1926     return messageOkCancel(mainMachineWindowShown(), MessageType_Info,
    1927                            tr("<p>The virtual machine window will be now switched to <b>fullscreen</b> mode. "
    1928                               "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
    1929                               "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
    1930                               "<p>Note that the main menu bar is hidden in fullscreen mode. "
    1931                               "You can access it by pressing <b>Host+Home</b>.</p>")
    1932                               .arg(strHotKey)
    1933                               .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
    1934                            "confirmGoingFullscreen",
    1935                            tr("Switch"));
     1942    return questionBinary(mainMachineWindowShown(), MessageType_Info,
     1943                          tr("<p>The virtual machine window will be now switched to <b>fullscreen</b> mode. "
     1944                             "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
     1945                             "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
     1946                             "<p>Note that the main menu bar is hidden in fullscreen mode. "
     1947                             "You can access it by pressing <b>Host+Home</b>.</p>")
     1948                             .arg(strHotKey, UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
     1949                          "confirmGoingFullscreen",
     1950                          tr("Switch"));
    19361951}
    19371952
    19381953bool UIMessageCenter::confirmGoingSeamless(const QString &strHotKey) const
    19391954{
    1940     return messageOkCancel(mainMachineWindowShown(), MessageType_Info,
    1941                            tr("<p>The virtual machine window will be now switched to <b>Seamless</b> mode. "
    1942                               "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
    1943                               "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
    1944                               "<p>Note that the main menu bar is hidden in seamless mode. "
    1945                               "You can access it by pressing <b>Host+Home</b>.</p>")
    1946                               .arg(strHotKey)
    1947                               .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
    1948                            "confirmGoingSeamless",
    1949                            tr("Switch"));
     1955    return questionBinary(mainMachineWindowShown(), MessageType_Info,
     1956                          tr("<p>The virtual machine window will be now switched to <b>Seamless</b> mode. "
     1957                             "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
     1958                             "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
     1959                             "<p>Note that the main menu bar is hidden in seamless mode. "
     1960                             "You can access it by pressing <b>Host+Home</b>.</p>")
     1961                             .arg(strHotKey, UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
     1962                          "confirmGoingSeamless",
     1963                          tr("Switch"));
    19501964}
    19511965
    19521966bool UIMessageCenter::confirmGoingScale(const QString &strHotKey) const
    19531967{
    1954     return messageOkCancel(mainMachineWindowShown(), MessageType_Info,
    1955                            tr("<p>The virtual machine window will be now switched to <b>Scale</b> mode. "
    1956                               "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
    1957                               "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
    1958                               "<p>Note that the main menu bar is hidden in scale mode. "
    1959                               "You can access it by pressing <b>Host+Home</b>.</p>")
    1960                               .arg(strHotKey)
    1961                               .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
    1962                            "confirmGoingScale",
    1963                            tr("Switch"));
     1968    return questionBinary(mainMachineWindowShown(), MessageType_Info,
     1969                          tr("<p>The virtual machine window will be now switched to <b>Scale</b> mode. "
     1970                             "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
     1971                             "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
     1972                             "<p>Note that the main menu bar is hidden in scale mode. "
     1973                             "You can access it by pressing <b>Host+Home</b>.</p>")
     1974                             .arg(strHotKey, UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
     1975                          "confirmGoingScale",
     1976                          tr("Switch"));
    19641977}
    19651978
    19661979bool UIMessageCenter::cannotEnterFullscreenMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const
    19671980{
    1968     return messageOkCancel(mainMachineWindowShown(), MessageType_Warning,
    1969                            tr("<p>Could not switch the guest display to fullscreen mode due to insufficient guest video memory.</p>"
    1970                               "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
    1971                               "<p>Press <b>Ignore</b> to switch to fullscreen mode anyway or press <b>Cancel</b> to cancel the operation.</p>")
    1972                               .arg(VBoxGlobal::formatSize(uMinVRAM)),
    1973                            0 /* auto-confirm id */,
    1974                            tr("Ignore"));
     1981    return questionBinary(mainMachineWindowShown(), MessageType_Warning,
     1982                          tr("<p>Could not switch the guest display to fullscreen mode due to insufficient guest video memory.</p>"
     1983                             "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
     1984                             "<p>Press <b>Ignore</b> to switch to fullscreen mode anyway or press <b>Cancel</b> to cancel the operation.</p>")
     1985                             .arg(VBoxGlobal::formatSize(uMinVRAM)),
     1986                          0 /* auto-confirm id */,
     1987                          tr("Ignore"));
    19751988}
    19761989
    19771990void UIMessageCenter::cannotEnterSeamlessMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const
    19781991{
    1979     message(mainMachineWindowShown(), MessageType_Error,
    1980             tr("<p>Could not enter seamless mode due to insufficient guest "
    1981                "video memory.</p>"
    1982                "<p>You should configure the virtual machine to have at "
    1983                "least <b>%1</b> of video memory.</p>")
    1984                .arg(VBoxGlobal::formatSize(uMinVRAM)));
     1992    alert(mainMachineWindowShown(), MessageType_Error,
     1993          tr("<p>Could not enter seamless mode due to insufficient guest "
     1994             "video memory.</p>"
     1995             "<p>You should configure the virtual machine to have at "
     1996             "least <b>%1</b> of video memory.</p>")
     1997             .arg(VBoxGlobal::formatSize(uMinVRAM)));
    19851998}
    19861999
    19872000bool UIMessageCenter::cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const
    19882001{
    1989     return messageOkCancel(mainMachineWindowShown(), MessageType_Warning,
    1990                            tr("<p>Could not change the guest screen to this host screen due to insufficient guest video memory.</p>"
    1991                               "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
    1992                               "<p>Press <b>Ignore</b> to switch the screen anyway or press <b>Cancel</b> to cancel the operation.</p>")
    1993                               .arg(VBoxGlobal::formatSize(uMinVRAM)),
    1994                            0 /* auto-confirm id */,
    1995                            tr("Ignore"));
     2002    return questionBinary(mainMachineWindowShown(), MessageType_Warning,
     2003                          tr("<p>Could not change the guest screen to this host screen due to insufficient guest video memory.</p>"
     2004                             "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
     2005                             "<p>Press <b>Ignore</b> to switch the screen anyway or press <b>Cancel</b> to cancel the operation.</p>")
     2006                             .arg(VBoxGlobal::formatSize(uMinVRAM)),
     2007                          0 /* auto-confirm id */,
     2008                          tr("Ignore"));
    19962009}
    19972010
    19982011void UIMessageCenter::cannotSwitchScreenInSeamless(quint64 uMinVRAM) const
    19992012{
    2000     message(mainMachineWindowShown(), MessageType_Error,
    2001             tr("<p>Could not change the guest screen to this host screen "
    2002                "due to insufficient guest video memory.</p>"
    2003                "<p>You should configure the virtual machine to have at "
    2004                "least <b>%1</b> of video memory.</p>")
    2005                .arg(VBoxGlobal::formatSize(uMinVRAM)));
    2006 }
    2007 
    2008 void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console, const QString &strDevice)
     2013    alert(mainMachineWindowShown(), MessageType_Error,
     2014          tr("<p>Could not change the guest screen to this host screen "
     2015             "due to insufficient guest video memory.</p>"
     2016             "<p>You should configure the virtual machine to have at "
     2017             "least <b>%1</b> of video memory.</p>")
     2018             .arg(VBoxGlobal::formatSize(uMinVRAM)));
     2019}
     2020
     2021void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) const
    20092022{
    20102023    /* Preserve error-info: */
    20112024    QString strErrorInfo = formatErrorInfo(console);
    2012     /* Show the message: */
    2013     message(mainMachineWindowShown(), MessageType_Error,
    2014             tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
    2015                .arg(strDevice, console.GetMachine().GetName()),
    2016             strErrorInfo);
    2017 }
    2018 
    2019 void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &error, const QString &strDevice, const QString &strMachineName)
    2020 {
    2021     message(mainMachineWindowShown(), MessageType_Error,
    2022             tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
    2023                .arg(strDevice, strMachineName),
    2024             formatErrorInfo(error));
    2025 }
    2026 
    2027 void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console, const QString &strDevice)
     2025    /* Show the error: */
     2026    error(mainMachineWindowShown(), MessageType_Error,
     2027          tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
     2028             .arg(strDevice, console.GetMachine().GetName()),
     2029          strErrorInfo);
     2030}
     2031
     2032void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const
     2033{
     2034    error(mainMachineWindowShown(), MessageType_Error,
     2035          tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
     2036             .arg(strDevice, strMachineName),
     2037          formatErrorInfo(errorInfo));
     2038}
     2039
     2040void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) const
    20282041{
    20292042    /* Preserve error-info: */
    20302043    QString strErrorInfo = formatErrorInfo(console);
    2031     /* Show the message: */
    2032     message(mainMachineWindowShown(), MessageType_Error,
    2033             tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
    2034                .arg(strDevice, console.GetMachine().GetName()),
    2035             strErrorInfo);
    2036 }
    2037 
    2038 void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &error, const QString &strDevice, const QString &strMachineName)
    2039 {
    2040     message(mainMachineWindowShown(), MessageType_Error,
    2041             tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
    2042                .arg(strDevice, strMachineName),
    2043             formatErrorInfo(error));
    2044 }
    2045 
    2046 void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent /*= 0*/)
    2047 {
    2048     message(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
    2049             tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "
    2050                "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "
    2051                "please install the Guest Additions if they are not installed, or re-install them if they are "
    2052                "not working correctly, by selecting <b>Install Guest Additions</b> from the <b>Devices</b> menu. "
    2053                "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"),
    2054             "remindAboutGuestAdditionsAreNotActive");
    2055 }
    2056 
    2057 bool UIMessageCenter::confirmCancelingAllNetworkRequests()
    2058 {
    2059     return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question,
    2060                            tr("Do you wish to cancel all current network operations?"));
    2061 }
    2062 
    2063 void UIMessageCenter::showUpdateSuccess(const QString &strVersion, const QString &strLink)
    2064 {
    2065     message(networkManagerOrMainWindowShown(), MessageType_Info,
    2066             tr("<p>A new version of VirtualBox has been released! Version <b>%1</b> is available "
    2067                "at <a href=\"http://www.virtualbox.org/\">virtualbox.org</a>.</p>"
    2068                "<p>You can download this version using the link:</p>"
    2069                "<p><a href=%2>%3</a></p>")
    2070                .arg(strVersion, strLink, strLink));
    2071 }
    2072 
    2073 void UIMessageCenter::showUpdateNotFound()
    2074 {
    2075     message(networkManagerOrMainWindowShown(), MessageType_Info,
    2076             tr("You are already running the most recent version of VirtualBox."));
    2077 }
    2078 
    2079 bool UIMessageCenter::askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion)
    2080 {
    2081     return message(mainWindowShown(), MessageType_Info,
    2082                    tr("<p>You have version %1 of the <b><nobr>%2</nobr></b> installed.</p>"
    2083                       "<p>You should download and install version %3 of this extension pack from Oracle!</p>")
    2084                       .arg(strExtPackVersion).arg(strExtPackName).arg(strVBoxVersion),
    2085                       0 /* auto-confirm id */,
    2086                       AlertButton_Ok | AlertButtonOption_Default,
    2087                       0,
    2088                       0,
    2089                       tr("Ok", "extension pack"));
     2044    /* Show the error: */
     2045    error(mainMachineWindowShown(), MessageType_Error,
     2046          tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
     2047             .arg(strDevice, console.GetMachine().GetName()),
     2048          strErrorInfo);
     2049}
     2050
     2051void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const
     2052{
     2053    error(mainMachineWindowShown(), MessageType_Error,
     2054          tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
     2055             .arg(strDevice, strMachineName),
     2056          formatErrorInfo(errorInfo));
     2057}
     2058
     2059void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent /*= 0*/) const
     2060{
     2061    alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
     2062          tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "
     2063             "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "
     2064             "please install the Guest Additions if they are not installed, or re-install them if they are "
     2065             "not working correctly, by selecting <b>Install Guest Additions</b> from the <b>Devices</b> menu. "
     2066             "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"),
     2067          "remindAboutGuestAdditionsAreNotActive");
     2068}
     2069
     2070bool UIMessageCenter::confirmCancelingAllNetworkRequests() const
     2071{
     2072    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
     2073                          tr("Do you wish to cancel all current network operations?"));
     2074}
     2075
     2076void UIMessageCenter::showUpdateSuccess(const QString &strVersion, const QString &strLink) const
     2077{
     2078    alert(networkManagerOrMainWindowShown(), MessageType_Info,
     2079          tr("<p>A new version of VirtualBox has been released! Version <b>%1</b> is available "
     2080             "at <a href=\"http://www.virtualbox.org/\">virtualbox.org</a>.</p>"
     2081             "<p>You can download this version using the link:</p>"
     2082             "<p><a href=%2>%3</a></p>")
     2083             .arg(strVersion, strLink, strLink));
     2084}
     2085
     2086void UIMessageCenter::showUpdateNotFound() const
     2087{
     2088    alert(networkManagerOrMainWindowShown(), MessageType_Info,
     2089          tr("You are already running the most recent version of VirtualBox."));
     2090}
     2091
     2092void UIMessageCenter::askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion) const
     2093{
     2094    alert(mainWindowShown(), MessageType_Info,
     2095          tr("<p>You have version %1 of the <b><nobr>%2</nobr></b> installed.</p>"
     2096             "<p>You should download and install version %3 of this extension pack from Oracle!</p>")
     2097             .arg(strExtPackVersion).arg(strExtPackName).arg(strVBoxVersion),
     2098          0 /* auto-confirm id */);
    20902099}
    20912100
    20922101bool UIMessageCenter::cannotFindGuestAdditions() const
    20932102{
    2094     return messageOkCancel(mainMachineWindowShown(), MessageType_Question,
    2095                            tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>"
    2096                               "<p>Do you wish to download this CD image from the Internet?</p>"),
    2097                            0 /* auto-confirm id */,
    2098                            tr("Download"));
     2103    return questionBinary(mainMachineWindowShown(), MessageType_Question,
     2104                          tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>"
     2105                             "<p>Do you wish to download this CD image from the Internet?</p>"),
     2106                          0 /* auto-confirm id */,
     2107                          tr("Download"));
    20992108}
    21002109
     
    21022111{
    21032112    QLocale loc(VBoxGlobal::languageId());
    2104     return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question,
    2105                            tr("<p>Are you sure you want to download the <b>VirtualBox Guest Additions</b> CD image "
    2106                               "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>")
    2107                               .arg(strUrl, loc.toString(uSize)),
    2108                            0 /* auto-confirm id */,
    2109                            tr("Download"));
     2113    return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question,
     2114                          tr("<p>Are you sure you want to download the <b>VirtualBox Guest Additions</b> CD image "
     2115                             "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>")
     2116                             .arg(strUrl, loc.toString(uSize)),
     2117                          0 /* auto-confirm id */,
     2118                          tr("Download"));
    21102119}
    21112120
    21122121void UIMessageCenter::cannotSaveGuestAdditions(const QString &strURL, const QString &strTarget) const
    21132122{
    2114     message(networkManagerOrMainMachineWindowShown(), MessageType_Error,
    2115             tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
    2116                "from <nobr><a href=\"%1\">%1</a></nobr> "
    2117                "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>"
    2118                "<p>Please choose another location for that file.</p>")
    2119                .arg(strURL, strTarget));
     2123    alert(networkManagerOrMainMachineWindowShown(), MessageType_Error,
     2124          tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
     2125             "from <nobr><a href=\"%1\">%1</a></nobr> "
     2126             "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>"
     2127             "<p>Please choose another location for that file.</p>")
     2128             .arg(strURL, strTarget));
    21202129}
    21212130
    21222131bool UIMessageCenter::proposeMountGuestAdditions(const QString &strUrl, const QString &strSrc) const
    21232132{
    2124     return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question,
    2125                            tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
    2126                               "from <nobr><a href=\"%1\">%1</a></nobr> "
    2127                               "and saved locally as <nobr><b>%2</b>.</nobr></p>"
    2128                               "<p>Do you wish to register this CD image and mount it on the virtual CD/DVD drive?</p>")
    2129                               .arg(strUrl, strSrc),
    2130                            0 /* auto-confirm id */,
    2131                            tr("Mount", "additions"));
     2133    return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question,
     2134                          tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
     2135                             "from <nobr><a href=\"%1\">%1</a></nobr> "
     2136                             "and saved locally as <nobr><b>%2</b>.</nobr></p>"
     2137                             "<p>Do you wish to register this CD image and mount it on the virtual CD/DVD drive?</p>")
     2138                             .arg(strUrl, strSrc),
     2139                          0 /* auto-confirm id */,
     2140                          tr("Mount", "additions"));
    21322141}
    21332142
    21342143void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName) const
    21352144{
    2136     message(mainMachineWindowShown(), MessageType_Error,
    2137             tr("<p>Could not insert the <b>VirtualBox Guest Additions</b> CD image into the virtual machine <b>%1</b>, "
    2138                "as the machine has no CD/DVD-ROM drives. Please add a drive using the storage page of the "
    2139                "virtual machine settings dialog.</p>")
    2140                .arg(strMachineName));
     2145    alert(mainMachineWindowShown(), MessageType_Error,
     2146          tr("<p>Could not insert the <b>VirtualBox Guest Additions</b> CD image into the virtual machine <b>%1</b>, "
     2147             "as the machine has no CD/DVD-ROM drives. Please add a drive using the storage page of the "
     2148             "virtual machine settings dialog.</p>")
     2149             .arg(strMachineName));
    21412150}
    21422151
    21432152void UIMessageCenter::cannotUpdateGuestAdditions(const CProgress &progress) const
    21442153{
    2145     message(mainMachineWindowShown(), MessageType_Error,
    2146             tr("Failed to update Guest Additions. "
    2147                "The Guest Additions installation image will be mounted to provide a manual installation."),
    2148             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     2154    error(mainMachineWindowShown(), MessageType_Error,
     2155          tr("Failed to update Guest Additions. "
     2156             "The Guest Additions installation image will be mounted to provide a manual installation."),
     2157          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    21492158}
    21502159
    21512160bool UIMessageCenter::cannotFindUserManual(const QString &strMissedLocation) const
    21522161{
    2153     return messageOkCancel(mainWindowShown(), MessageType_Question,
    2154                            tr("<p>Could not find the <b>VirtualBox User Manual</b> <nobr><b>%1</b>.</nobr></p>"
    2155                               "<p>Do you wish to download this file from the Internet?</p>")
    2156                               .arg(strMissedLocation),
    2157                            0 /* auto-confirm id */,
    2158                            tr("Download"));
     2162    return questionBinary(mainWindowShown(), MessageType_Question,
     2163                          tr("<p>Could not find the <b>VirtualBox User Manual</b> <nobr><b>%1</b>.</nobr></p>"
     2164                             "<p>Do you wish to download this file from the Internet?</p>")
     2165                             .arg(strMissedLocation),
     2166                          0 /* auto-confirm id */,
     2167                          tr("Download"));
    21592168}
    21602169
     
    21622171{
    21632172    QLocale loc(VBoxGlobal::languageId());
    2164     return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question,
    2165                            tr("<p>Are you sure you want to download the <b>VirtualBox User Manual</b> "
    2166                               "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>")
    2167                               .arg(strURL, loc.toString(uSize)),
    2168                            0 /* auto-confirm id */,
    2169                            tr("Download"));
     2173    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
     2174                          tr("<p>Are you sure you want to download the <b>VirtualBox User Manual</b> "
     2175                             "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>")
     2176                             .arg(strURL, loc.toString(uSize)),
     2177                          0 /* auto-confirm id */,
     2178                          tr("Download"));
    21702179}
    21712180
    21722181void UIMessageCenter::cannotSaveUserManual(const QString &strURL, const QString &strTarget) const
    21732182{
    2174     message(networkManagerOrMainWindowShown(), MessageType_Error,
    2175             tr("<p>The VirtualBox User Manual has been successfully downloaded "
    2176                "from <nobr><a href=\"%1\">%1</a></nobr> "
    2177                "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>"
    2178                "<p>Please choose another location for that file.</p>")
    2179                .arg(strURL, strTarget));
     2183    alert(networkManagerOrMainWindowShown(), MessageType_Error,
     2184          tr("<p>The VirtualBox User Manual has been successfully downloaded "
     2185             "from <nobr><a href=\"%1\">%1</a></nobr> "
     2186             "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>"
     2187             "<p>Please choose another location for that file.</p>")
     2188             .arg(strURL, strTarget));
    21802189}
    21812190
    21822191void UIMessageCenter::warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget) const
    21832192{
    2184     message(networkManagerOrMainWindowShown(), MessageType_Warning,
    2185             tr("<p>The VirtualBox User Manual has been successfully downloaded "
    2186                "from <nobr><a href=\"%1\">%1</a></nobr> "
    2187                "and saved locally as <nobr><b>%2</b>.</nobr></p>")
    2188                .arg(strURL, strTarget));
     2193    alert(networkManagerOrMainWindowShown(), MessageType_Warning,
     2194          tr("<p>The VirtualBox User Manual has been successfully downloaded "
     2195             "from <nobr><a href=\"%1\">%1</a></nobr> "
     2196             "and saved locally as <nobr><b>%2</b>.</nobr></p>")
     2197             .arg(strURL, strTarget));
    21892198}
    21902199
    21912200bool UIMessageCenter::warAboutOutdatedExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) const
    21922201{
    2193     return messageOkCancel(mainWindowShown(),
    2194                            MessageType_Question,
    2195                            tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>"
    2196                               "<p>Do you wish to download latest one from the Internet?</p>")
    2197                               .arg(strExtPackVersion).arg(strExtPackName),
    2198                            0 /* auto-confirm id */,
    2199                            tr("Download"));
     2202    return questionBinary(mainWindowShown(),
     2203                          MessageType_Question,
     2204                          tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>"
     2205                             "<p>Do you wish to download latest one from the Internet?</p>")
     2206                             .arg(strExtPackVersion).arg(strExtPackName),
     2207                          0 /* auto-confirm id */,
     2208                          tr("Download"));
    22002209}
    22012210
     
    22032212{
    22042213    QLocale loc(VBoxGlobal::languageId());
    2205     return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question,
    2206                            tr("<p>Are you sure you want to download the <b><nobr>%1</nobr></b> "
    2207                               "from <nobr><a href=\"%2\">%2</a></nobr> (size %3 bytes)?</p>")
    2208                               .arg(strExtPackName, strURL, loc.toString(uSize)),
    2209                            0 /* auto-confirm id */,
    2210                            tr("Download"));
     2214    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
     2215                          tr("<p>Are you sure you want to download the <b><nobr>%1</nobr></b> "
     2216                             "from <nobr><a href=\"%2\">%2</a></nobr> (size %3 bytes)?</p>")
     2217                             .arg(strExtPackName, strURL, loc.toString(uSize)),
     2218                          0 /* auto-confirm id */,
     2219                          tr("Download"));
    22112220}
    22122221
    22132222void UIMessageCenter::cannotSaveExtensionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const
    22142223{
    2215     message(networkManagerOrMainWindowShown(), MessageType_Error,
    2216             tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded "
    2217                "from <nobr><a href=\"%2\">%2</a></nobr> "
    2218                "but can't be saved locally as <nobr><b>%3</b>.</nobr></p>"
    2219                "<p>Please choose another location for that file.</p>")
    2220                .arg(strExtPackName, strFrom, strTo));
     2224    alert(networkManagerOrMainWindowShown(), MessageType_Error,
     2225          tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded "
     2226             "from <nobr><a href=\"%2\">%2</a></nobr> "
     2227             "but can't be saved locally as <nobr><b>%3</b>.</nobr></p>"
     2228             "<p>Please choose another location for that file.</p>")
     2229             .arg(strExtPackName, strFrom, strTo));
    22212230}
    22222231
    22232232bool UIMessageCenter::proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const
    22242233{
    2225     return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question,
    2226                            tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded "
    2227                               "from <nobr><a href=\"%2\">%2</a></nobr> "
    2228                               "and saved locally as <nobr><b>%3</b>.</nobr></p>"
    2229                               "<p>Do you wish to install this extension pack?</p>")
    2230                               .arg(strExtPackName, strFrom, strTo),
    2231                            0 /* auto-confirm id */,
    2232                            tr("Install", "extension pack"));
     2234    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
     2235                          tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded "
     2236                             "from <nobr><a href=\"%2\">%2</a></nobr> "
     2237                             "and saved locally as <nobr><b>%3</b>.</nobr></p>"
     2238                             "<p>Do you wish to install this extension pack?</p>")
     2239                             .arg(strExtPackName, strFrom, strTo),
     2240                          0 /* auto-confirm id */,
     2241                          tr("Install", "extension pack"));
    22332242}
    22342243
     
    22362245                                                  const QString &strPackDescription, QWidget *pParent /*= 0*/) const
    22372246{
    2238     return messageOkCancel(pParent ? pParent : mainWindowShown(),
    2239                            MessageType_Question,
    2240                            tr("<p>You are about to install a VirtualBox extension pack. "
    2241                               "Extension packs complement the functionality of VirtualBox and can contain system level software "
    2242                               "that could be potentially harmful to your system. Please review the description below and only proceed "
    2243                               "if you have obtained the extension pack from a trusted source.</p>"
    2244                               "<p><table cellpadding=0 cellspacing=0>"
    2245                               "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%1</td></tr>"
    2246                               "<tr><td><b>Version:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
    2247                               "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
    2248                               "</table></p>")
    2249                               .arg(strPackName).arg(strPackVersion).arg(strPackDescription),
    2250                            0,
    2251                            tr("Install", "extension pack"));
     2247    return questionBinary(pParent ? pParent : mainWindowShown(),
     2248                          MessageType_Question,
     2249                          tr("<p>You are about to install a VirtualBox extension pack. "
     2250                             "Extension packs complement the functionality of VirtualBox and can contain system level software "
     2251                             "that could be potentially harmful to your system. Please review the description below and only proceed "
     2252                             "if you have obtained the extension pack from a trusted source.</p>"
     2253                             "<p><table cellpadding=0 cellspacing=0>"
     2254                             "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%1</td></tr>"
     2255                             "<tr><td><b>Version:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
     2256                             "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
     2257                             "</table></p>")
     2258                             .arg(strPackName).arg(strPackVersion).arg(strPackDescription),
     2259                          0,
     2260                          tr("Install", "extension pack"));
    22522261}
    22532262
     
    22672276    int         iVerCmp = RTStrVersionCompare(ba1.constData(), ba2.constData());
    22682277
    2269     /* Show the message: */
     2278    /* Show the question: */
    22702279    bool fRc;
    22712280    if (iVerCmp > 0)
    2272         fRc = messageOkCancel(pParent ? pParent : mainWindowShown(),
    2273                               MessageType_Question,
    2274                               tr("<p>An older version of the extension pack is already installed, would you like to upgrade? "
    2275                                  "<p>%1</p>"
    2276                                  "<p><table cellpadding=0 cellspacing=0>"
    2277                                  "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
    2278                                  "<tr><td><b>New Version:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
    2279                                  "<tr><td><b>Current Version:&nbsp;&nbsp;</b></td><td>%4</td></tr>"
    2280                                  "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%5</td></tr>"
    2281                                  "</table></p>")
    2282                                  .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),
    2283                               0,
    2284                               tr("&Upgrade"));
     2281        fRc = questionBinary(pParent ? pParent : mainWindowShown(),
     2282                             MessageType_Question,
     2283                             tr("<p>An older version of the extension pack is already installed, would you like to upgrade? "
     2284                                "<p>%1</p>"
     2285                                "<p><table cellpadding=0 cellspacing=0>"
     2286                                "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
     2287                                "<tr><td><b>New Version:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
     2288                                "<tr><td><b>Current Version:&nbsp;&nbsp;</b></td><td>%4</td></tr>"
     2289                                "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%5</td></tr>"
     2290                                "</table></p>")
     2291                                .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),
     2292                             0,
     2293                             tr("&Upgrade"));
    22852294    else if (iVerCmp < 0)
    2286         fRc = messageOkCancel(pParent ? pParent : mainWindowShown(),
    2287                               MessageType_Question,
    2288                               tr("<p>An newer version of the extension pack is already installed, would you like to downgrade? "
    2289                                  "<p>%1</p>"
    2290                                  "<p><table cellpadding=0 cellspacing=0>"
    2291                                  "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
    2292                                  "<tr><td><b>New Version:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
    2293                                  "<tr><td><b>Current Version:&nbsp;&nbsp;</b></td><td>%4</td></tr>"
    2294                                  "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%5</td></tr>"
    2295                                  "</table></p>")
    2296                                  .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),
    2297                               0,
    2298                               tr("&Downgrade"));
     2295        fRc = questionBinary(pParent ? pParent : mainWindowShown(),
     2296                             MessageType_Question,
     2297                             tr("<p>An newer version of the extension pack is already installed, would you like to downgrade? "
     2298                                "<p>%1</p>"
     2299                                "<p><table cellpadding=0 cellspacing=0>"
     2300                                "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
     2301                                "<tr><td><b>New Version:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
     2302                                "<tr><td><b>Current Version:&nbsp;&nbsp;</b></td><td>%4</td></tr>"
     2303                                "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%5</td></tr>"
     2304                                "</table></p>")
     2305                                .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),
     2306                             0,
     2307                             tr("&Downgrade"));
    22992308    else
    2300         fRc = messageOkCancel(pParent ? pParent : mainWindowShown(),
    2301                               MessageType_Question,
    2302                               tr("<p>The extension pack is already installed with the same version, would you like reinstall it? "
    2303                                  "<p>%1</p>"
    2304                                  "<p><table cellpadding=0 cellspacing=0>"
    2305                                  "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
    2306                                  "<tr><td><b>Version:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
    2307                                  "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%4</td></tr>"
    2308                                  "</table></p>")
    2309                                  .arg(strBelehrung).arg(strPackName).arg(strPackVersionOld).arg(strPackDescription),
    2310                               0,
    2311                               tr("&Reinstall"));
     2309        fRc = questionBinary(pParent ? pParent : mainWindowShown(),
     2310                             MessageType_Question,
     2311                             tr("<p>The extension pack is already installed with the same version, would you like reinstall it? "
     2312                                "<p>%1</p>"
     2313                                "<p><table cellpadding=0 cellspacing=0>"
     2314                                "<tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%2</td></tr>"
     2315                                "<tr><td><b>Version:&nbsp;&nbsp;</b></td><td>%3</td></tr>"
     2316                                "<tr><td><b>Description:&nbsp;&nbsp;</b></td><td>%4</td></tr>"
     2317                                "</table></p>")
     2318                                .arg(strBelehrung).arg(strPackName).arg(strPackVersionOld).arg(strPackDescription),
     2319                             0,
     2320                             tr("&Reinstall"));
    23122321    return fRc;
    23132322}
     
    23152324bool UIMessageCenter::confirmRemoveExtensionPack(const QString &strPackName, QWidget *pParent /*= 0*/) const
    23162325{
    2317     return messageOkCancel(pParent ? pParent : mainWindowShown(),
    2318                            MessageType_Question,
    2319                            tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>"
    2320                               "<p>Are you sure you want to proceed?</p>")
    2321                               .arg(strPackName),
    2322                            0,
    2323                            tr("&Remove"));
     2326    return questionBinary(pParent ? pParent : mainWindowShown(),
     2327                          MessageType_Question,
     2328                          tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>"
     2329                             "<p>Are you sure you want to proceed?</p>")
     2330                             .arg(strPackName),
     2331                          0,
     2332                          tr("&Remove"));
    23242333}
    23252334
    23262335void UIMessageCenter::cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent /*= 0*/) const
    23272336{
    2328     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2329             tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
    2330             formatErrorInfo(extPackManager));
     2337    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2338          tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
     2339          formatErrorInfo(extPackManager));
    23312340}
    23322341
    23332342void UIMessageCenter::warnAboutBadExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent /*= 0*/) const
    23342343{
    2335     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2336             tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
    2337             "<!--EOM-->" + extPackFile.GetWhyUnusable());
     2344    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2345          tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
     2346          "<!--EOM-->" + extPackFile.GetWhyUnusable());
    23382347}
    23392348
    23402349void UIMessageCenter::cannotInstallExtPack(const CExtPackFile &extPackFile, const QString &strFilename, QWidget *pParent /*= 0*/) const
    23412350{
    2342     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2343             tr("Failed to install the Extension Pack <b>%1</b>.")
    2344                .arg(strFilename),
    2345             formatErrorInfo(extPackFile));
     2351    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2352          tr("Failed to install the Extension Pack <b>%1</b>.")
     2353             .arg(strFilename),
     2354          formatErrorInfo(extPackFile));
    23462355}
    23472356
    23482357void UIMessageCenter::cannotInstallExtPack(const CProgress &progress, const QString &strFilename, QWidget *pParent /*= 0*/) const
    23492358{
    2350     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2351             tr("Failed to install the Extension Pack <b>%1</b>.")
    2352                .arg(strFilename),
    2353             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     2359    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2360          tr("Failed to install the Extension Pack <b>%1</b>.")
     2361             .arg(strFilename),
     2362          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    23542363}
    23552364
    23562365void UIMessageCenter::cannotUninstallExtPack(const CExtPackManager &extPackManager, const QString &strPackName, QWidget *pParent /*= 0*/) const
    23572366{
    2358     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2359             tr("Failed to uninstall the Extension Pack <b>%1</b>.")
    2360                .arg(strPackName),
    2361             formatErrorInfo(extPackManager));
     2367    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2368          tr("Failed to uninstall the Extension Pack <b>%1</b>.")
     2369             .arg(strPackName),
     2370          formatErrorInfo(extPackManager));
    23622371}
    23632372
    23642373void UIMessageCenter::cannotUninstallExtPack(const CProgress &progress, const QString &strPackName, QWidget *pParent /*= 0*/) const
    23652374{
    2366     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2367             tr("Failed to uninstall the Extension Pack <b>%1</b>.")
    2368                .arg(strPackName),
    2369             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     2375    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2376          tr("Failed to uninstall the Extension Pack <b>%1</b>.")
     2377             .arg(strPackName),
     2378          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    23702379}
    23712380
    23722381void UIMessageCenter::warnAboutExtPackInstalled(const QString &strPackName, QWidget *pParent /*= 0*/) const
    23732382{
    2374     message(pParent ? pParent : mainWindowShown(),
    2375             MessageType_Info,
    2376             tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.")
    2377                .arg(strPackName));
     2383    alert(pParent ? pParent : mainWindowShown(), MessageType_Info,
     2384          tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.")
     2385             .arg(strPackName));
    23782386}
    23792387
     
    23812389void UIMessageCenter::cannotDropData(const CGuest &guest, QWidget *pParent /*= 0*/) const
    23822390{
    2383     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2384             tr("Failed to drop data."),
    2385             formatErrorInfo(guest));
     2391    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2392          tr("Failed to drop data."),
     2393          formatErrorInfo(guest));
    23862394}
    23872395
    23882396void UIMessageCenter::cannotDropData(const CProgress &progress, QWidget *pParent /*= 0*/) const
    23892397{
    2390     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2391             tr("Failed to drop data."),
    2392             !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     2398    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2399          tr("Failed to drop data."),
     2400          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
    23932401}
    23942402#endif /* VBOX_WITH_DRAG_AND_DROP */
    23952403
    2396 void UIMessageCenter::cannotOpenLicenseFile(const QString &strPath, QWidget *pParent /*= 0*/)
    2397 {
    2398     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    2399             tr("Failed to open the license file <nobr><b>%1</b></nobr>. Check file permissions.")
    2400                .arg(strPath));
    2401 }
    2402 
    2403 bool UIMessageCenter::confirmOverridingFile(const QString &strPath, QWidget *pParent /*= 0*/)
    2404 {
    2405     return messageOkCancel(pParent, MessageType_Question,
    2406                            tr("A file named <b>%1</b> already exists. "
    2407                               "Are you sure you want to replace it?<br /><br />"
    2408                               "Replacing it will overwrite its contents.")
    2409                               .arg(strPath));
    2410 }
    2411 
    2412 bool UIMessageCenter::confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/)
     2404void UIMessageCenter::cannotOpenLicenseFile(const QString &strPath, QWidget *pParent /*= 0*/) const
     2405{
     2406    alert(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2407          tr("Failed to open the license file <nobr><b>%1</b></nobr>. Check file permissions.")
     2408             .arg(strPath));
     2409}
     2410
     2411bool UIMessageCenter::confirmOverridingFile(const QString &strPath, QWidget *pParent /*= 0*/) const
     2412{
     2413    return questionBinary(pParent, MessageType_Question,
     2414                          tr("A file named <b>%1</b> already exists. "
     2415                             "Are you sure you want to replace it?<br /><br />"
     2416                             "Replacing it will overwrite its contents.")
     2417                             .arg(strPath));
     2418}
     2419
     2420bool UIMessageCenter::confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/) const
    24132421{
    24142422    /* If it is only one file use the single question versions above: */
     
    24162424        return confirmOverridingFile(strPaths.at(0), pParent);
    24172425    else if (strPaths.size() > 1)
    2418         return messageOkCancel(pParent, MessageType_Question,
    2419                                tr("The following files already exist:<br /><br />%1<br /><br />"
    2420                                   "Are you sure you want to replace them? "
    2421                                   "Replacing them will overwrite their contents.")
    2422                                   .arg(QStringList(strPaths.toList()).join("<br />")));
     2426        return questionBinary(pParent, MessageType_Question,
     2427                              tr("The following files already exist:<br /><br />%1<br /><br />"
     2428                                 "Are you sure you want to replace them? "
     2429                                 "Replacing them will overwrite their contents.")
     2430                                 .arg(QStringList(strPaths.toList()).join("<br />")));
    24232431    else
    24242432        return true;
    24252433}
    24262434
    2427 bool UIMessageCenter::confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent /*= 0*/)
     2435bool UIMessageCenter::confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent /*= 0*/) const
    24282436{
    24292437    QFileInfo fi(strPath);
     
    24342442}
    24352443
    2436 bool UIMessageCenter::confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/)
     2444bool UIMessageCenter::confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/) const
    24372445{
    24382446    QVector<QString> existingFiles;
     
    25192527}
    25202528
    2521 void UIMessageCenter::remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP)
     2529void UIMessageCenter::remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const
    25222530{
    25232531    emit sigRemindAboutWrongColorDepth(uRealBPP, uWantedBPP);
     
    26222630}
    26232631
    2624 void UIMessageCenter::sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP)
     2632void UIMessageCenter::sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const
    26252633{
    26262634    const char *kName = "remindAboutWrongColorDepth";
     
    26342642    }
    26352643
    2636     message(mainMachineWindowShown(), MessageType_Info,
    2637             tr("<p>The virtual machine window is optimized to work in "
    2638                "<b>%1&nbsp;bit</b> color mode but the "
    2639                "virtual display is currently set to <b>%2&nbsp;bit</b>.</p>"
    2640                "<p>Please open the display properties dialog of the guest OS and "
    2641                "select a <b>%3&nbsp;bit</b> color mode, if it is available, for "
    2642                "best possible performance of the virtual video subsystem.</p>"
    2643                "<p><b>Note</b>. Some operating systems, like OS/2, may actually "
    2644                "work in 32&nbsp;bit mode but report it as 24&nbsp;bit "
    2645                "(16 million colors). You may try to select a different color "
    2646                "mode to see if this message disappears or you can simply "
    2647                "disable the message now if you are sure the required color "
    2648                "mode (%4&nbsp;bit) is not available in the guest OS.</p>")
    2649                .arg(uWantedBPP).arg(uRealBPP).arg(uWantedBPP).arg(uWantedBPP),
    2650             kName);
     2644    alert(mainMachineWindowShown(), MessageType_Info,
     2645          tr("<p>The virtual machine window is optimized to work in "
     2646             "<b>%1&nbsp;bit</b> color mode but the "
     2647             "virtual display is currently set to <b>%2&nbsp;bit</b>.</p>"
     2648             "<p>Please open the display properties dialog of the guest OS and "
     2649             "select a <b>%3&nbsp;bit</b> color mode, if it is available, for "
     2650             "best possible performance of the virtual video subsystem.</p>"
     2651             "<p><b>Note</b>. Some operating systems, like OS/2, may actually "
     2652             "work in 32&nbsp;bit mode but report it as 24&nbsp;bit "
     2653             "(16 million colors). You may try to select a different color "
     2654             "mode to see if this message disappears or you can simply "
     2655             "disable the message now if you are sure the required color "
     2656             "mode (%4&nbsp;bit) is not available in the guest OS.</p>")
     2657             .arg(uWantedBPP).arg(uRealBPP).arg(uWantedBPP).arg(uWantedBPP),
     2658          kName);
    26512659}
    26522660
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r45364 r45368  
    6666
    6767    /* Notifiers: Synchronization stuff: */
    68     void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     68    void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const;
    6969
    7070public:
     
    7979    void setWarningShown(const QString &strWarningName, bool fWarningShown) const;
    8080
    81     /* API: Alert providing stuff: Main function: */
     81    /* API: Main message function, used directly only in exceptional cases: */
    8282    int message(QWidget *pParent, MessageType type,
    8383                const QString &strMessage,
    84                 const QString &strDetails = QString(),
     84                const QString &strDetails,
    8585                const char *pcszAutoConfirmId = 0,
    8686                int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
     
    8989                const QString &strButtonText3 = QString()) const;
    9090
    91     /* API: Alert providing stuff: Wrapper to the main function,
     91    /* API: Wrapper to 'message' function.
     92     * Provides single OK button: */
     93    void error(QWidget *pParent, MessageType type,
     94               const QString &strMessage,
     95               const QString &strDetails,
     96               const char *pcszAutoConfirmId = 0) const;
     97
     98    /* API: Wrapper to 'message' function,
     99     * Error with question providing two buttons (OK and Cancel by default): */
     100    bool errorWithQuestion(QWidget *pParent, MessageType type,
     101                           const QString &strMessage,
     102                           const QString &strDetails,
     103                           const char *pcszAutoConfirmId = 0,
     104                           const QString &strOkButtonText = QString(),
     105                           const QString &strCancelButtonText = QString()) const;
     106
     107    /* API: Wrapper to 'error' function.
    92108     * Omits details: */
    93     int message(QWidget *pParent, MessageType type,
    94                 const QString &strMessage,
    95                 const char *pcszAutoConfirmId,
    96                 int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
    97                 const QString &strButtonText1 = QString(),
    98                 const QString &strButtonText2 = QString(),
    99                 const QString &strButtonText3 = QString()) const;
    100 
    101     /* API: Alert providing stuff: Wrapper to the main function,
    102      * Takes button type(s) as "Ok / Cancel": */
    103     bool messageOkCancel(QWidget *pParent, MessageType type,
    104                          const QString &strMessage,
    105                          const QString &strDetails = QString(),
    106                          const char *pcszAutoConfirmId = 0,
    107                          const QString &strOkButtonText = QString(),
    108                          const QString &strCancelButtonText = QString(),
    109                          bool fOkByDefault = true) const;
    110 
    111     /* API: Alert providing stuff: Wrapper to the function above,
    112      * Takes button type(s) as "Ok / Cancel",
    113      * Omits details. */
    114     bool messageOkCancel(QWidget *pParent, MessageType type,
    115                          const QString &strMessage,
    116                          const char *pcszAutoConfirmId,
    117                          const QString &strOkButtonText = QString(),
    118                          const QString &strCancelButtonText = QString(),
    119                          bool fOkByDefault = true) const;
    120 
    121     /* API: Alert providing stuff: One more main function: */
     109    void alert(QWidget *pParent, MessageType type,
     110               const QString &strMessage,
     111               const char *pcszAutoConfirmId = 0) const;
     112
     113    /* API: Wrapper to 'message' function.
     114     * Omits details, provides two or three buttons: */
     115    int question(QWidget *pParent, MessageType type,
     116                 const QString &strMessage,
     117                 const char *pcszAutoConfirmId = 0,
     118                 int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
     119                 const QString &strButtonText1 = QString(),
     120                 const QString &strButtonText2 = QString(),
     121                 const QString &strButtonText3 = QString()) const;
     122
     123    /* API: Wrapper to 'question' function,
     124     * Question providing two buttons (OK and Cancel by default): */
     125    bool questionBinary(QWidget *pParent, MessageType type,
     126                        const QString &strMessage,
     127                        const char *pcszAutoConfirmId = 0,
     128                        const QString &strOkButtonText = QString(),
     129                        const QString &strCancelButtonText = QString()) const;
     130
     131    /* API: Wrapper to 'question' function,
     132     * Question providing three buttons (Yes, No and Cancel by default): */
     133    int questionTrinary(QWidget *pParent, MessageType type,
     134                        const QString &strMessage,
     135                        const char *pcszAutoConfirmId = 0,
     136                        const QString &strChoice1ButtonText = QString(),
     137                        const QString &strChoice2ButtonText = QString(),
     138                        const QString &strCancelButtonText = QString()) const;
     139
     140    /* API: One more main function: */
    122141    int messageWithOption(QWidget *pParent, MessageType type,
    123142                          const QString &strMessage,
    124143                          const QString &strOptionText,
    125144                          bool fDefaultOptionValue = true,
    126                           const QString &strDetails = QString(),
    127145                          int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
    128146                          const QString &strButtonText1 = QString(),
     
    237255    void cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent = 0) const;
    238256    void cannotDetachDevice(const CMachine &machine, UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0) const;
    239     int cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent = 0) const;
     257    bool cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent = 0) const;
    240258    void cannotOpenMedium(const CVirtualBox &vbox, UIMediumType type, const QString &strLocation, QWidget *pParent = 0) const;
    241259    void cannotCloseMedium(const UIMedium &medium, const COMResult &rc, QWidget *pParent = 0) const;
     
    276294    void remindAboutAutoCapture() const;
    277295    void remindAboutMouseIntegration(bool fSupportsAbsolute) const;
    278     bool remindAboutPausedVMInput() const;
     296    void remindAboutPausedVMInput() const;
    279297    bool confirmGoingFullscreen(const QString &strHotKey) const;
    280298    bool confirmGoingSeamless(const QString &strHotKey) const;
     
    284302    bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const;
    285303    void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const;
    286     void cannotAttachUSBDevice(const CConsole &console, const QString &strDevice);
    287     void cannotAttachUSBDevice(const CVirtualBoxErrorInfo &error, const QString &strDevice, const QString &strMachineName);
    288     void cannotDetachUSBDevice(const CConsole &console, const QString &strDevice);
    289     void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &error, const QString &strDevice, const QString &strMachineName);
    290     void remindAboutGuestAdditionsAreNotActive(QWidget *pParent = 0);
     304    void cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) const;
     305    void cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const;
     306    void cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) const;
     307    void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const;
     308    void remindAboutGuestAdditionsAreNotActive(QWidget *pParent = 0) const;
    291309
    292310    /* API: Network management warnings: */
    293     bool confirmCancelingAllNetworkRequests();
    294     void showUpdateSuccess(const QString &strVersion, const QString &strLink);
    295     void showUpdateNotFound();
    296     bool askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion);
     311    bool confirmCancelingAllNetworkRequests() const;
     312    void showUpdateSuccess(const QString &strVersion, const QString &strLink) const;
     313    void showUpdateNotFound() const;
     314    void askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion) const;
    297315
    298316    /* API: Downloading warnings: */
     
    330348
    331349    /* API: License-viewer warnings: */
    332     void cannotOpenLicenseFile(const QString &strPath, QWidget *pParent = 0);
     350    void cannotOpenLicenseFile(const QString &strPath, QWidget *pParent = 0) const;
    333351
    334352    /* API: File-dialog warnings: */
    335     bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0);
    336     bool confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent = 0);
    337     bool confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent = 0);
    338     bool confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent = 0);
     353    bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) const;
     354    bool confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent = 0) const;
     355    bool confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent = 0) const;
     356    bool confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent = 0) const;
    339357
    340358    /* API: Static helpers: */
     
    346364
    347365    /* API: Async stuff: */
    348     void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     366    void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const;
    349367
    350368public slots:
     
    367385
    368386    /* Handlers: Synchronization stuff: */
    369     void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     387    void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const;
    370388
    371389private:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r45333 r45368  
    906906                    /* Show a possible warning on key release which seems to be more expected by the end user: */
    907907                    if (uisession()->isPaused())
    908                     {
    909                         /* If the reminder is disabled we pass the event to Qt to enable normal
    910                          * keyboard functionality (for example, menu access with Alt+Letter): */
    911                         if (!msgCenter().remindAboutPausedVMInput())
    912                             break;
    913                     }
     908                        msgCenter().remindAboutPausedVMInput();
    914909                }
    915910                break;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r45334 r45368  
    15041504        /* Ask for force remounting: */
    15051505        if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? newId : currentId),
    1506                                             fMount, true /* retry? */, activeMachineWindow()) == AlertButton_Ok)
     1506                                            fMount, true /* retry? */, activeMachineWindow()))
    15071507        {
    15081508            /* Force remount medium to the predefined port/device: */
     
    15651565            /* Ask for force remounting: */
    15661566            if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? strNewId : strCurrentId),
    1567                                                 fMount, true /* retry? */, activeMachineWindow()) == AlertButton_Ok)
     1567                                                fMount, true /* retry? */, activeMachineWindow()))
    15681568            {
    15691569                /* Force remount medium to the predefined port/device: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r45328 r45368  
    591591                /* Ask for force mounting: */
    592592                if (msgCenter().cannotRemountMedium(machine, vboxMedium, true /* mount? */,
    593                                                     true /* retry? */, mainMachineWindow()) == AlertButton_Ok)
     593                                                    true /* retry? */, mainMachineWindow()))
    594594                {
    595595                    /* Force mount medium to the predefined port/device: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r45362 r45368  
    30563056            int iAnswer = msgCenter().confirmOpticalAttachmentCreation(strControllerName, this);
    30573057            if (iAnswer == AlertButton_Choice1)
     3058                strMediumId = vboxGlobal().findMedium(strMediumId).id();
     3059            else if (iAnswer == AlertButton_Choice2)
    30583060                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_DVD, this, strMachineFolder);
    3059             else if (iAnswer == AlertButton_Choice2)
    3060                 strMediumId = vboxGlobal().findMedium(strMediumId).id();
    30613061            break;
    30623062        }
     
    30653065            int iAnswer = msgCenter().confirmFloppyAttachmentCreation(strControllerName, this);
    30663066            if (iAnswer == AlertButton_Choice1)
     3067                strMediumId = vboxGlobal().findMedium(strMediumId).id();
     3068            else if (iAnswer == AlertButton_Choice2)
    30673069                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_Floppy, this, strMachineFolder);
    3068             else if (iAnswer == AlertButton_Choice2)
    3069                 strMediumId = vboxGlobal().findMedium(strMediumId).id();
    30703070            break;
    30713071        }
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