Changeset 45359 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 5, 2013 9:21:52 AM (12 years ago)
- 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 2048 2048 bool UIMessageCenter::cannotFindGuestAdditions() const 2049 2049 { 2050 return message YesNo(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")); 2055 2055 } 2056 2056 … … 2107 2107 bool UIMessageCenter::cannotFindUserManual(const QString &strMissedLocation) const 2108 2108 { 2109 return message YesNo(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")); 2115 2115 } 2116 2116 … … 2147 2147 bool UIMessageCenter::warAboutOutdatedExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) const 2148 2148 { 2149 return message YesNo(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")); 2156 2156 } 2157 2157 … … 2359 2359 bool UIMessageCenter::confirmOverridingFile(const QString &strPath, QWidget *pParent /*= 0*/) 2360 2360 { 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)); 2365 2366 } 2366 2367 … … 2371 2372 return confirmOverridingFile(strPaths.at(0), pParent); 2372 2373 else if (strPaths.size() > 1) 2373 return message YesNo(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 />"))); 2378 2379 else 2379 2380 return true; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45358 r45359 101 101 return message(pParent, type, strMessage, QString(), pcszAutoConfirmId, 102 102 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()) const113 {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()) const129 {130 return messageYesNo(pParent, type, strMessage, QString(),131 pcszAutoConfirmId, strYesButtonText, strNoButtonText);132 103 } 133 104
Note:
See TracChangeset
for help on using the changeset viewer.