VirtualBox

Changeset 69518 in vbox


Ignore:
Timestamp:
Oct 30, 2017 10:18:08 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118861
Message:

FE/Qt: bugref:8400: Media Manager: Moving UIEnumerationProgressBar code to header.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r69297 r69518  
    544544        src/globals/UIThreadPool.cpp \
    545545        src/medium/UIMediumEnumerator.cpp \
    546         src/medium/UIMediumManager.cpp \
    547546        src/runtime/UIActionPoolRuntime.cpp \
    548547        src/runtime/UIAddDiskEncryptionPasswordDialog.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r69200 r69518  
    240240
    241241
    242 /** Medium manager progress-bar.
    243   * Reflects medium-enumeration progress, stays hidden otherwise. */
    244 class UIEnumerationProgressBar : public QWidget
    245 {
    246     Q_OBJECT;
    247 
    248 public:
    249 
    250     /** Constructor on the basis of passed @a pParent. */
    251     UIEnumerationProgressBar(QWidget *pParent = 0)
    252         : QWidget(pParent)
    253     {
    254         /* Prepare: */
    255         prepare();
    256     }
    257 
    258     /** Defines progress-bar label-text. */
    259     void setText(const QString &strText) { m_pLabel->setText(strText); }
    260 
    261     /** Returns progress-bar current-value. */
    262     int value() const { return m_pProgressBar->value(); }
    263     /** Defines progress-bar current-value. */
    264     void setValue(int iValue) { m_pProgressBar->setValue(iValue); }
    265     /** Defines progress-bar maximum-value. */
    266     void setMaximum(int iValue) { m_pProgressBar->setMaximum(iValue); }
    267 
    268 private:
    269 
    270     /** Prepares progress-bar content. */
    271     void prepare()
    272     {
    273         /* Create layout: */
    274         QHBoxLayout *pLayout = new QHBoxLayout(this);
    275         {
    276             /* Configure layout: */
    277             pLayout->setContentsMargins(0, 0, 0, 0);
    278             /* Create label: */
    279             m_pLabel = new QLabel;
    280             /* Create progress-bar: */
    281             m_pProgressBar = new QProgressBar;
    282             {
    283                 /* Configure progress-bar: */
    284                 m_pProgressBar->setTextVisible(false);
    285             }
    286             /* Add widgets into layout: */
    287             pLayout->addWidget(m_pLabel);
    288             pLayout->addWidget(m_pProgressBar);
    289         }
    290     }
    291 
    292     /** Progress-bar label. */
    293     QLabel *m_pLabel;
    294     /** Progress-bar itself. */
    295     QProgressBar *m_pProgressBar;
    296 };
    297 
    298 
    299242/*********************************************************************************************************************************
    300243*   Class UIMediumItem implementation.                                                                                           *
     
    799742    /* Return failure: */
    800743    return false;
     744}
     745
     746
     747/*********************************************************************************************************************************
     748*   Class UIEnumerationProgressBar implementation.                                                                               *
     749*********************************************************************************************************************************/
     750
     751UIEnumerationProgressBar::UIEnumerationProgressBar(QWidget *pParent /* = 0 */)
     752    : QWidget(pParent)
     753{
     754    /* Prepare: */
     755    prepare();
     756}
     757
     758void UIEnumerationProgressBar::setText(const QString &strText)
     759{
     760    m_pLabel->setText(strText);
     761}
     762
     763int UIEnumerationProgressBar::value() const
     764{
     765    return m_pProgressBar->value();
     766}
     767
     768void UIEnumerationProgressBar::setValue(int iValue)
     769{
     770    m_pProgressBar->setValue(iValue);
     771}
     772
     773void UIEnumerationProgressBar::setMaximum(int iValue)
     774{
     775    m_pProgressBar->setMaximum(iValue);
     776}
     777
     778void UIEnumerationProgressBar::prepare()
     779{
     780    /* Create layout: */
     781    QHBoxLayout *pLayout = new QHBoxLayout(this);
     782    {
     783        /* Configure layout: */
     784        pLayout->setContentsMargins(0, 0, 0, 0);
     785        /* Create label: */
     786        m_pLabel = new QLabel;
     787        /* Create progress-bar: */
     788        m_pProgressBar = new QProgressBar;
     789        {
     790            /* Configure progress-bar: */
     791            m_pProgressBar->setTextVisible(false);
     792        }
     793        /* Add widgets into layout: */
     794        pLayout->addWidget(m_pLabel);
     795        pLayout->addWidget(m_pProgressBar);
     796    }
    801797}
    802798
     
    24342430}
    24352431
    2436 #include "UIMediumManager.moc"
    2437 
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h

    r69130 r69518  
    2727class QAbstractButton;
    2828class QLabel;
     29class QProgressBar;
    2930class QTabWidget;
    3031class QTreeWidgetItem;
     
    3233class QILabel;
    3334class QITreeWidget;
    34 class UIEnumerationProgressBar;
    3535class UIMedium;
    3636class UIMediumDetailsWidget;
     
    4949    /** Determines whether passed @a pItem is suitable. */
    5050    virtual bool isItSuitable(UIMediumItem *pItem) const = 0;
     51};
     52
     53
     54/** Medium manager progress-bar.
     55  * Reflects medium-enumeration progress, stays hidden otherwise. */
     56class UIEnumerationProgressBar : public QWidget
     57{
     58    Q_OBJECT;
     59
     60public:
     61
     62    /** Constructor on the basis of passed @a pParent. */
     63    UIEnumerationProgressBar(QWidget *pParent = 0);
     64
     65    /** Defines progress-bar label-text. */
     66    void setText(const QString &strText);
     67
     68    /** Returns progress-bar current-value. */
     69    int value() const;
     70    /** Defines progress-bar current-value. */
     71    void setValue(int iValue);
     72    /** Defines progress-bar maximum-value. */
     73    void setMaximum(int iValue);
     74
     75private:
     76
     77    /** Prepares progress-bar content. */
     78    void prepare();
     79
     80    /** Progress-bar label. */
     81    QLabel       *m_pLabel;
     82    /** Progress-bar itself. */
     83    QProgressBar *m_pProgressBar;
    5184};
    5285
Note: See TracChangeset for help on using the changeset viewer.

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