VirtualBox

Changeset 45296 in vbox


Ignore:
Timestamp:
Apr 3, 2013 8:41:08 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84697
Message:

FE/Qt: QIMessageBox cleanup/rework (part 2).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp

    r45295 r45296  
    5151 */
    5252QIMessageBox::QIMessageBox (const QString &aCaption, const QString &aText,
    53                             IconType aIcon, int aButton0, int aButton1, int aButton2,
     53                            AlertIconType aIcon, int aButton0, int aButton1, int aButton2,
    5454                            QWidget *aParent, const char *aName, bool aModal)
    5555    : QIDialog (aParent)
     
    156156    /* If this is an error message add an "Copy to clipboard" button for easier
    157157     * bug reports. */
    158     if (aIcon == QIMessageBox::IconType_Critical)
    159     {
    160         QPushButton *pCopyButton = createButton(Copy);
     158    if (aIcon == AlertIconType_Critical)
     159    {
     160        QPushButton *pCopyButton = createButton(AlertButton_Copy);
    161161        pCopyButton->setToolTip(tr("Copy all errors to the clipboard"));
    162162        connect(pCopyButton, SIGNAL(clicked()), SLOT(copy()));
     
    255255    QString text;
    256256    QDialogButtonBox::ButtonRole role;
    257     switch (aButton & ButtonMask)
    258     {
    259         case Ok:     text = tr("OK");     role = QDialogButtonBox::AcceptRole; break;
    260         case Yes:    text = tr("Yes");    role = QDialogButtonBox::YesRole; break;
    261         case No:     text = tr("No");     role = QDialogButtonBox::NoRole; break;
    262         case Cancel: text = tr("Cancel"); role = QDialogButtonBox::RejectRole; break;
    263         case Ignore: text = tr("Ignore"); role = QDialogButtonBox::AcceptRole; break;
    264         case Copy:   text = tr("Copy");   role = QDialogButtonBox::ActionRole; break;
     257    switch (aButton & AlertButtonMask)
     258    {
     259        case AlertButton_Ok:     text = tr("OK");     role = QDialogButtonBox::AcceptRole; break;
     260        case AlertButton_Cancel: text = tr("Cancel"); role = QDialogButtonBox::RejectRole; break;
     261        case AlertButton_Yes:    text = tr("Yes");    role = QDialogButtonBox::YesRole; break;
     262        case AlertButton_No:     text = tr("No");     role = QDialogButtonBox::NoRole; break;
     263        case AlertButton_Ignore: text = tr("Ignore"); role = QDialogButtonBox::AcceptRole; break;
     264        case AlertButton_Copy:   text = tr("Copy");   role = QDialogButtonBox::ActionRole; break;
    265265        default:
    266266            AssertMsgFailed(("Type %d is not implemented", aButton));
     
    270270    QPushButton *b = mButtonBox->addButton (text, role);
    271271
    272     if (aButton & Default)
     272    if (aButton & AlertButtonOption_Default)
    273273    {
    274274        b->setDefault (true);
     
    276276    }
    277277
    278     if (aButton & Escape)
    279         mButtonEsc = aButton & ButtonMask;
     278    if (aButton & AlertButtonOption_Escape)
     279        mButtonEsc = aButton & AlertButtonMask;
    280280
    281281    return b;
     
    316316}
    317317
    318 QPixmap QIMessageBox::standardPixmap (QIMessageBox::IconType aIcon)
     318QPixmap QIMessageBox::standardPixmap(AlertIconType aIcon)
    319319{
    320320    QIcon icon;
    321321    switch (aIcon)
    322322    {
    323         case QIMessageBox::IconType_Information:
     323        case AlertIconType_Information:
    324324            icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxInformationIcon, this);
    325325            break;
     
    327327            icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxWarningIcon, this);
    328328            break;
    329         case QIMessageBox::IconType_Critical:
     329        case AlertIconType_Critical:
    330330            icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxCriticalIcon, this);
    331331            break;
    332         case QIMessageBox::IconType_Question:
     332        case AlertIconType_Question:
    333333            icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxQuestionIcon, this);
    334334            break;
    335         case QIMessageBox::IconType_GuruMeditation:
     335        case AlertIconType_GuruMeditation:
    336336            icon = QIcon(":/meditation_32px.png");
    337337            break;
     
    466466    {
    467467        QDialog::reject();
    468         setResult (mButtonEsc & ButtonMask);
     468        setResult (mButtonEsc & AlertButtonMask);
    469469    }
    470470}
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h

    r45295 r45296  
    3737class QILabel;
    3838
     39/* Button type enumerator: */
     40enum AlertButton
     41{
     42    AlertButton_NoButton      =  0x0,  /* 00000000 00000000 */
     43    AlertButton_Ok            =  0x1,  /* 00000000 00000001 */
     44    AlertButton_Cancel        =  0x2,  /* 00000000 00000010 */
     45    AlertButton_Yes           =  0x4,  /* 00000000 00000100 */
     46    AlertButton_No            =  0x8,  /* 00000000 00001000 */
     47    AlertButton_Ignore        = 0x10,  /* 00000000 00010000 */
     48    AlertButton_Copy          = 0x20,  /* 00000000 00100000 */
     49    AlertButtonMask           = 0xFF   /* 00000000 11111111 */
     50};
     51
     52/* Button option enumerator: */
     53enum AlertButtonOption
     54{
     55    AlertButtonOption_Default = 0x100, /* 00000001 00000000 */
     56    AlertButtonOption_Escape  = 0x200, /* 00000010 00000000 */
     57    AlertButtonOptionMask     = 0x300  /* 00000011 00000000 */
     58};
     59
     60/* Alert option enumerator: */
     61enum AlertOption
     62{
     63    AlertOption_CheckBox      = 0x400, /* 00000100 00000000 */
     64    AlertOptionMask           = 0xFC00 /* 11111100 00000000 */
     65};
     66
     67/* Icon type enumerator: */
     68enum AlertIconType
     69{
     70    AlertIconType_NoIcon = QMessageBox::NoIcon,
     71    AlertIconType_Information = QMessageBox::Information,
     72    AlertIconType_Warning = QMessageBox::Warning,
     73    AlertIconType_Critical = QMessageBox::Critical,
     74    AlertIconType_Question = QMessageBox::Question,
     75    AlertIconType_GuruMeditation
     76};
     77
    3978/* QIDialog extension representing GUI alerts: */
    4079class QIMessageBox : public QIDialog
     
    4483public:
    4584
    46     /* Icon type enumerator: */
    47     enum IconType
    48     {
    49         IconType_NoIcon = QMessageBox::NoIcon,
    50         IconType_Information = QMessageBox::Information,
    51         IconType_Warning = QMessageBox::Warning,
    52         IconType_Critical = QMessageBox::Critical,
    53         IconType_Question = QMessageBox::Question,
    54         IconType_GuruMeditation,
    55     };
    56 
    57     enum
    58     {
    59         NoButton = 0, Ok = 1, Cancel = 2, Yes = 3, No = 4, Abort = 5,
    60         Retry = 6, Ignore = 7, YesAll = 8, NoAll = 9, Copy = 10,
    61         ButtonMask = 0xFF,
    62 
    63         Default = 0x100, Escape = 0x200,
    64         FlagMask = 0x300,
    65 
    66         OptionChosen = 0x400
    67     };
    68 
    69     QIMessageBox (const QString &aCaption, const QString &aText,
    70                   IconType aIcon, int aButton0, int aButton1 = 0, int aButton2 = 0,
    71                   QWidget *aParent = 0, const char *aName = 0, bool aModal = TRUE);
     85    QIMessageBox(const QString &aCaption, const QString &aText,
     86                 AlertIconType aIcon, int aButton0, int aButton1 = 0, int aButton2 = 0,
     87                 QWidget *aParent = 0, const char *aName = 0, bool aModal = TRUE);
    7288
    7389    QString buttonText (int aButton) const;
     
    8399    void setDetailsText (const QString &aText);
    84100
    85     QPixmap standardPixmap (QIMessageBox::IconType aIcon);
     101    QPixmap standardPixmap(AlertIconType aIcon);
    86102
    87103private:
     
    102118    void detailsNext();
    103119
    104     void done0() { mWasDone = true; done (mButton0 & ButtonMask); }
    105     void done1() { mWasDone = true; done (mButton1 & ButtonMask); }
    106     void done2() { mWasDone = true; done (mButton2 & ButtonMask); }
     120    void done0() { mWasDone = true; done (mButton0 & AlertButtonMask); }
     121    void done1() { mWasDone = true; done (mButton1 & AlertButtonMask); }
     122    void done2() { mWasDone = true; done (mButton2 & AlertButtonMask); }
    107123
    108124    void reject();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r45295 r45296  
    130130    /* If no buttons are set, using single 'OK' button: */
    131131    if (iButton1 == 0 && iButton2 == 0 && iButton3 == 0)
    132         iButton1 = QIMessageBox::Ok | QIMessageBox::Default;
     132        iButton1 = AlertButton_Ok | AlertButtonOption_Default;
    133133
    134134    /* Assign corresponding title and icon: */
    135135    QString strTitle;
    136     QIMessageBox::IconType icon;
     136    AlertIconType icon;
    137137    switch (type)
    138138    {
     
    140140        case MessageType_Info:
    141141            strTitle = tr("VirtualBox - Information", "msg box title");
    142             icon = QIMessageBox::IconType_Information;
     142            icon = AlertIconType_Information;
    143143            break;
    144144        case MessageType_Question:
    145145            strTitle = tr("VirtualBox - Question", "msg box title");
    146             icon = QIMessageBox::IconType_Question;
     146            icon = AlertIconType_Question;
    147147            break;
    148148        case MessageType_Warning:
    149149            strTitle = tr("VirtualBox - Warning", "msg box title");
    150             icon = QIMessageBox::IconType_Warning;
     150            icon = AlertIconType_Warning;
    151151            break;
    152152        case MessageType_Error:
    153153            strTitle = tr("VirtualBox - Error", "msg box title");
    154             icon = QIMessageBox::IconType_Critical;
     154            icon = AlertIconType_Critical;
    155155            break;
    156156        case MessageType_Critical:
    157157            strTitle = tr("VirtualBox - Critical Error", "msg box title");
    158             icon = QIMessageBox::IconType_Critical;
     158            icon = AlertIconType_Critical;
    159159            break;
    160160        case MessageType_GuruMeditation:
    161161            strTitle = "VirtualBox - Guru Meditation"; /* don't translate this */
    162             icon = QIMessageBox::IconType_GuruMeditation;
     162            icon = AlertIconType_GuruMeditation;
    163163            break;
    164164    }
     
    196196    /* Save option: */
    197197    if (pBox->isFlagChecked())
    198         rc |= QIMessageBox::OptionChosen;
     198        rc |= AlertOption_CheckBox;
    199199
    200200    /* Delete message-box: */
     
    572572           message(mainWindowShown(), MessageType_Question,
    573573                   strText, 0 /* auto-confirm id */,
    574                    QIMessageBox::Ok | QIMessageBox::Default,
    575                    QIMessageBox::Cancel | QIMessageBox::Escape,
     574                   AlertButton_Ok | AlertButtonOption_Default,
     575                   AlertButton_Cancel | AlertButtonOption_Escape,
    576576                   0,
    577577                   tr("Remove")) :
    578578           message(mainWindowShown(), MessageType_Question,
    579579                   strText, 0 /* auto-confirm id */,
    580                    QIMessageBox::Yes,
    581                    QIMessageBox::No | QIMessageBox::Default,
    582                    QIMessageBox::Cancel | QIMessageBox::Escape,
     580                   AlertButton_Yes,
     581                   AlertButton_No | AlertButtonOption_Default,
     582                   AlertButton_Cancel | AlertButtonOption_Escape,
    583583                   tr("Delete all files"),
    584584                   tr("Remove only"));
     
    697697                             !vboxGlobal().virtualBox().GetExtraDataStringList(GUI_InvertMessageOption).contains("confirmSnapshotRestoring"),
    698698                             QString() /* details */,
    699                              QIMessageBox::Ok | QIMessageBox::Default,
    700                              QIMessageBox::Cancel | QIMessageBox::Escape,
     699                             AlertButton_Ok | AlertButtonOption_Default,
     700                             AlertButton_Cancel | AlertButtonOption_Escape,
    701701                             0 /* 3rd button */,
    702702                             tr("Restore"), tr("Cancel"), QString() /* 3rd button text */) :
     
    705705                      .arg(strSnapshotName),
    706706                   0 /* auto-confirm id */,
    707                    QIMessageBox::Ok | QIMessageBox::Default,
    708                    QIMessageBox::Cancel | QIMessageBox::Escape,
     707                   AlertButton_Ok | AlertButtonOption_Default,
     708                   AlertButton_Cancel | AlertButtonOption_Escape,
    709709                   0 /* 3rd button */,
    710710                   tr("Restore"), tr("Cancel"), QString() /* 3rd button text */);
     
    866866                      .arg(strControllerName),
    867867                   0 /* auto-confirm id */,
    868                    QIMessageBox::Yes,
    869                    QIMessageBox::No,
    870                    QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
     868                   AlertButton_Yes,
     869                   AlertButton_No,
     870                   AlertButton_Cancel | AlertButtonOption_Default | AlertButtonOption_Escape,
    871871                   tr("Create &new disk", "add attachment routine"),
    872872                   tr("&Choose existing disk", "add attachment routine"));
     
    881881                      .arg(strControllerName),
    882882                   0 /* auto-confirm id */,
    883                    QIMessageBox::Yes,
    884                    QIMessageBox::No,
    885                    QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
     883                   AlertButton_Yes,
     884                   AlertButton_No,
     885                   AlertButton_Cancel | AlertButtonOption_Default | AlertButtonOption_Escape,
    886886                   tr("&Choose disk", "add attachment routine"),
    887887                   tr("Leave &empty", "add attachment routine"));
     
    896896                      .arg(strControllerName),
    897897                   0 /* auto-confirm id */,
    898                    QIMessageBox::Yes,
    899                    QIMessageBox::No,
    900                    QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
     898                   AlertButton_Yes,
     899                   AlertButton_No,
     900                   AlertButton_Cancel | AlertButtonOption_Default | AlertButtonOption_Escape,
    901901                   tr("&Choose disk", "add attachment routine"),
    902902                   tr("Leave &empty", "add attachment routine"));
     
    10331033                      .arg(strLocation),
    10341034                   0 /* auto-confirm id */,
    1035                    QIMessageBox::Yes,
    1036                    QIMessageBox::No | QIMessageBox::Default,
    1037                    QIMessageBox::Cancel | QIMessageBox::Escape,
     1035                   AlertButton_Yes,
     1036                   AlertButton_No | AlertButtonOption_Default,
     1037                   AlertButton_Cancel | AlertButtonOption_Escape,
    10381038                   tr("Delete", "hard disk storage"),
    10391039                   tr("Keep", "hard disk storage"));
     
    13211321           "machine using a virtual optical disk or from the network."),
    13221322        0 /* auto-confirm id */,
    1323         QIMessageBox::Ok,
    1324         QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
     1323        AlertButton_Ok | AlertButtonOption_Default,
     1324        AlertButton_Cancel | AlertButtonOption_Escape,
    13251325        0,
    13261326        tr("Continue", "no hard disk attached"),
    1327         tr("Go Back", "no hard disk attached")) == QIMessageBox::Ok;
     1327        tr("Go Back", "no hard disk attached")) == AlertButton_Ok;
    13281328}
    13291329
     
    17731773            .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
    17741774        "confirmInputCapture",
    1775         QIMessageBox::Ok | QIMessageBox::Default,
    1776         QIMessageBox::Cancel | QIMessageBox::Escape,
     1775        AlertButton_Ok | AlertButtonOption_Default,
     1776        AlertButton_Cancel | AlertButtonOption_Escape,
    17771777        0,
    17781778        tr("Capture", "do input capture"));
     
    17811781        *pfAutoConfirmed = (rc & AutoConfirmed);
    17821782
    1783     return (rc & QIMessageBox::ButtonMask) == QIMessageBox::Ok;
     1783    return (rc & AlertButtonMask) == AlertButton_Ok;
    17841784}
    17851785
     
    19091909             .arg(VBoxGlobal::formatSize(uMinVRAM)),
    19101910             0 /* auto-confirm id */,
    1911              QIMessageBox::Ignore | QIMessageBox::Default,
    1912              QIMessageBox::Cancel | QIMessageBox::Escape);
     1911             AlertButton_Ignore | AlertButtonOption_Default,
     1912             AlertButton_Cancel | AlertButtonOption_Escape);
    19131913}
    19141914
     
    19341934                   .arg(VBoxGlobal::formatSize(uMinVRAM)),
    19351935                   0 /* auto-confirm id */,
    1936                    QIMessageBox::Ignore | QIMessageBox::Default,
    1937                    QIMessageBox::Cancel | QIMessageBox::Escape);
     1936                   AlertButton_Ignore | AlertButtonOption_Default,
     1937                   AlertButton_Cancel | AlertButtonOption_Escape);
    19381938}
    19391939
     
    20832083            .arg(strLogFolder),
    20842084        0 /* auto-confirm id */,
    2085         QIMessageBox::Ok | QIMessageBox::Default,
    2086         QIMessageBox::Ignore | QIMessageBox::Escape);
    2087 
    2088     return rc == QIMessageBox::Ok;
     2085        AlertButton_Ok | AlertButtonOption_Default,
     2086        AlertButton_Ignore | AlertButtonOption_Escape);
     2087
     2088    return rc == AlertButton_Ok;
    20892089}
    20902090
     
    22122212                      .arg(strExtPackVersion).arg(strExtPackName).arg(strVBoxVersion),
    22132213                      0 /* auto-confirm id */,
    2214                       QIMessageBox::Ok | QIMessageBox::Default,
     2214                      AlertButton_Ok | AlertButtonOption_Default,
    22152215                      0,
    22162216                      0,
     
    29602960    /* Choose the 'default' button: */
    29612961    if (iButton1 == 0 && iButton2 == 0 && iButton3 == 0)
    2962         iButton1 = QIMessageBox::Ok | QIMessageBox::Default;
     2962        iButton1 = AlertButton_Ok | AlertButtonOption_Default;
    29632963
    29642964    /* Check if message-box was auto-confirmed before: */
     
    29722972        {
    29732973            int iResultCode = AutoConfirmed;
    2974             if (iButton1 & QIMessageBox::Default)
    2975                 iResultCode |= (iButton1 & QIMessageBox::ButtonMask);
    2976             if (iButton2 & QIMessageBox::Default)
    2977                 iResultCode |= (iButton2 & QIMessageBox::ButtonMask);
    2978             if (iButton3 & QIMessageBox::Default)
    2979                 iResultCode |= (iButton3 & QIMessageBox::ButtonMask);
     2974            if (iButton1 & AlertButtonOption_Default)
     2975                iResultCode |= (iButton1 & AlertButtonMask);
     2976            if (iButton2 & AlertButtonOption_Default)
     2977                iResultCode |= (iButton2 & AlertButtonMask);
     2978            if (iButton3 & AlertButtonOption_Default)
     2979                iResultCode |= (iButton3 & AlertButtonMask);
    29802980            return iResultCode;
    29812981        }
     
    29842984    /* Choose title and icon: */
    29852985    QString title;
    2986     QIMessageBox::IconType icon;
     2986    AlertIconType icon;
    29872987    switch (type)
    29882988    {
     
    29902990        case MessageType_Info:
    29912991            title = tr("VirtualBox - Information", "msg box title");
    2992             icon = QIMessageBox::IconType_Information;
     2992            icon = AlertIconType_Information;
    29932993            break;
    29942994        case MessageType_Question:
    29952995            title = tr("VirtualBox - MessageType_Question", "msg box title");
    2996             icon = QIMessageBox::IconType_Question;
     2996            icon = AlertIconType_Question;
    29972997            break;
    29982998        case MessageType_Warning:
    29992999            title = tr("VirtualBox - MessageType_Warning", "msg box title");
    3000             icon = QIMessageBox::IconType_Warning;
     3000            icon = AlertIconType_Warning;
    30013001            break;
    30023002        case MessageType_Error:
    30033003            title = tr("VirtualBox - MessageType_Error", "msg box title");
    3004             icon = QIMessageBox::IconType_Critical;
     3004            icon = AlertIconType_Critical;
    30053005            break;
    30063006        case MessageType_Critical:
    30073007            title = tr("VirtualBox - MessageType_Critical MessageType_Error", "msg box title");
    3008             icon = QIMessageBox::IconType_Critical;
     3008            icon = AlertIconType_Critical;
    30093009            break;
    30103010        case MessageType_GuruMeditation:
    30113011            title = "VirtualBox - Guru Meditation"; /* don't translate this */
    3012             icon = QIMessageBox::IconType_GuruMeditation;
     3012            icon = AlertIconType_GuruMeditation;
    30133013            break;
    30143014    }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r45292 r45296  
    114114    {
    115115        return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
    116                         QIMessageBox::Yes | QIMessageBox::Default,
    117                         QIMessageBox::No | QIMessageBox::Escape,
     116                        AlertButton_Yes | AlertButtonOption_Default,
     117                        AlertButton_No | AlertButtonOption_Escape,
    118118                        0,
    119119                        strYesButtonText, strNoButtonText, QString()) &
    120                 QIMessageBox::ButtonMask) == QIMessageBox::Yes;
     120                AlertButtonMask) == AlertButton_Yes;
    121121    }
    122122
     
    143143                         bool fOkByDefault = true) const
    144144    {
    145         int iOkButton = fOkByDefault ? QIMessageBox::Ok | QIMessageBox::Default :
    146                                        QIMessageBox::Ok;
    147         int iCancelButton = fOkByDefault ? QIMessageBox::Cancel | QIMessageBox::Escape :
    148                                            QIMessageBox::Cancel | QIMessageBox::Escape | QIMessageBox::Default;
     145        int iOkButton = fOkByDefault ? AlertButton_Ok | AlertButtonOption_Default :
     146                                       AlertButton_Ok;
     147        int iCancelButton = fOkByDefault ? AlertButton_Cancel | AlertButtonOption_Escape :
     148                                           AlertButton_Cancel | AlertButtonOption_Escape | AlertButtonOption_Default;
    149149        return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
    150150                        iOkButton, iCancelButton, 0, strOkButtonText, strCancelButtonText, QString()) &
    151                 QIMessageBox::ButtonMask) == QIMessageBox::Ok;
     151                AlertButtonMask) == AlertButton_Ok;
    152152    }
    153153
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r45292 r45296  
    11591159            {
    11601160                int rc = msgCenter().confirmDeleteHardDiskStorage(item->location(), this);
    1161                 if (rc == QIMessageBox::Cancel)
     1161                if (rc == AlertButton_Cancel)
    11621162                    return;
    1163                 deleteStorage = rc == QIMessageBox::Yes;
     1163                deleteStorage = rc == AlertButton_Yes;
    11641164            }
    11651165
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r45292 r45296  
    14931493        /* Ask for force remounting: */
    14941494        if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? newId : currentId),
    1495                                             fMount, true /* retry? */, activeMachineWindow()) == QIMessageBox::Ok)
     1495                                            fMount, true /* retry? */, activeMachineWindow()) == AlertButton_Ok)
    14961496        {
    14971497            /* Force remount medium to the predefined port/device: */
     
    15541554            /* Ask for force remounting: */
    15551555            if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? strNewId : strCurrentId),
    1556                                                 fMount, true /* retry? */, activeMachineWindow()) == QIMessageBox::Ok)
     1556                                                fMount, true /* retry? */, activeMachineWindow()) == AlertButton_Ok)
    15571557            {
    15581558                /* Force remount medium to the predefined port/device: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r44982 r45296  
    226226                msgCenter().cannotSwitchScreenInSeamless((((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M);
    227227            else
    228                 fSuccess = msgCenter().cannotSwitchScreenInFullscreen((((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M) != QIMessageBox::Cancel;
     228                fSuccess = msgCenter().cannotSwitchScreenInFullscreen((((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M) != AlertButton_Cancel;
    229229        }
    230230    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r45292 r45296  
    592592                /* Ask for force mounting: */
    593593                if (msgCenter().cannotRemountMedium(machine, vboxMedium, true /* mount? */,
    594                                                     true /* retry? */, mainMachineWindow()) == QIMessageBox::Ok)
     594                                                    true /* retry? */, mainMachineWindow()) == AlertButton_Ok)
    595595                {
    596596                    /* Force mount medium to the predefined port/device: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r45233 r45296  
    6262            int result = msgCenter().cannotEnterFullscreenMode(0, 0, 0,
    6363                                                               (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M);
    64             if (result == QIMessageBox::Cancel)
     64            if (result == AlertButton_Cancel)
    6565                return false;
    6666        }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp

    r45285 r45296  
    585585    /* Ask the user if he really wants to restore the snapshot: */
    586586    int iResultCode = msgCenter().confirmSnapshotRestoring(snapshot.GetName(), mMachine.GetCurrentStateModified());
    587     if (iResultCode & QIMessageBox::Cancel)
     587    if (iResultCode & AlertButton_Cancel)
    588588        return;
    589589
    590590    /* If user also confirmed new snapshot creation: */
    591     if (iResultCode & QIMessageBox::OptionChosen)
     591    if (iResultCode & AlertOption_CheckBox)
    592592    {
    593593        /* Take snapshot of changed current state: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r45288 r45296  
    14581458    /* Confirm machine removal: */
    14591459    int iResultCode = msgCenter().confirmMachineRemoval(machines);
    1460     if (iResultCode == QIMessageBox::Cancel)
     1460    if (iResultCode == AlertButton_Cancel)
    14611461        return;
    14621462
     
    14661466        /* Get iterated machine: */
    14671467        CMachine &machine = machines[iMachineIndex];
    1468         if (iResultCode == QIMessageBox::Yes)
     1468        if (iResultCode == AlertButton_Yes)
    14691469        {
    14701470            /* Unregister machine first: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r45294 r45296  
    30463046        {
    30473047            int iAnswer = msgCenter().askAboutHardDiskAttachmentCreation(strControllerName, this);
    3048             if (iAnswer == QIMessageBox::Yes)
     3048            if (iAnswer == AlertButton_Yes)
    30493049                strMediumId = getWithNewHDWizard();
    3050             else if (iAnswer == QIMessageBox::No)
     3050            else if (iAnswer == AlertButton_No)
    30513051                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_HardDisk, this, strMachineFolder);
    30523052            break;
     
    30553055        {
    30563056            int iAnswer = msgCenter().askAboutOpticalAttachmentCreation(strControllerName, this);
    3057             if (iAnswer == QIMessageBox::Yes)
     3057            if (iAnswer == AlertButton_Yes)
    30583058                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_DVD, this, strMachineFolder);
    3059             else if (iAnswer == QIMessageBox::No)
     3059            else if (iAnswer == AlertButton_No)
    30603060                strMediumId = vboxGlobal().findMedium(strMediumId).id();
    30613061            break;
     
    30643064        {
    30653065            int iAnswer = msgCenter().askAboutFloppyAttachmentCreation(strControllerName, this);
    3066             if (iAnswer == QIMessageBox::Yes)
     3066            if (iAnswer == AlertButton_Yes)
    30673067                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_Floppy, this, strMachineFolder);
    3068             else if (iAnswer == QIMessageBox::No)
     3068            else if (iAnswer == AlertButton_No)
    30693069                strMediumId = vboxGlobal().findMedium(strMediumId).id();
    30703070            break;
Note: See TracChangeset for help on using the changeset viewer.

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