Changeset 90069 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 6, 2021 3:09:01 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145564
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp
r90045 r90069 114 114 } 115 115 116 bool UINativeWizard::isPageVisible(int iIndex) const 117 { 118 return !m_invisiblePages.contains(iIndex); 119 } 120 121 void UINativeWizard::setPageVisible(int iIndex, bool fVisible) 122 { 123 AssertMsgReturnVoid(iIndex || fVisible, ("Can't hide 1st wizard page!\n")); 124 if (fVisible) 125 m_invisiblePages.remove(iIndex); 126 else 127 m_invisiblePages.insert(iIndex); 128 } 129 116 130 int UINativeWizard::addPage(UINativeWizardPage *pPage) 117 131 { … … 276 290 void UINativeWizard::sltPrevious() 277 291 { 278 /* For all the pages besides the 1st one we going backward: */ 279 AssertReturnVoid(m_pWidgetStack->currentIndex() > 0); 280 m_pWidgetStack->setCurrentIndex(m_pWidgetStack->currentIndex() - 1); 292 /* For all allowed pages besides the 1st one we going backward: */ 293 bool fPreviousFound = false; 294 int iIteratedIndex = m_pWidgetStack->currentIndex(); 295 while (!fPreviousFound && iIteratedIndex > 0) 296 if (isPageVisible(--iIteratedIndex)) 297 fPreviousFound = true; 298 if (fPreviousFound) 299 m_pWidgetStack->setCurrentIndex(iIteratedIndex); 281 300 } 282 301 … … 297 316 return; 298 317 299 /* For all the pages besides the last one we going forward: */ 300 if (m_pWidgetStack->currentIndex() < m_pWidgetStack->count() - 1) 301 m_pWidgetStack->setCurrentIndex(m_pWidgetStack->currentIndex() + 1); 318 /* For all allowed pages besides the last one we going forward: */ 319 bool fNextFound = false; 320 int iIteratedIndex = m_pWidgetStack->currentIndex(); 321 while (!fNextFound && iIteratedIndex < m_pWidgetStack->count() - 1) 322 if (isPageVisible(++iIteratedIndex)) 323 fNextFound = true; 324 if (fNextFound) 325 m_pWidgetStack->setCurrentIndex(iIteratedIndex); 302 326 /* For last one we just accept the wizard: */ 303 327 else … … 478 502 /* Update last index: */ 479 503 m_iLastIndex = -1; 504 /* Update invisible pages: */ 505 m_invisiblePages.clear(); 480 506 } 481 507 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h
r90032 r90069 105 105 void setPixmapName(const QString &strName); 106 106 107 /** Returns whether the page with certain @a iIndex is visible. */ 108 bool isPageVisible(int iIndex) const; 109 /** Defines whether the page with certain @a iIndex is @a fVisible. */ 110 void setPageVisible(int iIndex, bool fVisible); 111 107 112 /** Appends wizard @a pPage. 108 113 * @returns assigned page index. */ … … 162 167 /** Holds the last entered page index. */ 163 168 int m_iLastIndex; 169 /** Holds the set of invisible pages. */ 170 QSet<int> m_invisiblePages; 164 171 165 172 /** Holds the pixmap label instance. */
Note:
See TracChangeset
for help on using the changeset viewer.