Changeset 86343 in vbox
- Timestamp:
- Sep 30, 2020 11:19:51 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageBasic1.cpp
r84464 r86343 51 51 , m_pAccountComboBox(0) 52 52 , m_pAccountToolButton(0) 53 , m_pAccountPropertyTable(0)54 53 , m_pAccountInstanceLabel(0) 55 54 , m_pAccountInstanceList(0) … … 175 174 } 176 175 177 void UIWizardAddCloudVMPage1::populateAccountProperties() 178 { 179 /* Block signals while updating: */ 180 m_pAccountPropertyTable->blockSignals(true); 181 182 /* Clear table initially: */ 183 m_pAccountPropertyTable->clear(); 184 m_pAccountPropertyTable->setRowCount(0); 185 m_pAccountPropertyTable->setColumnCount(0); 176 void UIWizardAddCloudVMPage1::populateAccount() 177 { 186 178 /* Clear Cloud Profile: */ 187 179 m_comCloudProfile = CCloudProfile(); … … 190 182 if (m_comCloudProvider.isNotNull() && !profileName().isNull()) 191 183 { 192 /* Main API request sequence, can be interrupted after any step: */ 193 do 194 { 195 /* Acquire Cloud Profile: */ 196 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 197 if (!m_comCloudProvider.isOk()) 198 { 199 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 200 break; 201 } 202 203 /* Acquire profile properties: */ 204 QVector<QString> keys; 205 QVector<QString> values; 206 values = m_comCloudProfile.GetProperties(QString(), keys); 207 if (!m_comCloudProfile.isOk()) 208 { 209 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile); 210 break; 211 } 212 213 /* Configure table: */ 214 m_pAccountPropertyTable->setRowCount(keys.size()); 215 m_pAccountPropertyTable->setColumnCount(2); 216 217 /* Push acquired keys/values to data fields: */ 218 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i) 219 { 220 /* Create key item: */ 221 QTableWidgetItem *pItemK = new QTableWidgetItem(keys.at(i)); 222 if (pItemK) 223 { 224 /* Non-editable for sure, but non-selectable? */ 225 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsEditable); 226 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsSelectable); 227 228 /* Use non-translated description as tool-tip: */ 229 const QString strToolTip = m_comCloudProvider.GetPropertyDescription(keys.at(i)); 230 /* Show error message if necessary: */ 231 if (!m_comCloudProfile.isOk()) 232 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile); 233 else 234 pItemK->setData(Qt::UserRole, strToolTip); 235 236 /* Insert into table: */ 237 m_pAccountPropertyTable->setItem(i, 0, pItemK); 238 } 239 240 /* Create value item: */ 241 QTableWidgetItem *pItemV = new QTableWidgetItem(values.at(i)); 242 if (pItemV) 243 { 244 /* Non-editable for sure, but non-selectable? */ 245 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsEditable); 246 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsSelectable); 247 248 /* Use the value as tool-tip, there can be quite long values: */ 249 const QString strToolTip = values.at(i); 250 pItemV->setToolTip(strToolTip); 251 252 /* Insert into table: */ 253 m_pAccountPropertyTable->setItem(i, 1, pItemV); 254 } 255 } 256 257 /* Update table tool-tips: */ 258 updateAccountPropertyTableToolTips(); 259 260 /* Adjust the table: */ 261 adjustAccountPropertyTable(); 262 } 263 while (0); 264 } 265 266 /* Unblock signals after update: */ 267 m_pAccountPropertyTable->blockSignals(false); 184 /* Acquire Cloud Profile: */ 185 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 186 /* Show error message if necessary: */ 187 if (!m_comCloudProvider.isOk()) 188 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 189 } 268 190 } 269 191 … … 355 277 m_pSourceComboBox->setToolTip(strCurrentToolTip); 356 278 } 357 }358 359 void UIWizardAddCloudVMPage1::updateAccountPropertyTableToolTips()360 {361 /* Iterate through all the key items: */362 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i)363 {364 /* Acquire current key item: */365 QTableWidgetItem *pItemK = m_pAccountPropertyTable->item(i, 0);366 if (pItemK)367 {368 const QString strToolTip = pItemK->data(Qt::UserRole).toString();369 pItemK->setToolTip(QApplication::translate("UIWizardAddCloudVMPageBasic1", strToolTip.toUtf8().constData()));370 }371 }372 }373 374 void UIWizardAddCloudVMPage1::adjustAccountPropertyTable()375 {376 /* Disable last column stretching temporary: */377 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(false);378 379 /* Resize both columns to contents: */380 m_pAccountPropertyTable->resizeColumnsToContents();381 /* Then acquire full available width: */382 const int iFullWidth = m_pAccountPropertyTable->viewport()->width();383 /* First column should not be less than it's minimum size, last gets the rest: */384 const int iMinimumWidth0 = qMin(m_pAccountPropertyTable->horizontalHeader()->sectionSize(0), iFullWidth / 2);385 m_pAccountPropertyTable->horizontalHeader()->resizeSection(0, iMinimumWidth0);386 387 /* Enable last column stretching again: */388 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(true);389 279 } 390 280 … … 537 427 } 538 428 539 /* Create profile property table: */540 m_pAccountPropertyTable = new QTableWidget(this);541 if (m_pAccountPropertyTable)542 {543 const QFontMetrics fm(m_pAccountPropertyTable->font());544 const int iFontWidth = fm.width('x');545 const int iTotalWidth = 50 * iFontWidth;546 const int iFontHeight = fm.height();547 const int iTotalHeight = 4 * iFontHeight;548 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));549 //m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);550 m_pAccountPropertyTable->setAlternatingRowColors(true);551 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);552 m_pAccountPropertyTable->verticalHeader()->setVisible(false);553 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);554 555 /* Add into layout: */556 m_pCloudContainerLayout->addWidget(m_pAccountPropertyTable, 1, 1);557 }558 559 429 /* Create account instance label: */ 560 430 m_pAccountInstanceLabel = new QLabel(this); … … 562 432 { 563 433 /* Add into layout: */ 564 m_pCloudContainerLayout->addWidget(m_pAccountInstanceLabel, 2, 0, Qt::AlignRight);434 m_pCloudContainerLayout->addWidget(m_pAccountInstanceLabel, 1, 0, Qt::AlignRight); 565 435 } 566 436 /* Create profile instances table: */ … … 580 450 581 451 /* Add into layout: */ 582 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 2, 1, 2, 1);452 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 1, 1, 2, 1); 583 453 } 584 454 … … 607 477 } 608 478 609 bool UIWizardAddCloudVMPageBasic1::event(QEvent *pEvent)610 {611 /* Handle known event types: */612 switch (pEvent->type())613 {614 case QEvent::Show:615 case QEvent::Resize:616 {617 /* Adjust profile property table: */618 adjustAccountPropertyTable();619 break;620 }621 default:622 break;623 }624 625 /* Call to base-class: */626 return UIWizardPage::event(pEvent);627 }628 629 479 void UIWizardAddCloudVMPageBasic1::retranslateUi() 630 480 { … … 669 519 /* Update tool-tips: */ 670 520 updateSourceComboToolTip(); 671 updateAccountPropertyTableToolTips();672 521 } 673 522 … … 730 579 /* Refresh required settings: */ 731 580 populateAccounts(); 732 populateAccount Properties();581 populateAccount(); 733 582 populateAccountInstances(); 734 583 emit completeChanged(); … … 738 587 { 739 588 /* Refresh required settings: */ 740 populateAccount Properties();589 populateAccount(); 741 590 populateAccountInstances(); 742 591 emit completeChanged(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageBasic1.h
r83857 r86343 67 67 /** Populates accounts. */ 68 68 void populateAccounts(); 69 /** Populates account properties. */70 void populateAccount Properties();69 /** Populates account. */ 70 void populateAccount(); 71 71 /** Populates account instances. */ 72 72 void populateAccountInstances(); … … 74 74 /** Updates source combo tool-tips. */ 75 75 void updateSourceComboToolTip(); 76 /** Updates account property table tool-tips. */77 void updateAccountPropertyTableToolTips();78 /** Adjusts account property table. */79 void adjustAccountPropertyTable();80 76 81 77 /** Defines @a strSource. */ … … 121 117 /** Holds the account management tool-button instance. */ 122 118 QIToolButton *m_pAccountToolButton; 123 /** Holds the account property table instance. */124 QTableWidget *m_pAccountPropertyTable;125 119 /** Holds the account instance label instance. */ 126 120 QLabel *m_pAccountInstanceLabel; … … 146 140 /** Allows access wizard from base part. */ 147 141 virtual UIWizard *wizardImp() const /* override */ { return UIWizardPage::wizard(); } 148 149 /** Handle any Qt @a pEvent. */150 virtual bool event(QEvent *pEvent) /* override */;151 142 152 143 /** Handles translation event. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp
r83857 r86343 92 92 } 93 93 94 /* Create profile property table: */95 m_pAccountPropertyTable = new QTableWidget(m_pCntSource);96 if (m_pAccountPropertyTable)97 {98 const QFontMetrics fm(m_pAccountPropertyTable->font());99 const int iFontWidth = fm.width('x');100 const int iTotalWidth = 50 * iFontWidth;101 const int iFontHeight = fm.height();102 const int iTotalHeight = 4 * iFontHeight;103 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));104 //m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);105 m_pAccountPropertyTable->setAlternatingRowColors(true);106 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);107 m_pAccountPropertyTable->verticalHeader()->setVisible(false);108 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);109 110 /* Add into layout: */111 m_pCloudContainerLayout->addWidget(m_pAccountPropertyTable, 1, 0);112 }113 114 94 /* Create profile instances table: */ 115 95 m_pAccountInstanceList = new QListWidget(m_pCntSource); … … 127 107 128 108 /* Add into layout: */ 129 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 2, 0);109 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 1, 0); 130 110 } 131 111 … … 159 139 } 160 140 161 bool UIWizardAddCloudVMPageExpert::event(QEvent *pEvent)162 {163 /* Handle known event types: */164 switch (pEvent->type())165 {166 case QEvent::Show:167 case QEvent::Resize:168 {169 /* Adjust profile property table: */170 adjustAccountPropertyTable();171 break;172 }173 default:174 break;175 }176 177 /* Call to base-class: */178 return UIWizardPage::event(pEvent);179 }180 181 141 void UIWizardAddCloudVMPageExpert::retranslateUi() 182 142 { … … 194 154 /* Update tool-tips: */ 195 155 updateSourceComboToolTip(); 196 updateAccountPropertyTableToolTips();197 156 } 198 157 … … 255 214 /* Refresh required settings: */ 256 215 populateAccounts(); 257 populateAccount Properties();216 populateAccount(); 258 217 populateAccountInstances(); 259 218 emit completeChanged(); … … 263 222 { 264 223 /* Refresh required settings: */ 265 populateAccount Properties();224 populateAccount(); 266 225 populateAccountInstances(); 267 226 emit completeChanged(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.h
r83857 r86343 47 47 virtual UIWizard *wizardImp() const /* override */ { return UIWizardPage::wizard(); } 48 48 49 /** Handle any Qt @a pEvent. */50 virtual bool event(QEvent *pEvent) /* override */;51 52 49 /** Handles translation event. */ 53 50 virtual void retranslateUi() /* override */; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r82968 r86343 68 68 , m_pAccountComboBox(0) 69 69 , m_pAccountToolButton(0) 70 , m_pAccountPropertyTable(0)71 70 { 72 71 } … … 226 225 } 227 226 228 void UIWizardExportAppPage2::populateAccountProperties() 229 { 230 /* Clear table initially: */ 231 m_pAccountPropertyTable->clear(); 232 m_pAccountPropertyTable->setRowCount(0); 233 m_pAccountPropertyTable->setColumnCount(0); 227 void UIWizardExportAppPage2::populateAccount() 228 { 234 229 /* Clear Cloud Profile: */ 235 230 m_comCloudProfile = CCloudProfile(); … … 243 238 if (!m_comCloudProvider.isOk()) 244 239 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 245 else246 {247 /* Acquire properties: */248 QVector<QString> keys;249 QVector<QString> values;250 values = m_comCloudProfile.GetProperties(QString(), keys);251 /* Show error message if necessary: */252 if (!m_comCloudProfile.isOk())253 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile);254 else255 {256 /* Configure table: */257 m_pAccountPropertyTable->setRowCount(keys.size());258 m_pAccountPropertyTable->setColumnCount(2);259 260 /* Push acquired keys/values to data fields: */261 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i)262 {263 /* Create key item: */264 QTableWidgetItem *pItemK = new QTableWidgetItem(keys.at(i));265 if (pItemK)266 {267 /* Non-editable for sure, but non-selectable? */268 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsEditable);269 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsSelectable);270 271 /* Use non-translated description as tool-tip: */272 const QString strToolTip = m_comCloudProvider.GetPropertyDescription(keys.at(i));273 /* Show error message if necessary: */274 if (!m_comCloudProfile.isOk())275 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile);276 else277 pItemK->setData(Qt::UserRole, strToolTip);278 279 /* Insert into table: */280 m_pAccountPropertyTable->setItem(i, 0, pItemK);281 }282 283 /* Create value item: */284 QTableWidgetItem *pItemV = new QTableWidgetItem(values.at(i));285 if (pItemV)286 {287 /* Non-editable for sure, but non-selectable? */288 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsEditable);289 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsSelectable);290 291 /* Use the value as tool-tip, there can be quite long values: */292 const QString strToolTip = values.at(i);293 pItemV->setToolTip(strToolTip);294 295 /* Insert into table: */296 m_pAccountPropertyTable->setItem(i, 1, pItemV);297 }298 }299 300 /* Update table tool-tips: */301 updateAccountPropertyTableToolTips();302 303 /* Adjust the table: */304 adjustAccountPropertyTable();305 }306 }307 240 } 308 241 } … … 529 462 AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!")); 530 463 m_pMACComboBox->setToolTip(strCurrentToolTip); 531 }532 533 void UIWizardExportAppPage2::updateAccountPropertyTableToolTips()534 {535 /* Iterate through all the key items: */536 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i)537 {538 /* Acquire current key item: */539 QTableWidgetItem *pItemK = m_pAccountPropertyTable->item(i, 0);540 if (pItemK)541 {542 const QString strToolTip = pItemK->data(Qt::UserRole).toString();543 pItemK->setToolTip(QApplication::translate("UIWizardExportAppPageBasic2", strToolTip.toUtf8().constData()));544 }545 }546 }547 548 void UIWizardExportAppPage2::adjustAccountPropertyTable()549 {550 /* Disable last column stretching temporary: */551 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(false);552 553 /* Resize both columns to contents: */554 m_pAccountPropertyTable->resizeColumnsToContents();555 /* Then acquire full available width: */556 const int iFullWidth = m_pAccountPropertyTable->viewport()->width();557 /* First column should not be less than it's minimum size, last gets the rest: */558 const int iMinimumWidth0 = qMin(m_pAccountPropertyTable->horizontalHeader()->sectionSize(0), iFullWidth / 2);559 m_pAccountPropertyTable->horizontalHeader()->resizeSection(0, iMinimumWidth0);560 561 /* Enable last column stretching again: */562 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(true);563 464 } 564 465 … … 903 804 m_pSettingsLayout2->addLayout(pSubLayout, 0, 1); 904 805 } 905 /* Create profile property table: */906 m_pAccountPropertyTable = new QTableWidget;907 if (m_pAccountPropertyTable)908 {909 const QFontMetrics fm(m_pAccountPropertyTable->font());910 const int iFontWidth = fm.width('x');911 const int iTotalWidth = 50 * iFontWidth;912 const int iFontHeight = fm.height();913 const int iTotalHeight = 4 * iFontHeight;914 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));915 // m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);916 m_pAccountPropertyTable->setAlternatingRowColors(true);917 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);918 m_pAccountPropertyTable->verticalHeader()->setVisible(false);919 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);920 921 /* Add into layout: */922 m_pSettingsLayout2->addWidget(m_pAccountPropertyTable, 1, 1);923 }924 806 925 807 /* Create account label: */ … … 930 812 931 813 /* Add into layout: */ 932 m_pSettingsLayout2->addWidget(m_pMachineLabel, 2, 0);814 m_pSettingsLayout2->addWidget(m_pMachineLabel, 1, 0); 933 815 } 934 816 /* Create Export Then Ask button: */ … … 937 819 { 938 820 /* Add into layout: */ 939 m_pSettingsLayout2->addWidget(m_pRadioExportThenAsk, 2, 1);821 m_pSettingsLayout2->addWidget(m_pRadioExportThenAsk, 1, 1); 940 822 } 941 823 /* Create Ask Then Export button: */ … … 944 826 { 945 827 /* Add into layout: */ 946 m_pSettingsLayout2->addWidget(m_pRadioAskThenExport, 3, 1);828 m_pSettingsLayout2->addWidget(m_pRadioAskThenExport, 2, 1); 947 829 } 948 830 /* Create Do Not Ask button: */ … … 951 833 { 952 834 /* Add into layout: */ 953 m_pSettingsLayout2->addWidget(m_pRadioDoNotAsk, 4, 1);835 m_pSettingsLayout2->addWidget(m_pRadioDoNotAsk, 3, 1); 954 836 } 955 837 } … … 970 852 /* Populate accounts: */ 971 853 populateAccounts(); 972 /* Populate account properties: */973 populateAccount Properties();854 /* Populate account: */ 855 populateAccount(); 974 856 975 857 /* Setup connections: */ … … 1001 883 registerField("vsdExportForm", this, "vsdExportForm"); 1002 884 registerField("cloudExportMode", this, "cloudExportMode"); 1003 }1004 1005 bool UIWizardExportAppPageBasic2::event(QEvent *pEvent)1006 {1007 /* Handle known event types: */1008 switch (pEvent->type())1009 {1010 case QEvent::Show:1011 case QEvent::Resize:1012 {1013 /* Adjust profile property table: */1014 adjustAccountPropertyTable();1015 break;1016 }1017 default:1018 break;1019 }1020 1021 /* Call to base-class: */1022 return UIWizardPage::event(pEvent);1023 885 } 1024 886 … … 1134 996 updateFormatComboToolTip(); 1135 997 updateMACAddressExportPolicyComboToolTip(); 1136 updateAccountPropertyTableToolTips();1137 998 } 1138 999 … … 1201 1062 m_pLabelSettings->setText(UIWizardExportApp:: 1202 1063 tr("<p>Please choose one of cloud service accounts you have registered to export virtual " 1203 "machines to. Make sure profile settings reflected in the underlying table are valid. " 1204 "They will be used to establish network connection required to upload your virtual machine " 1205 "files to a remote cloud facility.</p>")); 1064 "machines to. It will be used to establish network connection required to upload your " 1065 "virtual machine files to a remote cloud facility.</p>")); 1206 1066 m_pAccountComboBox->setFocus(); 1207 1067 } … … 1227 1087 refreshIncludeISOsCheckBoxAccess(); 1228 1088 populateAccounts(); 1229 populateAccount Properties();1089 populateAccount(); 1230 1090 emit completeChanged(); 1231 1091 } … … 1250 1110 { 1251 1111 /* Refresh required settings: */ 1252 populateAccount Properties();1112 populateAccount(); 1253 1113 } 1254 1114 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h
r82968 r86343 103 103 /** Populates accounts. */ 104 104 void populateAccounts(); 105 /** Populates account properties. */106 void populateAccount Properties();105 /** Populates account. */ 106 void populateAccount(); 107 107 /** Populates form properties. */ 108 108 void populateFormProperties(); … … 126 126 /** Updates MAC address export policy combo tool-tips. */ 127 127 void updateMACAddressExportPolicyComboToolTip(); 128 /** Updates account property table tool-tips. */129 void updateAccountPropertyTableToolTips();130 /** Adjusts account property table. */131 void adjustAccountPropertyTable();132 128 133 129 /** Defines @a strFormat. */ … … 241 237 /** Holds the account management tool-button instance. */ 242 238 QIToolButton *m_pAccountToolButton; 243 /** Holds the account property table instance. */244 QTableWidget *m_pAccountPropertyTable;245 239 246 240 /** Holds the machine label instance. */ … … 279 273 protected: 280 274 281 /** Handle any Qt @a pEvent. */282 virtual bool event(QEvent *pEvent) /* override */;283 284 275 /** Allows access wizard from base part. */ 285 276 UIWizard *wizardImp() const { return UIWizardPage::wizard(); } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r82968 r86343 351 351 m_pSettingsLayout2->addLayout(pSubLayout, 0, 1); 352 352 } 353 /* Create account property table: */354 m_pAccountPropertyTable = new QTableWidget;355 if (m_pAccountPropertyTable)356 {357 const QFontMetrics fm(m_pAccountPropertyTable->font());358 const int iFontWidth = fm.width('x');359 const int iTotalWidth = 50 * iFontWidth;360 const int iFontHeight = fm.height();361 const int iTotalHeight = 8 * iFontHeight;362 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));363 m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);364 m_pAccountPropertyTable->setAlternatingRowColors(true);365 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);366 m_pAccountPropertyTable->verticalHeader()->setVisible(false);367 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);368 369 /* Add into layout: */370 m_pSettingsLayout2->addWidget(m_pAccountPropertyTable, 1, 1);371 }372 353 373 354 /* Create account label: */ … … 378 359 379 360 /* Add into layout: */ 380 m_pSettingsLayout2->addWidget(m_pMachineLabel, 2, 0);361 m_pSettingsLayout2->addWidget(m_pMachineLabel, 1, 0); 381 362 } 382 363 /* Create Export Then Ask button: */ … … 385 366 { 386 367 /* Add into layout: */ 387 m_pSettingsLayout2->addWidget(m_pRadioExportThenAsk, 2, 1);368 m_pSettingsLayout2->addWidget(m_pRadioExportThenAsk, 1, 1); 388 369 } 389 370 /* Create Ask Then Export button: */ … … 392 373 { 393 374 /* Add into layout: */ 394 m_pSettingsLayout2->addWidget(m_pRadioAskThenExport, 3, 1);375 m_pSettingsLayout2->addWidget(m_pRadioAskThenExport, 2, 1); 395 376 } 396 377 /* Create Do Not Ask button: */ … … 399 380 { 400 381 /* Add into layout: */ 401 m_pSettingsLayout2->addWidget(m_pRadioDoNotAsk, 4, 1);382 m_pSettingsLayout2->addWidget(m_pRadioDoNotAsk, 3, 1); 402 383 } 403 384 } … … 459 440 registerField("cloudExportMode", this, "cloudExportMode"); 460 441 registerField("applianceWidget", this, "applianceWidget"); 461 }462 463 bool UIWizardExportAppPageExpert::event(QEvent *pEvent)464 {465 /* Handle known event types: */466 switch (pEvent->type())467 {468 case QEvent::Show:469 case QEvent::Resize:470 {471 /* Adjust profile property table: */472 adjustAccountPropertyTable();473 break;474 }475 default:476 break;477 }478 479 /* Call to base-class: */480 return UIWizardPage::event(pEvent);481 442 } 482 443 … … 702 663 refreshIncludeISOsCheckBoxAccess(); 703 664 populateAccounts(); 704 populateAccount Properties();665 populateAccount(); 705 666 populateFormProperties(); 706 667 … … 735 696 { 736 697 /* Refresh required settings: */ 737 populateAccount Properties();698 populateAccount(); 738 699 populateFormProperties(); 739 700 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r82968 r86343 61 61 protected: 62 62 63 /** Handle any Qt @a pEvent. */64 virtual bool event(QEvent *pEvent) /* override */;65 66 63 /** Allows access wizard from base part. */ 67 64 UIWizard *wizardImp() const { return UIWizardPage::wizard(); } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp
r82968 r86343 59 59 , m_pAccountComboBox(0) 60 60 , m_pAccountToolButton(0) 61 , m_pAccountPropertyTable(0)62 61 , m_pAccountInstanceLabel(0) 63 62 , m_pAccountInstanceList(0) … … 197 196 } 198 197 199 void UIWizardImportAppPage1::populateAccountProperties() 200 { 201 /* Block signals while updating: */ 202 m_pAccountPropertyTable->blockSignals(true); 203 204 /* Clear table initially: */ 205 m_pAccountPropertyTable->clear(); 206 m_pAccountPropertyTable->setRowCount(0); 207 m_pAccountPropertyTable->setColumnCount(0); 198 void UIWizardImportAppPage1::populateAccount() 199 { 208 200 /* Clear Cloud Profile: */ 209 201 m_comCloudProfile = CCloudProfile(); … … 212 204 if (m_comCloudProvider.isNotNull() && !profileName().isNull()) 213 205 { 214 /* Main API request sequence, can be interrupted after any step: */ 215 do 216 { 217 /* Acquire Cloud Profile: */ 218 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 219 if (!m_comCloudProvider.isOk()) 220 { 221 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 222 break; 223 } 224 225 /* Acquire profile properties: */ 226 QVector<QString> keys; 227 QVector<QString> values; 228 values = m_comCloudProfile.GetProperties(QString(), keys); 229 if (!m_comCloudProfile.isOk()) 230 { 231 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile); 232 break; 233 } 234 235 /* Configure table: */ 236 m_pAccountPropertyTable->setRowCount(keys.size()); 237 m_pAccountPropertyTable->setColumnCount(2); 238 239 /* Push acquired keys/values to data fields: */ 240 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i) 241 { 242 /* Create key item: */ 243 QTableWidgetItem *pItemK = new QTableWidgetItem(keys.at(i)); 244 if (pItemK) 245 { 246 /* Non-editable for sure, but non-selectable? */ 247 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsEditable); 248 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsSelectable); 249 250 /* Use non-translated description as tool-tip: */ 251 const QString strToolTip = m_comCloudProvider.GetPropertyDescription(keys.at(i)); 252 /* Show error message if necessary: */ 253 if (!m_comCloudProfile.isOk()) 254 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile); 255 else 256 pItemK->setData(Qt::UserRole, strToolTip); 257 258 /* Insert into table: */ 259 m_pAccountPropertyTable->setItem(i, 0, pItemK); 260 } 261 262 /* Create value item: */ 263 QTableWidgetItem *pItemV = new QTableWidgetItem(values.at(i)); 264 if (pItemV) 265 { 266 /* Non-editable for sure, but non-selectable? */ 267 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsEditable); 268 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsSelectable); 269 270 /* Use the value as tool-tip, there can be quite long values: */ 271 const QString strToolTip = values.at(i); 272 pItemV->setToolTip(strToolTip); 273 274 /* Insert into table: */ 275 m_pAccountPropertyTable->setItem(i, 1, pItemV); 276 } 277 } 278 279 /* Update table tool-tips: */ 280 updateAccountPropertyTableToolTips(); 281 282 /* Adjust the table: */ 283 adjustAccountPropertyTable(); 284 } 285 while (0); 286 } 287 288 /* Unblock signals after update: */ 289 m_pAccountPropertyTable->blockSignals(false); 206 /* Acquire Cloud Profile: */ 207 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 208 /* Show error message if necessary: */ 209 if (!m_comCloudProvider.isOk()) 210 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 211 } 290 212 } 291 213 … … 455 377 AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!")); 456 378 m_pSourceComboBox->setToolTip(strCurrentToolTip); 457 }458 459 void UIWizardImportAppPage1::updateAccountPropertyTableToolTips()460 {461 /* Iterate through all the key items: */462 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i)463 {464 /* Acquire current key item: */465 QTableWidgetItem *pItemK = m_pAccountPropertyTable->item(i, 0);466 if (pItemK)467 {468 const QString strToolTip = pItemK->data(Qt::UserRole).toString();469 pItemK->setToolTip(QApplication::translate("UIWizardImportAppPageBasic1", strToolTip.toUtf8().constData()));470 }471 }472 }473 474 void UIWizardImportAppPage1::adjustAccountPropertyTable()475 {476 /* Disable last column stretching temporary: */477 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(false);478 479 /* Resize both columns to contents: */480 m_pAccountPropertyTable->resizeColumnsToContents();481 /* Then acquire full available width: */482 const int iFullWidth = m_pAccountPropertyTable->viewport()->width();483 /* First column should not be less than it's minimum size, last gets the rest: */484 const int iMinimumWidth0 = qMin(m_pAccountPropertyTable->horizontalHeader()->sectionSize(0), iFullWidth / 2);485 m_pAccountPropertyTable->horizontalHeader()->resizeSection(0, iMinimumWidth0);486 487 /* Enable last column stretching again: */488 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(true);489 379 } 490 380 … … 698 588 } 699 589 700 /* Create profile property table: */701 m_pAccountPropertyTable = new QTableWidget;702 if (m_pAccountPropertyTable)703 {704 const QFontMetrics fm(m_pAccountPropertyTable->font());705 const int iFontWidth = fm.width('x');706 const int iTotalWidth = 50 * iFontWidth;707 const int iFontHeight = fm.height();708 const int iTotalHeight = 4 * iFontHeight;709 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));710 // m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);711 m_pAccountPropertyTable->setAlternatingRowColors(true);712 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);713 m_pAccountPropertyTable->verticalHeader()->setVisible(false);714 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);715 716 /* Add into layout: */717 m_pCloudContainerLayout->addWidget(m_pAccountPropertyTable, 1, 1);718 }719 720 590 /* Create account instance label: */ 721 591 m_pAccountInstanceLabel = new QLabel; … … 723 593 { 724 594 /* Add into layout: */ 725 m_pCloudContainerLayout->addWidget(m_pAccountInstanceLabel, 2, 0, Qt::AlignRight);595 m_pCloudContainerLayout->addWidget(m_pAccountInstanceLabel, 1, 0, Qt::AlignRight); 726 596 } 727 597 … … 741 611 742 612 /* Add into layout: */ 743 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 2, 1, 2, 1);613 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 1, 1, 2, 1); 744 614 } 745 615 } … … 761 631 /* Populate accounts: */ 762 632 populateAccounts(); 763 /* Populate account properties: */764 populateAccount Properties();633 /* Populate account: */ 634 populateAccount(); 765 635 /* Populate account instances: */ 766 636 populateAccountInstances(); … … 790 660 } 791 661 792 bool UIWizardImportAppPageBasic1::event(QEvent *pEvent)793 {794 /* Handle known event types: */795 switch (pEvent->type())796 {797 case QEvent::Show:798 case QEvent::Resize:799 {800 /* Adjust profile property table: */801 adjustAccountPropertyTable();802 break;803 }804 default:805 break;806 }807 808 /* Call to base-class: */809 return UIWizardPage::event(pEvent);810 }811 812 662 void UIWizardImportAppPageBasic1::retranslateUi() 813 663 { … … 862 712 /* Update tool-tips: */ 863 713 updateSourceComboToolTip(); 864 updateAccountPropertyTableToolTips();865 714 } 866 715 … … 955 804 updatePageAppearance(); 956 805 populateAccounts(); 957 populateAccount Properties();806 populateAccount(); 958 807 populateAccountInstances(); 959 808 emit completeChanged(); … … 963 812 { 964 813 /* Refresh required settings: */ 965 populateAccount Properties();814 populateAccount(); 966 815 populateAccountInstances(); 967 816 emit completeChanged(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h
r82968 r86343 72 72 /** Populates accounts. */ 73 73 void populateAccounts(); 74 /** Populates account properties. */75 void populateAccount Properties();74 /** Populates account. */ 75 void populateAccount(); 76 76 /** Populates account instances. */ 77 77 void populateAccountInstances(); … … 84 84 /** Updates source combo tool-tips. */ 85 85 void updateSourceComboToolTip(); 86 /** Updates account property table tool-tips. */87 void updateAccountPropertyTableToolTips();88 /** Adjusts account property table. */89 void adjustAccountPropertyTable();90 86 91 87 /** Defines @a strSource. */ … … 150 146 /** Holds the account management tool-button instance. */ 151 147 QIToolButton *m_pAccountToolButton; 152 /** Holds the account property table instance. */153 QTableWidget *m_pAccountPropertyTable;154 148 /** Holds the account instance label instance. */ 155 149 QLabel *m_pAccountInstanceLabel; … … 176 170 protected: 177 171 178 /** Handle any Qt @a pEvent. */179 virtual bool event(QEvent *pEvent) /* override */;180 181 172 /** Handles translation event. */ 182 173 virtual void retranslateUi() /* override */; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp
r82968 r86343 138 138 } 139 139 140 /* Create profile property table: */141 m_pAccountPropertyTable = new QTableWidget(pCloudContainer);142 if (m_pAccountPropertyTable)143 {144 const QFontMetrics fm(m_pAccountPropertyTable->font());145 const int iFontWidth = fm.width('x');146 const int iTotalWidth = 50 * iFontWidth;147 const int iFontHeight = fm.height();148 const int iTotalHeight = 4 * iFontHeight;149 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));150 // m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);151 m_pAccountPropertyTable->setAlternatingRowColors(true);152 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);153 m_pAccountPropertyTable->verticalHeader()->setVisible(false);154 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);155 156 /* Add into layout: */157 m_pCloudContainerLayout->addWidget(m_pAccountPropertyTable, 1, 0);158 }159 160 140 /* Create profile instances table: */ 161 141 m_pAccountInstanceList = new QListWidget(pCloudContainer); … … 172 152 173 153 /* Add into layout: */ 174 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 2, 0);154 m_pCloudContainerLayout->addWidget(m_pAccountInstanceList, 1, 0); 175 155 } 176 156 } … … 252 232 /* Populate accounts: */ 253 233 populateAccounts(); 254 /* Populate account properties: */255 populateAccount Properties();234 /* Populate account: */ 235 populateAccount(); 256 236 /* Populate account instances: */ 257 237 populateAccountInstances(); … … 287 267 } 288 268 289 bool UIWizardImportAppPageExpert::event(QEvent *pEvent)290 {291 /* Handle known event types: */292 switch (pEvent->type())293 {294 case QEvent::Show:295 case QEvent::Resize:296 {297 /* Adjust profile property table: */298 adjustAccountPropertyTable();299 break;300 }301 default:302 break;303 }304 305 /* Call to base-class: */306 return UIWizardPage::event(pEvent);307 }308 309 269 void UIWizardImportAppPageExpert::retranslateUi() 310 270 { … … 337 297 /* Update tool-tips: */ 338 298 updateSourceComboToolTip(); 339 updateAccountPropertyTableToolTips();340 299 } 341 300 … … 433 392 updatePageAppearance(); 434 393 populateAccounts(); 435 populateAccount Properties();394 populateAccount(); 436 395 populateAccountInstances(); 437 396 populateFormProperties(); … … 456 415 { 457 416 /* Refresh required settings: */ 458 populateAccount Properties();417 populateAccount(); 459 418 populateAccountInstances(); 460 419 populateFormProperties(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.h
r82968 r86343 54 54 virtual QVariant fieldImp(const QString &strFieldName) const /* override */ { return UIWizardPage::field(strFieldName); } 55 55 56 /** Handle any Qt @a pEvent. */57 virtual bool event(QEvent *pEvent) /* override */;58 59 56 /** Handles translation event. */ 60 57 virtual void retranslateUi() /* override */; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.cpp
r84464 r86343 51 51 , m_pAccountComboBox(0) 52 52 , m_pAccountToolButton(0) 53 , m_pAccountPropertyTable(0)54 53 , m_pSourceImageLabel(0) 55 54 , m_pSourceTabBar(0) … … 176 175 } 177 176 178 void UIWizardNewCloudVMPage1::populateAccountProperties() 179 { 180 /* Block signals while updating: */ 181 m_pAccountPropertyTable->blockSignals(true); 182 183 /* Clear table initially: */ 184 m_pAccountPropertyTable->clear(); 185 m_pAccountPropertyTable->setRowCount(0); 186 m_pAccountPropertyTable->setColumnCount(0); 177 void UIWizardNewCloudVMPage1::populateAccount() 178 { 187 179 /* Clear Cloud Profile: */ 188 180 m_comCloudProfile = CCloudProfile(); … … 191 183 if (m_comCloudProvider.isNotNull() && !profileName().isNull()) 192 184 { 193 /* Main API request sequence, can be interrupted after any step: */ 194 do 195 { 196 /* Acquire Cloud Profile: */ 197 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 198 if (!m_comCloudProvider.isOk()) 199 { 200 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 201 break; 202 } 203 204 /* Acquire profile properties: */ 205 QVector<QString> keys; 206 QVector<QString> values; 207 values = m_comCloudProfile.GetProperties(QString(), keys); 208 if (!m_comCloudProfile.isOk()) 209 { 210 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile); 211 break; 212 } 213 214 /* Configure table: */ 215 m_pAccountPropertyTable->setRowCount(keys.size()); 216 m_pAccountPropertyTable->setColumnCount(2); 217 218 /* Push acquired keys/values to data fields: */ 219 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i) 220 { 221 /* Create key item: */ 222 QTableWidgetItem *pItemK = new QTableWidgetItem(keys.at(i)); 223 if (pItemK) 224 { 225 /* Non-editable for sure, but non-selectable? */ 226 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsEditable); 227 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsSelectable); 228 229 /* Use non-translated description as tool-tip: */ 230 const QString strToolTip = m_comCloudProvider.GetPropertyDescription(keys.at(i)); 231 /* Show error message if necessary: */ 232 if (!m_comCloudProfile.isOk()) 233 msgCenter().cannotAcquireCloudProfileParameter(m_comCloudProfile); 234 else 235 pItemK->setData(Qt::UserRole, strToolTip); 236 237 /* Insert into table: */ 238 m_pAccountPropertyTable->setItem(i, 0, pItemK); 239 } 240 241 /* Create value item: */ 242 QTableWidgetItem *pItemV = new QTableWidgetItem(values.at(i)); 243 if (pItemV) 244 { 245 /* Non-editable for sure, but non-selectable? */ 246 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsEditable); 247 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsSelectable); 248 249 /* Use the value as tool-tip, there can be quite long values: */ 250 const QString strToolTip = values.at(i); 251 pItemV->setToolTip(strToolTip); 252 253 /* Insert into table: */ 254 m_pAccountPropertyTable->setItem(i, 1, pItemV); 255 } 256 } 257 258 /* Update table tool-tips: */ 259 updateAccountPropertyTableToolTips(); 260 261 /* Adjust the table: */ 262 adjustAccountPropertyTable(); 263 } 264 while (0); 265 } 266 267 /* Unblock signals after update: */ 268 m_pAccountPropertyTable->blockSignals(false); 185 /* Acquire Cloud Profile: */ 186 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 187 /* Show error message if necessary: */ 188 if (!m_comCloudProvider.isOk()) 189 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 190 } 269 191 } 270 192 … … 450 372 } 451 373 452 void UIWizardNewCloudVMPage1::updateAccountPropertyTableToolTips()453 {454 /* Iterate through all the key items: */455 for (int i = 0; i < m_pAccountPropertyTable->rowCount(); ++i)456 {457 /* Acquire current key item: */458 QTableWidgetItem *pItemK = m_pAccountPropertyTable->item(i, 0);459 if (pItemK)460 {461 const QString strToolTip = pItemK->data(Qt::UserRole).toString();462 pItemK->setToolTip(QApplication::translate("UIWizardNewCloudVMPageBasic1", strToolTip.toUtf8().constData()));463 }464 }465 }466 467 void UIWizardNewCloudVMPage1::adjustAccountPropertyTable()468 {469 /* Disable last column stretching temporary: */470 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(false);471 472 /* Resize both columns to contents: */473 m_pAccountPropertyTable->resizeColumnsToContents();474 /* Then acquire full available width: */475 const int iFullWidth = m_pAccountPropertyTable->viewport()->width();476 /* First column should not be less than it's minimum size, last gets the rest: */477 const int iMinimumWidth0 = qMin(m_pAccountPropertyTable->horizontalHeader()->sectionSize(0), iFullWidth / 2);478 m_pAccountPropertyTable->horizontalHeader()->resizeSection(0, iMinimumWidth0);479 480 /* Enable last column stretching again: */481 m_pAccountPropertyTable->horizontalHeader()->setStretchLastSection(true);482 }483 484 374 void UIWizardNewCloudVMPage1::setLocation(const QString &strLocation) 485 375 { … … 651 541 } 652 542 653 /* Create account property table: */654 m_pAccountPropertyTable = new QTableWidget(this);655 if (m_pAccountPropertyTable)656 {657 const QFontMetrics fm(m_pAccountPropertyTable->font());658 const int iFontWidth = fm.width('x');659 const int iTotalWidth = 50 * iFontWidth;660 const int iFontHeight = fm.height();661 const int iTotalHeight = 4 * iFontHeight;662 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));663 //m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);664 m_pAccountPropertyTable->setAlternatingRowColors(true);665 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);666 m_pAccountPropertyTable->verticalHeader()->setVisible(false);667 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);668 669 /* Add into layout: */670 m_pOptionsLayout->addWidget(m_pAccountPropertyTable, 1, 1);671 }672 673 543 /* Create source image label: */ 674 544 m_pSourceImageLabel = new QLabel(this); … … 676 546 { 677 547 /* Add into layout: */ 678 m_pOptionsLayout->addWidget(m_pSourceImageLabel, 2, 0, Qt::AlignRight);548 m_pOptionsLayout->addWidget(m_pSourceImageLabel, 1, 0, Qt::AlignRight); 679 549 } 680 550 /* Create source image layout: */ … … 717 587 718 588 /* Add into layout: */ 719 m_pOptionsLayout->addLayout(pSourceImageLayout, 2, 1, 2, 1);589 m_pOptionsLayout->addLayout(pSourceImageLayout, 1, 1, 2, 1); 720 590 } 721 591 … … 743 613 } 744 614 745 bool UIWizardNewCloudVMPageBasic1::event(QEvent *pEvent)746 {747 /* Handle known event types: */748 switch (pEvent->type())749 {750 case QEvent::Show:751 case QEvent::Resize:752 {753 /* Adjust profile property table: */754 adjustAccountPropertyTable();755 break;756 }757 default:758 break;759 }760 761 /* Call to base-class: */762 return UIWizardPage::event(pEvent);763 }764 765 615 void UIWizardNewCloudVMPageBasic1::retranslateUi() 766 616 { … … 809 659 /* Update tool-tips: */ 810 660 updateLocationComboToolTip(); 811 updateAccountPropertyTableToolTips();812 661 } 813 662 … … 866 715 /* Refresh required settings: */ 867 716 populateAccounts(); 868 populateAccount Properties();717 populateAccount(); 869 718 populateSourceImages(); 870 719 emit completeChanged(); … … 874 723 { 875 724 /* Refresh required settings: */ 876 populateAccount Properties();725 populateAccount(); 877 726 populateSourceImages(); 878 727 emit completeChanged(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.h
r84289 r86343 70 70 /** Populates accounts. */ 71 71 void populateAccounts(); 72 /** Populates account properties. */73 void populateAccount Properties();72 /** Populates account. */ 73 void populateAccount(); 74 74 /** Populates source images. */ 75 75 void populateSourceImages(); … … 79 79 /** Updates location combo tool-tips. */ 80 80 void updateLocationComboToolTip(); 81 /** Updates account property table tool-tips. */82 void updateAccountPropertyTableToolTips();83 /** Adjusts account property table. */84 void adjustAccountPropertyTable();85 81 86 82 /** Defines @a strLocation. */ … … 132 128 /** Holds the account management tool-button instance. */ 133 129 QIToolButton *m_pAccountToolButton; 134 /** Holds the account property table instance. */135 QTableWidget *m_pAccountPropertyTable;136 130 /** Holds the source image label instance. */ 137 131 QLabel *m_pSourceImageLabel; … … 158 152 /** Allows access wizard from base part. */ 159 153 virtual UIWizard *wizardImp() const /* override */ { return UIWizardPage::wizard(); } 160 161 /** Handle any Qt @a pEvent. */162 virtual bool event(QEvent *pEvent) /* override */;163 154 164 155 /** Handles translation event. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp
r84289 r86343 95 95 pLocationLayout->addLayout(pAccountLayout); 96 96 } 97 98 /* Create account property table: */99 m_pAccountPropertyTable = new QTableWidget(m_pCntLocation);100 if (m_pAccountPropertyTable)101 {102 const QFontMetrics fm(m_pAccountPropertyTable->font());103 const int iFontWidth = fm.width('x');104 const int iTotalWidth = 50 * iFontWidth;105 const int iFontHeight = fm.height();106 const int iTotalHeight = 4 * iFontHeight;107 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));108 //m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);109 m_pAccountPropertyTable->setAlternatingRowColors(true);110 m_pAccountPropertyTable->horizontalHeader()->setVisible(false);111 m_pAccountPropertyTable->verticalHeader()->setVisible(false);112 m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);113 114 /* Add into layout: */115 pLocationLayout->addWidget(m_pAccountPropertyTable);116 }117 97 } 118 98 … … 217 197 } 218 198 219 bool UIWizardNewCloudVMPageExpert::event(QEvent *pEvent)220 {221 /* Handle known event types: */222 switch (pEvent->type())223 {224 case QEvent::Show:225 case QEvent::Resize:226 {227 /* Adjust profile property table: */228 adjustAccountPropertyTable();229 break;230 }231 default:232 break;233 }234 235 /* Call to base-class: */236 return UIWizardPage::event(pEvent);237 }238 239 199 void UIWizardNewCloudVMPageExpert::retranslateUi() 240 200 { … … 262 222 /* Update tool-tips: */ 263 223 updateLocationComboToolTip(); 264 updateAccountPropertyTableToolTips();265 224 } 266 225 … … 353 312 /* Refresh required settings: */ 354 313 populateAccounts(); 355 populateAccount Properties();314 populateAccount(); 356 315 populateSourceImages(); 357 316 populateFormProperties(); … … 363 322 { 364 323 /* Refresh required settings: */ 365 populateAccount Properties();324 populateAccount(); 366 325 populateSourceImages(); 367 326 populateFormProperties(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h
r84289 r86343 48 48 virtual UIWizard *wizardImp() const /* override */ { return UIWizardPage::wizard(); } 49 49 50 /** Handle any Qt @a pEvent. */51 virtual bool event(QEvent *pEvent) /* override */;52 53 50 /** Handles translation event. */ 54 51 virtual void retranslateUi() /* override */;
Note:
See TracChangeset
for help on using the changeset viewer.