Changeset 68326 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 7, 2017 6:03:54 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/medium
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDetailsWidget.cpp
r68325 r68326 58 58 , m_pLabelSize(0), m_pEditorSize(0), m_pErrorPaneSize(0) 59 59 , m_pButtonBox(0) 60 , m_fValid(true) 60 61 , m_pLayoutDetails(0) 61 62 { … … 638 639 void UIMediumDetailsWidget::revalidate(QWidget *pWidget /* = 0 */) 639 640 { 641 /* Reset the result: */ 642 m_fValid = true; 643 640 644 /* Validate 'Options' tab content: */ 641 645 if (!pWidget || pWidget == m_pErrorPaneType) … … 644 648 const bool fError = false; 645 649 m_pErrorPaneType->setVisible(fError); 650 if (fError) 651 m_fValid = false; 646 652 } 647 653 if (!pWidget || pWidget == m_pErrorPaneLocation) … … 650 656 const bool fError = false; 651 657 m_pErrorPaneLocation->setVisible(fError); 658 if (fError) 659 m_fValid = false; 652 660 } 653 661 if (!pWidget || pWidget == m_pErrorPaneDescription) … … 656 664 const bool fError = false; 657 665 m_pErrorPaneDescription->setVisible(fError); 666 if (fError) 667 m_fValid = false; 658 668 } 659 669 if (!pWidget || pWidget == m_pErrorPaneSize) … … 662 672 const bool fError = false; 663 673 m_pErrorPaneSize->setVisible(fError); 674 if (fError) 675 m_fValid = false; 664 676 } 665 677 … … 706 718 { 707 719 m_pButtonBox->button(QDialogButtonBox::Cancel)->setEnabled(m_oldData != m_newData); 708 m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled( m_oldData != m_newData);720 m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled((m_oldData != m_newData) && m_fValid); 709 721 } 710 722 711 723 /* Notify listeners as well: */ 712 emit sigDataChanged(m_oldData != m_newData); 724 emit sigRejectAllowed(m_oldData != m_newData); 725 emit sigAcceptAllowed((m_oldData != m_newData) && m_fValid); 713 726 } 714 727 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDetailsWidget.h
r67986 r68326 170 170 signals: 171 171 172 /** Notifies listeners about data changed and whether it @a fDiffers. */ 173 void sigDataChanged(bool fDiffers); 172 /** Notifies listeners about accept is allowed. */ 173 void sigAcceptAllowed(bool fAllowed); 174 /** Notifies listeners about reject is allowed. */ 175 void sigRejectAllowed(bool fAllowed); 174 176 175 177 /** Notifies listeners about data change rejected and should be reseted. */ … … 306 308 /** Holds the button-box instance. */ 307 309 QIDialogButtonBox *m_pButtonBox; 310 311 /** Holds whether options are valid. */ 312 bool m_fValid; 308 313 /** @} */ 309 314 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r68315 r68326 1560 1560 m_pDetailsWidget->setVisible(false); 1561 1561 m_pDetailsWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 1562 connect(m_pDetailsWidget, &UIMediumDetailsWidget::sigDataChanged, 1563 this, &UIMediumManagerWidget::sigMediumDetailsDataChanged); 1562 connect(m_pDetailsWidget, &UIMediumDetailsWidget::sigAcceptAllowed, 1563 this, &UIMediumManagerWidget::sigAcceptAllowed); 1564 connect(m_pDetailsWidget, &UIMediumDetailsWidget::sigRejectAllowed, 1565 this, &UIMediumManagerWidget::sigRejectAllowed); 1564 1566 connect(m_pDetailsWidget, &UIMediumDetailsWidget::sigDataChangeRejected, 1565 1567 this, &UIMediumManagerWidget::sltResetMediumDetailsChanges); … … 2317 2319 connect(widget(), &UIMediumManagerWidget::sigMediumDetailsVisibilityChanged, 2318 2320 button(ButtonType_Reset), &QPushButton::setVisible); 2319 connect(widget(), &UIMediumManagerWidget::sig MediumDetailsDataChanged,2321 connect(widget(), &UIMediumManagerWidget::sigAcceptAllowed, 2320 2322 button(ButtonType_Apply), &QPushButton::setEnabled); 2321 connect(widget(), &UIMediumManagerWidget::sig MediumDetailsDataChanged,2323 connect(widget(), &UIMediumManagerWidget::sigRejectAllowed, 2322 2324 button(ButtonType_Reset), &QPushButton::setEnabled); 2323 2325 connect(buttonBox(), &QIDialogButtonBox::clicked, -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r67765 r68326 64 64 /** Notifies listeners about medium details-widget @a fVisible. */ 65 65 void sigMediumDetailsVisibilityChanged(bool fVisible); 66 /** Notifies listeners about medium details data @a fDiffers. */ 67 void sigMediumDetailsDataChanged(bool fDiffers); 66 /** Notifies listeners about accept is @a fAllowed. */ 67 void sigAcceptAllowed(bool fAllowed); 68 /** Notifies listeners about reject is @a fAllowed. */ 69 void sigRejectAllowed(bool fAllowed); 68 70 69 71 public:
Note:
See TracChangeset
for help on using the changeset viewer.