VirtualBox

Changeset 80214 in vbox


Ignore:
Timestamp:
Aug 9, 2019 4:59:34 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132659
Message:

FE/Qt: bugref:7720: UINetworkAttachmentEditor: Validation check and label layout fixes.

File:
1 edited

Legend:

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

    r80213 r80214  
    252252        /* Create type label: */
    253253        if (m_fWithLabels)
     254        {
    254255            m_pLabelType = new QLabel(this);
     256            m_pLabelType->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
     257        }
    255258        if (m_pLabelType)
    256259            pMainLayout->addWidget(m_pLabelType, 0, iColumn++);
     
    283286        /* Create name label: */
    284287        if (m_fWithLabels)
     288        {
    285289            m_pLabelName = new QLabel(this);
     290            m_pLabelName->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
     291        }
    286292        if (m_pLabelName)
    287293            pMainLayout->addWidget(m_pLabelName, 1, iColumn++);
     
    447453void UINetworkAttachmentEditor::revalidate()
    448454{
    449     /// @todo Implement validation!
    450     emit sigValidChanged(true);
     455    bool fSuccess = false;
     456    switch (valueType())
     457    {
     458        case KNetworkAttachmentType_Bridged:
     459        case KNetworkAttachmentType_Internal:
     460        case KNetworkAttachmentType_HostOnly:
     461        case KNetworkAttachmentType_Generic:
     462        case KNetworkAttachmentType_NATNetwork:
     463            fSuccess = !valueName(valueType()).isEmpty();
     464            break;
     465        default:
     466            fSuccess = true;
     467            break;
     468    }
     469    emit sigValidChanged(fSuccess);
    451470}
    452471
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