VirtualBox

Changeset 8474 in vbox for trunk/src


Ignore:
Timestamp:
Apr 29, 2008 3:48:12 PM (17 years ago)
Author:
vboxsync
Message:

#2796: Network adapter UI misbehavior: fixed, but please check the behavior of interface combo-box now, it becomes editable.

Location:
trunk/src/VBox/Frontends/VirtualBox/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui

    r8155 r8474  
    240240                            <property name="name">
    241241                                <cstring>cbHostInterfaceName</cstring>
     242                            </property>
     243                            <property name="editable">
     244                                <bool>true</bool>
     245                            </property>
     246                            <property name="insertionPolicy">
     247                                <enum>NoInsertion</enum>
    242248                            </property>
    243249                            <property name="whatsThis" stdset="0">
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui.h

    r8452 r8474  
    8787    KNetworkAttachmentType type =
    8888        vboxGlobal().toNetworkAttachmentType (cbNetworkAttachment->currentText());
     89    if (!grbEnabled->isChecked())
     90        return CheckPage_Ok;
     91    else
    8992#if defined Q_WS_WIN
    9093    if (type == KNetworkAttachmentType_HostInterface &&
     
    112115    /* load current list items */
    113116    if (aList.count())
    114     {
    115117        cbHostInterfaceName->insertStringList (aList);
    116         int index = aList.findIndex (currentListItemName);
    117         if (index != -1)
    118             cbHostInterfaceName->setCurrentItem (index);
    119     }
    120     else
    121     {
     118    else
    122119        cbHostInterfaceName->insertItem (aNillItem);
     120
     121    if (currentListItemName.isEmpty() || currentListItemName == aNillItem)
    123122        cbHostInterfaceName->setCurrentItem (0);
    124     }
     123    else
     124        cbHostInterfaceName->setCurrentText (currentListItemName);
    125125#else
    126126    NOREF (aList);
     
    162162
    163163#if defined Q_WS_WIN
    164     QString name = adapter.GetHostInterface();
    165     for (int index = 0; index < cbHostInterfaceName->count(); ++ index)
    166         if (cbHostInterfaceName->text (index) == name)
    167         {
    168             cbHostInterfaceName->setCurrentItem (index);
    169             break;
    170         }
    171     if (cbHostInterfaceName->currentItem() == -1)
    172         cbHostInterfaceName->setCurrentText (name);
     164    if (!adapter.GetHostInterface().isEmpty())
     165        cbHostInterfaceName->setCurrentText (adapter.GetHostInterface());
    173166#else
    174167    leHostInterface->setText (adapter.GetHostInterface());
     
    249242{
    250243#if defined Q_WS_WIN
    251     if (!aOn)
    252     {
    253         cbNetworkAttachment->setCurrentItem (0);
    254         cbNetworkAttachment_activated (cbNetworkAttachment->currentText());
    255     }
     244    cbNetworkAttachment_activated (cbNetworkAttachment->currentText());
    256245#else
    257246    NOREF (aOn);
     
    261250void VBoxVMNetworkSettings::cbNetworkAttachment_activated (const QString &aString)
    262251{
    263     bool enableHostIf = vboxGlobal().toNetworkAttachmentType (aString) ==
     252    bool enableHostIf = grbEnabled->isChecked() &&
     253                        vboxGlobal().toNetworkAttachmentType (aString) ==
    264254                        KNetworkAttachmentType_HostInterface;
    265     bool enableIntNet = vboxGlobal().toNetworkAttachmentType (aString) ==
     255    bool enableIntNet = grbEnabled->isChecked() &&
     256                        vboxGlobal().toNetworkAttachmentType (aString) ==
    266257                        KNetworkAttachmentType_Internal;
    267258#if defined Q_WS_WIN
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