Changeset 84277 in vbox
- Timestamp:
- May 12, 2020 5:51:16 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm
- Files:
-
- 3 edited
-
UIWizardNewCloudVMPageBasic1.cpp (modified) (15 diffs)
-
UIWizardNewCloudVMPageBasic1.h (modified) (2 diffs)
-
UIWizardNewCloudVMPageExpert.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.cpp
r84276 r84277 53 53 , m_pAccountToolButton(0) 54 54 , m_pAccountPropertyTable(0) 55 , m_p AccountImageLabel(0)56 , m_p AccountImageList(0)55 , m_pSourceImageLabel(0) 56 , m_pSourceImageList(0) 57 57 { 58 58 } … … 269 269 } 270 270 271 void UIWizardNewCloudVMPage1::populate AccountImages()271 void UIWizardNewCloudVMPage1::populateSourceImages() 272 272 { 273 273 /* Block signals while updating: */ 274 m_p AccountImageList->blockSignals(true);274 m_pSourceImageList->blockSignals(true); 275 275 276 276 /* Clear list initially: */ 277 m_p AccountImageList->clear();277 m_pSourceImageList->clear(); 278 278 /* Clear Cloud Client: */ 279 279 setClient(CCloudClient()); … … 326 326 { 327 327 /* Create list item: */ 328 QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_p AccountImageList);328 QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pSourceImageList); 329 329 if (pItem) 330 330 { … … 335 335 336 336 /* Choose the 1st one by default if possible: */ 337 if (m_p AccountImageList->count())338 m_p AccountImageList->setCurrentRow(0);337 if (m_pSourceImageList->count()) 338 m_pSourceImageList->setCurrentRow(0); 339 339 } 340 340 while (0); … … 342 342 343 343 /* Unblock signals after update: */ 344 m_p AccountImageList->blockSignals(false);344 m_pSourceImageList->blockSignals(false); 345 345 } 346 346 … … 475 475 QString UIWizardNewCloudVMPage1::imageId() const 476 476 { 477 QListWidgetItem *pItem = m_p AccountImageList->currentItem();477 QListWidgetItem *pItem = m_pSourceImageList->currentItem(); 478 478 return pItem ? pItem->data(Qt::UserRole).toString() : QString(); 479 479 } … … 584 584 } 585 585 /* Create sub-layout: */ 586 QHBoxLayout *p SubLayout = new QHBoxLayout;587 if (p SubLayout)588 { 589 p SubLayout->setContentsMargins(0, 0, 0, 0);590 p SubLayout->setSpacing(1);586 QHBoxLayout *pAccountLayout = new QHBoxLayout; 587 if (pAccountLayout) 588 { 589 pAccountLayout->setContentsMargins(0, 0, 0, 0); 590 pAccountLayout->setSpacing(1); 591 591 592 592 /* Create account combo-box: */ … … 597 597 598 598 /* Add into layout: */ 599 p SubLayout->addWidget(m_pAccountComboBox);599 pAccountLayout->addWidget(m_pAccountComboBox); 600 600 } 601 601 /* Create account tool-button: */ … … 607 607 608 608 /* Add into layout: */ 609 p SubLayout->addWidget(m_pAccountToolButton);609 pAccountLayout->addWidget(m_pAccountToolButton); 610 610 } 611 611 612 612 /* Add into layout: */ 613 m_pCloudContainerLayout->addLayout(p SubLayout, 0, 1);613 m_pCloudContainerLayout->addLayout(pAccountLayout, 0, 1); 614 614 } 615 615 … … 634 634 } 635 635 636 /* Create account instance label: */637 m_p AccountImageLabel = new QLabel(this);638 if (m_p AccountImageLabel)636 /* Create source image label: */ 637 m_pSourceImageLabel = new QLabel(this); 638 if (m_pSourceImageLabel) 639 639 { 640 640 /* Add into layout: */ 641 m_pCloudContainerLayout->addWidget(m_p AccountImageLabel, 2, 0, Qt::AlignRight);642 } 643 /* Create profile instances table: */644 m_p AccountImageList = new QListWidget(this);645 if (m_p AccountImageList)646 { 647 m_p AccountImageLabel->setBuddy(m_pAccountImageLabel);648 const QFontMetrics fm(m_p AccountImageList->font());641 m_pCloudContainerLayout->addWidget(m_pSourceImageLabel, 2, 0, Qt::AlignRight); 642 } 643 /* Create source image list: */ 644 m_pSourceImageList = new QListWidget(this); 645 if (m_pSourceImageList) 646 { 647 m_pSourceImageLabel->setBuddy(m_pSourceImageList); 648 const QFontMetrics fm(m_pSourceImageList->font()); 649 649 const int iFontWidth = fm.width('x'); 650 650 const int iTotalWidth = 50 * iFontWidth; 651 651 const int iFontHeight = fm.height(); 652 652 const int iTotalHeight = 4 * iFontHeight; 653 m_p AccountImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));654 //m_p AccountImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);655 m_p AccountImageList->setAlternatingRowColors(true);653 m_pSourceImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight)); 654 //m_pSourceImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 655 m_pSourceImageList->setAlternatingRowColors(true); 656 656 657 657 /* Add into layout: */ 658 m_pCloudContainerLayout->addWidget(m_p AccountImageList, 2, 1, 2, 1);658 m_pCloudContainerLayout->addWidget(m_pSourceImageList, 2, 1, 2, 1); 659 659 } 660 660 … … 674 674 connect(m_pAccountToolButton, &QIToolButton::clicked, 675 675 this, &UIWizardNewCloudVMPageBasic1::sltHandleAccountButtonClick); 676 connect(m_p AccountImageList, &QListWidget::currentRowChanged,676 connect(m_pSourceImageList, &QListWidget::currentRowChanged, 677 677 this, &UIWizardNewCloudVMPageBasic1::completeChanged); 678 678 … … 729 729 /* Translate cloud stuff: */ 730 730 m_pAccountLabel->setText(UIWizardNewCloudVM::tr("&Account:")); 731 m_p AccountImageLabel->setText(UIWizardNewCloudVM::tr("&Images:"));731 m_pSourceImageLabel->setText(UIWizardNewCloudVM::tr("&Source:")); 732 732 733 733 /* Adjust label widths: */ … … 735 735 labels << m_pLocationLabel; 736 736 labels << m_pAccountLabel; 737 labels << m_p AccountImageLabel;737 labels << m_pSourceImageLabel; 738 738 int iMaxWidth = 0; 739 739 foreach (QWidget *pLabel, labels) … … 797 797 798 798 /* Make image list focused by default: */ 799 m_p AccountImageList->setFocus();799 m_pSourceImageList->setFocus(); 800 800 801 801 /* Refresh required settings: */ 802 802 populateAccounts(); 803 803 populateAccountProperties(); 804 populate AccountImages();804 populateSourceImages(); 805 805 emit completeChanged(); 806 806 } … … 810 810 /* Refresh required settings: */ 811 811 populateAccountProperties(); 812 populate AccountImages();812 populateSourceImages(); 813 813 emit completeChanged(); 814 814 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.h
r84275 r84277 71 71 /** Populates account properties. */ 72 72 void populateAccountProperties(); 73 /** Populates accountimages. */74 void populate AccountImages();73 /** Populates source images. */ 74 void populateSourceImages(); 75 75 /** Populates form properties. */ 76 76 void populateFormProperties(); … … 137 137 /** Holds the account property table instance. */ 138 138 QTableWidget *m_pAccountPropertyTable; 139 /** Holds the accountimage label instance. */140 QLabel *m_p AccountImageLabel;141 /** Holds the accountimage list instance. */142 QListWidget *m_p AccountImageList;139 /** Holds the source image label instance. */ 140 QLabel *m_pSourceImageLabel; 141 /** Holds the source image list instance. */ 142 QListWidget *m_pSourceImageList; 143 143 }; 144 144 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp
r84275 r84277 118 118 } 119 119 120 /* Create profile instances table: */121 m_p AccountImageList = new QListWidget(m_pCntLocation);122 if (m_p AccountImageList)120 /* Create source image list: */ 121 m_pSourceImageList = new QListWidget(m_pCntLocation); 122 if (m_pSourceImageList) 123 123 { 124 const QFontMetrics fm(m_p AccountImageList->font());124 const QFontMetrics fm(m_pSourceImageList->font()); 125 125 const int iFontWidth = fm.width('x'); 126 126 const int iTotalWidth = 50 * iFontWidth; 127 127 const int iFontHeight = fm.height(); 128 128 const int iTotalHeight = 4 * iFontHeight; 129 m_p AccountImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));130 //m_p AccountImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);131 m_p AccountImageList->setAlternatingRowColors(true);129 m_pSourceImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight)); 130 //m_pSourceImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 131 m_pSourceImageList->setAlternatingRowColors(true); 132 132 133 133 /* Add into layout: */ 134 m_pCloudContainerLayout->addWidget(m_p AccountImageList, 2, 0);134 m_pCloudContainerLayout->addWidget(m_pSourceImageList, 2, 0); 135 135 } 136 136 … … 183 183 connect(m_pAccountToolButton, &QIToolButton::clicked, 184 184 this, &UIWizardNewCloudVMPageExpert::sltHandleAccountButtonClick); 185 connect(m_p AccountImageList, &QListWidget::currentRowChanged,185 connect(m_pSourceImageList, &QListWidget::currentRowChanged, 186 186 this, &UIWizardNewCloudVMPageExpert::sltHandleInstanceListChange); 187 187 … … 316 316 317 317 /* Make image list focused by default: */ 318 m_p AccountImageList->setFocus();318 m_pSourceImageList->setFocus(); 319 319 320 320 /* Refresh required settings: */ 321 321 populateAccounts(); 322 322 populateAccountProperties(); 323 populate AccountImages();323 populateSourceImages(); 324 324 populateFormProperties(); 325 325 refreshFormPropertiesTable(); … … 331 331 /* Refresh required settings: */ 332 332 populateAccountProperties(); 333 populate AccountImages();333 populateSourceImages(); 334 334 populateFormProperties(); 335 335 refreshFormPropertiesTable();
Note:
See TracChangeset
for help on using the changeset viewer.

