summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2021-09-15 15:50:45 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2021-09-15 15:50:45 +0000
commit22a2cfa6de56c79531505f3366d0f82e1aa87f92 (patch)
tree7f98adafa5f93c1b91ca784a6f03c8d53460619c /src
parent4f2df81735c36a8b53eb997d845d4bf5b3a5c13c (diff)
downloadVirtualBox-svn-22a2cfa6de56c79531505f3366d0f82e1aa87f92.tar.gz
FE/Qt: bugref:9996. Refactoring UIDiskFormatsGroupBox. part 3.
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@91256 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src')
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp6
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPathSizePage.cpp6
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp130
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h121
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp6
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDSizeLocationPage.cpp6
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp2
-rw-r--r--src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp4
8 files changed, 148 insertions, 133 deletions
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp
index 6a59416882d..cecb3f08ddf 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp
@@ -92,7 +92,7 @@ void UIWizardCloneVDExpertPage::sltSelectLocationButtonClicked()
return;
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strSelectedPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
QFileInfo mediumPath(strMediumPath);
m_pMediumSizePathGroupBox->setMediumPath(QDir::toNativeSeparators(mediumPath.absoluteFilePath()));
}
@@ -117,7 +117,7 @@ void UIWizardCloneVDExpertPage::sltMediumPathChanged(const QString &strPath)
AssertReturnVoid(pWizard);
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
pWizard->setMediumPath(strMediumPath);
emit completeChanged();
}
@@ -140,7 +140,7 @@ void UIWizardCloneVDExpertPage::initializePage()
m_pMediumSizePathGroupBox->blockSignals(true);
m_pMediumSizePathGroupBox->setMediumSize(pWizard->sourceDiskLogicalSize());
pWizard->setMediumSize(m_pMediumSizePathGroupBox->mediumSize());
- QString strExtension = UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType());
+ QString strExtension = UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType());
QString strSourceDiskPath = QDir::toNativeSeparators(QFileInfo(pWizard->sourceDiskFilePath()).absolutePath());
/* Disk name without the format extension: */
QString strDiskName = QString("%1_%2").arg(QFileInfo(pWizard->sourceDiskName()).completeBaseName()).arg(tr("copy"));
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPathSizePage.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPathSizePage.cpp
index d1ab7471576..23e7eb620ad 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPathSizePage.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPathSizePage.cpp
@@ -72,7 +72,7 @@ void UIWizardCloneVDPathSizePage::initializePage()
if (!m_userModifiedParameters.contains("MediumPath"))
{
- QString strExtension = UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType());
+ QString strExtension = UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType());
QString strSourceDiskPath = QDir::toNativeSeparators(QFileInfo(pWizard->sourceDiskFilePath()).absolutePath());
/* Disk name without the format extension: */
QString strDiskName = QString("%1_%2").arg(QFileInfo(pWizard->sourceDiskName()).completeBaseName()).arg(tr("copy"));
@@ -118,7 +118,7 @@ void UIWizardCloneVDPathSizePage::sltSelectLocationButtonClicked()
return;
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strSelectedPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
QFileInfo mediumPath(strMediumPath);
m_pMediumSizePathGroupBox->setMediumPath(QDir::toNativeSeparators(mediumPath.absoluteFilePath()));
}
@@ -130,7 +130,7 @@ void UIWizardCloneVDPathSizePage::sltMediumPathChanged(const QString &strPath)
m_userModifiedParameters << "MediumPath";
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), pWizard->deviceType()));
pWizard->setMediumPath(strMediumPath);
emit completeChanged();
}
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp
index bf4403ea77c..bcd8cfdfa98 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp
@@ -167,54 +167,21 @@ QString UIDiskEditorGroupBox::defaultExtension(const CMediumFormat &mediumFormat
/*********************************************************************************************************************************
-* UIDiskFormatsGroupBox implementation. *
+* UIDiskFormatBase implementation. *
*********************************************************************************************************************************/
-UIDiskFormatsGroupBox::UIDiskFormatsGroupBox(bool fExpertMode, KDeviceType enmDeviceType, QWidget *pParent /* = 0 */)
- : UIDiskEditorGroupBox(fExpertMode, pParent)
- , UIDiskFormatBase(enmDeviceType)
- , m_pFormatButtonGroup(0)
- , m_pMainLayout(0)
-{
- prepare();
-
-}
-
-CMediumFormat UIDiskFormatsGroupBox::mediumFormat() const
-{
- return m_pFormatButtonGroup &&
- m_pFormatButtonGroup->checkedButton() ? m_formatList[m_pFormatButtonGroup->checkedId()].m_comFormat : CMediumFormat();
-}
-
-void UIDiskFormatsGroupBox::setMediumFormat(const CMediumFormat &mediumFormat)
+UIDiskFormatBase::UIDiskFormatBase(KDeviceType enmDeviceType, bool fExpertMode)
+ : m_enmDeviceType(enmDeviceType)
+ , m_fExpertMode(fExpertMode)
{
- int iPosition = -1;
- for (int i = 0; i < m_formatList.size(); ++i)
- {
- if (mediumFormat == m_formatList[i].m_comFormat)
- iPosition = i;
- }
- if (iPosition >= 0)
- {
- m_pFormatButtonGroup->button(iPosition)->click();
- m_pFormatButtonGroup->button(iPosition)->setFocus();
- }
}
-const CMediumFormat &UIDiskFormatsGroupBox::VDIMediumFormat() const
+const CMediumFormat &UIDiskFormatBase::VDIMediumFormat() const
{
return m_comVDIMediumFormat;
}
-void UIDiskFormatsGroupBox::prepare()
-{
- m_pMainLayout = new QVBoxLayout(this);
- populateFormats();
- createFormatWidgets();
- retranslateUi();
-}
-
-void UIDiskFormatsGroupBox::populateFormats(){
+void UIDiskFormatBase::populateFormats(){
/* Enumerate medium formats in special order: */
CSystemProperties properties = uiCommon().virtualBox().GetSystemProperties();
const QVector<CMediumFormat> &formats = properties.GetMediumFormats();
@@ -249,21 +216,7 @@ void UIDiskFormatsGroupBox::populateFormats(){
}
}
-void UIDiskFormatsGroupBox::retranslateUi()
-{
- if (m_fExpertMode)
- setTitle(tr("Hard Disk File &Type"));
-
- QList<QAbstractButton*> buttons = m_pFormatButtonGroup ? m_pFormatButtonGroup->buttons() : QList<QAbstractButton*>();
- for (int i = 0; i < buttons.size(); ++i)
- {
- QAbstractButton *pButton = buttons[i];
- UIMediumFormat enmFormat = gpConverter->fromInternalString<UIMediumFormat>(m_formatList[m_pFormatButtonGroup->id(pButton)].m_strName);
- pButton->setText(gpConverter->toString(enmFormat));
- }
-}
-
-void UIDiskFormatsGroupBox::addFormat(CMediumFormat medFormat, bool fPreferred /* = false */)
+void UIDiskFormatBase::addFormat(CMediumFormat medFormat, bool fPreferred /* = false */)
{
/* Check that medium format supports creation: */
ULONG uFormatCapabilities = 0;
@@ -282,10 +235,10 @@ void UIDiskFormatsGroupBox::addFormat(CMediumFormat medFormat, bool fPreferred /
medFormat.DescribeFileExtensions(fileExtensions, deviceTypes);
if (!deviceTypes.contains(m_enmDeviceType))
return;
- m_formatList << Format(medFormat, medFormat.GetName(), defaultExtension(medFormat, m_enmDeviceType), fPreferred);
+ m_formatList << Format(medFormat, UIDiskEditorGroupBox::defaultExtension(medFormat, m_enmDeviceType), fPreferred);
}
-const QStringList UIDiskFormatsGroupBox::formatExtensions() const
+QStringList UIDiskFormatBase::formatExtensions() const
{
QStringList extensionList;
foreach (const Format &format, m_formatList)
@@ -293,6 +246,67 @@ const QStringList UIDiskFormatsGroupBox::formatExtensions() const
return extensionList;
}
+bool UIDiskFormatBase::isExpertMode() const
+{
+ return m_fExpertMode;
+}
+
+/*********************************************************************************************************************************
+* UIDiskFormatsGroupBox implementation. *
+*********************************************************************************************************************************/
+
+UIDiskFormatsGroupBox::UIDiskFormatsGroupBox(bool fExpertMode, KDeviceType enmDeviceType, QWidget *pParent /* = 0 */)
+ : QIWithRetranslateUI<QWidget>(pParent)
+ , UIDiskFormatBase(enmDeviceType, fExpertMode)
+ , m_pFormatButtonGroup(0)
+ , m_pMainLayout(0)
+{
+ prepare();
+}
+
+CMediumFormat UIDiskFormatsGroupBox::mediumFormat() const
+{
+ return m_pFormatButtonGroup &&
+ m_pFormatButtonGroup->checkedButton() ? m_formatList[m_pFormatButtonGroup->checkedId()].m_comFormat : CMediumFormat();
+}
+
+void UIDiskFormatsGroupBox::setMediumFormat(const CMediumFormat &mediumFormat)
+{
+ int iPosition = -1;
+ for (int i = 0; i < m_formatList.size(); ++i)
+ {
+ if (mediumFormat == m_formatList[i].m_comFormat)
+ iPosition = i;
+ }
+ if (iPosition >= 0)
+ {
+ m_pFormatButtonGroup->button(iPosition)->click();
+ m_pFormatButtonGroup->button(iPosition)->setFocus();
+ }
+}
+
+void UIDiskFormatsGroupBox::prepare()
+{
+ m_pMainLayout = new QVBoxLayout(this);
+ populateFormats();
+ createFormatWidgets();
+ retranslateUi();
+}
+
+void UIDiskFormatsGroupBox::retranslateUi()
+{
+ QList<QAbstractButton*> buttons = m_pFormatButtonGroup ? m_pFormatButtonGroup->buttons() : QList<QAbstractButton*>();
+ for (int i = 0; i < buttons.size(); ++i)
+ {
+ QAbstractButton *pButton = buttons[i];
+ const CMediumFormat &format = m_formatList[m_pFormatButtonGroup->id(pButton)].m_comFormat;
+ if (format.isNull())
+ continue;
+ UIMediumFormat enmFormat = gpConverter->fromInternalString<UIMediumFormat>(format.GetName());
+ pButton->setText(gpConverter->toString(enmFormat));
+ }
+}
+
void UIDiskFormatsGroupBox::createFormatWidgets()
{
AssertReturnVoid(m_pMainLayout);
@@ -307,7 +321,7 @@ void UIDiskFormatsGroupBox::createFormatWidgets()
continue;
/* Make the preferred button font bold: */
- if (m_formatList[i].m_fPreferred && m_fExpertMode)
+ if (m_formatList[i].m_fPreferred && isExpertMode())
{
QFont font = pFormatButton->font();
font.setBold(true);
@@ -560,7 +574,7 @@ void UIMediumSizeAndPathGroupBox::updateMediumPath(const CMediumFormat &mediumFo
KDeviceType enmDeviceType)
{
/* Compose virtual-disk extension: */
- QString strDefaultExtension = UIDiskFormatsGroupBox::defaultExtension(mediumFormat, enmDeviceType);
+ QString strDefaultExtension = UIDiskEditorGroupBox::defaultExtension(mediumFormat, enmDeviceType);
/* Update m_pLocationEditor's text if necessary: */
if (!m_pLocationEditor->text().isEmpty() && !strDefaultExtension.isEmpty())
{
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h b/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h
index ff43102828b..4dcae64c7cb 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h
@@ -73,66 +73,6 @@ protected:
bool m_fExpertMode;
};
-class UIDiskFormatBase
-{
-
-public:
-
- UIDiskFormatBase(KDeviceType enmDeviceType)
- : m_enmDeviceType(enmDeviceType)
- {}
-
-protected:
-
- struct Format
- {
- CMediumFormat m_comFormat;
- QString m_strName;
- QString m_strExtension;
- bool m_fPreferred;
- Format(const CMediumFormat &comFormat, const QString &strName,
- const QString &strExtension, bool fPreferred)
- : m_comFormat(comFormat)
- , m_strName(strName)
- , m_strExtension(strExtension)
- , m_fPreferred(fPreferred){}
- Format(){}
- };
-
- QVector<Format> m_formatList;
- CMediumFormat m_comVDIMediumFormat;
- KDeviceType m_enmDeviceType;
-
-};
-
-class SHARED_LIBRARY_STUFF UIDiskFormatsGroupBox : public UIDiskEditorGroupBox, public UIDiskFormatBase
-{
- Q_OBJECT;
-
-signals:
-
- void sigMediumFormatChanged();
-
-public:
-
- UIDiskFormatsGroupBox(bool fExpertMode, KDeviceType enmDeviceType, QWidget *pParent = 0);
- CMediumFormat mediumFormat() const;
- void setMediumFormat(const CMediumFormat &mediumFormat);
- const CMediumFormat &VDIMediumFormat() const;
- const QStringList formatExtensions() const;
-
-private:
-
- void prepare();
- void populateFormats();
- void addFormat(CMediumFormat medFormat, bool fPreferred = false);
- void createFormatWidgets();
- virtual void retranslateUi() /* override final */;
-
-
- QButtonGroup *m_pFormatButtonGroup;
- QVBoxLayout *m_pMainLayout;
-};
class SHARED_LIBRARY_STUFF UIDiskVariantGroupBox : public UIDiskEditorGroupBox
{
@@ -208,4 +148,65 @@ private:
QIRichTextLabel *m_pSizeLabel;
};
+/** Base class for the widgets used to select virtual medium format. It implements mutual functioanlity
+ * like finding name, extension etc for a CMediumFormat and device type. */
+class SHARED_LIBRARY_STUFF UIDiskFormatBase
+{
+public:
+
+ UIDiskFormatBase(KDeviceType enmDeviceType, bool fExpertMode);
+ const CMediumFormat &VDIMediumFormat() const;
+ QStringList formatExtensions() const;
+
+protected:
+
+ struct Format
+ {
+ CMediumFormat m_comFormat;
+ QString m_strExtension;
+ bool m_fPreferred;
+ Format(const CMediumFormat &comFormat,
+ const QString &strExtension, bool fPreferred)
+ : m_comFormat(comFormat)
+ , m_strExtension(strExtension)
+ , m_fPreferred(fPreferred){}
+ Format(){}
+ };
+
+ void addFormat(CMediumFormat medFormat, bool fPreferred = false);
+ void populateFormats();
+ bool isExpertMode() const;
+ QVector<Format> m_formatList;
+
+private:
+
+ CMediumFormat m_comVDIMediumFormat;
+ KDeviceType m_enmDeviceType;
+ bool m_fExpertMode;
+};
+
+class SHARED_LIBRARY_STUFF UIDiskFormatsGroupBox : public QIWithRetranslateUI<QWidget>, public UIDiskFormatBase
+{
+ Q_OBJECT;
+
+signals:
+
+ void sigMediumFormatChanged();
+
+public:
+
+ UIDiskFormatsGroupBox(bool fExpertMode, KDeviceType enmDeviceType, QWidget *pParent = 0);
+ CMediumFormat mediumFormat() const;
+ void setMediumFormat(const CMediumFormat &mediumFormat);
+
+private:
+
+ void prepare();
+ void createFormatWidgets();
+ virtual void retranslateUi() /* override final */;
+
+ QButtonGroup *m_pFormatButtonGroup;
+ QVBoxLayout *m_pMainLayout;
+};
+
#endif /* !FEQT_INCLUDED_SRC_wizards_editors_UIWizardDiskEditors_h */
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp
index a0e8d6f0a41..f3f2b08b55e 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp
@@ -81,7 +81,7 @@ void UIWizardNewVDExpertPage::sltMediumPathChanged(const QString &strPath)
AssertReturnVoid(pWizard);
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
pWizard->setMediumPath(strMediumPath);
emit completeChanged();
}
@@ -114,7 +114,7 @@ void UIWizardNewVDExpertPage::sltSelectLocationButtonClicked()
return;
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strSelectedPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
QFileInfo mediumPath(strMediumPath);
m_pSizeAndPathGroup->setMediumPath(QDir::toNativeSeparators(mediumPath.absoluteFilePath()));
emit completeChanged();
@@ -134,7 +134,7 @@ void UIWizardNewVDExpertPage::initializePage()
AssertReturnVoid(!comMediumFormat.isNull());
pWizard->setMediumFormat(comMediumFormat);
- QString strExtension = UIDiskFormatsGroupBox::defaultExtension(comMediumFormat, KDeviceType_HardDisk);
+ QString strExtension = UIDiskEditorGroupBox::defaultExtension(comMediumFormat, KDeviceType_HardDisk);
QString strMediumFilePath =
UIDiskEditorGroupBox::constructMediumFilePath(UIDiskVariantGroupBox::appendExtension(m_strDefaultName,
strExtension), m_strDefaultPath);
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDSizeLocationPage.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDSizeLocationPage.cpp
index c532e5d8997..7a91cf432e4 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDSizeLocationPage.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDSizeLocationPage.cpp
@@ -69,7 +69,7 @@ void UIWizardNewVDSizeLocationPage::sltSelectLocationButtonClicked()
return;
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strSelectedPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
QFileInfo mediumPath(strMediumPath);
m_pMediumSizePathGroup->setMediumPath(QDir::toNativeSeparators(mediumPath.absoluteFilePath()));
}
@@ -89,7 +89,7 @@ void UIWizardNewVDSizeLocationPage::sltMediumPathChanged(const QString &strPath)
m_userModifiedParameters << "MediumPath";
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
pWizard->setMediumPath(strMediumPath);
emit completeChanged();
}
@@ -106,7 +106,7 @@ void UIWizardNewVDSizeLocationPage::initializePage()
if (!m_userModifiedParameters.contains("MediumPath"))
{
- QString strExtension = UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk);
+ QString strExtension = UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk);
QString strMediumFilePath =
UIDiskEditorGroupBox::constructMediumFilePath(UIDiskVariantGroupBox::appendExtension(m_strDefaultName,
strExtension), m_strDefaultPath);
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp
index 4812435a5c7..f8a08f2572c 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp
@@ -295,7 +295,7 @@ void UIWizardNewVMDiskPage::initializePage()
AssertMsgFailed(("No medium format corresponding to VDI could be found!"));
setWidgetVisibility(pWizard->mediumFormat());
}
- QString strDefaultExtension = UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk);
+ QString strDefaultExtension = UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk);
/* We set the medium name and path according to machine name/path and do not allow user change these in the guided mode: */
QString strDefaultName = pWizard->machineBaseName().isEmpty() ? QString("NewVirtualDisk1") : pWizard->machineBaseName();
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
index 56ef7d624e5..a511372059d 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
@@ -687,7 +687,7 @@ void UIWizardNewVMExpertPage::sltMediumLocationButtonClicked()
return;
QString strMediumPath =
UIDiskEditorGroupBox::appendExtension(strSelectedPath,
- UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
+ UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk));
QFileInfo mediumPath(strMediumPath);
m_pSizeAndLocationGroup->setMediumPath(QDir::toNativeSeparators(mediumPath.absoluteFilePath()));
}
@@ -805,7 +805,7 @@ void UIWizardNewVMExpertPage::updateVirtualMediumPathFromMachinePathName()
else
strMediumPath = uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
}
- QString strExtension = UIDiskFormatsGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk);
+ QString strExtension = UIDiskEditorGroupBox::defaultExtension(pWizard->mediumFormat(), KDeviceType_HardDisk);
if (m_pSizeAndLocationGroup)
{
QString strMediumFilePath =