VirtualBox

Changeset 69519 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 30, 2017 10:31:13 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8400: Media Manager: Resurrecting UIEnumerationProgressBar functionality lost during medium manager rework; Now it's embedded into corresponding button-box of either manager dialog or details widget.

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  
    4040# include "UIIconPool.h"
    4141# include "UIMediumDetailsWidget.h"
     42# include "UIMediumManager.h"
    4243# include "UIMediumSizeEditor.h"
    4344# include "VBoxGlobal.h"
     
    4950
    5051
    51 UIMediumDetailsWidget::UIMediumDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
     52UIMediumDetailsWidget::UIMediumDetailsWidget(UIMediumManagerWidget *pParent, EmbedTo enmEmbedding)
    5253    : QIWithRetranslateUI<QWidget>(pParent)
     54    , m_pParent(pParent)
    5355    , m_enmEmbedding(enmEmbedding)
    5456    , m_oldData(UIDataMedium())
     
    6062    , m_pLabelSize(0), m_pEditorSize(0), m_pErrorPaneSize(0)
    6163    , m_pButtonBox(0)
     64    , m_pProgressBar(0)
    6265    , m_fValid(true)
    6366    , m_pLayoutDetails(0)
     
    495498                m_pButtonBox = new QIDialogButtonBox;
    496499                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                }
    500517
    501518                /* Add into layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDetailsWidget.h

    r69277 r69519  
    4141class QITabWidget;
    4242class QIToolButton;
     43class UIEnumerationProgressBar;
     44class UIMediumManagerWidget;
    4345class UIMediumSizeEditor;
    4446
     
    185187    /** Constructs medium details dialog passing @a pParent to the base-class.
    186188      * @param  enmEmbedding  Brings embedding type. */
    187     UIMediumDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent = 0);
     189    UIMediumDetailsWidget(UIMediumManagerWidget *pParent, EmbedTo enmEmbedding);
    188190
    189191    /** Defines the raised details @a enmType. */
     
    270272    /** @name General variables.
    271273      * @{ */
     274        /** Holds the parent reference. */
     275        UIMediumManagerWidget *m_pParent;
    272276        /** Holds the parent widget embedding type. */
    273277        const EmbedTo m_enmEmbedding;
     
    315319
    316320        /** Holds the button-box instance. */
    317         QIDialogButtonBox *m_pButtonBox;
     321        QIDialogButtonBox        *m_pButtonBox;
     322        /** Holds the progress-bar widget instance. */
     323        UIEnumerationProgressBar *m_pProgressBar;
    318324
    319325        /** Holds whether options are valid. */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r69518 r69519  
    825825    /* Prepare: */
    826826    prepare();
     827}
     828
     829void UIMediumManagerWidget::setProgressBar(UIEnumerationProgressBar *pProgressBar)
     830{
     831    /* Cache progress-bar reference:*/
     832    m_pProgressBar = pProgressBar;
     833
     834    /* Update translation: */
     835    retranslateUi();
    827836}
    828837
     
    16341643{
    16351644    /* Create details-widget: */
    1636     m_pDetailsWidget = new UIMediumDetailsWidget(m_enmEmbedding);
     1645    m_pDetailsWidget = new UIMediumDetailsWidget(this, m_enmEmbedding);
    16371646    AssertPtrReturnVoid(m_pDetailsWidget);
    16381647    {
     
    16531662    }
    16541663}
    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 //}
    16681664
    16691665void UIMediumManagerWidget::loadSettings()
     
    23392335UIMediumManager::UIMediumManager(QWidget *pCenterWidget)
    23402336    : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
     2337    , m_pProgressBar(0)
    23412338{
    23422339}
     
    24172414    connect(buttonBox(), &QIDialogButtonBox::clicked,
    24182415            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    }
    24192428}
    24202429
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h

    r69518 r69519  
    114114    UIToolBar *toolbar() const { return m_pToolBar; }
    115115#endif
     116
     117    /** Defines @a pProgressBar reference. */
     118    void setProgressBar(UIEnumerationProgressBar *pProgressBar);
    116119
    117120protected:
     
    216219        /** Prepares details-widget. */
    217220        void prepareDetailsWidget();
    218 //        /** Prepares progress-bar. */
    219 //        void prepareProgressBar();
    220221        /** Load settings: */
    221222        void loadSettings();
     
    359360    /** @name Progress-bar variables.
    360361      * @{ */
    361         /** Holds the progress-bar widget instance. */
     362        /** Holds the progress-bar widget reference. */
    362363        UIEnumerationProgressBar *m_pProgressBar;
    363364    /** @} */
     
    426427    /** @} */
    427428
     429    /** @name Progress-bar variables.
     430      * @{ */
     431        /** Holds the progress-bar widget instance. */
     432        UIEnumerationProgressBar *m_pProgressBar;
     433    /** @} */
     434
    428435    /** Allow factory access to private/protected members: */
    429436    friend class UIMediumManagerFactory;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette