- Timestamp:
- Oct 29, 2021 1:54:47 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
r92110 r92149 20 20 #include <QLabel> 21 21 #include <QPainter> 22 #include <QProgressBar>23 22 #include <QPushButton> 24 23 #include <QStackedWidget> … … 93 92 , m_pLabelPageTitle(0) 94 93 , m_pWidgetStack(0) 95 , m_pProgressStack(0)96 , m_pProgressBar(0)97 94 , m_pNotificationCenter(0) 98 95 { … … 173 170 connect(pPage, &UINativeWizardPage::completeChanged, 174 171 this, &UINativeWizard::sltCompleteChanged); 175 connect(pPage, &UINativeWizardPage::sigProgressStarted,176 this, &UINativeWizard::sltHandleProgressStarted);177 connect(pPage, &UINativeWizardPage::sigProgressChange,178 this, &UINativeWizard::sltHandleProgressChange);179 connect(pPage, &UINativeWizardPage::sigProgressFinished,180 this, &UINativeWizard::sltHandleProgressFinished);181 172 182 173 /* Returns added page index: */ … … 239 230 pButtonCancel->setText(tr("&Cancel")); 240 231 pButtonCancel->setToolTip(tr("Cancel wizard execution.")); 241 }242 243 void UINativeWizard::sltHandleProgressStarted()244 {245 m_pProgressStack->setCurrentIndex(1);246 }247 248 void UINativeWizard::sltHandleProgressChange(ulong uPercent)249 {250 m_pProgressBar->setMinimum(0);251 m_pProgressBar->setValue(uPercent);252 m_pProgressBar->setMaximum(100);253 }254 255 void UINativeWizard::sltHandleProgressFinished()256 {257 m_pProgressStack->setCurrentIndex(0);258 232 } 259 233 … … 508 482 pLayoutBottom->addWidget(pButton); 509 483 if (enmType == WizardButtonType_Help) 510 { 511 /* Prepare progress-stack: */ 512 m_pProgressStack = new QStackedWidget(pWidgetBottom); 513 if (m_pProgressStack) 514 { 515 /* Prepare stretch: */ 516 QWidget *pStretch = new QWidget(m_pProgressStack); 517 if (pStretch) 518 m_pProgressStack->addWidget(pStretch); 519 520 /* Prepare progress-bar: */ 521 m_pProgressBar = new QProgressBar(m_pProgressStack); 522 if (m_pProgressBar) 523 { 524 m_pProgressBar->setMaximum(0); 525 m_pProgressStack->addWidget(m_pProgressBar); 526 } 527 528 /* Add to layout: */ 529 pLayoutBottom->addWidget(m_pProgressStack); 530 } 531 } 484 pLayoutBottom->addStretch(1); 532 485 if ( pButton 533 486 && enmType == WizardButtonType_Next) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h
r92110 r92149 33 33 /* Forward declarations: */ 34 34 class QLabel; 35 class QProgressBar;36 35 class QPushButton; 37 36 class QStackedWidget; … … 139 138 protected slots: 140 139 141 /** Handles signal about progress has started. */142 void sltHandleProgressStarted();143 /** Handles signal about progress changed.144 * @param uPercent Brings the progress percentage. */145 void sltHandleProgressChange(ulong uPercent);146 /** Handles signal about progress has finished. */147 void sltHandleProgressFinished();148 149 private slots:150 151 140 /** Handles current-page change to page with @a iIndex. */ 152 141 void sltCurrentIndexChanged(int iIndex = -1); … … 206 195 /** Holds the widget-stack instance. */ 207 196 QStackedWidget *m_pWidgetStack; 208 /** Holds the progress-stack instance. */209 QStackedWidget *m_pProgressStack;210 /** Holds the progress-bar instance. */211 QProgressBar *m_pProgressBar;212 197 /** Holds button instance map. */ 213 198 QMap<WizardButtonType, QPushButton*> m_buttons; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizardPage.h
r90990 r92149 38 38 /** Notifies about page validity changes. */ 39 39 void completeChanged(); 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 40 49 41 public:
Note:
See TracChangeset
for help on using the changeset viewer.