Changeset 69519 in vbox for trunk/src/VBox
- Timestamp:
- Oct 30, 2017 10:31:13 AM (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
r69277 r69519 40 40 # include "UIIconPool.h" 41 41 # include "UIMediumDetailsWidget.h" 42 # include "UIMediumManager.h" 42 43 # include "UIMediumSizeEditor.h" 43 44 # include "VBoxGlobal.h" … … 49 50 50 51 51 UIMediumDetailsWidget::UIMediumDetailsWidget( EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)52 UIMediumDetailsWidget::UIMediumDetailsWidget(UIMediumManagerWidget *pParent, EmbedTo enmEmbedding) 52 53 : QIWithRetranslateUI<QWidget>(pParent) 54 , m_pParent(pParent) 53 55 , m_enmEmbedding(enmEmbedding) 54 56 , m_oldData(UIDataMedium()) … … 60 62 , m_pLabelSize(0), m_pEditorSize(0), m_pErrorPaneSize(0) 61 63 , m_pButtonBox(0) 64 , m_pProgressBar(0) 62 65 , m_fValid(true) 63 66 , m_pLayoutDetails(0) … … 495 498 m_pButtonBox = new QIDialogButtonBox; 496 499 AssertPtrReturnVoid(m_pButtonBox); 497 /* Configure button-box: */ 498 m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); 499 connect(m_pButtonBox, &QIDialogButtonBox::clicked, this, &UIMediumDetailsWidget::sltHandleButtonBoxClick); 500 { 501 /* Configure button-box: */ 502 m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); 503 connect(m_pButtonBox, &QIDialogButtonBox::clicked, this, &UIMediumDetailsWidget::sltHandleButtonBoxClick); 504 505 /* Create progress-bar: */ 506 m_pProgressBar = new UIEnumerationProgressBar; 507 AssertPtrReturnVoid(m_pProgressBar); 508 { 509 /* Configure progress-bar: */ 510 m_pProgressBar->hide(); 511 /* Add progress-bar into button-box layout: */ 512 m_pButtonBox->addExtraWidget(m_pProgressBar); 513 /* Notify parent it has progress-bar: */ 514 m_pParent->setProgressBar(m_pProgressBar); 515 } 516 } 500 517 501 518 /* Add into layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDetailsWidget.h
r69277 r69519 41 41 class QITabWidget; 42 42 class QIToolButton; 43 class UIEnumerationProgressBar; 44 class UIMediumManagerWidget; 43 45 class UIMediumSizeEditor; 44 46 … … 185 187 /** Constructs medium details dialog passing @a pParent to the base-class. 186 188 * @param enmEmbedding Brings embedding type. */ 187 UIMediumDetailsWidget( EmbedTo enmEmbedding, QWidget *pParent = 0);189 UIMediumDetailsWidget(UIMediumManagerWidget *pParent, EmbedTo enmEmbedding); 188 190 189 191 /** Defines the raised details @a enmType. */ … … 270 272 /** @name General variables. 271 273 * @{ */ 274 /** Holds the parent reference. */ 275 UIMediumManagerWidget *m_pParent; 272 276 /** Holds the parent widget embedding type. */ 273 277 const EmbedTo m_enmEmbedding; … … 315 319 316 320 /** Holds the button-box instance. */ 317 QIDialogButtonBox *m_pButtonBox; 321 QIDialogButtonBox *m_pButtonBox; 322 /** Holds the progress-bar widget instance. */ 323 UIEnumerationProgressBar *m_pProgressBar; 318 324 319 325 /** Holds whether options are valid. */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r69518 r69519 825 825 /* Prepare: */ 826 826 prepare(); 827 } 828 829 void UIMediumManagerWidget::setProgressBar(UIEnumerationProgressBar *pProgressBar) 830 { 831 /* Cache progress-bar reference:*/ 832 m_pProgressBar = pProgressBar; 833 834 /* Update translation: */ 835 retranslateUi(); 827 836 } 828 837 … … 1634 1643 { 1635 1644 /* Create details-widget: */ 1636 m_pDetailsWidget = new UIMediumDetailsWidget( m_enmEmbedding);1645 m_pDetailsWidget = new UIMediumDetailsWidget(this, m_enmEmbedding); 1637 1646 AssertPtrReturnVoid(m_pDetailsWidget); 1638 1647 { … … 1653 1662 } 1654 1663 } 1655 1656 //void UIMediumManagerWidget::prepareProgressBar()1657 //{1658 // /* Create progress-bar: */1659 // m_pProgressBar = new UIEnumerationProgressBar;1660 // AssertPtrReturnVoid(m_pProgressBar);1661 // {1662 // /* Configure progress-bar: */1663 // m_pProgressBar->hide();1664 // /* Add progress-bar into button-box layout: */1665 // m_pButtonBox->addExtraWidget(m_pProgressBar);1666 // }1667 //}1668 1664 1669 1665 void UIMediumManagerWidget::loadSettings() … … 2339 2335 UIMediumManager::UIMediumManager(QWidget *pCenterWidget) 2340 2336 : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget) 2337 , m_pProgressBar(0) 2341 2338 { 2342 2339 } … … 2417 2414 connect(buttonBox(), &QIDialogButtonBox::clicked, 2418 2415 this, &UIMediumManager::sltHandleButtonBoxClick); 2416 2417 /* Create progress-bar: */ 2418 m_pProgressBar = new UIEnumerationProgressBar; 2419 AssertPtrReturnVoid(m_pProgressBar); 2420 { 2421 /* Configure progress-bar: */ 2422 m_pProgressBar->hide(); 2423 /* Add progress-bar into button-box layout: */ 2424 buttonBox()->addExtraWidget(m_pProgressBar); 2425 /* Notify widget it has progress-bar: */ 2426 widget()->setProgressBar(m_pProgressBar); 2427 } 2419 2428 } 2420 2429 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r69518 r69519 114 114 UIToolBar *toolbar() const { return m_pToolBar; } 115 115 #endif 116 117 /** Defines @a pProgressBar reference. */ 118 void setProgressBar(UIEnumerationProgressBar *pProgressBar); 116 119 117 120 protected: … … 216 219 /** Prepares details-widget. */ 217 220 void prepareDetailsWidget(); 218 // /** Prepares progress-bar. */219 // void prepareProgressBar();220 221 /** Load settings: */ 221 222 void loadSettings(); … … 359 360 /** @name Progress-bar variables. 360 361 * @{ */ 361 /** Holds the progress-bar widget instance. */362 /** Holds the progress-bar widget reference. */ 362 363 UIEnumerationProgressBar *m_pProgressBar; 363 364 /** @} */ … … 426 427 /** @} */ 427 428 429 /** @name Progress-bar variables. 430 * @{ */ 431 /** Holds the progress-bar widget instance. */ 432 UIEnumerationProgressBar *m_pProgressBar; 433 /** @} */ 434 428 435 /** Allow factory access to private/protected members: */ 429 436 friend class UIMediumManagerFactory;
Note:
See TracChangeset
for help on using the changeset viewer.