Changeset 85135 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 9, 2020 6:59:35 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.cpp
r82968 r85135 303 303 } 304 304 305 void QIComboBox::mark(bool fError) 306 { 307 if (!m_pComboBox) 308 return; 309 QPalette palette = m_pComboBox->palette(); 310 if (fError) 311 palette.setColor(QPalette::Base, QColor(255, 180, 180)); 312 else 313 palette.setColor(QPalette::Base, m_originalBaseColor); 314 m_pComboBox->setPalette(palette); 315 } 316 305 317 void QIComboBox::clear() 306 318 { … … 376 388 AssertPtrReturnVoid(m_pComboBox); 377 389 { 390 /* Cache original base color: */ 391 m_originalBaseColor = m_pComboBox->palette().color(QPalette::Base); 378 392 /* Configure combo-box: */ 379 393 setFocusProxy(m_pComboBox); -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.h
r82968 r85135 119 119 /** Defines size adjust @a enmPolicy. */ 120 120 void setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy enmPolicy); 121 /** Paints the file selectors background to a reddish color when @p fError is true. */ 122 void mark(bool fError); 121 123 122 124 public slots: … … 154 156 /** Holds the original combo-box instance. */ 155 157 QComboBox *m_pComboBox; 158 159 /** The original background base color. Used when marking/unmarking the combo box. */ 160 QColor m_originalBaseColor; 156 161 }; 157 162 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
r82968 r85135 27 27 # include <QListView> 28 28 #endif 29 #include <QPalette> 29 30 30 31 /* GUI includes: */ … … 184 185 } 185 186 187 186 188 void UIFilePathSelector::setPath(const QString &strPath, bool fRefreshText /* = true */) 187 189 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h
r82968 r85135 118 118 const QString& defaultPath() const; 119 119 120 /** Paints the file selectors background to a reddish color when @p fError is true. */ 121 void markFileSelector(bool fError); 122 120 123 public slots: 121 124 … … 213 216 /** Path is set to m_strDefaultPath when it is reset. */ 214 217 QString m_strDefaultPath; 218 215 219 }; 216 220 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r85064 r85135 72 72 }; 73 73 74 /* Constructor: */74 /** Constructor: */ 75 75 UIWizardNewVM(QWidget *pParent, const QString &strGroup = QString()); 76 76 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r85110 r85135 483 483 } 484 484 485 void UIWizardNewVMPage1::setTypeByISODetectedOSType(const QString &strDetectedOSType) 486 { 487 if (!strDetectedOSType.isEmpty()) 488 onNameChanged(strDetectedOSType); 489 } 490 491 void UIWizardNewVMPage1::markWidgets() const 492 { 493 if (m_pISOFilePathSelector) 494 m_pISOFilePathSelector->mark(isISOFileSelectorComplete()); 495 } 496 497 bool UIWizardNewVMPage1::isISOFileSelectorComplete() const 498 { 499 if (!m_pISOFilePathSelector) 500 return false; 501 return checkISOFile(); 502 } 503 485 504 UIWizardNewVMPageBasic1::UIWizardNewVMPageBasic1(const QString &strGroup) 486 505 : UIWizardNewVMPage1(strGroup) … … 525 544 } 526 545 527 void UIWizardNewVMPage1::setTypeByISODetectedOSType(const QString &strDetectedOSType)528 {529 if (!strDetectedOSType.isEmpty())530 onNameChanged(strDetectedOSType);531 }532 533 546 bool UIWizardNewVMPageBasic1::isComplete() const 534 547 { 548 markWidgets(); 535 549 if (m_pNameAndSystemEditor->name().isEmpty()) 536 550 return false; 537 return checkISOFile();551 return isISOFileSelectorComplete(); 538 552 } 539 553 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r85104 r85135 71 71 /** @} */ 72 72 73 74 73 bool determineOSType(const QString &strISOPath); 75 74 /** calls CVirtualBox::ComposeMachineFilename(...) and sets related member variables */ 76 75 void composeMachineFilePath(); 77 bool checkISOFile() const;78 76 /** Creates the page widgets and adds them into the @p pGridLayout. */ 79 77 void createNameOSTypeWidgets(QGridLayout *pGridLayout, bool fCreateLabels = true); 80 78 void setTypeByISODetectedOSType(const QString &strDetectedOSType); 79 /** Colors the widgets red if they cause isComplete to fail. */ 80 void markWidgets() const; 81 82 bool isISOFileSelectorComplete() const; 81 83 82 84 /** @name Widgets … … 89 91 QLabel *m_pISOSelectorLabel; 90 92 /** Holds the ISO selector editor instance. */ 91 UIFilePathSelector *m_pISOFilePathSelector;93 mutable UIFilePathSelector *m_pISOFilePathSelector; 92 94 /** Holds the headless start label instance. */ 93 95 QLabel *m_pStartHeadlessLabel; … … 105 107 private: 106 108 109 bool checkISOFile() const; 107 110 108 111 /** Full path (including the file name) of the machine's configuration file. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r85110 r85135 336 336 bool UIWizardNewVMPageExpert::isComplete() const 337 337 { 338 UIWizardNewVMPage1::markWidgets(); 338 339 /* Make sure mandatory fields are complete, 339 340 * 'ram' field feats the bounds, … … 346 347 { 347 348 /* Check the installation medium: */ 348 if (! checkISOFile())349 if (!isISOFileSelectorComplete()) 349 350 return false; 350 351 /* Check the GA installation medium: */
Note:
See TracChangeset
for help on using the changeset viewer.