Changeset 104555 in vbox
- Timestamp:
- May 8, 2024 1:20:58 PM (7 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp
r104551 r104555 181 181 } 182 182 183 /* Translate received values of Sourcecombo-box.183 /* Translate received values of Provider combo-box. 184 184 * We are enumerating starting from 0 for simplicity: */ 185 185 if (m_pProviderComboBox) 186 { 187 m_pProviderComboBox->setToolTip(UIWizardAddCloudVM::tr("Selects cloud service provider.")); 186 188 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 187 {188 189 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 189 m_pProviderComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole); 190 } 191 192 /* Update tool-tips: */ 193 updateComboToolTip(m_pProviderComboBox); 190 } 194 191 } 195 192 … … 236 233 void UIWizardAddCloudVMPageExpert::sltHandleProviderComboChange() 237 234 { 238 /* Update combo tool-tip: */239 updateComboToolTip(m_pProviderComboBox);240 241 235 /* Update wizard fields: */ 242 236 wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp
r104551 r104555 237 237 } 238 238 239 void UIWizardAddCloudVMSource::updateComboToolTip(QIComboBox *pCombo)240 {241 /* Sanity check: */242 AssertPtrReturnVoid(pCombo);243 244 const int iCurrentIndex = pCombo->currentIndex();245 if (iCurrentIndex != -1)246 {247 const QString strCurrentToolTip = pCombo->itemData(iCurrentIndex, Qt::ToolTipRole).toString();248 AssertMsg(!strCurrentToolTip.isEmpty(), ("Tool-tip data not found!\n"));249 pCombo->setToolTip(strCurrentToolTip);250 }251 }252 253 239 QStringList UIWizardAddCloudVMSource::currentListWidgetData(QListWidget *pList) 254 240 { … … 425 411 /* Translate provider label: */ 426 412 m_pProviderLabel->setText(UIWizardAddCloudVM::tr("&Source:")); 427 /* Translate received values of Sourcecombo-box.413 /* Translate received values of Provider combo-box. 428 414 * We are enumerating starting from 0 for simplicity: */ 429 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 430 { 431 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 432 m_pProviderComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole); 415 if (m_pProviderComboBox) 416 { 417 m_pProviderComboBox->setToolTip(UIWizardAddCloudVM::tr("Selects cloud service provider.")); 418 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 419 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 433 420 } 434 421 … … 458 445 m_pProviderLayout->setColumnMinimumWidth(0, iMaxWidth); 459 446 m_pOptionsLayout->setColumnMinimumWidth(0, iMaxWidth); 460 461 /* Update tool-tips: */462 updateComboToolTip(m_pProviderComboBox);463 447 } 464 448 … … 503 487 void UIWizardAddCloudVMPageSource::sltHandleProviderComboChange() 504 488 { 505 /* Update combo tool-tip: */506 updateComboToolTip(m_pProviderComboBox);507 508 489 /* Update wizard fields: */ 509 490 wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.h
r103982 r104555 72 72 /** Populates @a pList with profile instances available in @a comClient. */ 73 73 void populateProfileInstances(QListWidget *pList, UINotificationCenter *pCenter, const CCloudClient &comClient); 74 75 /** Updates @a pCombo tool-tips. */76 void updateComboToolTip(QIComboBox *pCombo);77 74 78 75 /** Returns current user data for @a pList specified. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp
r104551 r104555 249 249 if (m_pProviderLabel) 250 250 m_pProviderLabel->setText(UIWizardNewCloudVM::tr("&Location:")); 251 /* Translate received values of Locationcombo-box.251 /* Translate received values of Provider combo-box. 252 252 * We are enumerating starting from 0 for simplicity: */ 253 253 if (m_pProviderComboBox) 254 { 255 m_pProviderComboBox->setToolTip(UIWizardNewCloudVM::tr("Selects cloud service provider.")); 254 256 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 255 {256 257 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 257 m_pProviderComboBox->setItemData(i, UIWizardNewCloudVM::tr("Create VM for cloud service provider."), Qt::ToolTipRole); 258 } 258 } 259 259 260 260 /* Translate source tab-bar: */ … … 273 273 m_pProfileToolButton->setToolTip(UIWizardNewCloudVM::tr("Opens cloud profile manager...")); 274 274 } 275 276 /* Update tool-tips: */277 updateComboToolTip(m_pProviderComboBox);278 275 } 279 276 … … 348 345 void UIWizardNewCloudVMPageExpert::sltHandleProviderComboChange() 349 346 { 350 /* Update combo tool-tip: */351 updateComboToolTip(m_pProviderComboBox);352 353 347 /* Update wizard fields: */ 354 348 wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp
r104551 r104555 273 273 } 274 274 275 void UIWizardNewCloudVMSource::updateComboToolTip(QIComboBox *pCombo)276 {277 /* Sanity check: */278 AssertPtrReturnVoid(pCombo);279 280 const int iCurrentIndex = pCombo->currentIndex();281 if (iCurrentIndex != -1)282 {283 const QString strCurrentToolTip = pCombo->itemData(iCurrentIndex, Qt::ToolTipRole).toString();284 AssertMsg(!strCurrentToolTip.isEmpty(), ("Tool-tip data not found!\n"));285 pCombo->setToolTip(strCurrentToolTip);286 }287 }288 289 275 QString UIWizardNewCloudVMSource::currentListWidgetData(QListWidget *pList) 290 276 { … … 489 475 /* Translate provider label: */ 490 476 m_pProviderLabel->setText(UIWizardNewCloudVM::tr("&Location:")); 491 /* Translate received values of Locationcombo-box.477 /* Translate received values of Provider combo-box. 492 478 * We are enumerating starting from 0 for simplicity: */ 493 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 494 { 495 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 496 m_pProviderComboBox->setItemData(i, UIWizardNewCloudVM::tr("Create VM for cloud service provider."), Qt::ToolTipRole); 479 if (m_pProviderComboBox) 480 { 481 m_pProviderComboBox->setToolTip(UIWizardNewCloudVM::tr("Selects cloud service provider.")); 482 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 483 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 497 484 } 498 485 … … 526 513 m_pProviderLayout->setColumnMinimumWidth(0, iMaxWidth); 527 514 m_pOptionsLayout->setColumnMinimumWidth(0, iMaxWidth); 528 529 /* Update tool-tips: */530 updateComboToolTip(m_pProviderComboBox);531 515 } 532 516 … … 576 560 void UIWizardNewCloudVMPageSource::sltHandleProviderComboChange() 577 561 { 578 /* Update combo tool-tip: */579 updateComboToolTip(m_pProviderComboBox);580 581 562 /* Update wizard fields: */ 582 563 wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.h
r103982 r104555 92 92 const QString &strImageId); 93 93 94 /** Updates @a pCombo tool-tips. */95 void updateComboToolTip(QIComboBox *pCombo);96 97 94 /** Returns current user data for @a pList specified. */ 98 95 QString currentListWidgetData(QListWidget *pList);
Note:
See TracChangeset
for help on using the changeset viewer.