VirtualBox

Changeset 6376 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 18, 2008 2:01:16 PM (17 years ago)
Author:
vboxsync
Message:

1905: Add GUI support for internal network name:

Internal network name set on one of the adapter pages now instantly becomes available in other pages' combo-boxes (even before OK is pressed).

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

Legend:

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

    r6372 r6376  
    135135#endif
    136136    Assert (cbNetworkName);
     137    QString curText = cbNetworkName->currentText();
    137138    cbNetworkName->clear();
    138139    cbNetworkName->clearEdit();
    139140    cbNetworkName->insertStringList (aList);
     141    cbNetworkName->setCurrentText (curText);
    140142}
    141143
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui

    r6364 r6376  
    32203220    <variable access="private">bool mAllowResetFirstRunFlag;</variable>
    32213221    <variable access="private">bool mResetFirstRunFlag;</variable>
     3222    <variable access="private">bool mLockNetworkListUpdate;</variable>
    32223223</variables>
    32233224<slots>
     
    32333234    <slot>showVDImageManager( QUuid *id, VBoxMediaComboBox *le, QLabel *tx = NULL )</slot>
    32343235    <slot>addNetworkAdapter( const CNetworkAdapter &amp; )</slot>
     3236    <slot>updateNetworksList()</slot>
    32353237    <slot>addSerialPort( const CSerialPort &amp; )</slot>
    32363238    <slot>addParallelPort( const CParallelPort &amp; )</slot>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h

    r6372 r6376  
    10401040        }
    10411041    }
     1042    mLockNetworkListUpdate = false;
    10421043}
    10431044
     
    23652366             wval, SLOT (revalidate()));
    23662367    connect (cbNetworkName, SIGNAL (textChanged (const QString &)),
     2368             this, SLOT (updateNetworksList()));
     2369    connect (cbNetworkName, SIGNAL (textChanged (const QString &)),
    23672370             wval, SLOT (revalidate()));
    23682371    connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)),
     
    23842387
    23852388#endif
     2389}
     2390
     2391void VBoxVMSettingsDlg::updateNetworksList()
     2392{
     2393    if (mLockNetworkListUpdate)
     2394        return;
     2395    mLockNetworkListUpdate = true;
     2396
     2397    QStringList curList (mNetworksList);
     2398    for (int index = 0; index < tbwNetwork->count(); ++ index)
     2399    {
     2400        VBoxVMNetworkSettings *pg = tbwNetwork->page (index) ?
     2401            static_cast <VBoxVMNetworkSettings*> (tbwNetwork->page (index)) : 0;
     2402        if (pg)
     2403        {
     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();
     2412            if (!curText.isEmpty() && !curList.contains (curText))
     2413                curList << curText;
     2414        }
     2415    }
     2416
     2417    for (int index = 0; index < tbwNetwork->count(); ++ index)
     2418    {
     2419        VBoxVMNetworkSettings *pg = tbwNetwork->page (index) ?
     2420            static_cast <VBoxVMNetworkSettings*> (tbwNetwork->page (index)) : 0;
     2421        pg->loadNetworksList (curList);
     2422    }
     2423
     2424    mLockNetworkListUpdate = false;
    23862425}
    23872426
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