Changeset 93659 in vbox for trunk/src/VBox
- Timestamp:
- Feb 8, 2022 2:53:08 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp
r93235 r93659 143 143 else 144 144 m_invisiblePages.insert(iIndex); 145 /* Update the button labels since the last visible page might have changed. Thus 'Next' <-> 'Finish' might be needed: */ 146 retranslateUi(); 145 147 } 146 148 … … 210 212 QPushButton *pButtonNext = wizardButton(WizardButtonType_Next); 211 213 AssertMsgReturnVoid(pButtonNext, ("No Next wizard button found!\n")); 212 if ( m_pWidgetStack && m_pWidgetStack->currentIndex() < m_pWidgetStack->count() - 1)214 if (!isLastVisiblePage(m_pWidgetStack->currentIndex())) 213 215 { 214 216 pButtonNext->setText(tr("&Next")); … … 720 722 m_pLabelPixmap->setPixmap(pixmapNew); 721 723 } 724 725 bool UINativeWizard::isLastVisiblePage(int iPageIndex) const 726 { 727 if (!m_pWidgetStack) 728 return false; 729 if (iPageIndex == -1) 730 return false; 731 /* The page itself is not visible: */ 732 if (m_invisiblePages.contains(iPageIndex)) 733 return false; 734 bool fLastVisible = true; 735 /* Look at the page coming after the page with @p iPageIndex and check if they are visible: */ 736 for (int i = iPageIndex + 1; i < m_pWidgetStack->count(); ++i) 737 { 738 if (!m_invisiblePages.contains(i)) 739 { 740 fLastVisible = false; 741 break; 742 } 743 } 744 return fLastVisible; 745 } 746 722 747 #endif /* !VBOX_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h
r93115 r93659 173 173 void assignWatermark(); 174 174 #endif 175 /** Checks if the pages coming after the page with iPageIndex is visible or not. Returns true if 176 * page with iPageIndex is the last visible page of the wizard. Returns false otherwise. */ 177 bool isLastVisiblePage(int iPageIndex) const; 175 178 176 179 /** Holds the wizard type. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r93115 r93659 134 134 } 135 135 136 bool UIWizardCloneVM::machineHasSnapshot() const 137 { 138 AssertReturn(!m_machine.isNull(), false); 139 return m_machine.GetSnapshotCount() > 0; 140 } 141 136 142 bool UIWizardCloneVM::cloneVM() 137 143 { … … 235 241 addPage(new UIWizardCloneVMNamePathPage(m_strCloneName, strDefaultMachineFolder, m_strGroup)); 236 242 addPage(new UIWizardCloneVMTypePage(m_snapshot.isNull())); 237 if (m _machine.GetSnapshotCount() > 0)243 if (machineHasSnapshot()) 238 244 m_iCloneModePageIndex = addPage(new UIWizardCloneVMModePage(m_snapshot.isNull() ? false : m_snapshot.GetChildrenCount() > 0)); 239 245 break; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.h
r93115 r93659 43 43 /** Clone VM stuff. */ 44 44 bool cloneVM(); 45 bool machineHasSnapshot() const; 45 46 46 47 /** @name Parameter setter/getters -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMExpertPage.cpp
r93115 r93659 80 80 this, &UIWizardCloneVMExpertPage::sltKeepHardwareUUIDsToggled); 81 81 } 82 83 82 retranslateUi(); 84 83 } … … 118 117 if (m_pCloneModeGroupBox) 119 118 pWizard->setCloneMode(m_pCloneModeGroupBox->cloneMode()); 119 120 if (m_pCloneModeGroupBox) 121 m_pCloneModeGroupBox->setEnabled(pWizard->machineHasSnapshot()); 120 122 121 123 retranslateUi();
Note:
See TracChangeset
for help on using the changeset viewer.