Changeset 87249 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 14, 2021 1:35:18 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.cpp
r85150 r87249 217 217 if (!pLabel) 218 218 return; 219 pLayout->addWidget(pLabel, iRow, 0, 1, 1, Qt::AlignRight); 219 pLabel->setAlignment(Qt::AlignRight); 220 pLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 221 222 pLayout->addWidget(pLabel, iRow, 0, 1, 1); 223 220 224 221 225 pLineEdit = new T; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r86979 r87249 18 18 /* Qt includes: */ 19 19 #include <QAbstractButton> 20 #include <QLayout> 20 21 21 22 /* GUI includes: */ … … 563 564 return getStringFieldValue("guestOSFamiyId").contains("windows", Qt::CaseInsensitive); 564 565 } 566 567 void UIWizardNewVM::increaseLayoutLeftMargin(QLayout *pLayout, float mult /* = 2 */) 568 { 569 if (!pLayout) 570 return; 571 QMargins margins = pLayout->contentsMargins(); 572 pLayout->setContentsMargins(mult * margins.left(), 573 margins.top(), 574 margins.right(), 575 margins.bottom()); 576 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r85150 r87249 84 84 bool isUnattendedInstallEnabled() const; 85 85 bool isGuestOSTypeWindows() const; 86 /** Increases the amoun of the left marign of @p pLayout. */ 87 static void increaseLayoutLeftMargin(QLayout *pLayout, float mult = 2); 86 88 87 89 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r87244 r87249 286 286 } 287 287 288 QWidget *UIWizardNewVMPage1::createNameOSTypeWidgets( WizardMode mode, bool fCreateLabels /* = true */)289 { 290 Q_UNUSED( mode);288 QWidget *UIWizardNewVMPage1::createNameOSTypeWidgets(bool fIncreaseLeftIndent, bool fCreateLabels /* = true */) 289 { 290 Q_UNUSED(fIncreaseLeftIndent); 291 291 QWidget *pContainer = new QWidget; 292 292 QGridLayout *pLayout = new QGridLayout(pContainer); 293 if (fIncreaseLeftIndent) 294 UIWizardNewVM::increaseLayoutLeftMargin(pLayout); 295 293 296 int iRow = 0; 294 297 if (fCreateLabels) … … 520 523 { 521 524 QVBoxLayout *pPageLayout = new QVBoxLayout(this); 522 pPageLayout->addWidget(createNameOSTypeWidgets( WizardMode_Basic,false));525 pPageLayout->addWidget(createNameOSTypeWidgets(/* fIncreaseLeftIndent */ false, /* fCreateLabels */false)); 523 526 pPageLayout->addStretch(); 524 527 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r87244 r87249 78 78 void composeMachineFilePath(); 79 79 80 QWidget *createNameOSTypeWidgets( WizardMode mode, bool fCreateLabels = true);80 QWidget *createNameOSTypeWidgets(bool fIncreaseLeftIndent, bool fCreateLabels = true); 81 81 int createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels = true); 82 82 void setTypeByISODetectedOSType(const QString &strDetectedOSType); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp
r85173 r87249 118 118 } 119 119 120 QWidget *UIWizardNewVMPage2::createUserNameHostNameWidgets( )120 QWidget *UIWizardNewVMPage2::createUserNameHostNameWidgets(bool fIncreaseLeftIndent) 121 121 { 122 122 QWidget *pContainer = new QWidget; 123 123 QGridLayout *pGridLayout = new QGridLayout(pContainer); 124 pGridLayout->setContentsMargins(0, 0, 0, 0); 124 125 if (fIncreaseLeftIndent) 126 UIWizardNewVM::increaseLayoutLeftMargin(pGridLayout); 125 127 126 128 m_pUserNamePasswordEditor = new UIUserNamePasswordEditor; 127 pGridLayout->addWidget(m_pUserNamePasswordEditor, 0, 0, 3, 4); 129 pGridLayout->addWidget(m_pUserNamePasswordEditor, 0, 0, 1, 4); 130 128 131 m_pHostnameLabel = new QLabel; 132 m_pHostnameLabel->setAlignment(Qt::AlignRight); 133 m_pHostnameLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 134 129 135 m_pHostnameLineEdit = new QLineEdit; 130 pGridLayout->addWidget(m_pHostnameLabel, 3, 0, 1, 1, Qt::AlignRight); 131 pGridLayout->addWidget(m_pHostnameLineEdit, 3, 1, 1, 3); 136 137 pGridLayout->addWidget(m_pHostnameLabel, 1, 0, 1, 1); 138 pGridLayout->addWidget(m_pHostnameLineEdit, 1, 1, 1, 3); 139 132 140 return pContainer; 133 141 } 134 142 135 QWidget *UIWizardNewVMPage2::createGAInstallWidgets( )143 QWidget *UIWizardNewVMPage2::createGAInstallWidgets(bool fIncreaseLeftIndent) 136 144 { 137 145 QWidget *pContainer = new QWidget; 138 146 QGridLayout *pContainerLayout = new QGridLayout(pContainer); 139 pContainerLayout->setContentsMargins(0, 0, 0, 0); 147 if (fIncreaseLeftIndent) 148 UIWizardNewVM::increaseLayoutLeftMargin(pContainerLayout); 140 149 141 150 m_pInstallGACheckBox = new QCheckBox; … … 160 169 } 161 170 162 QWidget *UIWizardNewVMPage2::createProductKeyWidgets( )171 QWidget *UIWizardNewVMPage2::createProductKeyWidgets(bool fIncreaseLeftIndent) 163 172 { 164 173 QWidget *pContainer = new QWidget; 165 174 QGridLayout *pGridLayout = new QGridLayout(pContainer); 166 pGridLayout->setContentsMargins(0, 0, 0, 0); 175 if (fIncreaseLeftIndent) 176 UIWizardNewVM::increaseLayoutLeftMargin(pGridLayout); 167 177 168 178 m_pProductKeyLabel = new QLabel; 179 m_pProductKeyLabel->setAlignment(Qt::AlignRight); 180 181 m_pProductKeyLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 182 169 183 m_pProductKeyLineEdit = new QLineEdit; 170 184 m_pProductKeyLineEdit->setInputMask(">NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#"); 171 pGridLayout->addWidget(m_pProductKeyLabel, 0, 0, 1, 1 , Qt::AlignRight);185 pGridLayout->addWidget(m_pProductKeyLabel, 0, 0, 1, 1); 172 186 pGridLayout->addWidget(m_pProductKeyLineEdit, 0, 1, 1, 3); 173 187 return pContainer; … … 226 240 } 227 241 228 m_pToolBox->insertItem(ToolBoxItems_UserNameHostname, createUserNameHostNameWidgets(), QString()); 229 m_pToolBox->insertItem(ToolBoxItems_GAInstall, createGAInstallWidgets(), QString()); 230 m_pToolBox->insertItem(ToolBoxItems_ProductKey, createProductKeyWidgets(), QString()); 231 m_pToolBox->setStyleSheet("QToolBox::tab:selected { font: bold; }"); 242 m_pToolBox->insertItem(ToolBoxItems_UserNameHostname, createUserNameHostNameWidgets(/* fIncreaseLeftIndent */ true), QString()); 243 m_pToolBox->insertItem(ToolBoxItems_GAInstall, createGAInstallWidgets(/* fIncreaseLeftIndent */ true), QString()); 244 m_pToolBox->insertItem(ToolBoxItems_ProductKey, createProductKeyWidgets(/* fIncreaseLeftIndent */ true), QString()); 232 245 233 246 registerField("userName", this, "userName"); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h
r85168 r87249 67 67 }; 68 68 69 QWidget *createUserNameHostNameWidgets( );70 QWidget *createGAInstallWidgets( );71 QWidget *createProductKeyWidgets( );69 QWidget *createUserNameHostNameWidgets(bool fIncreaseLeftIndent); 70 QWidget *createGAInstallWidgets(bool fIncreaseLeftIndent); 71 QWidget *createProductKeyWidgets(bool fIncreaseLeftIndent); 72 72 73 73 bool checkGAISOFile() const; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r85637 r87249 164 164 } 165 165 166 QWidget *UIWizardNewVMPage3::createDiskWidgets( )166 QWidget *UIWizardNewVMPage3::createDiskWidgets(bool fIncreaseLeftIndent) 167 167 { 168 168 QWidget *pDiskContainer = new QWidget; 169 169 QGridLayout *pDiskLayout = new QGridLayout(pDiskContainer); 170 pDiskLayout->setContentsMargins(0, 0, 0, 0); 170 if (fIncreaseLeftIndent) 171 UIWizardNewVM::increaseLayoutLeftMargin(pDiskLayout); 172 171 173 172 174 m_pDiskSkip = new QRadioButton; … … 195 197 } 196 198 197 QWidget *UIWizardNewVMPage3::createHardwareWidgets( )199 QWidget *UIWizardNewVMPage3::createHardwareWidgets(bool fIncreaseLeftIndent) 198 200 { 199 201 QWidget *pHardwareContainer = new QWidget; 200 202 QGridLayout *pHardwareLayout = new QGridLayout(pHardwareContainer); 201 pHardwareLayout->setContentsMargins(0, 0, 0, 0); 203 if (fIncreaseLeftIndent) 204 UIWizardNewVM::increaseLayoutLeftMargin(pHardwareLayout); 202 205 m_pBaseMemoryEditor = new UIBaseMemoryEditor(0, true); 203 206 m_pVirtualCPUEditor = new UIVirtualCPUEditor(0, true); … … 230 233 pMainLayout->addWidget(m_pToolBox); 231 234 232 m_pToolBox->insertItem(ToolBoxItems_Disk, createDiskWidgets( ), QString());233 m_pToolBox->insertItem(ToolBoxItems_Hardware, createHardwareWidgets( ), QString());235 m_pToolBox->insertItem(ToolBoxItems_Disk, createDiskWidgets(/* fIncreaseLeftIndent */ true), QString()); 236 m_pToolBox->insertItem(ToolBoxItems_Hardware, createHardwareWidgets(/* fIncreaseLeftIndent */ true), QString()); 234 237 m_pToolBox->setStyleSheet("QToolBox::tab:selected { font: bold; }"); 235 238 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.h
r85168 r87249 77 77 /** @} */ 78 78 79 QWidget *createDiskWidgets( );80 QWidget *createHardwareWidgets( );79 QWidget *createDiskWidgets(bool fIncreaseLeftIndent); 80 QWidget *createHardwareWidgets(bool fIncreaseLeftIndent); 81 81 82 82 /** Helpers. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87244 r87249 50 50 { 51 51 m_pToolBox = new QToolBox; 52 53 m_pToolBox->insertItem(ExpertToolboxItems_NameAndOSType, createNameOSTypeWidgets(WizardMode_Expert,false), "");54 m_pToolBox->insertItem(ExpertToolboxItems_Disk, createDiskWidgets( ), "");55 m_pToolBox->insertItem(ExpertToolboxItems_Hardware, createHardwareWidgets( ), "");56 m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, createUserNameHostNameWidgets( ), "");57 m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, createGAInstallWidgets( ), "");58 m_pToolBox->insertItem(ExpertToolboxItems_ProductKey, createProductKeyWidgets( ), "");52 m_pToolBox->insertItem(ExpertToolboxItems_NameAndOSType, createNameOSTypeWidgets(/* fIncreaseLeftIndent */ true, 53 /* fCreateLabels */ false), ""); 54 m_pToolBox->insertItem(ExpertToolboxItems_Disk, createDiskWidgets(/* fIncreaseLeftIndent */ true), ""); 55 m_pToolBox->insertItem(ExpertToolboxItems_Hardware, createHardwareWidgets(/* fIncreaseLeftIndent */ true), ""); 56 m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, createUserNameHostNameWidgets(/* fIncreaseLeftIndent */ true), ""); 57 m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, createGAInstallWidgets(/* fIncreaseLeftIndent */ true), ""); 58 m_pToolBox->insertItem(ExpertToolboxItems_ProductKey, createProductKeyWidgets(/* fIncreaseLeftIndent */ true), ""); 59 59 pMainLayout->addWidget(m_pToolBox); 60 60 61 pMainLayout->addStretch(); 61 62 updateVirtualDiskSource(); 62 63 } 64 63 65 64 66 createConnections();
Note:
See TracChangeset
for help on using the changeset viewer.