Changeset 77170 in vbox
- Timestamp:
- Feb 6, 2019 9:18:49 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r77167 r77170 2636 2636 QUuid VBoxGlobal::createVisoMediumWithVisoCreator(QWidget *pParent, const QString &strMachineName, const QString &strFolder) 2637 2637 { 2638 2639 2638 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 2640 2639 QPointer<UIVisoCreator> pVisoCreator = new UIVisoCreator(pDialogParent, strMachineName); … … 2721 2720 QUuid VBoxGlobal::showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder) 2722 2721 { 2722 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 2723 2723 2724 UIFDCreationDialog *pDialog = new UIFDCreationDialog(pParent, strMachineName, strMachineFolder); 2725 if (!pDialog) 2726 return QUuid(); 2727 windowManager().registerNewParent(pDialog, pDialogParent); 2728 2724 2729 if (pDialog->exec()) 2725 2730 { … … 2731 2736 2732 2737 QUuid VBoxGlobal::openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, 2733 const QString &strMachineName, const QString &strMachineFolder) 2738 const QString &strMachineName, const QString &strMachineFolder, 2739 const QString &strMachineGuestOSTypeId /* = QString() */) 2734 2740 { 2735 2741 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 2736 2742 QPointer<UIMediumSelector> pSelector = new UIMediumSelector(enmMediumType, strMachineName, 2737 strMachineFolder, pDialogParent);2743 strMachineFolder, strMachineGuestOSTypeId, pDialogParent); 2738 2744 2739 2745 if (!pSelector) 2740 return Q String();2746 return QUuid(); 2741 2747 windowManager().registerNewParent(pSelector, pDialogParent); 2742 2748 if (pSelector->exec(false)) … … 2762 2768 /* Show New VD wizard: */ 2763 2769 UISafePointerWizardNewVD pWizard = new UIWizardNewVD(pParent, QString(), fileInfo.absolutePath(), comGuestOSType.GetRecommendedHDD()); 2770 2771 if (!pWizard) 2772 return QUuid(); 2773 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 2774 windowManager().registerNewParent(pWizard, pDialogParent); 2764 2775 pWizard->prepare(); 2776 2765 2777 const QUuid uResult = pWizard->exec() == QDialog::Accepted ? pWizard->virtualDisk().GetId() : QUuid(); 2766 2778 if (pWizard) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r77167 r77170 513 513 514 514 /** Creates and shows a UIMediumSelector dialog. 515 * @param parent Passes the parent of the dialog, 516 * @param enmMediumType Passes the medium type. 517 * @param strMachineName Passes the name of the machine, 518 * @param strMachineFolder Passes the machine folder, 515 * @param parent Passes the parent of the dialog, 516 * @param enmMediumType Passes the medium type. 517 * @param strMachineName Passes the name of the machine, 518 * @param strMachineFolder Passes the machine folder, 519 * @param strMachineGuestOSTypeId Passes the type ID of machine's guest os, 519 520 * returns the ID of the selected/created medium if successful, a null QUuid otherwise.*/ 520 521 QUuid openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, 521 const QString &strMachineName, const QString &strMachineFolder); 522 const QString &strMachineName, const QString &strMachineFolder, 523 const QString &strMachineGuestOSTypeId = QString()); 522 524 523 525 /** Creates and shows a UIWizardNewVD wizard. -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r77009 r77170 55 55 56 56 UIMediumSelector::UIMediumSelector(UIMediumDeviceType enmMediumType, const QString &machineName /* = QString() */, 57 const QString &machineSettigFilePath /* = QString() */, QWidget *pParent /* = 0 */) 57 const QString &machineSettingsFilePath /* = QString() */, 58 const QString &strMachineGuestOSTypeId /*= QString() */, QWidget *pParent /* = 0 */) 58 59 :QIWithRetranslateUI<QIMainDialog>(pParent) 59 60 , m_pCentralWidget(0) … … 72 73 , m_pSearchWidget(0) 73 74 , m_iCurrentShownIndex(0) 74 , m_strMachineSettingsFilePath(machineSetti gFilePath)75 , m_strMachineSettingsFilePath(machineSettingsFilePath) 75 76 , m_strMachineName(machineName) 77 , m_strMachineGuestOSTypeId(strMachineGuestOSTypeId) 76 78 { 77 79 configure(); … … 176 178 } 177 179 178 /* Currently create is supported only for Floppy: */ 179 if (m_enmMediumType == UIMediumDeviceType_Floppy) 180 { 181 m_pActionCreate = new QAction(this); 182 } 180 m_pActionCreate = new QAction(this); 183 181 if (m_pActionCreate) 184 182 { … … 407 405 void UIMediumSelector::sltCreateMedium() 408 406 { 409 QString strMachineFolder = QFileInfo(m_strMachineSettingsFilePath).absolutePath(); 410 UIFDCreationDialog *pDialog = new UIFDCreationDialog(this, m_strMachineName, strMachineFolder); 411 if (pDialog->exec()) 407 QUuid uMediumId; 408 409 if (m_enmMediumType == UIMediumDeviceType_Floppy) 410 uMediumId = vboxGlobal().showCreateFloppyDiskDialog(this, m_strMachineName, m_strMachineSettingsFilePath); 411 else if (m_enmMediumType == UIMediumDeviceType_HardDisk) 412 uMediumId = vboxGlobal().createHDWithNewHDWizard(this, m_strMachineGuestOSTypeId, m_strMachineSettingsFilePath); 413 else if (m_enmMediumType == UIMediumDeviceType_DVD) 414 uMediumId = vboxGlobal().createVisoMediumWithVisoCreator(this, m_strMachineName, m_strMachineSettingsFilePath); 415 416 if (!uMediumId.isNull()) 412 417 { 413 418 repopulateTreeWidget(); 414 selectMedium(pDialog->mediumID()); 415 } 416 delete pDialog; 419 selectMedium(uMediumId); 420 } 417 421 } 418 422 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h
r77009 r77170 52 52 53 53 UIMediumSelector(UIMediumDeviceType enmMediumType, const QString &machineName = QString(), 54 const QString &machineSettigFilePath = QString(), QWidget *pParent = 0); 54 const QString &machineSettingsFilePath = QString(), const QString &strMachineGuestOSTypeId = QString(), 55 QWidget *pParent = 0); 56 55 57 QList<QUuid> selectedMediumIds() const; 56 58 … … 131 133 QString m_strMachineSettingsFilePath; 132 134 QString m_strMachineName; 135 QString m_strMachineGuestOSTypeId; 133 136 }; 134 137 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r77167 r77170 3810 3810 else if (iAnswer == AlertButton_Choice2) 3811 3811 uMediumId = vboxGlobal().openMediumSelectorDialog(this, UIMediumDeviceType_HardDisk, 3812 m_strMachineName, m_strMachineSettingsFilePath); 3812 m_strMachineName, m_strMachineSettingsFilePath, 3813 m_strMachineGuestOSTypeId); 3813 3814 else if (iAnswer == AlertButton_Cancel) 3814 3815 fCancelled = true; … … 3834 3835 uMediumId = vboxGlobal().openMediumSelectorDialog(this, UIMediumDeviceType_Floppy, 3835 3836 m_strMachineName, m_strMachineSettingsFilePath); 3837 3836 3838 /* We allow creating an empty floppy drive: */ 3837 3839 else if (iAnswer == AlertButton_Choice1) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r77167 r77170 744 744 /** Prepares connections. */ 745 745 void prepareConnections(); 746 /** Opens medium selector dialog and retrieves uuid of a selected medium (if any). */ 747 QUuid openMediumSelectorDialog(UIMediumDeviceType enmMediumType, 748 const QString &strMachineName, const QString &strMachineSettingsFilePath); 746 749 747 /** Cleanups all. */ 750 748 void cleanup(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r76606 r77170 64 64 QUuid uMediumId = vboxGlobal().openMediumSelectorDialog(thisImp(), UIMediumDeviceType_HardDisk, 65 65 fieldImp("machineBaseName").toString(), 66 fieldImp("machineFolder").toString()); 66 fieldImp("machineFolder").toString(), 67 fieldImp("type").value<CGuestOSType>().GetFamilyId()); 67 68 if (!uMediumId.isNull()) 68 69 {
Note:
See TracChangeset
for help on using the changeset viewer.