Changeset 105260 in vbox
- Timestamp:
- Jul 10, 2024 2:01:29 PM (5 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp
r104985 r105260 182 182 bool UIWizardCloneVDExpertPage::isComplete() const 183 183 { 184 bool fResult = true; 185 186 if (m_pFormatComboBox) 187 fResult = m_pFormatComboBox->mediumFormat().isNull(); 188 if (m_pVariantWidget) 189 fResult = m_pVariantWidget->isComplete(); 190 if (m_pMediumSizePathGroupBox) 191 fResult = m_pMediumSizePathGroupBox->isComplete(); 192 193 return fResult; 184 AssertReturn(m_pFormatComboBox, false); 185 AssertReturn(m_pVariantWidget, false); 186 AssertReturn(m_pMediumSizePathGroupBox, false); 187 188 if (m_pFormatComboBox->mediumFormat().isNull()) 189 return false; 190 191 if (!m_pVariantWidget->isComplete()) 192 return false; 193 194 if (!m_pMediumSizePathGroupBox->pathExists()) 195 return false; 196 if (!m_pMediumSizePathGroupBox->filePathUnique()) 197 return false; 198 199 return true; 194 200 } 195 201 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPathSizePage.cpp
r103957 r105260 100 100 { 101 101 AssertReturn(m_pMediumSizePathGroupBox, false); 102 return m_pMediumSizePathGroupBox->isComplete(); 102 if (!m_pMediumSizePathGroupBox->pathExists()) 103 return false; 104 if (!m_pMediumSizePathGroupBox->filePathUnique()) 105 return false; 106 return true; 103 107 } 104 108 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp
r104985 r105260 332 332 } 333 333 334 bool UIMediumSizeAndPathGroupBox::isComplete() const 335 { 334 bool UIMediumSizeAndPathGroupBox::pathExists() const 335 { 336 /* Check if the path upto file name exists: */ 337 if (!QFileInfo(mediumPath()).exists()) 338 { 339 m_pLocationEditor->mark(true, tr("Disk file path does not exists"), tr("Disk file path is valid")); 340 return false; 341 } 342 m_pLocationEditor->mark(false, tr("Disk file path does not exists"), tr("Disk file path is valid")); 343 return true; 344 } 345 346 bool UIMediumSizeAndPathGroupBox::filePathUnique() const 347 { 348 /* Check if there is not such file already: */ 336 349 if (QFileInfo(mediumFilePath()).exists()) 337 350 { … … 340 353 } 341 354 m_pLocationEditor->mark(false, tr("Disk file name is not unique"), tr("Disk file name is valid")); 342 343 355 return true; 344 356 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h
r104985 r105260 137 137 void setMediumSize(qulonglong uSize); 138 138 139 bool isComplete() const; 139 bool filePathUnique() const; 140 bool pathExists() const; 140 141 141 142 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp
r104985 r105260 196 196 if (pWizard->mediumSize() > m_uMediumSizeMax || pWizard->mediumSize() < m_uMediumSizeMin) 197 197 return false; 198 if (!m_pSizeAndPathGroup->filePathUnique() || !m_pSizeAndPathGroup->pathExists()) 199 return false; 198 200 return true; 199 201 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
r104899 r105260 646 646 fIsComplete = false; 647 647 } 648 /* Check only the uniqueness of the file and not path existence since the vm folder (default medium path) 649 * has not been created yet: */ 650 if (!m_pSizeAndLocationGroup->filePathUnique()) 651 fIsComplete = false; 648 652 } 649 653 return fIsComplete;
Note:
See TracChangeset
for help on using the changeset viewer.