Changeset 104475 in vbox
- Timestamp:
- May 2, 2024 11:08:41 AM (7 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp
r103957 r104475 74 74 , m_pSettingsWidget1(0) 75 75 , m_pLocalContainerLayout(0) 76 , m_pFileLabel(0) 76 77 , m_pFileSelector(0) 77 78 , m_pCloudContainerLayout(0) 79 , m_pProfileLabel(0) 78 80 , m_pProfileComboBox(0) 79 81 , m_pProfileToolButton(0) 82 , m_pProfileInstanceLabel(0) 80 83 , m_pProfileInstanceList(0) 81 84 , m_pSettingsWidget2(0) … … 97 100 if (m_pToolBox) 98 101 { 99 /* Prepare source w idget: */100 QWidget *pWidgetSource = new QWidget(m_pToolBox);101 if (pWidgetSource )102 /* Prepare source wrapper widget: */ 103 QWidget *pWidgetSourceWrapper = new QWidget(m_pToolBox); 104 if (pWidgetSourceWrapper) 102 105 { 103 /* Prepare source layout: */104 m_pSourceLayout = new QGridLayout(pWidgetSource);105 if ( m_pSourceLayout)106 /* Prepare source wrapper layout: */ 107 QVBoxLayout *pLayoutSourceWrapper = new QVBoxLayout(pWidgetSourceWrapper); 108 if (pLayoutSourceWrapper) 106 109 { 107 m_pSourceLayout->setContentsMargins(0, 0, 0, 0); 108 109 /* Prepare source combo: */ 110 m_pSourceComboBox = new QIComboBox(pWidgetSource); 111 if (m_pSourceComboBox) 112 m_pSourceLayout->addWidget(m_pSourceComboBox, 0, 0); 110 pLayoutSourceWrapper->setContentsMargins(0, 0, 0, 0); 111 112 /* Prepare source layout: */ 113 m_pSourceLayout = new QGridLayout; 114 if (m_pSourceLayout) 115 { 116 m_pSourceLayout->setContentsMargins(0, 0, 0, 0); 117 m_pSourceLayout->setColumnStretch(0, 0); 118 m_pSourceLayout->setColumnStretch(1, 1); 119 120 /* Prepare source label: */ 121 m_pSourceLabel = new QLabel(pWidgetSourceWrapper); 122 if (m_pSourceLabel) 123 m_pSourceLayout->addWidget(m_pSourceLabel, 0, 0, Qt::AlignRight); 124 /* Prepare source combo: */ 125 m_pSourceComboBox = new QIComboBox(pWidgetSourceWrapper); 126 if (m_pSourceComboBox) 127 { 128 m_pSourceLabel->setBuddy(m_pSourceComboBox); 129 m_pSourceLayout->addWidget(m_pSourceComboBox, 0, 1); 130 } 131 132 /* Add into layout: */ 133 pLayoutSourceWrapper->addLayout(m_pSourceLayout); 134 } 113 135 114 136 /* Prepare settings widget 1: */ 115 m_pSettingsWidget1 = new QStackedWidget(pWidgetSource );137 m_pSettingsWidget1 = new QStackedWidget(pWidgetSourceWrapper); 116 138 if (m_pSettingsWidget1) 117 139 { … … 120 142 if (pContainerLocal) 121 143 { 122 /* Prepare local widgetlayout: */144 /* Prepare local container layout: */ 123 145 m_pLocalContainerLayout = new QGridLayout(pContainerLocal); 124 146 if (m_pLocalContainerLayout) 125 147 { 126 148 m_pLocalContainerLayout->setContentsMargins(0, 0, 0, 0); 149 m_pLocalContainerLayout->setColumnStretch(0, 0); 150 m_pLocalContainerLayout->setColumnStretch(1, 1); 127 151 m_pLocalContainerLayout->setRowStretch(1, 1); 128 152 153 /* Prepare file label: */ 154 m_pFileLabel = new QLabel(pContainerLocal); 155 if (m_pFileLabel) 156 m_pLocalContainerLayout->addWidget(m_pFileLabel, 0, 0, Qt::AlignRight); 129 157 /* Prepare file-path selector: */ 130 158 m_pFileSelector = new UIEmptyFilePathSelector(pContainerLocal); 131 159 if (m_pFileSelector) 132 160 { 161 m_pFileLabel->setBuddy(m_pFileSelector); 133 162 m_pFileSelector->setHomeDir(uiCommon().documentsPath()); 134 163 m_pFileSelector->setMode(UIEmptyFilePathSelector::Mode_File_Open); 135 164 m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition); 136 165 m_pFileSelector->setEditable(true); 137 m_pLocalContainerLayout->addWidget(m_pFileSelector, 0, 0);166 m_pLocalContainerLayout->addWidget(m_pFileSelector, 0, 1); 138 167 } 139 168 } … … 152 181 { 153 182 m_pCloudContainerLayout->setContentsMargins(0, 0, 0, 0); 154 m_pCloudContainerLayout->setRowStretch(1, 1); 155 183 m_pCloudContainerLayout->setColumnStretch(0, 0); 184 m_pCloudContainerLayout->setColumnStretch(1, 1); 185 m_pCloudContainerLayout->setRowStretch(1, 0); 186 m_pCloudContainerLayout->setRowStretch(2, 1); 187 188 /* Prepare profile label: */ 189 m_pProfileLabel = new QLabel(pContainerCloud); 190 if (m_pProfileLabel) 191 m_pCloudContainerLayout->addWidget(m_pProfileLabel, 0, 0, Qt::AlignRight); 156 192 /* Prepare profile layout: */ 157 193 QHBoxLayout *pLayoutProfile = new QHBoxLayout; … … 164 200 m_pProfileComboBox = new QIComboBox(pContainerCloud); 165 201 if (m_pProfileComboBox) 202 { 203 m_pProfileLabel->setBuddy(m_pProfileComboBox); 166 204 pLayoutProfile->addWidget(m_pProfileComboBox); 167 205 } 168 206 /* Prepare profile tool-button: */ 169 207 m_pProfileToolButton = new QIToolButton(pContainerCloud); … … 176 214 177 215 /* Add into layout: */ 178 m_pCloudContainerLayout->addLayout(pLayoutProfile, 0, 0);216 m_pCloudContainerLayout->addLayout(pLayoutProfile, 0, 1); 179 217 } 180 218 219 /* Prepare profile instance label: */ 220 m_pProfileInstanceLabel = new QLabel(pContainerCloud); 221 if (m_pProfileInstanceLabel) 222 m_pCloudContainerLayout->addWidget(m_pProfileInstanceLabel, 1, 0, Qt::AlignRight); 181 223 /* Create profile instances table: */ 182 224 m_pProfileInstanceList = new QListWidget(pContainerCloud); 183 225 if (m_pProfileInstanceList) 184 226 { 227 m_pProfileInstanceLabel->setBuddy(m_pProfileInstanceLabel); 185 228 const QFontMetrics fm(m_pProfileInstanceList->font()); 186 229 #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) … … 195 238 // m_pProfileInstanceList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 196 239 m_pProfileInstanceList->setAlternatingRowColors(true); 197 m_pCloudContainerLayout->addWidget(m_pProfileInstanceList, 1, 0);240 m_pCloudContainerLayout->addWidget(m_pProfileInstanceList, 1, 1, 2, 1); 198 241 } 199 242 } … … 204 247 205 248 /* Add into layout: */ 206 m_pSourceLayout->addWidget(m_pSettingsWidget1, 1, 0);249 pLayoutSourceWrapper->addWidget(m_pSettingsWidget1); 207 250 } 208 251 } 209 252 210 253 /* Add into tool-box: */ 211 m_pToolBox->insertPage(0, pWidgetSource , QString());254 m_pToolBox->insertPage(0, pWidgetSourceWrapper, QString()); 212 255 } 213 256 … … 369 412 } 370 413 371 /* Translate hardcoded values of Source combo-box: */ 414 /* Translate source label: */ 415 if (m_pSourceLabel) 416 m_pSourceLabel->setText(UIWizardImportApp::tr("&Source:")); 372 417 if (m_pSourceComboBox) 373 418 { 419 /* Translate hardcoded values of Source combo-box: */ 374 420 m_pSourceComboBox->setItemText(0, UIWizardImportApp::tr("Local File System")); 375 421 m_pSourceComboBox->setItemData(0, UIWizardImportApp::tr("Import from local file system."), Qt::ToolTipRole); … … 386 432 387 433 /* Translate file selector: */ 434 if (m_pFileLabel) 435 m_pFileLabel->setText(UIWizardImportApp::tr("&File:")); 388 436 if (m_pFileSelector) 389 437 { … … 394 442 395 443 /* Translate profile stuff: */ 444 if (m_pProfileLabel) 445 m_pProfileLabel->setText(UIWizardImportApp::tr("&Profile:")); 396 446 if (m_pProfileToolButton) 397 447 m_pProfileToolButton->setToolTip(UIWizardImportApp::tr("Open Cloud Profile Manager...")); 448 if (m_pProfileInstanceLabel) 449 m_pProfileInstanceLabel->setText(UIWizardImportApp::tr("&Machines:")); 398 450 399 451 /* Translate path selector label: */ … … 418 470 if (m_pFileSelector) 419 471 m_pFileSelector->setToolTip(UIWizardImportApp::tr("Holds the path of the file selected for import.")); 472 473 /* Adjust label widths: */ 474 QList<QWidget*> labels; 475 if (m_pSourceLabel) 476 labels << m_pSourceLabel; 477 if (m_pFileLabel) 478 labels << m_pFileLabel; 479 if (m_pProfileLabel) 480 labels << m_pProfileLabel; 481 if (m_pProfileInstanceLabel) 482 labels << m_pProfileInstanceLabel; 483 int iMaxWidth = 0; 484 foreach (QWidget *pLabel, labels) 485 iMaxWidth = qMax(iMaxWidth, pLabel->minimumSizeHint().width()); 486 if (m_pSourceLayout) 487 m_pSourceLayout->setColumnMinimumWidth(0, iMaxWidth); 488 if ( m_pLocalContainerLayout 489 && m_pCloudContainerLayout) 490 { 491 m_pLocalContainerLayout->setColumnMinimumWidth(0, iMaxWidth); 492 m_pCloudContainerLayout->setColumnMinimumWidth(0, iMaxWidth); 493 } 420 494 421 495 /* Translate separate stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.h
r103982 r104475 130 130 /** Holds the local container layout instance. */ 131 131 QGridLayout *m_pLocalContainerLayout; 132 /** Holds the file label instance. */ 133 QLabel *m_pFileLabel; 132 134 /** Holds the file selector instance. */ 133 135 UIEmptyFilePathSelector *m_pFileSelector; … … 135 137 /** Holds the cloud container layout instance. */ 136 138 QGridLayout *m_pCloudContainerLayout; 139 /** Holds the profile label instance. */ 140 QLabel *m_pProfileLabel; 137 141 /** Holds the profile combo-box instance. */ 138 142 QIComboBox *m_pProfileComboBox; 139 143 /** Holds the profile management tool-button instance. */ 140 144 QIToolButton *m_pProfileToolButton; 145 /** Holds the profile instance label instance. */ 146 QLabel *m_pProfileInstanceLabel; 141 147 /** Holds the profile instance list instance. */ 142 148 QListWidget *m_pProfileInstanceList; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageSource.cpp
r103957 r104475 516 516 if (m_pFileLabel) 517 517 m_pLocalContainerLayout->addWidget(m_pFileLabel, 0, 0, Qt::AlignRight); 518 519 518 /* Prepare file-path selector: */ 520 519 m_pFileSelector = new UIEmptyFilePathSelector(pContainerLocal); … … 552 551 if (m_pProfileLabel) 553 552 m_pCloudContainerLayout->addWidget(m_pProfileLabel, 0, 0, Qt::AlignRight); 554 555 553 /* Prepare sub-layout: */ 556 554 QHBoxLayout *pSubLayout = new QHBoxLayout; … … 567 565 pSubLayout->addWidget(m_pProfileComboBox); 568 566 } 569 570 567 /* Prepare profile tool-button: */ 571 568 m_pProfileToolButton = new QIToolButton(pContainerCloud); … … 585 582 if (m_pProfileInstanceLabel) 586 583 m_pCloudContainerLayout->addWidget(m_pProfileInstanceLabel, 1, 0, Qt::AlignRight); 587 588 584 /* Prepare profile instances table: */ 589 585 m_pProfileInstanceList = new QListWidget(pContainerCloud); … … 719 715 /* Adjust label widths: */ 720 716 QList<QWidget*> labels; 717 if (m_pSourceLabel) 718 labels << m_pSourceLabel; 721 719 if (m_pFileLabel) 722 720 labels << m_pFileLabel; 723 if (m_pSourceLabel)724 labels << m_pSourceLabel;725 721 if (m_pProfileLabel) 726 722 labels << m_pProfileLabel; … … 732 728 if (m_pSourceLayout) 733 729 m_pSourceLayout->setColumnMinimumWidth(0, iMaxWidth); 734 if (m_pLocalContainerLayout) 730 if ( m_pLocalContainerLayout 731 && m_pCloudContainerLayout) 735 732 { 736 733 m_pLocalContainerLayout->setColumnMinimumWidth(0, iMaxWidth);
Note:
See TracChangeset
for help on using the changeset viewer.