Changeset 105539 in vbox
- Timestamp:
- Jul 30, 2024 10:50:44 AM (4 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r105363 r105539 108 108 } 109 109 110 const QString &UIWizardNewVD::defaultPath() const 111 { 112 return m_strDefaultPath; 113 } 114 115 const QString &UIWizardNewVD::defaultName() const 116 { 117 return m_strDefaultName; 118 } 119 120 qulonglong UIWizardNewVD::defaultSize() const 121 { 122 return m_uDefaultSize; 123 } 124 110 125 void UIWizardNewVD::populatePages() 111 126 { … … 116 131 addPage(new UIWizardNewVDFileTypePage); 117 132 m_iMediumVariantPageIndex = addPage(new UIWizardNewVDVariantPage); 118 addPage(new UIWizardNewVDSizeLocationPage( m_strDefaultName, m_strDefaultPath, m_uDefaultSize));133 addPage(new UIWizardNewVDSizeLocationPage(diskMinimumSize())); 119 134 break; 120 135 } 121 136 case WizardMode_Expert: 122 137 { 123 addPage(new UIWizardNewVDExpertPage( m_strDefaultName, m_strDefaultPath, m_uDefaultSize));138 addPage(new UIWizardNewVDExpertPage(diskMinimumSize())); 124 139 break; 125 140 } … … 234 249 setPageVisible(m_iMediumVariantPageIndex, cTest > 1); 235 250 } 251 252 qulonglong UIWizardNewVD::diskMinimumSize() const 253 { 254 return sourceDiskLogicalSize(); 255 } 256 257 qulonglong UIWizardNewVD::sourceDiskLogicalSize() const 258 { 259 if (m_comSourceVirtualDisk.isNull()) 260 return _4M; 261 return m_comSourceVirtualDisk.GetLogicalSize(); 262 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.h
r103982 r105539 81 81 /** @} */ 82 82 83 const QString &defaultPath() const; 84 const QString &defaultName() const; 85 qulonglong defaultSize() const; 86 83 87 protected: 84 88 … … 93 97 /** Check medium capabilities and decide if medium variant page should be hidden. */ 94 98 void setMediumVariantPageVisibility(); 99 qulonglong diskMinimumSize() const; 100 qulonglong sourceDiskLogicalSize() const; 95 101 qulonglong m_uMediumVariant; 96 102 CMediumFormat m_comMediumFormat; … … 102 108 int m_iMediumVariantPageIndex; 103 109 QUuid m_uMediumId; 110 /** Holds the source virtual disk wrapper. */ 111 CMedium m_comSourceVirtualDisk; 104 112 }; 105 113 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp
r105260 r105539 42 42 #include "CSystemProperties.h" 43 43 44 UIWizardNewVDExpertPage::UIWizardNewVDExpertPage( const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize)44 UIWizardNewVDExpertPage::UIWizardNewVDExpertPage(qulonglong uDiskMinimumSize) 45 45 : UINativeWizardPage() 46 46 , m_pSizeAndPathGroup(0) … … 48 48 , m_pVariantWidget(0) 49 49 , m_pFormatVariantGroupBox(0) 50 , m_strDefaultName(strDefaultName)51 , m_strDefaultPath(strDefaultPath)52 , m_uDefaultSize(uDefaultSize)53 50 , m_uMediumSizeMin(_4M) 54 51 , m_uMediumSizeMax(gpGlobalSession->virtualBox().GetSystemProperties().GetInfoVDSize()) 55 52 { 56 prepare( );57 } 58 59 void UIWizardNewVDExpertPage::prepare( )53 prepare(uDiskMinimumSize); 54 } 55 56 void UIWizardNewVDExpertPage::prepare(qulonglong uDiskMinimumSize) 60 57 { 61 58 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 62 m_pSizeAndPathGroup = new UIMediumSizeAndPathGroupBox(true /* fExpertMode */, 0 /* parent */, _4M /* minimum size */);59 m_pSizeAndPathGroup = new UIMediumSizeAndPathGroupBox(true /* fExpertMode */, 0 /* parent */,uDiskMinimumSize); 63 60 m_pFormatComboBox = new UIDiskFormatsComboBox(true /* fExpertMode */, KDeviceType_HardDisk, 0); 64 61 m_pVariantWidget = new UIDiskVariantWidget(0); … … 163 160 QString strExtension = UIWizardDiskEditors::defaultExtension(comMediumFormat, KDeviceType_HardDisk); 164 161 QString strMediumFilePath = 165 UIWizardDiskEditors::constructMediumFilePath(UIWizardDiskEditors::appendExtension( m_strDefaultName,166 strExtension), m_strDefaultPath);162 UIWizardDiskEditors::constructMediumFilePath(UIWizardDiskEditors::appendExtension(pWizard->defaultName(), 163 strExtension), pWizard->defaultPath()); 167 164 m_pSizeAndPathGroup->blockSignals(true); 168 165 m_pSizeAndPathGroup->setMediumFilePath(strMediumFilePath); … … 171 168 172 169 m_pSizeAndPathGroup->blockSignals(true); 173 m_pSizeAndPathGroup->setMediumSize(m_uDefaultSize > m_uMediumSizeMin && m_uDefaultSize < m_uMediumSizeMax ? m_uDefaultSize : m_uMediumSizeMin); 170 qulonglong uDefaultSize = pWizard->defaultSize(); 171 m_pSizeAndPathGroup->setMediumSize(uDefaultSize > m_uMediumSizeMin && uDefaultSize < m_uMediumSizeMax ? uDefaultSize : m_uMediumSizeMin); 174 172 m_pSizeAndPathGroup->blockSignals(false); 175 173 pWizard->setMediumSize(m_pSizeAndPathGroup->mediumSize()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.h
r103982 r105539 48 48 public: 49 49 50 UIWizardNewVDExpertPage( const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize);50 UIWizardNewVDExpertPage(qulonglong uDiskMinimumSize); 51 51 52 52 private slots: … … 63 63 64 64 /** Prepare stuff. */ 65 void prepare( );65 void prepare(qulonglong uDiskMinimumSize); 66 66 virtual void initializePage() RT_OVERRIDE RT_FINAL; 67 67 … … 81 81 /** @name Variable 82 82 * @{ */ 83 QString m_strDefaultName;84 QString m_strDefaultPath;85 qulonglong m_uDefaultSize;86 83 qulonglong m_uMediumSizeMin; 87 84 qulonglong m_uMediumSizeMax; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDSizeLocationPage.cpp
r104069 r105539 40 40 #include "CSystemProperties.h" 41 41 42 UIWizardNewVDSizeLocationPage::UIWizardNewVDSizeLocationPage(const QString &strDefaultName, 43 const QString &strDefaultPath, qulonglong uDefaultSize) 42 UIWizardNewVDSizeLocationPage::UIWizardNewVDSizeLocationPage(qulonglong uDiskMinimumSize) 44 43 : m_pMediumSizePathGroup(0) 45 , m_uMediumSizeMin( _4M)44 , m_uMediumSizeMin(uDiskMinimumSize) 46 45 , m_uMediumSizeMax(gpGlobalSession->virtualBox().GetSystemProperties().GetInfoVDSize()) 47 , m_strDefaultName(strDefaultName.isEmpty() ? QString("NewVirtualDisk1") : strDefaultName)48 , m_strDefaultPath(strDefaultPath)49 , m_uDefaultSize(uDefaultSize)50 46 { 51 47 prepare(); … … 119 115 /* Initialize the medium file path with default name and path if user has not exclusively modified them yet: */ 120 116 if (!m_userModifiedParameters.contains("MediumPath")) 117 { 121 118 strMediumFilePath = 122 UIWizardDiskEditors::constructMediumFilePath(UIWizardDiskEditors::appendExtension(m_strDefaultName, 123 strExtension), m_strDefaultPath); 119 UIWizardDiskEditors::constructMediumFilePath(UIWizardDiskEditors::appendExtension(pWizard->defaultName(), 120 strExtension), pWizard->defaultPath()); 121 } 124 122 /* Initialize the medium file path with file path and file name from the location editor. This part is to update the 125 123 * file extention correctly in case user has gone back and changed the file format after modifying medium file path: */ … … 136 134 { 137 135 m_pMediumSizePathGroup->blockSignals(true); 138 m_pMediumSizePathGroup->setMediumSize(m_uDefaultSize > m_uMediumSizeMin && m_uDefaultSize < m_uMediumSizeMax ? m_uDefaultSize : m_uMediumSizeMin); 136 qulonglong uDefaultSize = pWizard->defaultSize(); 137 m_pMediumSizePathGroup->setMediumSize(uDefaultSize > m_uMediumSizeMin && uDefaultSize < m_uMediumSizeMax ? uDefaultSize : m_uMediumSizeMin); 139 138 m_pMediumSizePathGroup->blockSignals(false); 140 139 pWizard->setMediumSize(m_pMediumSizePathGroup->mediumSize()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDSizeLocationPage.h
r104037 r105539 47 47 public: 48 48 49 UIWizardNewVDSizeLocationPage( const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize);49 UIWizardNewVDSizeLocationPage(qulonglong uDiskMinimumSize); 50 50 51 51 private slots: … … 66 66 qulonglong m_uMediumSizeMin; 67 67 qulonglong m_uMediumSizeMax; 68 QString m_strDefaultName;69 QString m_strDefaultPath;70 qulonglong m_uDefaultSize;71 68 QSet<QString> m_userModifiedParameters; 72 69 };
Note:
See TracChangeset
for help on using the changeset viewer.