Changeset 43424 in vbox
- Timestamp:
- Sep 25, 2012 9:01:47 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r41689 r43424 1097 1097 1098 1098 /* Show Clone VD wizard: */ 1099 UIWizardCloneVD wizard(this, pItem->medium().medium()); 1100 wizard.exec(); 1099 UISafePointerWizard pWizard = new UIWizardCloneVD(this, pItem->medium().medium()); 1100 pWizard->prepare(); 1101 pWizard->exec(); 1102 if (pWizard) 1103 delete pWizard; 1101 1104 } 1102 1105 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r43396 r43424 1136 1136 && machine.GetTeleporterEnabled())) 1137 1137 { 1138 UIWizardFirstRun wzd(mainMachineWindow(), session().GetMachine()); 1139 wzd.exec(); 1138 UISafePointerWizard pWizard = new UIWizardFirstRun(mainMachineWindow(), session().GetMachine()); 1139 pWizard->prepare(); 1140 pWizard->exec(); 1141 if (pWizard) 1142 delete pWizard; 1140 1143 } 1141 1144 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r43242 r43424 278 278 QString strTmpFile = strFileName; 279 279 #endif /* !Q_WS_MAC */ 280 UIWizardImportApp wizard(this, strTmpFile); 281 if (strFileName.isEmpty() || wizard.isValid()) 282 wizard.exec(); 280 UISafePointerWizardImportApp pWizard = new UIWizardImportApp(this, strTmpFile); 281 pWizard->prepare(); 282 if (strFileName.isEmpty() || pWizard->isValid()) 283 pWizard->exec(); 284 if (pWizard) 285 delete pWizard; 283 286 } 284 287 … … 294 297 names << items[i]->name(); 295 298 /* Show Export Appliance wizard: */ 296 UIWizardExportApp wizard(this, names); 297 wizard.exec(); 299 UISafePointerWizard pWizard = new UIWizardExportApp(this, names); 300 pWizard->prepare(); 301 pWizard->exec(); 302 if (pWizard) 303 delete pWizard; 298 304 } 299 305 … … 416 422 417 423 /* Show Clone VM wizard: */ 418 UIWizardCloneVM wizard(this, pItem->machine()); 419 wizard.exec(); 424 UISafePointerWizard pWizard = new UIWizardCloneVM(this, pItem->machine()); 425 pWizard->prepare(); 426 pWizard->exec(); 427 if (pWizard) 428 delete pWizard; 420 429 } 421 430 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r42925 r43424 705 705 706 706 /* Show Clone VM wizard: */ 707 UIWizardCloneVM wzd(this, machine, snapshot); 708 wzd.exec(); 707 UISafePointerWizard pWizard = new UIWizardCloneVM(this, machine, snapshot); 708 pWizard->prepare(); 709 pWizard->exec(); 710 if (pWizard) 711 delete pWizard; 709 712 } 710 713 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r43155 r43424 899 899 else if (!selectionList().isEmpty()) 900 900 pGroup = selectionList().first()->parentItem(); 901 QString strGroupName; 901 902 if (pGroup) 902 { 903 UIWizardNewVM wizard(&vboxGlobal().selectorWnd(), fullName(pGroup)); 904 wizard.exec(); 905 } 906 else 907 { 908 UIWizardNewVM wizard(&vboxGlobal().selectorWnd()); 909 wizard.exec(); 910 } 903 strGroupName = fullName(pGroup); 904 UISafePointerWizard pWizard = new UIWizardNewVM(&vboxGlobal().selectorWnd(), strGroupName); 905 pWizard->prepare(); 906 pWizard->exec(); 907 if (pWizard) 908 delete pWizard; 911 909 } 912 910 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r43132 r43424 3088 3088 QFileInfo fileInfo(m_strMachineSettingsFilePath); 3089 3089 /* Show New VD wizard: */ 3090 UIWizardNewVD dlg(this, QString(), fileInfo.absolutePath(), guestOSType.GetRecommendedHDD()); 3091 return dlg.exec() == QDialog::Accepted ? dlg.virtualDisk().GetId() : QString(); 3090 UISafePointerWizardNewVD pWizard = new UIWizardNewVD(this, QString(), fileInfo.absolutePath(), guestOSType.GetRecommendedHDD()); 3091 pWizard->prepare(); 3092 QString strResult = pWizard->exec() == QDialog::Accepted ? pWizard->virtualDisk().GetId() : QString(); 3093 if (pWizard) 3094 delete pWizard; 3095 return strResult; 3092 3096 } 3093 3097 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.cpp
r41689 r43424 28 28 #include "VBoxGlobal.h" 29 29 #include "QIRichTextLabel.h" 30 31 int UIWizard::exec()32 {33 /* Prepare wizard: */34 prepare();35 /* Call to base-class: */36 return QWizard::exec();37 }38 30 39 31 void UIWizard::sltCurrentIdChanged(int iId) … … 243 235 244 236 /* Get some (first) of those pages: */ 245 UIWizardPage *pPage = qobject_cast<UIWizardPage*>(page(0)); 237 QList<int> pids = pageIds(); 238 UIWizardPage *pPage = qobject_cast<UIWizardPage*>(page(pids.first())); 246 239 /* Calculate actual label width: */ 247 240 int iPageWidth = pPage->minimumWidth(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.h
r41415 r43424 20 20 #define __UIWizard_h__ 21 21 22 /* Globalincludes: */22 /* Qt includes: */ 23 23 #include <QWizard> 24 #include <QPointer> 24 25 25 26 /* Local includes: */ … … 54 55 Q_OBJECT; 55 56 56 public slots:57 58 /* Exec slot: */59 int exec();60 61 57 public: 62 58 63 59 /* Mode related stuff: */ 64 60 UIWizardMode mode() { return m_mode; } 61 62 /* Page related methods: */ 63 virtual void prepare(); 65 64 66 65 protected slots: … … 82 81 /* Page related methods: */ 83 82 void setPage(int iId, UIWizardPage *pPage); 84 virtual void prepare();85 83 void cleanup(); 86 84 … … 119 117 }; 120 118 119 typedef QPointer<UIWizard> UISafePointerWizard; 120 121 121 #endif // __UIWizard_h__ 122 122 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.h
r41021 r43424 46 46 UIWizardImportApp(QWidget *pParent, const QString &strFileName); 47 47 48 /* Pages related stuff: */ 49 void prepare(); 50 48 51 /* Is appliance valid? */ 49 52 bool isValid() const; … … 70 73 void retranslateUi(); 71 74 72 /* Pages related stuff: */73 void prepare();74 75 75 /* Variables: */ 76 76 QString m_strFileName; 77 77 }; 78 78 79 typedef QPointer<UIWizardImportApp> UISafePointerWizardImportApp; 80 79 81 #endif /* __UIWizardImportApp_h__ */ 80 82 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.h
r41587 r43424 54 54 UIWizardMode mode = UIWizardMode_Auto); 55 55 56 /* Pages related stuff: */ 57 void prepare(); 58 56 59 /* Returns virtual-disk: */ 57 60 CMedium virtualDisk() const { return m_virtualDisk; } … … 71 74 void retranslateUi(); 72 75 73 /* Pages related stuff: */74 void prepare();75 76 76 /* Variables: */ 77 77 QString m_strDefaultName; … … 81 81 }; 82 82 83 typedef QPointer<UIWizardNewVD> UISafePointerWizardNewVD; 84 83 85 #endif // __UIWizardNewVD_h__ 84 86 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r42950 r43424 77 77 { 78 78 /* Create New Virtual Hard Drive wizard: */ 79 UIWizardNewVD dlg(thisImp(), 80 fieldImp("machineBaseName").toString(), 81 fieldImp("machineFolder").toString(), 82 fieldImp("type").value<CGuestOSType>().GetRecommendedHDD(), 83 wizardImp()->mode()); 84 if (dlg.exec() == QDialog::Accepted) 85 { 86 m_virtualDisk = dlg.virtualDisk(); 79 UISafePointerWizardNewVD pWizard = new UIWizardNewVD(thisImp(), 80 fieldImp("machineBaseName").toString(), 81 fieldImp("machineFolder").toString(), 82 fieldImp("type").value<CGuestOSType>().GetRecommendedHDD(), 83 wizardImp()->mode()); 84 pWizard->prepare(); 85 bool fResult = false; 86 if (pWizard->exec() == QDialog::Accepted) 87 { 88 fResult = true; 89 m_virtualDisk = pWizard->virtualDisk(); 87 90 m_pDiskSelector->setCurrentItem(m_virtualDisk.GetId()); 88 91 m_pDiskPresent->click(); 89 return true; 90 } 91 return false; 92 } 93 if (pWizard) 94 delete pWizard; 95 return fResult; 92 96 } 93 97
Note:
See TracChangeset
for help on using the changeset viewer.