- Timestamp:
- Jul 27, 2021 6:00:18 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145935
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp
r90356 r90362 28 28 #include "QILineEdit.h" 29 29 #include "QIToolButton.h" 30 #include "QIRichTextLabel.h" 30 31 #include "UICommon.h" 31 32 #include "UIConverter.h" … … 43 44 #include "CSystemProperties.h" 44 45 46 47 /********************************************************************************************************************************* 48 * UIDiskEditorGroupBox implementation. * 49 *********************************************************************************************************************************/ 50 51 UIDiskEditorGroupBox::UIDiskEditorGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */) 52 : QIWithRetranslateUI<QGroupBox>(pParent) 53 , m_fExpertMode(fExpertMode) 54 { 55 if (!m_fExpertMode) 56 setFlat(true); 57 } 58 45 59 /********************************************************************************************************************************* 46 60 * UIDiskFormatsGroupBox implementation. * … … 48 62 49 63 UIDiskFormatsGroupBox::UIDiskFormatsGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */) 50 : QIWithRetranslateUI<QGroupBox>(pParent)64 : UIDiskEditorGroupBox(fExpertMode, pParent) 51 65 , m_pFormatButtonGroup(0) 52 , m_fExpertMode(fExpertMode)53 66 { 54 67 prepare(); … … 78 91 { 79 92 QVBoxLayout *pContainerLayout = new QVBoxLayout(this); 80 if (!m_fExpertMode)81 setFlat(true);82 93 83 94 m_pFormatButtonGroup = new QButtonGroup; … … 212 223 213 224 UIDiskVariantGroupBox::UIDiskVariantGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */) 214 : QIWithRetranslateUI<QGroupBox>(pParent)225 : UIDiskEditorGroupBox(fExpertMode, pParent) 215 226 , m_pFixedCheckBox(0) 216 227 , m_pSplitBox(0) 217 , m_fExpertMode(fExpertMode)218 228 { 219 229 prepare(); … … 222 232 void UIDiskVariantGroupBox::prepare() 223 233 { 224 if (!m_fExpertMode)225 setFlat(true);226 234 QVBoxLayout *pVariantLayout = new QVBoxLayout(this); 227 235 AssertReturnVoid(pVariantLayout); … … 353 361 *********************************************************************************************************************************/ 354 362 355 UIMediumSizeAndPathGroupBox::UIMediumSizeAndPathGroupBox(QWidget *pParent /* = 0 */) 356 : QIWithRetranslateUI<QGroupBox>(pParent) 357 , m_pLocationLabel(0) 363 UIMediumSizeAndPathGroupBox::UIMediumSizeAndPathGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */) 364 : UIDiskEditorGroupBox(fExpertMode, pParent) 358 365 , m_pLocationEditor(0) 359 366 , m_pLocationOpenButton(0) 360 , m_pMediumSizeEditorLabel(0)361 367 , m_pMediumSizeEditor(0) 368 , m_pLocationLabel(0) 369 , m_pSizeLabel(0) 362 370 { 363 371 prepare(); … … 366 374 void UIMediumSizeAndPathGroupBox::prepare() 367 375 { 368 Q GridLayout *pDiskContainerLayout = new QGridLayout(this);369 370 /* Disk location widgets: */371 m_pLocationLabel = new QLabel;372 m_pLocationLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);376 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 377 /* Location widgets: */ 378 if (!m_fExpertMode) 379 m_pLocationLabel = new QIRichTextLabel; 380 QHBoxLayout *pLocationLayout = new QHBoxLayout; 373 381 m_pLocationEditor = new QILineEdit; 374 382 m_pLocationOpenButton = new QIToolButton; … … 378 386 m_pLocationOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_disabled_16px.png")); 379 387 } 380 m_pLocationLabel->setBuddy(m_pLocationEditor);381 382 /* Disk file size widgets: */ 383 m_pMediumSizeEditorLabel = new QLabel;384 m_pMediumSizeEditorLabel->setAlignment(Qt::AlignRight);385 m_pMediumSizeEditorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);388 pLocationLayout->addWidget(m_pLocationEditor); 389 pLocationLayout->addWidget(m_pLocationOpenButton); 390 391 /* Size widgets: */ 392 if (!m_fExpertMode) 393 m_pSizeLabel = new QIRichTextLabel; 386 394 m_pMediumSizeEditor = new UIMediumSizeEditor; 387 m_pMediumSizeEditorLabel->setBuddy(m_pMediumSizeEditor); 388 389 pDiskContainerLayout->addWidget(m_pLocationLabel, 0, 0, 1, 1); 390 pDiskContainerLayout->addWidget(m_pLocationEditor, 0, 1, 1, 2); 391 pDiskContainerLayout->addWidget(m_pLocationOpenButton, 0, 3, 1, 1); 392 393 pDiskContainerLayout->addWidget(m_pMediumSizeEditorLabel, 1, 0, 1, 1, Qt::AlignBottom); 394 pDiskContainerLayout->addWidget(m_pMediumSizeEditor, 1, 1, 2, 3); 395 396 /* Add widgets to main layout: */ 397 if (m_pLocationLabel) 398 pMainLayout->addWidget(m_pLocationLabel); 399 pMainLayout->addLayout(pLocationLayout); 400 401 if (m_pSizeLabel) 402 pMainLayout->addWidget(m_pSizeLabel); 403 pMainLayout->addWidget(m_pMediumSizeEditor); 395 404 396 405 connect(m_pMediumSizeEditor, &UIMediumSizeEditor::sigSizeChanged, … … 407 416 void UIMediumSizeAndPathGroupBox::retranslateUi() 408 417 { 409 setTitle(tr("Hard Disk File Location and Size")); 418 if (m_fExpertMode) 419 setTitle(tr("Hard Disk File Location and Size")); 410 420 if (m_pLocationOpenButton) 411 421 m_pLocationOpenButton->setToolTip(tr("Choose a location for new virtual hard disk file...")); 422 423 if (!m_fExpertMode && m_pLocationLabel) 424 m_pLocationLabel->setText(tr("Please type the name of the new virtual hard disk file into the box below or " 425 "click on the folder icon to select a different folder to create the file in.")); 426 if (!m_fExpertMode && m_pSizeLabel) 427 m_pSizeLabel->setText(tr("Select the size of the virtual hard disk in megabytes. " 428 "This size is the limit on the amount of file data " 429 "that a virtual machine will be able to store on the hard disk.")); 412 430 } 413 431 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h
r90356 r90362 37 37 class QLabel; 38 38 class QVBoxLayout; 39 class QIRichTextLabel; 39 40 class QILineEdit; 40 41 class QIToolButton; … … 49 50 #include "CMediumFormat.h" 50 51 51 class SHARED_LIBRARY_STUFF UIDiskFormatsGroupBox : public QIWithRetranslateUI<QGroupBox> 52 class SHARED_LIBRARY_STUFF UIDiskEditorGroupBox : public QIWithRetranslateUI<QGroupBox> 53 { 54 Q_OBJECT; 55 56 public: 57 58 UIDiskEditorGroupBox(bool fExpertMode, QWidget *pParent = 0); 59 60 protected: 61 62 bool m_fExpertMode; 63 }; 64 65 class SHARED_LIBRARY_STUFF UIDiskFormatsGroupBox : public UIDiskEditorGroupBox 52 66 { 53 67 Q_OBJECT; … … 78 92 QStringList m_formatExtensions; 79 93 QButtonGroup *m_pFormatButtonGroup; 80 bool m_fExpertMode;81 94 }; 82 95 83 class SHARED_LIBRARY_STUFF UIDiskVariantGroupBox : public QIWithRetranslateUI<QGroupBox>96 class SHARED_LIBRARY_STUFF UIDiskVariantGroupBox : public UIDiskEditorGroupBox 84 97 { 85 98 Q_OBJECT; … … 109 122 QCheckBox *m_pFixedCheckBox; 110 123 QCheckBox *m_pSplitBox; 111 bool m_fExpertMode;112 124 }; 113 125 114 126 115 class SHARED_LIBRARY_STUFF UIMediumSizeAndPathGroupBox : public QIWithRetranslateUI<QGroupBox>127 class SHARED_LIBRARY_STUFF UIMediumSizeAndPathGroupBox : public UIDiskEditorGroupBox 116 128 { 117 129 Q_OBJECT; … … 125 137 public: 126 138 127 UIMediumSizeAndPathGroupBox(QWidget *pParent = 0); 128 139 UIMediumSizeAndPathGroupBox(bool fExpertMode, QWidget *pParent = 0); 129 140 QString mediumPath() const; 130 141 void setMediumPath(const QString &strMediumPath); … … 132 143 qulonglong mediumSize() const; 133 144 void setMediumSize(qulonglong uSize); 134 135 145 136 146 private: … … 141 151 const QStringList &formatExtensions); 142 152 143 144 QLabel *m_pLocationLabel;145 153 QILineEdit *m_pLocationEditor; 146 154 QIToolButton *m_pLocationOpenButton; 147 QLabel *m_pMediumSizeEditorLabel;148 155 UIMediumSizeEditor *m_pMediumSizeEditor; 156 QIRichTextLabel *m_pLocationLabel; 157 QIRichTextLabel *m_pSizeLabel; 149 158 }; 150 159 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r90356 r90362 63 63 addPage(new UIWizardNewVDPageFileType); 64 64 addPage(new UIWizardNewVDPageVariant); 65 addPage(new UIWizardNewVDPageSizeLocation(m_strDefaultName, m_strDefaultPath, m_uDefaultSize)); 65 66 break; 66 67 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageSizeLocation.cpp
r90356 r90362 300 300 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 301 301 AssertReturnVoid(pMainLayout); 302 m_pMediumSizePathGroup = new UIMediumSizeAndPathGroupBox(false, 0); 302 303 // { 303 304 // m_pLocationLabel = new QIRichTextLabel(this); … … 319 320 // pMainLayout->addLayout(pLocationLayout); 320 321 // pMainLayout->addWidget(m_pSizeLabel); 321 // pMainLayout->addWidget(m_pMediumSizeEditor);322 //pMainLayout->addStretch();322 pMainLayout->addWidget(m_pMediumSizePathGroup); 323 pMainLayout->addStretch(); 323 324 // } 324 325 retranslateUi(); … … 334 335 { 335 336 setTitle(UIWizardNewVD::tr("File location and size")); 336 // if (m_pLocationLabel)337 // m_pLocationLabel->setText(UIWizardNewVD::tr("Please type the name of the new virtual hard disk file into the box below or "338 // "click on the folder icon to select a different folder to create the file in."));339 // if (m_pSizeLabel)340 // m_pSizeLabel->setText(UIWizardNewVD::tr("Select the size of the virtual hard disk in megabytes. "341 // "This size is the limit on the amount of file data "342 // "that a virtual machine will be able to store on the hard disk."));343 337 } 344 338 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageVariant.cpp
r90356 r90362 233 233 { 234 234 //return mediumVariant() != (qulonglong)KMediumVariant_Max; 235 return false;236 } 235 return true; 236 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r90356 r90362 464 464 QGridLayout *pDiskContainerLayout = new QGridLayout(pNewDiskContainerWidget); 465 465 466 m_pSizeAndLocationGroup = new UIMediumSizeAndPathGroupBox ;466 m_pSizeAndLocationGroup = new UIMediumSizeAndPathGroupBox(true, 0); 467 467 pDiskContainerLayout->addWidget(m_pSizeAndLocationGroup, 0, 0, 2, 2); 468 468 m_pFormatButtonGroup = new UIDiskFormatsGroupBox(true, 0);
Note:
See TracChangeset
for help on using the changeset viewer.