Changeset 90727 in vbox
- Timestamp:
- Aug 18, 2021 4:09:34 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp
r90712 r90727 20 20 #include <QLabel> 21 21 #include <QPainter> 22 #include <QProgressBar> 22 23 #include <QPushButton> 23 24 #include <QStackedWidget> … … 100 101 , m_pLabelPageTitle(0) 101 102 , m_pWidgetStack(0) 103 , m_pProgressStack(0) 104 , m_pProgressBar(0) 102 105 { 103 106 prepare(); … … 153 156 connect(pPage, &UINativeWizardPage::completeChanged, 154 157 this, &UINativeWizard::sltCompleteChanged); 158 connect(pPage, &UINativeWizardPage::sigProgressStarted, 159 this, &UINativeWizard::sltHandleProgressStarted); 160 connect(pPage, &UINativeWizardPage::sigProgressChange, 161 this, &UINativeWizard::sltHandleProgressChange); 162 connect(pPage, &UINativeWizardPage::sigProgressFinished, 163 this, &UINativeWizard::sltHandleProgressFinished); 155 164 156 165 /* Returns added page index: */ … … 272 281 AssertMsgReturnVoid(pButtonNext, ("No Next wizard button found!\n")); 273 282 pButtonNext->setEnabled(pPage->isComplete()); 283 } 284 285 void UINativeWizard::sltHandleProgressStarted() 286 { 287 m_pProgressStack->setCurrentIndex(1); 288 } 289 290 void UINativeWizard::sltHandleProgressChange(ulong uPercent) 291 { 292 m_pProgressBar->setMinimum(0); 293 m_pProgressBar->setValue(uPercent); 294 m_pProgressBar->setMaximum(100); 295 } 296 297 void UINativeWizard::sltHandleProgressFinished() 298 { 299 m_pProgressStack->setCurrentIndex(0); 274 300 } 275 301 … … 467 493 pLayoutBottom->addWidget(pButton); 468 494 if (enmType == WizardButtonType_Help) 469 pLayoutBottom->addStretch(1); 495 { 496 /* Prepare progress-stack: */ 497 m_pProgressStack = new QStackedWidget(pWidgetBottom); 498 if (m_pProgressStack) 499 { 500 /* Prepare stretch: */ 501 QWidget *pStretch = new QWidget(m_pProgressStack); 502 if (pStretch) 503 m_pProgressStack->addWidget(pStretch); 504 505 /* Prepare progress-bar: */ 506 m_pProgressBar = new QProgressBar(m_pProgressStack); 507 if (m_pProgressBar) 508 { 509 m_pProgressBar->setMaximum(0); 510 m_pProgressStack->addWidget(m_pProgressBar); 511 } 512 513 /* Add to layout: */ 514 pLayoutBottom->addWidget(m_pProgressStack); 515 } 516 } 470 517 if ( pButton 471 518 && enmType == WizardButtonType_Next) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h
r90069 r90727 33 33 /* Forward declarations: */ 34 34 class QLabel; 35 class QProgressBar; 35 36 class QPushButton; 36 37 class QStackedWidget; … … 128 129 void sltCompleteChanged(); 129 130 131 /** Handles signal about progress has started. */ 132 void sltHandleProgressStarted(); 133 /** Handles signal about progress changed. 134 * @param uPercent Brings the progress percentage. */ 135 void sltHandleProgressChange(ulong uPercent); 136 /** Handles signal about progress has finished. */ 137 void sltHandleProgressFinished(); 138 130 139 /** Toggles between basic and expert modes. */ 131 140 void sltExpert(); … … 178 187 /** Holds the widget-stack instance. */ 179 188 QStackedWidget *m_pWidgetStack; 189 /** Holds the progress-stack instance. */ 190 QStackedWidget *m_pProgressStack; 191 /** Holds the progress-bar instance. */ 192 QProgressBar *m_pProgressBar; 180 193 /** Holds button instance map. */ 181 194 QMap<WizardButtonType, QPushButton*> m_buttons; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizardPage.h
r89960 r90727 39 39 void completeChanged(); 40 40 41 /** Notifies listeners about progress has started. */ 42 void sigProgressStarted(); 43 /** Notifies listeners about progress has changed. 44 * @param uPercent Brings the progress percentage. */ 45 void sigProgressChange(ulong uPercent); 46 /** Notifies listeners about progress has finished. */ 47 void sigProgressFinished(); 48 41 49 public: 42 50
Note:
See TracChangeset
for help on using the changeset viewer.