VirtualBox

Ignore:
Timestamp:
Apr 5, 2013 9:21:52 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Message-center: Remove yes/no messages, ok/cancel is enough.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

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

    r45358 r45359  
    20482048bool UIMessageCenter::cannotFindGuestAdditions() const
    20492049{
    2050     return messageYesNo(mainMachineWindowShown(), MessageType_Question,
    2051                         tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>"
    2052                            "<p>Do you wish to download this CD image from the Internet?</p>"),
    2053                         0 /* auto-confirm id */,
    2054                         tr("Download"));
     2050    return messageOkCancel(mainMachineWindowShown(), MessageType_Question,
     2051                           tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>"
     2052                              "<p>Do you wish to download this CD image from the Internet?</p>"),
     2053                           0 /* auto-confirm id */,
     2054                           tr("Download"));
    20552055}
    20562056
     
    21072107bool UIMessageCenter::cannotFindUserManual(const QString &strMissedLocation) const
    21082108{
    2109     return messageYesNo(mainWindowShown(), MessageType_Question,
    2110                         tr("<p>Could not find the <b>VirtualBox User Manual</b> <nobr><b>%1</b>.</nobr></p>"
    2111                            "<p>Do you wish to download this file from the Internet?</p>")
    2112                            .arg(strMissedLocation),
    2113                         0 /* auto-confirm id */,
    2114                         tr("Download"));
     2109    return messageOkCancel(mainWindowShown(), MessageType_Question,
     2110                           tr("<p>Could not find the <b>VirtualBox User Manual</b> <nobr><b>%1</b>.</nobr></p>"
     2111                              "<p>Do you wish to download this file from the Internet?</p>")
     2112                              .arg(strMissedLocation),
     2113                           0 /* auto-confirm id */,
     2114                           tr("Download"));
    21152115}
    21162116
     
    21472147bool UIMessageCenter::warAboutOutdatedExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) const
    21482148{
    2149     return messageYesNo(mainWindowShown(),
    2150                         MessageType_Question,
    2151                         tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>"
    2152                            "<p>Do you wish to download latest one from the Internet?</p>")
    2153                            .arg(strExtPackVersion).arg(strExtPackName),
    2154                         0 /* auto-confirm id */,
    2155                         tr("Download"));
     2149    return messageOkCancel(mainWindowShown(),
     2150                           MessageType_Question,
     2151                           tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>"
     2152                              "<p>Do you wish to download latest one from the Internet?</p>")
     2153                              .arg(strExtPackVersion).arg(strExtPackName),
     2154                           0 /* auto-confirm id */,
     2155                           tr("Download"));
    21562156}
    21572157
     
    23592359bool UIMessageCenter::confirmOverridingFile(const QString &strPath, QWidget *pParent /*= 0*/)
    23602360{
    2361     return messageYesNo(pParent, MessageType_Question,
    2362                         tr("A file named <b>%1</b> already exists. "
    2363                            "Are you sure you want to replace it?<br /><br />"
    2364                            "Replacing it will overwrite its contents.").arg(strPath));
     2361    return messageOkCancel(pParent, MessageType_Question,
     2362                           tr("A file named <b>%1</b> already exists. "
     2363                              "Are you sure you want to replace it?<br /><br />"
     2364                              "Replacing it will overwrite its contents.")
     2365                              .arg(strPath));
    23652366}
    23662367
     
    23712372        return confirmOverridingFile(strPaths.at(0), pParent);
    23722373    else if (strPaths.size() > 1)
    2373         return messageYesNo(pParent, MessageType_Question,
    2374                             tr("The following files already exist:<br /><br />%1<br /><br />"
    2375                                "Are you sure you want to replace them? "
    2376                                "Replacing them will overwrite their contents.")
    2377                                .arg(QStringList(strPaths.toList()).join("<br />")));
     2374        return messageOkCancel(pParent, MessageType_Question,
     2375                               tr("The following files already exist:<br /><br />%1<br /><br />"
     2376                                  "Are you sure you want to replace them? "
     2377                                  "Replacing them will overwrite their contents.")
     2378                                  .arg(QStringList(strPaths.toList()).join("<br />")));
    23782379    else
    23792380        return true;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r45358 r45359  
    101101        return message(pParent, type, strMessage, QString(), pcszAutoConfirmId,
    102102                       iButton1, iButton2, iButton3, strButtonText1, strButtonText2, strButtonText3);
    103     }
    104 
    105     /* API: Alert providing stuff: Wrapper to the main function,
    106      * Takes button type(s) as "Yes / No": */
    107     bool messageYesNo(QWidget *pParent, MessageType type,
    108                       const QString &strMessage,
    109                       const QString &strDetails = QString(),
    110                       const char *pcszAutoConfirmId = 0,
    111                       const QString &strYesButtonText = QString(),
    112                       const QString &strNoButtonText = QString()) const
    113     {
    114         return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
    115                         AlertButton_Yes | AlertButtonOption_Default,
    116                         AlertButton_No | AlertButtonOption_Escape,
    117                         0,
    118                         strYesButtonText, strNoButtonText, QString()) &
    119                 AlertButtonMask) == AlertButton_Yes;
    120     }
    121 
    122     /* API: Alert providing stuff: Wrapper to the function above,
    123      * Omits details. Takes button type(s) as "Yes / No": */
    124     bool messageYesNo(QWidget *pParent, MessageType type,
    125                       const QString &strMessage,
    126                       const char *pcszAutoConfirmId,
    127                       const QString &strYesButtonText = QString(),
    128                       const QString &strNoButtonText = QString()) const
    129     {
    130         return messageYesNo(pParent, type, strMessage, QString(),
    131                             pcszAutoConfirmId, strYesButtonText, strNoButtonText);
    132103    }
    133104
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