VirtualBox

Changeset 6378 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 18, 2008 2:47:11 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27321
Message:

1905: Add GUI support for internal network name:

Moving "Internal Network Name" combo-box under linux at the same position as under windows (it.et. make this combo shared for all os).

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

Legend:

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

    r6372 r6378  
    9999                        <widget class="QLabel" row="2" column="0">
    100100                            <property name="name">
    101                                 <cstring>txInternalNetwork_WIN</cstring>
     101                                <cstring>txInternalNetwork</cstring>
    102102                            </property>
    103103                            <property name="sizePolicy">
     
    113113                            </property>
    114114                            <property name="buddy" stdset="0">
    115                                 <cstring>cbInternalNetworkName_WIN</cstring>
     115                                <cstring>cbInternalNetworkName</cstring>
    116116                            </property>
    117117                        </widget>
     
    216216                        <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="2">
    217217                            <property name="name">
    218                                 <cstring>cbInternalNetworkName_WIN</cstring>
     218                                <cstring>cbInternalNetworkName</cstring>
    219219                            </property>
    220220                            <property name="editable">
     
    566566                </widget>
    567567            </vbox>
    568         </widget>
    569         <widget class="QGroupBox">
    570             <property name="name">
    571                 <cstring>grbIntNet</cstring>
    572             </property>
    573             <property name="title">
    574                 <string>Internal Network Settings</string>
    575             </property>
    576             <property name="flat">
    577                 <bool>false</bool>
    578             </property>
    579             <hbox>
    580                 <property name="name">
    581                     <cstring>unnamed</cstring>
    582                 </property>
    583                 <widget class="QLabel">
    584                     <property name="name">
    585                         <cstring>txInternalNetwork_X11</cstring>
    586                     </property>
    587                     <property name="text">
    588                         <string>&amp;Network Name</string>
    589                     </property>
    590                     <property name="buddy" stdset="0">
    591                         <cstring>cbInternalNetworkName_X11</cstring>
    592                     </property>
    593                 </widget>
    594                 <widget class="QComboBox">
    595                     <property name="name">
    596                         <cstring>cbInternalNetworkName_X11</cstring>
    597                     </property>
    598                     <property name="editable">
    599                         <bool>true</bool>
    600                     </property>
    601                     <property name="insertionPolicy">
    602                         <enum>NoInsertion</enum>
    603                     </property>
    604                     <property name="autoCompletion">
    605                         <bool>true</bool>
    606                     </property>
    607                     <property name="duplicatesEnabled">
    608                         <bool>false</bool>
    609                     </property>
    610                 </widget>
    611             </hbox>
    612568        </widget>
    613569        <spacer>
     
    659615    <tabstop>cbNetworkAttachment</tabstop>
    660616    <tabstop>cbHostInterfaceName</tabstop>
    661     <tabstop>cbInternalNetworkName_WIN</tabstop>
     617    <tabstop>cbInternalNetworkName</tabstop>
    662618    <tabstop>leMACAddress</tabstop>
    663619</tabstops>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui.h

    r6376 r6378  
    5050    /* disable unused interface name UI */
    5151    grbTAP->setHidden (true);
    52     grbIntNet->setHidden (true);
    5352    connect (grbEnabled, SIGNAL (toggled (bool)),
    5453             this, SLOT (grbEnabledToggled (bool)));
     
    5756    txHostInterface_WIN->setHidden (true);
    5857    cbHostInterfaceName->setHidden (true);
    59     txInternalNetwork_WIN->setHidden (true);
    60     cbInternalNetworkName_WIN->setHidden (true);
    6158    /* setup iconsets */
    6259    pbTAPSetup->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png",
     
    8481        isInterfaceInvalid (aList, cbHostInterfaceName->currentText()))
    8582        return IncorrectInterface;
    86     else if (type == CEnums::InternalNetworkAttachment &&
    87              cbInternalNetworkName_WIN->currentText().isEmpty())
     83    else
     84#else
     85    NOREF (aList);
     86#endif
     87    if (type == CEnums::InternalNetworkAttachment &&
     88        cbInternalNetworkName->currentText().isEmpty())
    8889        return MissedNetworkName;
    8990    else
    9091        return NoErrors;
    91 #else
    92     NOREF (aList);
    93     if (type == CEnums::InternalNetworkAttachment &&
    94         cbInternalNetworkName_X11->currentText().isEmpty())
    95         return MissedNetworkName;
    96     else
    97         return NoErrors;
    98 #endif
    9992}
    10093
     
    128121void VBoxVMNetworkSettings::loadNetworksList (const QStringList &aList)
    129122{
    130     QComboBox *cbNetworkName = 0;
    131 #if defined Q_WS_WIN
    132     cbNetworkName = cbInternalNetworkName_WIN;
    133 #else
    134     cbNetworkName = cbInternalNetworkName_X11;
    135 #endif
    136     Assert (cbNetworkName);
    137     QString curText = cbNetworkName->currentText();
    138     cbNetworkName->clear();
    139     cbNetworkName->clearEdit();
    140     cbNetworkName->insertStringList (aList);
    141     cbNetworkName->setCurrentText (curText);
     123    QString curText = cbInternalNetworkName->currentText();
     124    cbInternalNetworkName->clear();
     125    cbInternalNetworkName->clearEdit();
     126    cbInternalNetworkName->insertStringList (aList);
     127    cbInternalNetworkName->setCurrentText (curText);
    142128}
    143129
     
    172158    if (cbHostInterfaceName->currentItem() == -1)
    173159        cbHostInterfaceName->setCurrentText (name);
    174     cbInternalNetworkName_WIN->setCurrentText (adapter.GetInternalNetwork());
    175160#else
    176161    leHostInterface->setText (adapter.GetHostInterface());
    177     cbInternalNetworkName_X11->setCurrentText (adapter.GetInternalNetwork());
    178 #endif
     162#endif
     163    cbInternalNetworkName->setCurrentText (adapter.GetInternalNetwork());
    179164
    180165#if defined Q_WS_X11
     
    232217    }
    233218    else if (type == CEnums::InternalNetworkAttachment)
    234     {
    235 #if defined Q_WS_WIN
    236         if (!cbInternalNetworkName_WIN->currentText().isEmpty())
    237             cadapter.SetInternalNetwork (cbInternalNetworkName_WIN->currentText());
    238 #else
    239         if (!cbInternalNetworkName_X11->currentText().isEmpty())
    240             cadapter.SetInternalNetwork (cbInternalNetworkName_X11->currentText());
    241 #endif
    242     }
     219        cadapter.SetInternalNetwork (cbInternalNetworkName->currentText());
    243220}
    244221
     
    275252    txHostInterface_WIN->setEnabled (enableHostIf);
    276253    cbHostInterfaceName->setEnabled (enableHostIf);
    277     txInternalNetwork_WIN->setEnabled (enableIntNet);
    278     cbInternalNetworkName_WIN->setEnabled (enableIntNet);
    279254#else
    280255    grbTAP->setEnabled (enableHostIf);
    281     grbIntNet->setEnabled (enableIntNet);
    282 #endif
     256#endif
     257    txInternalNetwork->setEnabled (enableIntNet);
     258    cbInternalNetworkName->setEnabled (enableIntNet);
    283259}
    284260
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h

    r6376 r6378  
    23482348
    23492349    /* setup validation */
    2350     QComboBox *cbNetworkName = 0;
    2351 #ifdef Q_WS_WIN
    2352     cbNetworkName = page->cbInternalNetworkName_WIN;
    2353 #else
    2354     cbNetworkName = page->cbInternalNetworkName_X11;
    2355 #endif
    2356     Assert (cbNetworkName);
    2357 
    23582350    QIWidgetValidator *wval =
    23592351        new QIWidgetValidator (QString ("%1: %2")
     
    23632355    connect (page->cbNetworkAttachment, SIGNAL (activated (const QString &)),
    23642356             wval, SLOT (revalidate()));
    2365     connect (cbNetworkName, SIGNAL (activated (const QString &)),
     2357    connect (page->cbInternalNetworkName, SIGNAL (activated (const QString &)),
    23662358             wval, SLOT (revalidate()));
    2367     connect (cbNetworkName, SIGNAL (textChanged (const QString &)),
     2359    connect (page->cbInternalNetworkName, SIGNAL (textChanged (const QString &)),
    23682360             this, SLOT (updateNetworksList()));
    2369     connect (cbNetworkName, SIGNAL (textChanged (const QString &)),
     2361    connect (page->cbInternalNetworkName, SIGNAL (textChanged (const QString &)),
    23702362             wval, SLOT (revalidate()));
    23712363    connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)),
     
    24022394        if (pg)
    24032395        {
    2404             QComboBox *cb = 0;
    2405 #if defined Q_WS_WIN
    2406             cb = pg->cbInternalNetworkName_WIN;
    2407 #else
    2408             cb = pg->cbInternalNetworkName_X11;
    2409 #endif
    2410             Assert (cb);
    2411             QString curText = cb->currentText();
     2396            QString curText = pg->cbInternalNetworkName->currentText();
    24122397            if (!curText.isEmpty() && !curList.contains (curText))
    24132398                curList << curText;
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