- Timestamp:
- Apr 5, 2013 10:34:20 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
r45362 r45364 114 114 strButtonText1, strButtonText2, strButtonText3, 115 115 QString(pcszAutoConfirmId)); 116 } 117 118 int UIMessageCenter::message(QWidget *pParent, MessageType type, 119 const QString &strMessage, 120 const char *pcszAutoConfirmId, 121 int iButton1 /*= 0*/, 122 int iButton2 /*= 0*/, 123 int iButton3 /*= 0*/, 124 const QString &strButtonText1 /*= QString()*/, 125 const QString &strButtonText2 /*= QString()*/, 126 const QString &strButtonText3 /*= QString()*/) const 127 { 128 return message(pParent, type, strMessage, QString(), pcszAutoConfirmId, 129 iButton1, iButton2, iButton3, strButtonText1, strButtonText2, strButtonText3); 130 } 131 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()) & 148 AlertButtonMask) == AlertButton_Ok; 149 } 150 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); 116 160 } 117 161 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45359 r45364 97 97 const QString &strButtonText1 = QString(), 98 98 const QString &strButtonText2 = QString(), 99 const QString &strButtonText3 = QString()) const 100 { 101 return message(pParent, type, strMessage, QString(), pcszAutoConfirmId, 102 iButton1, iButton2, iButton3, strButtonText1, strButtonText2, strButtonText3); 103 } 99 const QString &strButtonText3 = QString()) const; 104 100 105 101 /* API: Alert providing stuff: Wrapper to the main function, … … 111 107 const QString &strOkButtonText = QString(), 112 108 const QString &strCancelButtonText = QString(), 113 bool fOkByDefault = true) const 114 { 115 int iOkButton = fOkByDefault ? AlertButton_Ok | AlertButtonOption_Default : 116 AlertButton_Ok; 117 int iCancelButton = fOkByDefault ? AlertButton_Cancel | AlertButtonOption_Escape : 118 AlertButton_Cancel | AlertButtonOption_Escape | AlertButtonOption_Default; 119 return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId, 120 iOkButton, iCancelButton, 0, strOkButtonText, strCancelButtonText, QString()) & 121 AlertButtonMask) == AlertButton_Ok; 122 } 109 bool fOkByDefault = true) const; 123 110 124 111 /* API: Alert providing stuff: Wrapper to the function above, 125 * Omits details. Takes button type(s) as "Ok / Cancel": */ 112 * Takes button type(s) as "Ok / Cancel", 113 * Omits details. */ 126 114 bool messageOkCancel(QWidget *pParent, MessageType type, 127 115 const QString &strMessage, … … 129 117 const QString &strOkButtonText = QString(), 130 118 const QString &strCancelButtonText = QString(), 131 bool fOkByDefault = true) const 132 { 133 return messageOkCancel(pParent, type, strMessage, QString(), pcszAutoConfirmId, 134 strOkButtonText, strCancelButtonText, fOkByDefault); 135 } 119 bool fOkByDefault = true) const; 136 120 137 121 /* API: Alert providing stuff: One more main function: */
Note:
See TracChangeset
for help on using the changeset viewer.