Changeset 69518 in vbox
- Timestamp:
- Oct 30, 2017 10:18:08 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 118861
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r69297 r69518 544 544 src/globals/UIThreadPool.cpp \ 545 545 src/medium/UIMediumEnumerator.cpp \ 546 src/medium/UIMediumManager.cpp \547 546 src/runtime/UIActionPoolRuntime.cpp \ 548 547 src/runtime/UIAddDiskEncryptionPasswordDialog.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r69200 r69518 240 240 241 241 242 /** Medium manager progress-bar.243 * Reflects medium-enumeration progress, stays hidden otherwise. */244 class UIEnumerationProgressBar : public QWidget245 {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 299 242 /********************************************************************************************************************************* 300 243 * Class UIMediumItem implementation. * … … 799 742 /* Return failure: */ 800 743 return false; 744 } 745 746 747 /********************************************************************************************************************************* 748 * Class UIEnumerationProgressBar implementation. * 749 *********************************************************************************************************************************/ 750 751 UIEnumerationProgressBar::UIEnumerationProgressBar(QWidget *pParent /* = 0 */) 752 : QWidget(pParent) 753 { 754 /* Prepare: */ 755 prepare(); 756 } 757 758 void UIEnumerationProgressBar::setText(const QString &strText) 759 { 760 m_pLabel->setText(strText); 761 } 762 763 int UIEnumerationProgressBar::value() const 764 { 765 return m_pProgressBar->value(); 766 } 767 768 void UIEnumerationProgressBar::setValue(int iValue) 769 { 770 m_pProgressBar->setValue(iValue); 771 } 772 773 void UIEnumerationProgressBar::setMaximum(int iValue) 774 { 775 m_pProgressBar->setMaximum(iValue); 776 } 777 778 void 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 } 801 797 } 802 798 … … 2434 2430 } 2435 2431 2436 #include "UIMediumManager.moc"2437 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r69130 r69518 27 27 class QAbstractButton; 28 28 class QLabel; 29 class QProgressBar; 29 30 class QTabWidget; 30 31 class QTreeWidgetItem; … … 32 33 class QILabel; 33 34 class QITreeWidget; 34 class UIEnumerationProgressBar;35 35 class UIMedium; 36 36 class UIMediumDetailsWidget; … … 49 49 /** Determines whether passed @a pItem is suitable. */ 50 50 virtual bool isItSuitable(UIMediumItem *pItem) const = 0; 51 }; 52 53 54 /** Medium manager progress-bar. 55 * Reflects medium-enumeration progress, stays hidden otherwise. */ 56 class UIEnumerationProgressBar : public QWidget 57 { 58 Q_OBJECT; 59 60 public: 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 75 private: 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; 51 84 }; 52 85
Note:
See TracChangeset
for help on using the changeset viewer.