- Timestamp:
- Sep 23, 2021 7:18:29 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 147008
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r91216 r91341 1713 1713 1714 1714 1715 void UICommon::openMediumCreatorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType,1715 QUuid UICommon::openMediumCreatorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, 1716 1716 const QString &strDefaultFolder /* = QString() */, 1717 1717 const QString &strMachineName /* = QString() */, … … 1723 1723 { 1724 1724 case UIMediumDeviceType_HardDisk: 1725 createVDWithWizard(pParent, strDefaultFolder, strMachineName, strMachineGuestOSTypeId);1725 uMediumId = createVDWithWizard(pParent, strDefaultFolder, strMachineName, strMachineGuestOSTypeId); 1726 1726 break; 1727 1727 case UIMediumDeviceType_DVD: … … 1735 1735 } 1736 1736 if (uMediumId.isNull()) 1737 return ;1737 return QUuid(); 1738 1738 1739 1739 /* Update the recent medium list only if the medium type is DVD or floppy: */ 1740 1740 if (enmMediumType == UIMediumDeviceType_DVD || enmMediumType == UIMediumDeviceType_Floppy) 1741 1741 updateRecentlyUsedMediumListAndFolder(enmMediumType, medium(uMediumId).location()); 1742 return uMediumId; 1742 1743 } 1743 1744 … … 1889 1890 } 1890 1891 1891 void UICommon::createVDWithWizard(QWidget *pParent,1892 const QString &strMachineFolder /* = QString() */,1893 const QString &strMachineName /* = QString() */,1894 const QString &strMachineGuestOSTypeId /* = QString() */)1892 QUuid UICommon::createVDWithWizard(QWidget *pParent, 1893 const QString &strMachineFolder /* = QString() */, 1894 const QString &strMachineName /* = QString() */, 1895 const QString &strMachineGuestOSTypeId /* = QString() */) 1895 1896 { 1896 1897 /* Initialize variables: */ … … 1913 1914 comGuestOSType.GetRecommendedHDD()); 1914 1915 if (!pWizard) 1915 return ;1916 return QUuid(); 1916 1917 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 1917 1918 windowManager().registerNewParent(pWizard, pDialogParent); 1919 QUuid mediumId = pWizard->mediumId(); 1918 1920 pWizard->exec(); 1919 1921 delete pWizard; 1922 return mediumId; 1920 1923 } 1921 1924 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r91125 r91341 424 424 * @param strMachineFolder Passes the machine folder, 425 425 * @param strMachineGuestOSTypeId Passes the type ID of machine's guest os, 426 * @param fEnableCreate Passes whether to show/enable create action in the medium selector dialog. */ 427 void openMediumCreatorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, 428 const QString &strMachineFolder = QString(), 429 const QString &strMachineName = QString(), 430 const QString &strMachineGuestOSTypeId = QString()); 426 * @param fEnableCreate Passes whether to show/enable create action in the medium selector dialog, 427 * returns QUuid of the new medium */ 428 QUuid openMediumCreatorDialog(QWidget *pParent, UIMediumDeviceType enmMediumType, 429 const QString &strMachineFolder = QString(), 430 const QString &strMachineName = QString(), 431 const QString &strMachineGuestOSTypeId = QString()); 431 432 432 433 /** Prepares storage menu according passed parameters. … … 622 623 * @param strMachineFolder Passes the machine folder, 623 624 * @param strMachineName Passes the name of the machine, 624 * @param strMachineGuestOSTypeId Passes the string of machine's guest OS type ID. */ 625 void createVDWithWizard(QWidget *pParent, 626 const QString &strMachineFolder = QString(), 627 const QString &strMachineName = QString(), 628 const QString &strMachineGuestOSTypeId = QString()); 625 * @param strMachineGuestOSTypeId Passes the string of machine's guest OS type ID, 626 * returns QUuid of the created medium. */ 627 QUuid createVDWithWizard(QWidget *pParent, 628 const QString &strMachineFolder = QString(), 629 const QString &strMachineName = QString(), 630 const QString &strMachineGuestOSTypeId = QString()); 629 631 /** @} */ 630 632 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r91109 r91341 449 449 void UIMediumSelector::sltCreateMedium() 450 450 { 451 uiCommon().openMediumCreatorDialog(this, m_enmMediumType, m_strMachineFolder, 452 m_strMachineName, m_strMachineGuestOSTypeId); 451 QUuid uMediumId = uiCommon().openMediumCreatorDialog(this, m_enmMediumType, m_strMachineFolder, 452 m_strMachineName, m_strMachineGuestOSTypeId); 453 /* Make sure that the data structure is updated and newly created medium is selected and visible: */ 454 sltHandleMediumCreated(uMediumId); 453 455 } 454 456 … … 468 470 void UIMediumSelector::sltHandleMediumCreated(const QUuid &uMediumId) 469 471 { 472 if (uMediumId.isNull()) 473 return; 470 474 /* Update the tree widget making sure we show the new item: */ 471 475 repopulateTreeWidget(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r91061 r91341 88 88 } 89 89 90 QUuid UIWizardNewVD::mediumId() const 91 { 92 return m_uMediumId; 93 } 94 90 95 void UIWizardNewVD::populatePages() 91 96 { … … 143 148 connect(pNotification, &UINotificationProgressMediumCreate::sigMediumCreated, 144 149 &uiCommon(), &UICommon::sltHandleMediumCreated); 150 151 m_uMediumId = comVirtualDisk.GetId(); 152 145 153 gpNotificationCenter->append(pNotification); 146 154 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.h
r91061 r91341 56 56 qulonglong mediumSize() const; 57 57 void setMediumSize(qulonglong mediumSize); 58 59 QUuid mediumId() const; 58 60 /** @} */ 59 61 … … 75 77 qulonglong m_uDefaultSize; 76 78 int m_iMediumVariantPageIndex; 79 QUuid m_uMediumId; 77 80 }; 78 81
Note:
See TracChangeset
for help on using the changeset viewer.