VirtualBox

Changeset 22965 in vbox


Ignore:
Timestamp:
Sep 11, 2009 9:34:14 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: 4011: Network Settings UI: Few fixes for r52231 & r52237.

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

Legend:

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

    r22964 r22965  
    4444
    4545    /* Setup widgets */
    46     mCbName->setInsertPolicy (QComboBox::NoInsert);
     46    mCbAdapterName->setInsertPolicy (QComboBox::NoInsert);
    4747    mLeMAC->setValidator (new QRegExpValidator (QRegExp (
    4848                          "[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this));
     
    7878
    7979    /* Load adapter activity state */
    80     mGbAdapter->setChecked (aAdapter.GetEnabled());
     80    mCbEnableAdapter->setChecked (aAdapter.GetEnabled());
    8181
    8282    /* Load adapter type */
     
    109109
    110110    mLeMAC->setText (mAdapter.GetMACAddress());
    111     mCbCable->setChecked (mAdapter.GetCableConnected());
     111    mCbCableConnected->setChecked (mAdapter.GetCableConnected());
    112112}
    113113
     
    115115{
    116116    /* Save adapter activity state */
    117     mAdapter.SetEnabled (mGbAdapter->isChecked());
     117    mAdapter.SetEnabled (mCbEnableAdapter->isChecked());
    118118
    119119    /* Save adapter type */
     
    148148
    149149    mAdapter.SetMACAddress (mLeMAC->text().isEmpty() ? QString::null : mLeMAC->text());
    150     mAdapter.SetCableConnected (mCbCable->isChecked());
     150    mAdapter.SetCableConnected (mCbCableConnected->isChecked());
    151151}
    152152
     
    155155    mValidator = aValidator;
    156156
    157     connect (mGbAdapter, SIGNAL (toggled (bool)),
     157    connect (mCbEnableAdapter, SIGNAL (toggled (bool)),
    158158             mValidator, SLOT (revalidate()));
    159159    connect (mCbAttachmentType, SIGNAL (activated (const QString&)),
    160160             this, SLOT (updateAttachmentAlternative()));
    161     connect (mCbName, SIGNAL (activated (const QString&)),
     161    connect (mCbAdapterName, SIGNAL (activated (const QString&)),
    162162             this, SLOT (updateAlternativeName()));
    163     connect (mCbName, SIGNAL (editTextChanged (const QString&)),
     163    connect (mCbAdapterName, SIGNAL (editTextChanged (const QString&)),
    164164             this, SLOT (updateAlternativeName()));
    165165
     
    170170{
    171171    /* 'True' for disabled adapter */
    172     if (!mGbAdapter->isChecked())
     172    if (!mCbEnableAdapter->isChecked())
    173173        return true;
    174174
     
    210210QWidget* VBoxVMSettingsNetwork::setOrderAfter (QWidget *aAfter)
    211211{
    212     setTabOrder (aAfter, mGbAdapter);
    213     setTabOrder (mGbAdapter, mCbAttachmentType);
    214     setTabOrder (mCbAttachmentType, mCbName);
    215     setTabOrder (mCbName, mAbsAdvanced);
     212    setTabOrder (aAfter, mCbEnableAdapter);
     213    setTabOrder (mCbEnableAdapter, mCbAttachmentType);
     214    setTabOrder (mCbAttachmentType, mCbAdapterName);
     215    setTabOrder (mCbAdapterName, mAbsAdvanced);
    216216    setTabOrder (mAbsAdvanced, mCbAdapterType);
    217217    setTabOrder (mCbAdapterType, mLeMAC);
    218218    setTabOrder (mLeMAC, mTbMAC);
    219     setTabOrder (mTbMAC, mCbCable);
    220     return mCbCable;
     219    setTabOrder (mTbMAC, mCbCableConnected);
     220    return mCbCableConnected;
    221221}
    222222
     
    275275{
    276276    /* Blocking signals to change content manually */
    277     mCbName->blockSignals (true);
     277    mCbAdapterName->blockSignals (true);
    278278
    279279    /* Update alternative-name combo-box availability */
    280     mLbName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
    281                          attachmentType() != KNetworkAttachmentType_NAT);
    282     mCbName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
    283                          attachmentType() != KNetworkAttachmentType_NAT);
     280    mLbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
     281                                attachmentType() != KNetworkAttachmentType_NAT);
     282    mCbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
     283                                attachmentType() != KNetworkAttachmentType_NAT);
    284284
    285285    /* Refresh list */
    286     mCbName->clear();
     286    mCbAdapterName->clear();
    287287    switch (attachmentType())
    288288    {
    289289        case KNetworkAttachmentType_Bridged:
    290             mCbName->insertItems (0, mParent->brgList());
    291             mCbName->setEditable (false);
     290            mCbAdapterName->insertItems (0, mParent->brgList());
     291            mCbAdapterName->setEditable (false);
    292292            break;
    293293        case KNetworkAttachmentType_Internal:
    294             mCbName->insertItems (0, mParent->intList());
    295             mCbName->setEditable (true);
    296             mCbName->setCompleter (0);
     294            mCbAdapterName->insertItems (0, mParent->intList());
     295            mCbAdapterName->setEditable (true);
     296            mCbAdapterName->setCompleter (0);
    297297            break;
    298298        case KNetworkAttachmentType_HostOnly:
    299             mCbName->insertItems (0, mParent->hoiList());
    300             mCbName->setEditable (false);
     299            mCbAdapterName->insertItems (0, mParent->hoiList());
     300            mCbAdapterName->setEditable (false);
    301301            break;
    302302        default:
     
    305305
    306306    /* Prepend 'empty' or 'default' item */
    307     if (mCbName->count() == 0)
     307    if (mCbAdapterName->count() == 0)
    308308    {
    309309        switch (attachmentType())
     
    313313            {
    314314                /* Adapters list 'empty' */
    315                 int pos = mCbName->findData (emptyItemCode);
     315                int pos = mCbAdapterName->findData (emptyItemCode);
    316316                if (pos == -1)
    317                     mCbName->insertItem (0, tr ("Not selected", "network adapter name"), emptyItemCode);
     317                    mCbAdapterName->insertItem (0, tr ("Not selected", "network adapter name"), emptyItemCode);
    318318                else
    319                     mCbName->setItemText (pos, tr ("Not selected", "network adapter name"));
     319                    mCbAdapterName->setItemText (pos, tr ("Not selected", "network adapter name"));
    320320                break;
    321321            }
     
    323323            {
    324324                /* Internal network 'default' name */
    325                 if (mCbName->findText ("intnet") == -1)
    326                     mCbName->insertItem (0, "intnet");
     325                if (mCbAdapterName->findText ("intnet") == -1)
     326                    mCbAdapterName->insertItem (0, "intnet");
    327327                break;
    328328            }
     
    338338        case KNetworkAttachmentType_HostOnly:
    339339        {
    340             int pos = mCbName->findText (alternativeName());
    341             mCbName->setCurrentIndex (pos == -1 ? 0 : pos);
     340            int pos = mCbAdapterName->findText (alternativeName());
     341            mCbAdapterName->setCurrentIndex (pos == -1 ? 0 : pos);
    342342            break;
    343343        }
    344344        case KNetworkAttachmentType_Internal:
    345345        {
    346             int pos = mCbName->findText (alternativeName());
    347             mCbName->setCurrentIndex (pos == -1 ? 0 : pos);
     346            int pos = mCbAdapterName->findText (alternativeName());
     347            mCbAdapterName->setCurrentIndex (pos == -1 ? 0 : pos);
    348348            break;
    349349        }
     
    356356
    357357    /* Unblocking signals as content is changed already */
    358     mCbName->blockSignals (false);
     358    mCbAdapterName->blockSignals (false);
    359359}
    360360
     
    365365        case KNetworkAttachmentType_Bridged:
    366366        {
    367             QString newName (mCbName->itemData (mCbName->currentIndex()).toString() ==
     367            QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
    368368                             QString (emptyItemCode) ||
    369                              mCbName->currentText().isEmpty() ?
    370                              QString::null : mCbName->currentText());
     369                             mCbAdapterName->currentText().isEmpty() ?
     370                             QString::null : mCbAdapterName->currentText());
    371371            if (mBrgName != newName)
    372372                mBrgName = newName;
     
    375375        case KNetworkAttachmentType_Internal:
    376376        {
    377             QString newName ((mCbName->itemData (mCbName->currentIndex()).toString() ==
     377            QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
    378378                              QString (emptyItemCode) &&
    379                               mCbName->currentText() ==
    380                               mCbName->itemText (mCbName->currentIndex())) ||
    381                               mCbName->currentText().isEmpty() ?
    382                               QString::null : mCbName->currentText());
     379                              mCbAdapterName->currentText() ==
     380                              mCbAdapterName->itemText (mCbAdapterName->currentIndex())) ||
     381                              mCbAdapterName->currentText().isEmpty() ?
     382                              QString::null : mCbAdapterName->currentText());
    383383            if (mIntName != newName)
    384384            {
     
    391391        case KNetworkAttachmentType_HostOnly:
    392392        {
    393             QString newName (mCbName->itemData (mCbName->currentIndex()).toString() ==
     393            QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
    394394                             QString (emptyItemCode) ||
    395                              mCbName->currentText().isEmpty() ?
    396                              QString::null : mCbName->currentText());
     395                             mCbAdapterName->currentText().isEmpty() ?
     396                             QString::null : mCbAdapterName->currentText());
    397397            if (mHoiName != newName)
    398398                mHoiName = newName;
     
    409409void VBoxVMSettingsNetwork::toggleAdvanced()
    410410{
    411     mLbAType->setVisible (mAbsAdvanced->isExpanded());
     411    mLbAdapterType->setVisible (mAbsAdvanced->isExpanded());
    412412    mCbAdapterType->setVisible (mAbsAdvanced->isExpanded());
    413413    mLbMAC->setVisible (mAbsAdvanced->isExpanded());
    414414    mLeMAC->setVisible (mAbsAdvanced->isExpanded());
    415415    mTbMAC->setVisible (mAbsAdvanced->isExpanded());
    416     mCbCable->setVisible (mAbsAdvanced->isExpanded());
     416    mCbCableConnected->setVisible (mAbsAdvanced->isExpanded());
    417417}
    418418
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsNetwork.ui

    r22964 r22965  
    2929  <layout class="QGridLayout" name="VBoxVMSettingsNetworkGridLayout">
    3030   <item row="0" column="0" colspan="2">
    31     <widget class="QCheckBox" name="mGbAdapter" >
     31    <widget class="QCheckBox" name="mCbEnableAdapter" >
    3232     <property name="whatsThis" >
    3333      <string>When checked, plugs this virtual network adapter into the virtual machine.</string>
     
    6464      </property>
    6565      <item row="0" column="0" >
    66        <widget class="QLabel" name="mLbNAType">
     66       <widget class="QLabel" name="mLbAttachmentType">
    6767        <property name="text" >
    6868         <string>&amp;Attached to:</string>
     
    7979       <widget class="QComboBox" name="mCbAttachmentType">
    8080        <property name="sizePolicy">
    81          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     81         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
    8282          <horstretch>0</horstretch>
    8383          <verstretch>0</verstretch>
     
    9090      </item>
    9191      <item row="1" column="0" >
    92        <widget class="QLabel" name="mLbName">
     92       <widget class="QLabel" name="mLbAdapterName">
    9393        <property name="text" >
    9494         <string>&amp;Name:</string>
     
    9898        </property>
    9999        <property name="buddy" >
    100          <cstring>mCbName</cstring>
    101         </property>
    102        </widget>
    103       </item>
    104       <item row="1" column="1">
    105        <widget class="QComboBox" name="mCbName">
    106         <property name="sizePolicy">
    107          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
    108           <horstretch>0</horstretch>
     100         <cstring>mCbAdapterName</cstring>
     101        </property>
     102       </widget>
     103      </item>
     104      <item row="1" column="1" colspan="3">
     105       <widget class="QComboBox" name="mCbAdapterName">
     106        <property name="sizePolicy">
     107         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     108          <horstretch>1</horstretch>
    109109          <verstretch>0</verstretch>
    110110         </sizepolicy>
     
    116116      </item>
    117117      <item row="2" column="0">
    118        <widget class="QIArrowButtonSwitch" native="1" name="mAbsAdvanced">
    119         <property name="text">
    120          <string>A&amp;dvanced</string>
    121         </property>
    122         <property name="whatsThis" >
    123          <string>Shows/hide additional network adapter options.</string>
    124         </property>
    125        </widget>
     118       <layout class="QHBoxLayout" name="mLtAdvancedBtn">
     119        <property name="margin">
     120         <number>0</number>
     121        </property>
     122        <item>
     123         <spacer name="horizontalSpacer2">
     124          <property name="orientation">
     125           <enum>Qt::Horizontal</enum>
     126          </property>
     127          <property name="sizeHint" stdset="0">
     128           <size>
     129            <width>0</width>
     130            <height>0</height>
     131           </size>
     132          </property>
     133         </spacer>
     134        </item>
     135        <item>
     136         <widget class="QIArrowButtonSwitch" native="1" name="mAbsAdvanced">
     137          <property name="text">
     138           <string>A&amp;dvanced</string>
     139          </property>
     140          <property name="whatsThis" >
     141           <string>Shows/hide additional network adapter options.</string>
     142          </property>
     143         </widget>
     144        </item>
     145       </layout>
    126146      </item>
    127147      <item row="3" column="0">
    128        <widget class="QLabel" name="mLbAType">
     148       <widget class="QLabel" name="mLbAdapterType">
    129149        <property name="text">
    130150         <string>Adapter &amp;Type:</string>
     
    141161       <widget class="QComboBox" name="mCbAdapterType">
    142162        <property name="sizePolicy">
    143          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
    144           <horstretch>0</horstretch>
     163         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     164          <horstretch>1</horstretch>
    145165          <verstretch>0</verstretch>
    146166         </sizepolicy>
     
    168188        <property name="sizePolicy">
    169189         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
    170           <horstretch>0</horstretch>
     190          <horstretch>1</horstretch>
    171191          <verstretch>0</verstretch>
    172192         </sizepolicy>
     
    174194        <property name="whatsThis">
    175195         <string>Displays the MAC address of this adapter. It contains exactly 12 characters chosen from {0-9,A-F}. Note that the second character must be an even digit.</string>
    176         </property>
    177         <property name="frame">
    178          <bool>true</bool>
    179196        </property>
    180197       </widget>
     
    195212      </item>
    196213      <item row="5" column="1" colspan="3">
    197        <widget class="QCheckBox" name="mCbCable">
     214       <widget class="QCheckBox" name="mCbCableConnected">
    198215        <property name="whatsThis">
    199216         <string>Indicates whether the virtual network cable is plugged in on machine startup or not.</string>
     
    204221       </widget>
    205222      </item>
    206       <item rowspan="2" row="0" column="2" colspan="2">
    207        <spacer name="horizontalSpacer3">
    208         <property name="orientation">
    209          <enum>Qt::Horizontal</enum>
    210         </property>
    211         <property name="sizeHint" stdset="0">
    212          <size>
    213           <width>40</width>
    214           <height>20</height>
    215          </size>
    216         </property>
    217        </spacer>
    218       </item>
    219223     </layout>
    220224    </widget>
    221225   </item>
    222    <item row="1" column="2">
    223     <spacer name="horizontalSpacer2">
    224      <property name="orientation">
    225       <enum>Qt::Horizontal</enum>
    226      </property>
    227      <property name="sizeHint" stdset="0">
    228       <size>
    229        <width>0</width>
    230        <height>0</height>
    231       </size>
    232      </property>
    233     </spacer>
    234    </item>
    235    <item row="4" column="0" colspan="3">
     226   <item row="4" column="0" colspan="2">
    236227    <spacer name="verticalSpacer">
    237228     <property name="orientation">
     
    266257 <connections>
    267258  <connection>
    268    <sender>mGbAdapter</sender>
     259   <sender>mCbEnableAdapter</sender>
    269260   <signal>toggled(bool)</signal>
    270261   <receiver>mNetworkChild</receiver>
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