Changeset 105558 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 1, 2024 10:08:22 AM (6 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r105553 r105558 1940 1940 UINotificationProgressMediumCopy::UINotificationProgressMediumCopy(const CMedium &comSource, 1941 1941 const CMedium &comTarget, 1942 const QVector<KMediumVariant> &variants) 1942 const QVector<KMediumVariant> &variants, 1943 qulonglong uMediumSize) 1943 1944 : m_comSource(comSource) 1944 1945 , m_comTarget(comTarget) 1945 1946 , m_variants(variants) 1947 , m_uMediumSize(uMediumSize) 1946 1948 { 1947 1949 connect(this, &UINotificationProgress::sigProgressFinished, … … 1980 1982 1981 1983 /* Initialize progress-wrapper: */ 1982 CProgress comProgress = m_comSource. CloneTo(m_comTarget, m_variants, CMedium());1984 CProgress comProgress = m_comSource.ResizeAndCloneTo(m_comTarget, m_uMediumSize, m_variants, CMedium()); 1983 1985 /* Store COM result: */ 1984 1986 comResult = m_comSource; -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r105081 r105558 822 822 823 823 /** Constructs medium copy notification-progress. 824 * @param comSource Brings the medium being copied. 825 * @param comTarget Brings the medium being the target. 826 * @param variants Brings the target medium options. */ 824 * @param comSource Brings the medium being copied. 825 * @param comTarget Brings the medium being the target. 826 * @param variants Brings the target medium options. 827 * @param uMediumSize Brings the target medium size. 828 */ 827 829 UINotificationProgressMediumCopy(const CMedium &comSource, 828 830 const CMedium &comTarget, 829 const QVector<KMediumVariant> &variants); 831 const QVector<KMediumVariant> &variants, 832 qulonglong uMediumSize); 830 833 831 834 protected: … … 855 858 /** Holds the target medium options. */ 856 859 QVector<KMediumVariant> m_variants; 860 /** Holds the target medium size. */ 861 qulonglong m_uMediumSize; 857 862 }; 858 863 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVD.cpp
r104904 r105558 100 100 UINotificationProgressMediumCopy *pNotification = new UINotificationProgressMediumCopy(m_comSourceVirtualDisk, 101 101 comVirtualDisk, 102 variants); 102 variants, 103 m_uMediumSize); 103 104 connect(pNotification, &UINotificationProgressMediumCopy::sigMediumCopied, 104 105 gpMediumEnumerator, &UIMediumEnumerator::sltHandleMediumCreated); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r105554 r105558 182 182 /* Create new virtual disk image: */ 183 183 CMedium comVirtualDisk = comVBox.CreateMedium(m_comMediumFormat.GetName(), 184 m_strMediumPath, KAccessMode_ReadWrite, KDeviceType_HardDisk);184 m_strMediumPath, KAccessMode_ReadWrite, m_enmDeviceType); 185 185 if (!comVBox.isOk()) 186 186 { … … 198 198 } 199 199 200 UINotificationProgressMediumCreate *pNotification = new UINotificationProgressMediumCreate(comVirtualDisk, 201 m_uMediumSize, 202 variants); 203 connect(pNotification, &UINotificationProgressMediumCreate::sigMediumCreated, 204 gpMediumEnumerator, &UIMediumEnumerator::sltHandleMediumCreated); 200 if (!isClonning()) 201 { 202 UINotificationProgressMediumCreate *pNotification = new UINotificationProgressMediumCreate(comVirtualDisk, 203 m_uMediumSize, 204 variants); 205 connect(pNotification, &UINotificationProgressMediumCreate::sigMediumCreated, 206 gpMediumEnumerator, &UIMediumEnumerator::sltHandleMediumCreated); 207 gpNotificationCenter->append(pNotification); 208 } 209 else 210 { 211 /* Copy medium: */ 212 UINotificationProgressMediumCopy *pNotification = new UINotificationProgressMediumCopy(m_comSourceVirtualDisk, 213 comVirtualDisk, 214 variants, 215 m_uMediumSize); 216 connect(pNotification, &UINotificationProgressMediumCopy::sigMediumCopied, 217 gpMediumEnumerator, &UIMediumEnumerator::sltHandleMediumCreated); 218 gpNotificationCenter->append(pNotification); 219 } 205 220 206 221 m_uMediumId = comVirtualDisk.GetId(); 207 208 gpNotificationCenter->append(pNotification);209 210 222 /* Positive: */ 211 223 return true; … … 253 265 { 254 266 UINativeWizard::sltRetranslateUI(); 255 setWindowTitle(tr("Create Virtual Hard Disk")); 267 if (!isClonning()) 268 setWindowTitle(tr("Create Virtual Hard Disk")); 269 else 270 setWindowTitle(tr("Copy Virtual Disk")); 256 271 } 257 272 … … 277 292 qulonglong UIWizardNewVD::diskMinimumSize() const 278 293 { 279 if ( m_comSourceVirtualDisk.isNull())294 if (!isClonning()) 280 295 return _4M; 281 296 return m_comSourceVirtualDisk.GetLogicalSize(); … … 286 301 return m_enmDeviceType; 287 302 } 303 304 bool UIWizardNewVD::isClonning() const 305 { 306 return !m_comSourceVirtualDisk.isNull(); 307 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.h
r105554 r105558 102 102 void setMediumVariantPageVisibility(); 103 103 qulonglong diskMinimumSize() const; 104 bool isClonning() const; 104 105 105 106 qulonglong m_uMediumVariant;
Note:
See TracChangeset
for help on using the changeset viewer.