Changeset 77592 in vbox
- Timestamp:
- Mar 7, 2019 8:46:46 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r76606 r77592 56 56 /* Register classes: */ 57 57 qRegisterMetaType<CGuestOSType>(); 58 59 connect(this, &UIWizardNewVM::rejected, this, &UIWizardNewVM::sltHandleWizardCancel); 58 60 } 59 61 … … 326 328 } 327 329 330 void UIWizardNewVM::sltHandleWizardCancel() 331 { 332 switch (mode()) 333 { 334 case WizardMode_Basic: 335 { 336 UIWizardNewVMPageBasic1 *pPage1 = qobject_cast<UIWizardNewVMPageBasic1*> (page(Page1)); 337 if (pPage1) 338 pPage1->cleanupMachineFolder(true); 339 break; 340 } 341 case WizardMode_Expert: 342 { 343 UIWizardNewVMPageExpert *pPage = qobject_cast<UIWizardNewVMPageExpert*> (page(PageExpert)); 344 if (pPage) 345 pPage->cleanupMachineFolder(true); 346 break; 347 } 348 default: 349 break; 350 } 351 } 352 328 353 void UIWizardNewVM::retranslateUi() 329 354 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r76581 r77592 68 68 friend class UIWizardNewVMPageExpert; 69 69 70 private slots: 71 72 void sltHandleWizardCancel(); 73 70 74 private: 71 75 … … 90 94 91 95 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVM_h */ 92 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r76606 r77592 245 245 composeMachineFilePath(); 246 246 247 248 247 /* Check if the folder already exists and check if it has been created by this wizard */ 249 248 if (QDir(m_strMachineFolder).exists()) … … 271 270 } 272 271 273 bool UIWizardNewVMPage1::cleanupMachineFolder( )272 bool UIWizardNewVMPage1::cleanupMachineFolder(bool fWizardCancel /* = false */) 274 273 { 275 274 /* Make sure folder was previosly created: */ 276 if (!m_strCreatedFolder.isEmpty() && m_strCreatedFolder != m_strMachineFolder) 275 if (m_strCreatedFolder.isEmpty()) 276 return true; 277 /* Clean this folder if the machine folder has been changed by the user or we are cancelling the wizard: */ 278 if (m_strCreatedFolder != m_strMachineFolder || fWizardCancel) 277 279 { 278 280 /* Try to cleanup folder (and it's predecessors): */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r76581 r77592 43 43 bool createMachineFolder(); 44 44 /** Removes a previously created folder (if exists) before creating a new one. 45 * used during page cleanup and new folder creation. */ 46 bool cleanupMachineFolder(); 45 * used during page cleanup and new folder creation. Called upon page Next/Back and 46 * wizard cancel */ 47 bool cleanupMachineFolder(bool fWizardCancel = false); 47 48 48 49 QString machineFilePath() const; … … 77 78 bool m_fSupportsHWVirtEx; 78 79 bool m_fSupportsLongMode; 80 friend class UIWizardNewVM; 79 81 }; 80 82
Note:
See TracChangeset
for help on using the changeset viewer.