Changeset 87859 in vbox
- Timestamp:
- Feb 24, 2021 1:01:12 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r82968 r87859 18 18 /* Qt includes: */ 19 19 #include <QVariant> 20 20 #include <QPushButton> 21 21 /* GUI includes: */ 22 22 #include "UICommon.h" … … 49 49 assignBackground(":/wizard_new_harddisk_bg.png"); 50 50 #endif /* VBOX_WS_MAC */ 51 QPushButton *pButton = new QPushButton("boooo"); 52 setSideWidget(pButton); 53 51 54 } 52 55 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic1.cpp
r87850 r87859 145 145 } 146 146 147 void UIWizardNewVDPage1::retranslateWidgets() 148 { 149 QList<QAbstractButton*> buttons = m_pFormatButtonGroup->buttons(); 150 for (int i = 0; i < buttons.size(); ++i) 151 { 152 QAbstractButton *pButton = buttons[i]; 153 UIMediumFormat enmFormat = gpConverter->fromInternalString<UIMediumFormat>(m_formatNames[m_pFormatButtonGroup->id(pButton)]); 154 pButton->setText(gpConverter->toString(enmFormat)); 155 } 156 } 157 147 158 UIWizardNewVDPageBasic1::UIWizardNewVDPageBasic1() 148 159 { … … 169 180 void UIWizardNewVDPageBasic1::retranslateUi() 170 181 { 182 retranslateWidgets(); 171 183 /* Translate page: */ 172 setTitle(UIWizardNewVD::tr(" Hard disk file type"));184 setTitle(UIWizardNewVD::tr("Virtual Hard disk file type")); 173 185 174 186 /* Translate widgets: */ … … 176 188 "for the new virtual hard disk. If you do not need to use it " 177 189 "with other virtualization software you can leave this setting unchanged.")); 178 QList<QAbstractButton*> buttons = m_pFormatButtonGroup->buttons();179 for (int i = 0; i < buttons.size(); ++i)180 {181 QAbstractButton *pButton = buttons[i];182 UIMediumFormat enmFormat = gpConverter->fromInternalString<UIMediumFormat>(m_formatNames[m_pFormatButtonGroup->id(pButton)]);183 pButton->setText(gpConverter->toString(enmFormat));184 }185 190 } 186 191 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic1.h
r87850 r87859 52 52 CMediumFormat mediumFormat() const; 53 53 void setMediumFormat(const CMediumFormat &mediumFormat); 54 void retranslateWidgets(); 54 55 55 56 /* Variables: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic2.cpp
r82968 r87859 72 72 } 73 73 74 void UIWizardNewVDPage2::retranslateWidgets() 75 { 76 m_pDynamicalButton->setText(UIWizardNewVD::tr("&Dynamically allocated")); 77 m_pFixedButton->setText(UIWizardNewVD::tr("&Fixed size")); 78 m_pSplitBox->setText(UIWizardNewVD::tr("&Split into files of less than 2GB")); 79 } 80 74 81 UIWizardNewVDPageBasic2::UIWizardNewVDPageBasic2() 75 82 { … … 119 126 void UIWizardNewVDPageBasic2::retranslateUi() 120 127 { 128 retranslateWidgets(); 121 129 /* Translate page: */ 122 130 setTitle(UIWizardNewVD::tr("Storage on physical hard disk")); … … 134 142 "virtual machine on removable USB devices or old systems, some of which cannot " 135 143 "handle very large files.")); 136 m_pDynamicalButton->setText(UIWizardNewVD::tr("&Dynamically allocated"));137 m_pFixedButton->setText(UIWizardNewVD::tr("&Fixed size"));138 m_pSplitBox->setText(UIWizardNewVD::tr("&Split into files of less than 2GB"));139 144 } 140 145 … … 168 173 return mediumVariant() != (qulonglong)KMediumVariant_Max; 169 174 } 170 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic2.h
r82968 r87859 43 43 qulonglong mediumVariant() const; 44 44 void setMediumVariant(qulonglong uMediumVariant); 45 void retranslateWidgets(); 45 46 46 47 /* Widgets: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.cpp
r87850 r87859 52 52 , m_uMediumSizeMin(_4M) 53 53 , m_uMediumSizeMax(uiCommon().virtualBox().GetSystemProperties().GetInfoVDSize()) 54 , m_pLocationEditor(0) 55 , m_pLocationOpenButton(0) 56 , m_pEditorSize(0) 57 54 58 { 55 59 } … … 102 106 if (QFileInfo(strChosenFilePath).suffix().isEmpty()) 103 107 strChosenFilePath += QString(".%1").arg(m_strDefaultExtension); 104 m_pLocationEditor->setText(QDir::toNativeSeparators(strChosenFilePath)); 105 m_pLocationEditor->selectAll(); 106 m_pLocationEditor->setFocus(); 108 if (m_pLocationEditor) 109 { 110 m_pLocationEditor->setText(QDir::toNativeSeparators(strChosenFilePath)); 111 m_pLocationEditor->selectAll(); 112 m_pLocationEditor->setFocus(); 113 } 107 114 } 108 115 } … … 200 207 QString UIWizardNewVDPage3::mediumPath() const 201 208 { 209 if (!m_pLocationEditor) 210 return QString(); 202 211 return absoluteFilePath(toFileName(m_pLocationEditor->text(), m_strDefaultExtension), m_strDefaultPath); 203 212 } … … 205 214 qulonglong UIWizardNewVDPage3::mediumSize() const 206 215 { 207 return m_pEditorSize ->mediumSize();216 return m_pEditorSize ? m_pEditorSize->mediumSize() : 0; 208 217 } 209 218 210 219 void UIWizardNewVDPage3::setMediumSize(qulonglong uMediumSize) 211 220 { 212 m_pEditorSize->setMediumSize(uMediumSize); 221 if (m_pEditorSize) 222 m_pEditorSize->setMediumSize(uMediumSize); 223 } 224 225 void UIWizardNewVDPage3::retranslateWidgets() 226 { 227 if (m_pLocationOpenButton) 228 m_pLocationOpenButton->setToolTip(UIWizardNewVD::tr("Choose a location for new virtual hard disk file...")); 213 229 } 214 230 … … 259 275 void UIWizardNewVDPageBasic3::retranslateUi() 260 276 { 277 retranslateWidgets(); 261 278 /* Translate page: */ 262 279 setTitle(UIWizardNewVD::tr("File location and size")); … … 265 282 m_pLocationLabel->setText(UIWizardNewVD::tr("Please type the name of the new virtual hard disk file into the box below or " 266 283 "click on the folder icon to select a different folder to create the file in.")); 267 m_pLocationOpenButton->setToolTip(UIWizardNewVD::tr("Choose a location for new virtual hard disk file..."));268 m_pSizeLabel->setText(UIWizardNewVD::tr("Select the size of the virtual hard disk in megabytes. "269 "This size is the limit on the amount of file data "270 "that a virtual machine will be able to store on the hard disk."));284 if (m_pSizeLabel) 285 m_pSizeLabel->setText(UIWizardNewVD::tr("Select the size of the virtual hard disk in megabytes. " 286 "This size is the limit on the amount of file data " 287 "that a virtual machine will be able to store on the hard disk.")); 271 288 } 272 289 … … 279 296 m_strDefaultExtension = defaultExtension(field("mediumFormat").value<CMediumFormat>()); 280 297 /* Set default name as text for location editor: */ 281 m_pLocationEditor->setText(absoluteFilePath(m_strDefaultName, m_strDefaultPath, m_strDefaultExtension)); 298 if (m_pLocationEditor) 299 m_pLocationEditor->setText(absoluteFilePath(m_strDefaultName, m_strDefaultPath, m_strDefaultExtension)); 282 300 } 283 301 284 302 bool UIWizardNewVDPageBasic3::isComplete() const 285 303 { 304 if (!m_pLocationEditor) 305 return false; 286 306 /* Make sure current name is not empty and current size feats the bounds: */ 287 307 return !m_pLocationEditor->text().trimmed().isEmpty() && -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.h
r87775 r87859 65 65 qulonglong mediumSize() const; 66 66 void setMediumSize(qulonglong uMediumSize); 67 void retranslateWidgets(); 67 68 68 69 /* Variables: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r87850 r87859 197 197 void UIWizardNewVDPageExpert::retranslateUi() 198 198 { 199 UIWizardNewVDPage1::retranslateWidgets(); 200 UIWizardNewVDPage2::retranslateWidgets(); 201 UIWizardNewVDPage3::retranslateWidgets(); 199 202 /* Translate widgets: */ 200 203 if (m_pLocationGroupBox) 201 204 m_pLocationGroupBox->setTitle(UIWizardNewVD::tr("File &location")); 202 if (m_pLocationOpenButton)203 m_pLocationOpenButton->setToolTip(UIWizardNewVD::tr("Choose a location for new virtual hard disk file..."));204 205 if (m_pSizeGroupBox) 205 206 m_pSizeGroupBox->setTitle(UIWizardNewVD::tr("File &size"));
Note:
See TracChangeset
for help on using the changeset viewer.