VirtualBox

Changeset 75051 in vbox


Ignore:
Timestamp:
Oct 24, 2018 4:22:42 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126098
Message:

FE/Qt: bugref:9152: Forgot to apply mask to tool-tip as well, (s.a. r126091).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r75046 r75051  
    578578            {
    579579                if (!m_strOrigValue.isEmpty())
    580                     value = UIApplianceEditorWidget::tr("<b>Original Value:</b> %1").arg(m_strOrigValue);
     580                {
     581                    /* Prepare tool-tip pattern/body: */
     582                    const QString strToolTipPattern = UIApplianceEditorWidget::tr("<b>Original Value:</b> %1");
     583                    QString strToolTipBody;
     584
     585                    /* Handle certain VSD types separately: */
     586                    switch (m_enmVSDType)
     587                    {
     588                        case KVirtualSystemDescriptionType_CloudOCIInstanceShape:
     589                        case KVirtualSystemDescriptionType_CloudOCIDomain:
     590                        case KVirtualSystemDescriptionType_CloudOCIBootDiskSize:
     591                        case KVirtualSystemDescriptionType_CloudOCIBucket:
     592                        case KVirtualSystemDescriptionType_CloudOCIVCN:
     593                        {
     594                            /* Get VSD type hint and check which kind of data it is.
     595                             * These VSD types can have masks if represented by arrays. */
     596                            const QVariant get = m_pParent->getHint(m_enmVSDType);
     597                            switch (m_pParent->kindHint(m_enmVSDType))
     598                            {
     599                                case ParameterKind_Array:
     600                                {
     601                                    QString strMask;
     602                                    AbstractVSDParameterArray array = get.value<AbstractVSDParameterArray>();
     603                                    /* Every array member is a complex value, - string pair,
     604                                     * "first" is always present while "second" can be null. */
     605                                    foreach (const QIStringPair &pair, array.values)
     606                                    {
     607                                        /* If "second" isn't null & equal to m_strOrigValue => return "first": */
     608                                        if (!pair.second.isNull() && pair.second == m_strOrigValue)
     609                                        {
     610                                            strMask = pair.first;
     611                                            break;
     612                                        }
     613                                    }
     614                                    /* Use mask if found: */
     615                                    if (!strMask.isNull())
     616                                        strToolTipBody = strMask;
     617                                    break;
     618                                }
     619                                default:
     620                                    break;
     621                            }
     622                            break;
     623                        }
     624                        default:
     625                            break;
     626                    }
     627
     628                    /* Make sure we have at least something: */
     629                    if (strToolTipBody.isNull())
     630                        strToolTipBody = m_strOrigValue;
     631                    /* Compose tool-tip finally: */
     632                    value = strToolTipPattern.arg(strToolTipBody);
     633                }
    581634            }
    582635            break;
Note: See TracChangeset for help on using the changeset viewer.

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