VirtualBox

Changeset 104555 in vbox


Ignore:
Timestamp:
May 8, 2024 1:20:58 PM (7 months ago)
Author:
vboxsync
Message:

FE/Qt: NLS fixes for Cloud Provider combo used in a bunch of cloud related wizards; This is related to bugref:10670 and bugref:10671.

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  
    181181    }
    182182
    183     /* Translate received values of Source combo-box.
     183    /* Translate received values of Provider combo-box.
    184184     * We are enumerating starting from 0 for simplicity: */
    185185    if (m_pProviderComboBox)
     186    {
     187        m_pProviderComboBox->setToolTip(UIWizardAddCloudVM::tr("Selects cloud service provider."));
    186188        for (int i = 0; i < m_pProviderComboBox->count(); ++i)
    187         {
    188189            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    }
    194191}
    195192
     
    236233void UIWizardAddCloudVMPageExpert::sltHandleProviderComboChange()
    237234{
    238     /* Update combo tool-tip: */
    239     updateComboToolTip(m_pProviderComboBox);
    240 
    241235    /* Update wizard fields: */
    242236    wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString());
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp

    r104551 r104555  
    237237}
    238238
    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 
    253239QStringList UIWizardAddCloudVMSource::currentListWidgetData(QListWidget *pList)
    254240{
     
    425411    /* Translate provider label: */
    426412    m_pProviderLabel->setText(UIWizardAddCloudVM::tr("&Source:"));
    427     /* Translate received values of Source combo-box.
     413    /* Translate received values of Provider combo-box.
    428414     * 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());
    433420    }
    434421
     
    458445    m_pProviderLayout->setColumnMinimumWidth(0, iMaxWidth);
    459446    m_pOptionsLayout->setColumnMinimumWidth(0, iMaxWidth);
    460 
    461     /* Update tool-tips: */
    462     updateComboToolTip(m_pProviderComboBox);
    463447}
    464448
     
    503487void UIWizardAddCloudVMPageSource::sltHandleProviderComboChange()
    504488{
    505     /* Update combo tool-tip: */
    506     updateComboToolTip(m_pProviderComboBox);
    507 
    508489    /* Update wizard fields: */
    509490    wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString());
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.h

    r103982 r104555  
    7272    /** Populates @a pList with profile instances available in @a comClient. */
    7373    void populateProfileInstances(QListWidget *pList, UINotificationCenter *pCenter, const CCloudClient &comClient);
    74 
    75     /** Updates @a pCombo tool-tips. */
    76     void updateComboToolTip(QIComboBox *pCombo);
    7774
    7875    /** Returns current user data for @a pList specified. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp

    r104551 r104555  
    249249    if (m_pProviderLabel)
    250250        m_pProviderLabel->setText(UIWizardNewCloudVM::tr("&Location:"));
    251     /* Translate received values of Location combo-box.
     251    /* Translate received values of Provider combo-box.
    252252     * We are enumerating starting from 0 for simplicity: */
    253253    if (m_pProviderComboBox)
     254    {
     255        m_pProviderComboBox->setToolTip(UIWizardNewCloudVM::tr("Selects cloud service provider."));
    254256        for (int i = 0; i < m_pProviderComboBox->count(); ++i)
    255         {
    256257            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    }
    259259
    260260    /* Translate source tab-bar: */
     
    273273        m_pProfileToolButton->setToolTip(UIWizardNewCloudVM::tr("Opens cloud profile manager..."));
    274274    }
    275 
    276     /* Update tool-tips: */
    277     updateComboToolTip(m_pProviderComboBox);
    278275}
    279276
     
    348345void UIWizardNewCloudVMPageExpert::sltHandleProviderComboChange()
    349346{
    350     /* Update combo tool-tip: */
    351     updateComboToolTip(m_pProviderComboBox);
    352 
    353347    /* Update wizard fields: */
    354348    wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString());
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp

    r104551 r104555  
    273273}
    274274
    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 
    289275QString UIWizardNewCloudVMSource::currentListWidgetData(QListWidget *pList)
    290276{
     
    489475    /* Translate provider label: */
    490476    m_pProviderLabel->setText(UIWizardNewCloudVM::tr("&Location:"));
    491     /* Translate received values of Location combo-box.
     477    /* Translate received values of Provider combo-box.
    492478     * 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());
    497484    }
    498485
     
    526513    m_pProviderLayout->setColumnMinimumWidth(0, iMaxWidth);
    527514    m_pOptionsLayout->setColumnMinimumWidth(0, iMaxWidth);
    528 
    529     /* Update tool-tips: */
    530     updateComboToolTip(m_pProviderComboBox);
    531515}
    532516
     
    576560void UIWizardNewCloudVMPageSource::sltHandleProviderComboChange()
    577561{
    578     /* Update combo tool-tip: */
    579     updateComboToolTip(m_pProviderComboBox);
    580 
    581562    /* Update wizard fields: */
    582563    wizard()->setProviderShortName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString());
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.h

    r103982 r104555  
    9292                                const QString &strImageId);
    9393
    94     /** Updates @a pCombo tool-tips. */
    95     void updateComboToolTip(QIComboBox *pCombo);
    96 
    9794    /** Returns current user data for @a pList specified. */
    9895    QString currentListWidgetData(QListWidget *pList);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette