Changeset 77154 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 4, 2019 5:52:47 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128629
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
- 4 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r77086 r77154 675 675 src/wizards/clonevd/UIWizardCloneVDPageBasic2.h \ 676 676 src/wizards/clonevd/UIWizardCloneVDPageBasic3.h \ 677 src/wizards/clonevd/UIWizardCloneVDPageBasic4.h \678 677 src/wizards/clonevd/UIWizardCloneVDPageExpert.h \ 679 678 src/wizards/exportappliance/UIWizardExportApp.h \ … … 1094 1093 src/wizards/clonevd/UIWizardCloneVDPageBasic2.cpp \ 1095 1094 src/wizards/clonevd/UIWizardCloneVDPageBasic3.cpp \ 1096 src/wizards/clonevd/UIWizardCloneVDPageBasic4.cpp \1097 1095 src/wizards/clonevd/UIWizardCloneVDPageExpert.cpp \ 1098 1096 src/wizards/exportappliance/UIWizardExportApp.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVD.cpp
r76606 r77154 21 21 #include "UIWizardCloneVDPageBasic2.h" 22 22 #include "UIWizardCloneVDPageBasic3.h" 23 #include "UIWizardCloneVDPageBasic4.h"24 23 #include "UIWizardCloneVDPageExpert.h" 25 24 #include "VBoxGlobal.h" … … 47 46 { 48 47 /* Gather attributes: */ 49 CMedium comSourceVirtualDisk = field("sourceVirtualDisk").value<CMedium>(); 48 50 49 const CMediumFormat comMediumFormat = field("mediumFormat").value<CMediumFormat>(); 51 50 const qulonglong uVariant = field("mediumVariant").toULongLong(); … … 77 76 78 77 /* Copy source image to new one: */ 79 CProgress comProgress = comSourceVirtualDisk.CloneTo(comVirtualDisk, variants, CMedium());80 if (! comSourceVirtualDisk.isOk())78 CProgress comProgress = m_comSourceVirtualDisk.CloneTo(comVirtualDisk, variants, CMedium()); 79 if (!m_comSourceVirtualDisk.isOk()) 81 80 { 82 msgCenter().cannotCreateMediumStorage( comSourceVirtualDisk, strMediumPath, this);81 msgCenter().cannotCreateMediumStorage(m_comSourceVirtualDisk, strMediumPath, this); 83 82 return false; 84 83 } … … 120 119 case WizardMode_Basic: 121 120 { 122 setPage(Page1, new UIWizardCloneVDPageBasic1(m_comSourceVirtualDisk, 123 m_enmSourceVirtualDiskDeviceType)); 121 setPage(Page1, new UIWizardCloneVDPageBasic1(m_enmSourceVirtualDiskDeviceType)); 124 122 setPage(Page2, new UIWizardCloneVDPageBasic2(m_enmSourceVirtualDiskDeviceType)); 125 setPage(Page3, new UIWizardCloneVDPageBasic3(m_enmSourceVirtualDiskDeviceType)); 126 setPage(Page4, new UIWizardCloneVDPageBasic4); 123 setPage(Page3, new UIWizardCloneVDPageBasic3); 127 124 break; 128 125 } 129 126 case WizardMode_Expert: 130 127 { 131 setPage(PageExpert, new UIWizardCloneVDPageExpert(m_comSourceVirtualDisk, 132 m_enmSourceVirtualDiskDeviceType)); 128 setPage(PageExpert, new UIWizardCloneVDPageExpert(m_enmSourceVirtualDiskDeviceType)); 133 129 break; 134 130 } … … 142 138 UIWizard::prepare(); 143 139 } 144 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVD.h
r76581 r77154 42 42 Page1, 43 43 Page2, 44 Page3, 45 Page4 44 Page3 46 45 }; 47 46 … … 56 55 57 56 /** Returns source virtual-disk. */ 58 CMediumsourceVirtualDisk() const { return m_comSourceVirtualDisk; }57 const CMedium &sourceVirtualDisk() const { return m_comSourceVirtualDisk; } 59 58 /** Returns target virtual-disk. */ 60 59 CMedium targetVirtualDisk() const { return m_comTargetVirtualDisk; } … … 84 83 85 84 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVD_h */ 86 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic1.cpp
r77153 r77154 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardCloneVDPageBasic 2class implementation.3 * VBox Qt GUI - UIWizardCloneVDPageBasic1 class implementation. 4 4 */ 5 5 … … 23 23 /* GUI includes: */ 24 24 #include "UIConverter.h" 25 #include "UIWizardCloneVDPageBasic 2.h"25 #include "UIWizardCloneVDPageBasic1.h" 26 26 #include "UIWizardCloneVD.h" 27 27 #include "VBoxGlobal.h" … … 32 32 33 33 34 UIWizardCloneVDPage 2::UIWizardCloneVDPage2()35 { 36 } 37 38 void UIWizardCloneVDPage 2::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, KDeviceType enmDeviceType, CMediumFormat comMediumFormat, bool fPreferred /* = false */)34 UIWizardCloneVDPage1::UIWizardCloneVDPage1() 35 { 36 } 37 38 void UIWizardCloneVDPage1::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, KDeviceType enmDeviceType, CMediumFormat comMediumFormat, bool fPreferred /* = false */) 39 39 { 40 40 /* Check that medium format supports creation: */ … … 74 74 } 75 75 76 CMediumFormat UIWizardCloneVDPage 2::mediumFormat() const76 CMediumFormat UIWizardCloneVDPage1::mediumFormat() const 77 77 { 78 78 return m_pFormatButtonGroup->checkedButton() ? m_formats[m_pFormatButtonGroup->checkedId()] : CMediumFormat(); 79 79 } 80 80 81 void UIWizardCloneVDPage 2::setMediumFormat(const CMediumFormat &comMediumFormat)81 void UIWizardCloneVDPage1::setMediumFormat(const CMediumFormat &comMediumFormat) 82 82 { 83 83 int iPosition = m_formats.indexOf(comMediumFormat); … … 89 89 } 90 90 91 UIWizardCloneVDPageBasic 2::UIWizardCloneVDPageBasic2(KDeviceType enmDeviceType)91 UIWizardCloneVDPageBasic1::UIWizardCloneVDPageBasic1(KDeviceType enmDeviceType) 92 92 { 93 93 /* Create widgets: */ … … 143 143 /* Setup connections: */ 144 144 connect(m_pFormatButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 145 this, &UIWizardCloneVDPageBasic 2::completeChanged);145 this, &UIWizardCloneVDPageBasic1::completeChanged); 146 146 147 147 /* Register classes: */ … … 151 151 } 152 152 153 void UIWizardCloneVDPageBasic 2::retranslateUi()153 void UIWizardCloneVDPageBasic1::retranslateUi() 154 154 { 155 155 /* Translate page: */ … … 169 169 } 170 170 171 void UIWizardCloneVDPageBasic 2::initializePage()171 void UIWizardCloneVDPageBasic1::initializePage() 172 172 { 173 173 /* Translate page: */ … … 175 175 } 176 176 177 bool UIWizardCloneVDPageBasic 2::isComplete() const177 bool UIWizardCloneVDPageBasic1::isComplete() const 178 178 { 179 179 /* Make sure medium format is correct: */ … … 181 181 } 182 182 183 int UIWizardCloneVDPageBasic 2::nextId() const183 int UIWizardCloneVDPageBasic1::nextId() const 184 184 { 185 185 /* Show variant page only if there is something to show: */ … … 208 208 } 209 209 /* Skip otherwise: */ 210 return UIWizardCloneVD::Page4; 211 } 212 210 return UIWizardCloneVD::Page3; 211 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic1.h
r77153 r77154 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardCloneVDPageBasic 2class declaration.3 * VBox Qt GUI - UIWizardCloneVDPageBasic1 class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic 2_h19 #define FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic 2_h18 #ifndef FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic1_h 19 #define FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic1_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 36 36 37 37 38 /** 2ndpage of the Clone Virtual Disk Image wizard (base part): */39 class UIWizardCloneVDPage 2: public UIWizardPageBase38 /** 1st page of the Clone Virtual Disk Image wizard (base part): */ 39 class UIWizardCloneVDPage1 : public UIWizardPageBase 40 40 { 41 41 protected: 42 42 43 43 /** Constructs page basis. */ 44 UIWizardCloneVDPage 2();44 UIWizardCloneVDPage1(); 45 45 46 46 /** Adds format button. … … 71 71 72 72 /** 2nd page of the Clone Virtual Disk Image wizard (basic extension): */ 73 class UIWizardCloneVDPageBasic 2 : public UIWizardPage, public UIWizardCloneVDPage273 class UIWizardCloneVDPageBasic1 : public UIWizardPage, public UIWizardCloneVDPage1 74 74 { 75 75 Q_OBJECT; … … 80 80 /** Constructs basic page. 81 81 * @param enmDeviceType Brings the device type to limit format to. */ 82 UIWizardCloneVDPageBasic 2(KDeviceType enmDeviceType);82 UIWizardCloneVDPageBasic1(KDeviceType enmDeviceType); 83 83 84 84 private: … … 100 100 }; 101 101 102 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic2_h */ 103 102 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic1_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic2.cpp
r77153 r77154 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardCloneVDPageBasic 3class implementation.3 * VBox Qt GUI - UIWizardCloneVDPageBasic2 class implementation. 4 4 */ 5 5 … … 23 23 24 24 /* GUI includes: */ 25 #include "UIWizardCloneVDPageBasic 3.h"25 #include "UIWizardCloneVDPageBasic2.h" 26 26 #include "UIWizardCloneVD.h" 27 27 #include "QIRichTextLabel.h" … … 31 31 32 32 33 UIWizardCloneVDPage 3::UIWizardCloneVDPage3()33 UIWizardCloneVDPage2::UIWizardCloneVDPage2() 34 34 { 35 35 } 36 36 37 qulonglong UIWizardCloneVDPage 3::mediumVariant() const37 qulonglong UIWizardCloneVDPage2::mediumVariant() const 38 38 { 39 39 /* Initial value: */ … … 54 54 } 55 55 56 void UIWizardCloneVDPage 3::setMediumVariant(qulonglong uMediumVariant)56 void UIWizardCloneVDPage2::setMediumVariant(qulonglong uMediumVariant) 57 57 { 58 58 /* Exclusive options: */ … … 72 72 } 73 73 74 UIWizardCloneVDPageBasic 3::UIWizardCloneVDPageBasic3(KDeviceType enmDeviceType)74 UIWizardCloneVDPageBasic2::UIWizardCloneVDPageBasic2(KDeviceType enmDeviceType) 75 75 { 76 76 /* Create widgets: */ … … 116 116 /* Setup connections: */ 117 117 connect(m_pVariantButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 118 this, &UIWizardCloneVDPageBasic 3::completeChanged);118 this, &UIWizardCloneVDPageBasic2::completeChanged); 119 119 connect(m_pSplitBox, &QCheckBox::stateChanged, 120 this, &UIWizardCloneVDPageBasic 3::completeChanged);120 this, &UIWizardCloneVDPageBasic2::completeChanged); 121 121 122 122 /* Register fields: */ … … 124 124 } 125 125 126 void UIWizardCloneVDPageBasic 3::retranslateUi()126 void UIWizardCloneVDPageBasic2::retranslateUi() 127 127 { 128 128 /* Translate page: */ … … 146 146 } 147 147 148 void UIWizardCloneVDPageBasic 3::initializePage()148 void UIWizardCloneVDPageBasic2::initializePage() 149 149 { 150 150 /* Translate page: */ … … 170 170 } 171 171 172 bool UIWizardCloneVDPageBasic 3::isComplete() const172 bool UIWizardCloneVDPageBasic2::isComplete() const 173 173 { 174 174 /* Make sure medium variant is correct: */ 175 175 return mediumVariant() != (qulonglong)KMediumVariant_Max; 176 176 } 177 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic2.h
r77153 r77154 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardCloneVDPageBasic 3class declaration.3 * VBox Qt GUI - UIWizardCloneVDPageBasic2 class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic 3_h19 #define FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic 3_h18 #ifndef FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic2_h 19 #define FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic2_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 36 36 37 37 /** 3rd page of the Clone Virtual Disk Image wizard (base part): */ 38 class UIWizardCloneVDPage 3: public UIWizardPageBase38 class UIWizardCloneVDPage2 : public UIWizardPageBase 39 39 { 40 40 protected: 41 41 42 42 /** Constructs page basis. */ 43 UIWizardCloneVDPage 3();43 UIWizardCloneVDPage2(); 44 44 45 45 /** Returns 'mediumVariant' field value. */ … … 60 60 61 61 /** 3rd page of the Clone Virtual Disk Image wizard (basic extension): */ 62 class UIWizardCloneVDPageBasic 3 : public UIWizardPage, public UIWizardCloneVDPage362 class UIWizardCloneVDPageBasic2 : public UIWizardPage, public UIWizardCloneVDPage2 63 63 { 64 64 Q_OBJECT; … … 68 68 69 69 /** Constructs basic page. */ 70 UIWizardCloneVDPageBasic 3(KDeviceType enmDeviceType);70 UIWizardCloneVDPageBasic2(KDeviceType enmDeviceType); 71 71 72 72 private: … … 91 91 }; 92 92 93 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic3_h */ 94 93 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic2_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic3.cpp
r77153 r77154 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardCloneVDPageBasic 4class implementation.3 * VBox Qt GUI - UIWizardCloneVDPageBasic3 class implementation. 4 4 */ 5 5 … … 23 23 24 24 /* GUI includes: */ 25 #include "UIWizardCloneVDPageBasic 4.h"25 #include "UIWizardCloneVDPageBasic3.h" 26 26 #include "UIWizardCloneVD.h" 27 27 #include "VBoxGlobal.h" … … 36 36 37 37 38 UIWizardCloneVDPage 4::UIWizardCloneVDPage4()39 { 40 } 41 42 void UIWizardCloneVDPage 4::onSelectLocationButtonClicked()38 UIWizardCloneVDPage3::UIWizardCloneVDPage3() 39 { 40 } 41 42 void UIWizardCloneVDPage3::onSelectLocationButtonClicked() 43 43 { 44 44 /* Get current folder and filename: */ … … 94 94 95 95 /* static */ 96 QString UIWizardCloneVDPage 4::toFileName(const QString &strName, const QString &strExtension)96 QString UIWizardCloneVDPage3::toFileName(const QString &strName, const QString &strExtension) 97 97 { 98 98 /* Convert passed name to native separators (it can be full, actually): */ … … 113 113 114 114 /* static */ 115 QString UIWizardCloneVDPage 4::absoluteFilePath(const QString &strFileName, const QString &strDefaultPath)115 QString UIWizardCloneVDPage3::absoluteFilePath(const QString &strFileName, const QString &strDefaultPath) 116 116 { 117 117 /* Wrap file-info around received file name: */ … … 128 128 129 129 /* static */ 130 void UIWizardCloneVDPage 4::acquireExtensions(const CMediumFormat &comMediumFormat, KDeviceType enmDeviceType,130 void UIWizardCloneVDPage3::acquireExtensions(const CMediumFormat &comMediumFormat, KDeviceType enmDeviceType, 131 131 QStringList &aAllowedExtensions, QString &strDefaultExtension) 132 132 { … … 143 143 } 144 144 145 QString UIWizardCloneVDPage 4::mediumPath() const145 QString UIWizardCloneVDPage3::mediumPath() const 146 146 { 147 147 /* Acquire chosen file path, and what is important user suffix: */ … … 156 156 } 157 157 158 qulonglong UIWizardCloneVDPage4::mediumSize() const 159 { 160 const CMedium &sourceVirtualDisk = fieldImp("sourceVirtualDisk").value<CMedium>(); 158 qulonglong UIWizardCloneVDPage3::mediumSize() 159 { 160 UIWizardCloneVD *pWizard = qobject_cast<UIWizardCloneVD*>(wizardImp()); 161 if (!pWizard) 162 return 0; 163 const CMedium &sourceVirtualDisk = pWizard->sourceVirtualDisk(); 161 164 return sourceVirtualDisk.isNull() ? 0 : sourceVirtualDisk.GetLogicalSize(); 162 165 } 163 166 164 UIWizardCloneVDPageBasic 4::UIWizardCloneVDPageBasic4()167 UIWizardCloneVDPageBasic3::UIWizardCloneVDPageBasic3() 165 168 { 166 169 /* Create widgets: */ … … 185 188 186 189 /* Setup page connections: */ 187 connect(m_pDestinationDiskEditor, &QLineEdit::textChanged, this, &UIWizardCloneVDPageBasic 4::completeChanged);188 connect(m_pDestinationDiskOpenButton, &QIToolButton::clicked, this, &UIWizardCloneVDPageBasic 4::sltSelectLocationButtonClicked);190 connect(m_pDestinationDiskEditor, &QLineEdit::textChanged, this, &UIWizardCloneVDPageBasic3::completeChanged); 191 connect(m_pDestinationDiskOpenButton, &QIToolButton::clicked, this, &UIWizardCloneVDPageBasic3::sltSelectLocationButtonClicked); 189 192 190 193 /* Register fields: */ … … 193 196 } 194 197 195 void UIWizardCloneVDPageBasic 4::sltSelectLocationButtonClicked()198 void UIWizardCloneVDPageBasic3::sltSelectLocationButtonClicked() 196 199 { 197 200 /* Call to base-class: */ … … 199 202 } 200 203 201 void UIWizardCloneVDPageBasic 4::retranslateUi()204 void UIWizardCloneVDPageBasic3::retranslateUi() 202 205 { 203 206 /* Translate page: */ … … 210 213 } 211 214 212 void UIWizardCloneVDPageBasic 4::initializePage()215 void UIWizardCloneVDPageBasic3::initializePage() 213 216 { 214 217 /* Translate page: */ 215 218 retranslateUi(); 216 219 220 UIWizardCloneVD *pWizard = qobject_cast<UIWizardCloneVD*>(wizardImp()); 221 if (!pWizard) 222 return; 223 const CMedium &comMedium = pWizard->sourceVirtualDisk(); 224 217 225 /* Get source virtual-disk file-information: */ 218 QFileInfo sourceFileInfo( field("sourceVirtualDisk").value<CMedium>().GetLocation());226 QFileInfo sourceFileInfo(comMedium.GetLocation()); 219 227 /* Get default path for virtual-disk copy: */ 220 228 m_strDefaultPath = sourceFileInfo.absolutePath(); … … 229 237 } 230 238 231 bool UIWizardCloneVDPageBasic 4::isComplete() const239 bool UIWizardCloneVDPageBasic3::isComplete() const 232 240 { 233 241 /* Make sure current name is not empty: */ … … 235 243 } 236 244 237 bool UIWizardCloneVDPageBasic 4::validatePage()245 bool UIWizardCloneVDPageBasic3::validatePage() 238 246 { 239 247 /* Initial result: */ … … 261 269 return fResult; 262 270 } 263 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic3.h
r77153 r77154 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardCloneVDPageBasic 4class declaration.3 * VBox Qt GUI - UIWizardCloneVDPageBasic3 class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic 4_h19 #define FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic 4_h18 #ifndef FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic3_h 19 #define FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic3_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 39 39 40 40 /** 4th page of the Clone Virtual Disk Image wizard (base part): */ 41 class UIWizardCloneVDPage 4: public UIWizardPageBase41 class UIWizardCloneVDPage3 : public UIWizardPageBase 42 42 { 43 43 protected: 44 44 45 45 /** Constructs page basis. */ 46 UIWizardCloneVDPage 4();46 UIWizardCloneVDPage3(); 47 47 48 48 /** Handles command to open target disk. */ … … 62 62 63 63 /** Returns 'mediumSize' field value. */ 64 qulonglong mediumSize() const;64 qulonglong mediumSize(); 65 65 66 66 /** Holds the default path. */ … … 79 79 80 80 /** 4th page of the Clone Virtual Disk Image wizard (basic extension): */ 81 class UIWizardCloneVDPageBasic 4 : public UIWizardPage, public UIWizardCloneVDPage481 class UIWizardCloneVDPageBasic3 : public UIWizardPage, public UIWizardCloneVDPage3 82 82 { 83 83 Q_OBJECT; … … 88 88 89 89 /** Constructs basic page. */ 90 UIWizardCloneVDPageBasic 4();90 UIWizardCloneVDPageBasic3(); 91 91 92 92 protected: … … 122 122 }; 123 123 124 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic4_h */ 125 124 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageBasic3_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageExpert.cpp
r76606 r77154 39 39 40 40 41 UIWizardCloneVDPageExpert::UIWizardCloneVDPageExpert( const CMedium &comSourceVirtualDisk,KDeviceType enmDeviceType)41 UIWizardCloneVDPageExpert::UIWizardCloneVDPageExpert(KDeviceType enmDeviceType) 42 42 { 43 43 /* Create widgets: */ 44 44 QGridLayout *pMainLayout = new QGridLayout(this); 45 45 { 46 m_pSourceDiskCnt = new QGroupBox(this);47 {48 m_pSourceDiskCnt->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);49 QHBoxLayout *pSourceDiskCntLayout = new QHBoxLayout(m_pSourceDiskCnt);50 {51 m_pSourceDiskSelector = new UIMediaComboBox(m_pSourceDiskCnt);52 {53 m_pSourceDiskSelector->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);54 m_pSourceDiskSelector->setType(UIMediumDefs::mediumTypeToLocal(enmDeviceType));55 m_pSourceDiskSelector->setCurrentItem(comSourceVirtualDisk.GetId());56 m_pSourceDiskSelector->repopulate();57 }58 m_pSourceDiskOpenButton = new QIToolButton(m_pSourceDiskCnt);59 {60 m_pSourceDiskOpenButton->setAutoRaise(true);61 m_pSourceDiskOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png"));62 }63 pSourceDiskCntLayout->addWidget(m_pSourceDiskSelector);64 pSourceDiskCntLayout->addWidget(m_pSourceDiskOpenButton);65 }66 }67 46 m_pDestinationCnt = new QGroupBox(this); 68 47 { … … 153 132 } 154 133 } 155 pMainLayout->addWidget(m_pSourceDiskCnt, 0, 0, 1, 2);156 134 pMainLayout->addWidget(m_pDestinationCnt, 1, 0, 1, 2); 157 135 pMainLayout->addWidget(m_pFormatCnt, 2, 0, Qt::AlignTop); … … 160 138 161 139 /* Setup connections: */ 162 connect(m_pSourceDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),163 this, &UIWizardCloneVDPageExpert::sltHandleSourceDiskChange);164 connect(m_pSourceDiskOpenButton, &QIToolButton::clicked,165 this, &UIWizardCloneVDPageExpert::sltHandleOpenSourceDiskClick);166 140 connect(m_pFormatButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 167 141 this, &UIWizardCloneVDPageExpert::sltMediumFormatChanged); … … 179 153 qRegisterMetaType<CMediumFormat>(); 180 154 /* Register fields: */ 181 registerField("sourceVirtualDisk", this, "sourceVirtualDisk");182 155 registerField("mediumFormat", this, "mediumFormat"); 183 156 registerField("mediumVariant", this, "mediumVariant"); … … 186 159 } 187 160 188 void UIWizardCloneVDPageExpert::sltHandleSourceDiskChange() 189 { 161 void UIWizardCloneVDPageExpert::setTargetLocation() 162 { 163 UIWizardCloneVD *pWizard = qobject_cast<UIWizardCloneVD*>(wizard()); 164 if (!pWizard) 165 return; 190 166 /* Get source virtual-disk file-information: */ 191 QFileInfo sourceFileInfo( sourceVirtualDisk().GetLocation());167 QFileInfo sourceFileInfo(pWizard->sourceVirtualDisk().GetLocation()); 192 168 /* Get default path for virtual-disk copy: */ 193 169 m_strDefaultPath = sourceFileInfo.absolutePath(); … … 196 172 /* Set text to location editor: */ 197 173 m_pDestinationDiskEditor->setText(strMediumName); 198 199 /* Broadcast complete-change: */200 emit completeChanged();201 }202 203 void UIWizardCloneVDPageExpert::sltHandleOpenSourceDiskClick()204 {205 /* Call to base-class: */206 onHandleOpenSourceDiskClick();207 174 208 175 /* Broadcast complete-change: */ … … 251 218 { 252 219 /* Translate widgets: */ 253 m_pSourceDiskCnt->setTitle(UIWizardCloneVD::tr("Disk image to ©"));254 m_pSourceDiskOpenButton->setToolTip(UIWizardCloneVD::tr("Choose a virtual disk image file to copy..."));255 220 m_pDestinationCnt->setTitle(UIWizardCloneVD::tr("&New disk image to create")); 256 221 m_pDestinationDiskOpenButton->setToolTip(UIWizardCloneVD::tr("Choose a location for new virtual disk image file...")); … … 274 239 retranslateUi(); 275 240 276 s ltHandleSourceDiskChange();241 setTargetLocation(); 277 242 sltMediumFormatChanged(); 278 243 } … … 280 245 bool UIWizardCloneVDPageExpert::isComplete() const 281 246 { 247 UIWizardCloneVD *pWizard = qobject_cast<UIWizardCloneVD*>(wizard()); 248 if (!pWizard) 249 return false; 282 250 /* Check what source virtual-disk feats the rules, 283 251 * medium format/variant is correct, 284 252 * current name is not empty: */ 285 return ! sourceVirtualDisk().isNull() &&253 return !pWizard->sourceVirtualDisk().isNull() && 286 254 !mediumFormat().isNull() && 287 255 mediumVariant() != (qulonglong)KMediumVariant_Max && … … 313 281 return fResult; 314 282 } 315 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageExpert.h
r76581 r77154 26 26 #include "UIWizardCloneVDPageBasic2.h" 27 27 #include "UIWizardCloneVDPageBasic3.h" 28 #include "UIWizardCloneVDPageBasic4.h"29 28 30 29 /* Forward declarations: */ … … 36 35 public UIWizardCloneVDPage1, 37 36 public UIWizardCloneVDPage2, 38 public UIWizardCloneVDPage3, 39 public UIWizardCloneVDPage4 37 public UIWizardCloneVDPage3 40 38 { 41 39 Q_OBJECT; 42 Q_PROPERTY(CMedium sourceVirtualDisk READ sourceVirtualDisk WRITE setSourceVirtualDisk);43 40 Q_PROPERTY(CMediumFormat mediumFormat READ mediumFormat WRITE setMediumFormat); 44 41 Q_PROPERTY(qulonglong mediumVariant READ mediumVariant WRITE setMediumVariant); … … 51 48 * @param comSourceVirtualDisk Brings the initial source disk to make copy from. 52 49 * @param enmDeviceType Brings the device type to limit format to. */ 53 UIWizardCloneVDPageExpert( const CMedium &comSourceVirtualDisk,KDeviceType enmDeviceType);50 UIWizardCloneVDPageExpert(KDeviceType enmDeviceType); 54 51 55 52 protected: … … 63 60 64 61 private slots: 65 66 /** Handles source disk change. */67 void sltHandleSourceDiskChange();68 /** Handles command to open source disk. */69 void sltHandleOpenSourceDiskClick();70 62 71 63 /** Handles medium format change. */ … … 89 81 virtual bool validatePage() /* override */; 90 82 91 /** Holds the source disk container instance. */ 92 QGroupBox *m_pSourceDiskCnt; 83 /** Sets the target disk name and location. */ 84 void setTargetLocation(); 85 93 86 /** Holds the format container instance. */ 94 87 QGroupBox *m_pFormatCnt; … … 100 93 101 94 #endif /* !FEQT_INCLUDED_SRC_wizards_clonevd_UIWizardCloneVDPageExpert_h */ 102
Note:
See TracChangeset
for help on using the changeset viewer.