VirtualBox

Changeset 6993 in vbox


Ignore:
Timestamp:
Feb 18, 2008 1:49:09 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28188
Message:

2679: Add selector of NIC type to network configuration GUI.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h

    r6917 r6993  
    361361        AssertMsg (it != audioControllerTypes.end(), ("No value for {%s}", s.latin1()));
    362362        return CEnums::AudioControllerType (it - audioControllerTypes.begin());
     363    }
     364
     365    QString toString (CEnums::NetworkAdapterType t) const
     366    {
     367        AssertMsg (!networkAdapterTypes [t].isNull(), ("No text for %d", t));
     368        return networkAdapterTypes [t];
     369    }
     370
     371    CEnums::NetworkAdapterType toNetworkAdapterType (const QString &s) const
     372    {
     373        QStringVector::const_iterator it =
     374            qFind (networkAdapterTypes.begin(), networkAdapterTypes.end(), s);
     375        AssertMsg (it != networkAdapterTypes.end(), ("No value for {%s}", s.latin1()));
     376        return CEnums::NetworkAdapterType (it - networkAdapterTypes.begin());
    363377    }
    364378
     
    624638    QStringVector audioDriverTypes;
    625639    QStringVector audioControllerTypes;
     640    QStringVector networkAdapterTypes;
    626641    QStringVector networkAttachmentTypes;
    627642    QStringVector clipboardTypes;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r6917 r6993  
    748748    , audioDriverTypes (CEnums::AudioDriverType_COUNT)
    749749    , audioControllerTypes (CEnums::AudioControllerType_COUNT)
     750    , networkAdapterTypes (CEnums::NetworkAdapterType_COUNT)
    750751    , networkAttachmentTypes (CEnums::NetworkAttachmentType_COUNT)
    751752    , clipboardTypes (CEnums::ClipboardMode_COUNT)
     
    22502251        tr ("SoundBlaster 16", "AudioControllerType");
    22512252
     2253    networkAdapterTypes [CEnums::NetworkAdapterAm79C970A] =
     2254        tr ("PCnet-PCI II (Am79C970A)", "NetworkAdapterType");
     2255    networkAdapterTypes [CEnums::NetworkAdapterAm79C973] =
     2256        tr ("PCnet-FAST III (Am79C973)", "NetworkAdapterType");
     2257    networkAdapterTypes [CEnums::NetworkAdapter82540EM] =
     2258        tr ("E1000 PRO MT Desktop (82540EM)", "NetworkAdapterType");
     2259
    22522260    networkAttachmentTypes [CEnums::NoNetworkAttachment] =
    22532261        tr ("Not attached", "NetworkAttachmentType");
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui

    r6383 r6993  
    7878                            <cstring>unnamed</cstring>
    7979                        </property>
    80                         <widget class="QLabel" row="1" column="0">
     80                        <widget class="QLabel" row="2" column="0">
    8181                            <property name="name">
    8282                                <cstring>txHostInterface_WIN</cstring>
     
    9797                            </property>
    9898                        </widget>
    99                         <widget class="QLabel" row="2" column="0">
     99                        <widget class="QLabel" row="3" column="0">
    100100                            <property name="name">
    101101                                <cstring>txInternalNetwork</cstring>
     
    116116                            </property>
    117117                        </widget>
    118                         <widget class="QLineEdit" row="3" column="1">
     118                        <widget class="QLineEdit" row="4" column="1">
    119119                            <property name="name">
    120120                                <cstring>leMACAddress</cstring>
     
    138138                            </property>
    139139                        </widget>
     140                        <widget class="QLabel" row="0" column="0">
     141                            <property name="name">
     142                                <cstring>txAdapterType</cstring>
     143                            </property>
     144                            <property name="sizePolicy">
     145                                <sizepolicy>
     146                                    <hsizetype>0</hsizetype>
     147                                    <vsizetype>0</vsizetype>
     148                                    <horstretch>0</horstretch>
     149                                    <verstretch>0</verstretch>
     150                                </sizepolicy>
     151                            </property>
     152                            <property name="text">
     153                                <string>Adapter &amp;type</string>
     154                            </property>
     155                            <property name="buddy" stdset="0">
     156                                <cstring>cbAdapterType</cstring>
     157                            </property>
     158                        </widget>
    140159                        <widget class="QComboBox" row="0" column="1" rowspan="1" colspan="2">
    141160                            <property name="name">
     161                                <cstring>cbAdapterType</cstring>
     162                            </property>
     163                            <property name="whatsThis" stdset="0">
     164                                <string>Type of the virtual network adapter. Depending on this value, VirtualBox will provide a different virtual network hardware to the guest.</string>
     165                            </property>
     166                        </widget>
     167                        <widget class="QComboBox" row="1" column="1" rowspan="1" colspan="2">
     168                            <property name="name">
    142169                                <cstring>cbNetworkAttachment</cstring>
    143170                            </property>
    144171                            <property name="whatsThis" stdset="0">
    145                                     <string>Controls the way how this virtual adapter is attached to the real network of the Host OS.</string>
    146                             </property>
    147                         </widget>
    148                         <widget class="QToolButton" row="3" column="2">
     172                                <string>Controls the way how this virtual adapter is attached to the real network of the Host OS.</string>
     173                            </property>
     174                        </widget>
     175                        <widget class="QToolButton" row="4" column="2">
    149176                            <property name="name">
    150177                                <cstring>pbGenerateMAC</cstring>
     
    168195                            </property>
    169196                        </widget>
    170                         <widget class="QLabel" row="0" column="0">
     197                        <widget class="QLabel" row="1" column="0">
    171198                            <property name="name">
    172199                                <cstring>txNetworkAttachment</cstring>
     
    187214                            </property>
    188215                        </widget>
    189                         <widget class="QLabel" row="3" column="0">
     216                        <widget class="QLabel" row="4" column="0">
    190217                            <property name="name">
    191218                                <cstring>txMACAddress</cstring>
     
    206233                            </property>
    207234                        </widget>
    208                         <widget class="QComboBox" row="1" column="1" rowspan="1" colspan="2">
     235                        <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="2">
    209236                            <property name="name">
    210237                                <cstring>cbHostInterfaceName</cstring>
     
    214241                            </property>
    215242                        </widget>
    216                         <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="2">
     243                        <widget class="QComboBox" row="3" column="1" rowspan="1" colspan="2">
    217244                            <property name="name">
    218245                                <cstring>cbInternalNetworkName</cstring>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui.h

    r6383 r6993  
    2828void VBoxVMNetworkSettings::init()
    2929{
     30    cbAdapterType->insertItem (vboxGlobal().toString (CEnums::NetworkAdapterAm79C970A));
     31    cbAdapterType->insertItem (vboxGlobal().toString (CEnums::NetworkAdapterAm79C973));
     32    cbAdapterType->insertItem (vboxGlobal().toString (CEnums::NetworkAdapter82540EM));
     33
    3034    leMACAddress->setValidator (new QRegExpValidator
    3135                                (QRegExp ("[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this));
     
    135139    grbEnabled->setChecked (adapter.GetEnabled());
    136140
     141    cbAdapterType->setCurrentText (vboxGlobal().
     142        toString (adapter.GetAdapterType()));
     143
    137144    CEnums::NetworkAttachmentType type = adapter.GetAttachmentType();
    138145    cbNetworkAttachment->setCurrentItem (0);
     
    175182    cadapter.SetEnabled (grbEnabled->isChecked());
    176183
     184    cadapter.SetAdapterType (vboxGlobal().
     185        toNetworkAdapterType (cbAdapterType->currentText()));
     186
    177187    CEnums::NetworkAttachmentType type =
    178188        vboxGlobal().toNetworkAttachmentType (cbNetworkAttachment->currentText());
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