Changeset 45295 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 3, 2013 7:28:29 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp
r45192 r45295 51 51 */ 52 52 QIMessageBox::QIMessageBox (const QString &aCaption, const QString &aText, 53 Icon aIcon, int aButton0, int aButton1, int aButton2,53 IconType aIcon, int aButton0, int aButton1, int aButton2, 54 54 QWidget *aParent, const char *aName, bool aModal) 55 55 : QIDialog (aParent) … … 156 156 /* If this is an error message add an "Copy to clipboard" button for easier 157 157 * bug reports. */ 158 if (aIcon == QIMessageBox:: Critical)158 if (aIcon == QIMessageBox::IconType_Critical) 159 159 { 160 160 QPushButton *pCopyButton = createButton(Copy); … … 316 316 } 317 317 318 QPixmap QIMessageBox::standardPixmap (QIMessageBox::Icon aIcon)318 QPixmap QIMessageBox::standardPixmap (QIMessageBox::IconType aIcon) 319 319 { 320 320 QIcon icon; 321 321 switch (aIcon) 322 322 { 323 case QIMessageBox::I nformation:323 case QIMessageBox::IconType_Information: 324 324 icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxInformationIcon, this); 325 325 break; … … 327 327 icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxWarningIcon, this); 328 328 break; 329 case QIMessageBox:: Critical:329 case QIMessageBox::IconType_Critical: 330 330 icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxCriticalIcon, this); 331 331 break; 332 case QIMessageBox:: Question:332 case QIMessageBox::IconType_Question: 333 333 icon = UIIconPool::defaultIcon(UIIconPool::MessageBoxQuestionIcon, this); 334 334 break; 335 case QIMessageBox:: GuruMeditation:335 case QIMessageBox::IconType_GuruMeditation: 336 336 icon = QIcon(":/meditation_32px.png"); 337 337 break; … … 364 364 mTextLabel->useSizeHintForWidth (mTextLabel->width()); 365 365 mTextLabel->updateGeometry(); 366 setFixed Width (width());366 setFixedSize(size()); 367 367 mDetailsSplitter->toggleWidget(); 368 368 mWasPolished = true; -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h
r45192 r45295 6 6 7 7 /* 8 * Copyright (C) 2006-201 2Oracle Corporation8 * Copyright (C) 2006-2013 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __QIMessageBox_h__ 21 21 22 /* VBox includes */ 23 #include "QIDialog.h" 24 25 /* Qt includes */ 22 /* Qt includes: */ 26 23 #include <QCheckBox> 27 24 #include <QMessageBox> 28 25 #include <QTextEdit> 29 26 30 /* VBox forwards */ 27 /* GUI includes: */ 28 #include "QIDialog.h" 29 30 /* Forward declarations: */ 31 class QCloseEvent; 32 class QLabel; 33 class QPushButton; 34 class QSpacerItem; 31 35 class QIArrowSplitter; 32 36 class QIDialogButtonBox; 33 37 class QILabel; 34 38 35 /* Qt forwards */ 36 class QCloseEvent; 37 class QLabel; 38 class QPushButton; 39 class QSpacerItem; 40 41 /** @class QIMessageBox 42 * 43 * The QIMessageBox class is a message box similar to QMessageBox. 44 * It partly implements the QMessageBox interface and adds some enhanced 45 * functionality. 46 */ 39 /* QIDialog extension representing GUI alerts: */ 47 40 class QIMessageBox : public QIDialog 48 41 { … … 51 44 public: 52 45 53 / / for compatibility with QMessageBox54 enum Icon 46 /* Icon type enumerator: */ 47 enum IconType 55 48 { 56 NoIcon = QMessageBox::NoIcon,57 I nformation = QMessageBox::Information,58 Warning = QMessageBox::Warning,59 Critical = QMessageBox::Critical,60 Question = QMessageBox::Question,61 GuruMeditation,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, 62 55 }; 63 56 … … 75 68 76 69 QIMessageBox (const QString &aCaption, const QString &aText, 77 Icon aIcon, int aButton0, int aButton1 = 0, int aButton2 = 0,70 IconType aIcon, int aButton0, int aButton1 = 0, int aButton2 = 0, 78 71 QWidget *aParent = 0, const char *aName = 0, bool aModal = TRUE); 79 72 … … 90 83 void setDetailsText (const QString &aText); 91 84 92 QPixmap standardPixmap (QIMessageBox::Icon aIcon);85 QPixmap standardPixmap (QIMessageBox::IconType aIcon); 93 86 94 87 private: -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45292 r45295 134 134 /* Assign corresponding title and icon: */ 135 135 QString strTitle; 136 QIMessageBox::Icon icon;136 QIMessageBox::IconType icon; 137 137 switch (type) 138 138 { … … 140 140 case MessageType_Info: 141 141 strTitle = tr("VirtualBox - Information", "msg box title"); 142 icon = QIMessageBox::I nformation;142 icon = QIMessageBox::IconType_Information; 143 143 break; 144 144 case MessageType_Question: 145 145 strTitle = tr("VirtualBox - Question", "msg box title"); 146 icon = QIMessageBox:: Question;146 icon = QIMessageBox::IconType_Question; 147 147 break; 148 148 case MessageType_Warning: 149 149 strTitle = tr("VirtualBox - Warning", "msg box title"); 150 icon = QIMessageBox:: Warning;150 icon = QIMessageBox::IconType_Warning; 151 151 break; 152 152 case MessageType_Error: 153 153 strTitle = tr("VirtualBox - Error", "msg box title"); 154 icon = QIMessageBox:: Critical;154 icon = QIMessageBox::IconType_Critical; 155 155 break; 156 156 case MessageType_Critical: 157 157 strTitle = tr("VirtualBox - Critical Error", "msg box title"); 158 icon = QIMessageBox:: Critical;158 icon = QIMessageBox::IconType_Critical; 159 159 break; 160 160 case MessageType_GuruMeditation: 161 161 strTitle = "VirtualBox - Guru Meditation"; /* don't translate this */ 162 icon = QIMessageBox:: GuruMeditation;162 icon = QIMessageBox::IconType_GuruMeditation; 163 163 break; 164 164 } … … 795 795 /* Show the message: */ 796 796 message(mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error, 797 798 799 797 tr("Failed to access the USB subsystem."), 798 formatErrorInfo(res), 799 "cannotAccessUSB"); 800 800 } 801 801 … … 2984 2984 /* Choose title and icon: */ 2985 2985 QString title; 2986 QIMessageBox::Icon icon;2986 QIMessageBox::IconType icon; 2987 2987 switch (type) 2988 2988 { … … 2990 2990 case MessageType_Info: 2991 2991 title = tr("VirtualBox - Information", "msg box title"); 2992 icon = QIMessageBox::I nformation;2992 icon = QIMessageBox::IconType_Information; 2993 2993 break; 2994 2994 case MessageType_Question: 2995 2995 title = tr("VirtualBox - MessageType_Question", "msg box title"); 2996 icon = QIMessageBox:: Question;2996 icon = QIMessageBox::IconType_Question; 2997 2997 break; 2998 2998 case MessageType_Warning: 2999 2999 title = tr("VirtualBox - MessageType_Warning", "msg box title"); 3000 icon = QIMessageBox:: Warning;3000 icon = QIMessageBox::IconType_Warning; 3001 3001 break; 3002 3002 case MessageType_Error: 3003 3003 title = tr("VirtualBox - MessageType_Error", "msg box title"); 3004 icon = QIMessageBox:: Critical;3004 icon = QIMessageBox::IconType_Critical; 3005 3005 break; 3006 3006 case MessageType_Critical: 3007 3007 title = tr("VirtualBox - MessageType_Critical MessageType_Error", "msg box title"); 3008 icon = QIMessageBox:: Critical;3008 icon = QIMessageBox::IconType_Critical; 3009 3009 break; 3010 3010 case MessageType_GuruMeditation: 3011 3011 title = "VirtualBox - Guru Meditation"; /* don't translate this */ 3012 icon = QIMessageBox:: GuruMeditation;3012 icon = QIMessageBox::IconType_GuruMeditation; 3013 3013 break; 3014 3014 }
Note:
See TracChangeset
for help on using the changeset viewer.