- Timestamp:
- Oct 13, 2021 3:23:17 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r91713 r91717 390 390 { 391 391 case UIExtraDataMetaDefs::DialogType_VISOCreator: strResult = "VISOCreator"; break; 392 case UIExtraDataMetaDefs::DialogType_BootFailure: strResult = "BootFailure"; break; 392 393 case UIExtraDataMetaDefs::DialogType_All: strResult = "All"; break; 393 394 default: … … 407 408 QStringList keys; QList<UIExtraDataMetaDefs::DialogType> values; 408 409 keys << "VISOCreator"; values << UIExtraDataMetaDefs::DialogType_VISOCreator; 410 keys << "BootFailure"; values << UIExtraDataMetaDefs::DialogType_BootFailure; 409 411 keys << "All"; values << UIExtraDataMetaDefs::DialogType_All; 410 412 /* Invalid type for unknown words: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r91713 r91717 495 495 DialogType_Invalid = 0, 496 496 DialogType_VISOCreator = RT_BIT(0), 497 DialogType_BootFailure = RT_BIT(1), 497 498 DialogType_All = 0xFFFF 498 499 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIBootFailureDialog.cpp
r91715 r91717 18 18 /* Qt includes: */ 19 19 #include <QAction> 20 #include <QCheckBox> 20 21 #include <QHeaderView> 21 22 #include <QLabel> … … 28 29 #include "QIToolButton.h" 29 30 #include "QIRichTextLabel.h" 30 31 #include "UIBootFailureDialog.h" 31 32 #include "UICommon.h" 33 #include "UIConverter.h" 32 34 #include "UIDesktopWidgetWatchdog.h" 33 35 #include "UIExtraDataManager.h" 34 36 #include "UIFilePathSelector.h" 35 #include "UIBootFailureDialog.h"36 37 37 #include "UIIconPool.h" 38 #include "UIMessageCenter.h" 38 39 #include "UIModalWindowManager.h" 39 #include "UIMessageCenter.h" 40 41 40 41 /* COM includes: */ 42 42 #include "CMediumAttachment.h" 43 43 #include "CStorageController.h" … … 54 54 , m_pBootImageSelector(0) 55 55 , m_pBootImageLabel(0) 56 , m_pIconLabel(0) 57 , m_pSuppressDialogCheckBox(0) 56 58 , m_comMachine(comMachine) 57 59 { 58 60 configure(); 61 } 62 63 UIBootFailureDialog::~UIBootFailureDialog() 64 { 65 if (m_pSuppressDialogCheckBox && m_pSuppressDialogCheckBox->isChecked()) 66 { 67 QStringList suppressedMessageList = gEDataManager->suppressedMessages(); 68 suppressedMessageList << gpConverter->toInternalString(UIExtraDataMetaDefs::DialogType_BootFailure); 69 gEDataManager->setSuppressedMessages(suppressedMessageList); 70 } 59 71 } 60 72 … … 79 91 if (m_pBootImageLabel) 80 92 m_pBootImageLabel->setText(tr("Boot DVD:")); 93 if (m_pSuppressDialogCheckBox) 94 m_pSuppressDialogCheckBox->setText(tr("Do not show this dialog again")); 81 95 } 82 96 … … 110 124 return; 111 125 126 QHBoxLayout *pTopLayout = new QHBoxLayout; 127 pTopLayout->setContentsMargins(0, 0, 0, 0); 128 129 m_pIconLabel = new QLabel; 130 if (m_pIconLabel) 131 { 132 m_pIconLabel->setPixmap(iconPixmap()); 133 m_pIconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); 134 pTopLayout->addWidget(m_pIconLabel, Qt::AlignTop | Qt::AlignCenter); 135 } 136 112 137 m_pLabel = new QIRichTextLabel; 113 138 if (m_pLabel) 114 m_pMainLayout->addWidget(m_pLabel);139 pTopLayout->addWidget(m_pLabel); 115 140 116 141 QHBoxLayout *pSelectorLayout = new QHBoxLayout; … … 134 159 this, &UIBootFailureDialog::sltFileSelectorPathChanged); 135 160 } 161 162 m_pMainLayout->addLayout(pTopLayout); 136 163 m_pMainLayout->addLayout(pSelectorLayout); 164 165 m_pSuppressDialogCheckBox = new QCheckBox; 166 if (m_pSuppressDialogCheckBox) 167 m_pMainLayout->addWidget(m_pSuppressDialogCheckBox); 168 137 169 m_pButtonBox = new QIDialogButtonBox; 138 170 if (m_pButtonBox) … … 144 176 m_pMainLayout->addWidget(m_pButtonBox); 145 177 } 178 146 179 m_pMainLayout->addStretch(); 147 180 retranslateUi(); … … 184 217 if (m_pParent) 185 218 UIDesktopWidgetWatchdog::centerWidget(this, m_pParent, false); 186 219 QIWithRetranslateUI<QIMainDialog>::showEvent(pEvent); 187 220 } 188 221 … … 247 280 insertBootMedium(uiCommon().openMedium(UIMediumDeviceType_DVD, strPath)); 248 281 } 282 283 QPixmap UIBootFailureDialog::iconPixmap() 284 { 285 QIcon icon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning); 286 if (icon.isNull()) 287 return QPixmap(); 288 int iSize = QApplication::style()->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, 0); 289 return icon.pixmap(iSize, iSize); 290 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIBootFailureDialog.h
r91715 r91717 30 30 31 31 /* Forward declarations: */ 32 class QCheckBox; 32 33 class QLabel; 33 34 class QVBoxLayout; … … 58 59 59 60 UIBootFailureDialog(QWidget *pParent, const CMachine &comMachine); 61 ~UIBootFailureDialog(); 60 62 QString bootMediumPath() const; 61 63 62 64 protected: 63 65 64 void showEvent(QShowEvent *pEvent); 65 66 virtual void showEvent(QShowEvent *pEvent) /* override */; 66 67 67 68 private slots: … … 74 75 75 76 bool insertBootMedium(const QUuid &uMediumId); 77 QPixmap iconPixmap(); 76 78 77 79 /** @name Event-handling stuff. … … 100 102 UIFilePathSelector *m_pBootImageSelector; 101 103 QLabel *m_pBootImageLabel; 104 QLabel *m_pIconLabel; 105 QCheckBox *m_pSuppressDialogCheckBox; 102 106 CMachine m_comMachine; 103 107 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r91715 r91717 667 667 return askUserForTheDiskEncryptionPasswords(); 668 668 else if (strErrorId == "VMBootFail") 669 return showBootFailureDialog(); 669 { 670 if (!gEDataManager->suppressedMessages().contains(gpConverter->toInternalString(UIExtraDataMetaDefs::DialogType_BootFailure))) 671 return showBootFailureDialog(); 672 else 673 return; 674 } 670 675 671 676 /* Show runtime error: */ … … 3266 3271 int iResult = pBootFailureDialog->exec(false); 3267 3272 3268 3269 3273 delete pBootFailureDialog; 3270 3274
Note:
See TracChangeset
for help on using the changeset viewer.