VirtualBox

儲存庫 vbox 的更動 18235


忽略:
時間撮記:
2009-3-25 上午02:42:57 (16 年 以前)
作者:
vboxsync
訊息:

FE/Qt4: 2869: Rework network adapter UI - Host-only Interface settings moved to Global Settings.

位置:
trunk/src/VBox/Frontends/VirtualBox
檔案:
新增 6 筆資料
修改 10 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r18071 r18235  
    284284        include/VBoxGLSettingsUpdate.h \
    285285        include/VBoxGLSettingsLanguage.h \
     286        include/VBoxGLSettingsNetwork.h \
     287        include/VBoxGLSettingsNetworkDetails.h \
    286288        include/VBoxSettingsDialog.h \
    287289        include/VBoxSettingsDialogSpecific.h \
     
    366368        src/VBoxGLSettingsUpdate.cpp \
    367369        src/VBoxGLSettingsLanguage.cpp \
     370        src/VBoxGLSettingsNetwork.cpp \
     371        src/VBoxGLSettingsNetworkDetails.cpp \
    368372        src/VBoxSettingsDialog.cpp \
    369373        src/VBoxSettingsDialogSpecific.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro

    r17784 r18235  
    5757    ui/VBoxGLSettingsUpdate.ui \
    5858    ui/VBoxGLSettingsLanguage.ui \
     59    ui/VBoxGLSettingsNetwork.ui \
     60    ui/VBoxGLSettingsNetworkDetails.ui \
    5961    ui/VBoxImportApplianceWgt.ui \
    6062    ui/VBoxImportApplianceWzd.ui \
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxSettingsDialog.h

    r14339 r18235  
    2424#define __VBoxSettingsDialog_h__
    2525
    26 #include "VBoxSettingsDialog.gen.h"
     26/* VBox includes */
    2727#include "QIMainDialog.h"
    2828#include "QIWithRetranslateUI.h"
     29#include "VBoxSettingsDialog.gen.h"
    2930
     31/* Qt forwards */
     32class QIWidgetValidator;
     33class QStackedWidget;
     34class QTimer;
     35
     36/* VBox forwards*/
    3037class VBoxWarnIconLabel;
    31 class QIWidgetValidator;
    3238class VBoxSettingsSelector;
    33 class QTimer;
    34 class QStackedWidget;
     39class VBoxSettingsPage;
    3540
    3641/*
     
    5257protected slots:
    5358
    54     virtual void revalidate (QIWidgetValidator * /* aWval */) {}
     59    virtual void revalidate (QIWidgetValidator *aWval);
    5560    void categoryChanged (int aId);
    5661
     
    6469    void setError (const QString &aError);
    6570    void setWarning (const QString &aWarning);
     71
     72    void addItem (const QString &aBigIcon, const QString &aBigIconDisabled,
     73                  const QString &aSmallIcon, const QString &aSmallIconDisabled,
     74                  int aId, const QString &aLink,
     75                  VBoxSettingsPage* aPrefPage = NULL, int aParentId = -1);
    6676
    6777    VBoxSettingsSelector *mSelector;
     
    7888    bool eventFilter (QObject *aObject, QEvent *aEvent);
    7989    void showEvent (QShowEvent *aEvent);
     90
     91    VBoxSettingsPage* attachValidator (VBoxSettingsPage *aPage);
    8092
    8193    /* Flags */
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxSettingsDialogSpecific.h

    r12130 r18235  
    2424#define __VBoxSettingsDialogSpecific_h__
    2525
     26#include "COMDefs.h"
    2627#include "VBoxSettingsDialog.h"
    27 #include "COMDefs.h"
    28 
    29 class VBoxGlobalSettings;
    30 class VBoxSettingsPage;
    3128
    3229/*
     
    4643        UpdateId,
    4744        LanguageId,
    48         USBId
     45        USBId,
     46        NetworkId
    4947    };
    5048
     
    9593                       const QString &aCategory, const QString &aControl);
    9694
    97 protected slots:
    98 
    99     void revalidate (QIWidgetValidator *aWval);
    100 
    10195protected:
    10296
     
    115109private:
    116110
    117     void addItem (const QString &aBigIcon, const QString &aBigIconDisabled, const QString &aSmallIcon, const QString &aSmallIconDisabled, int aId, const QString &aLink, VBoxSettingsPage* aPrefPage = NULL, int aParentId = -1);
    118111    void updateAvailability();
    119     VBoxSettingsPage* attachValidator (VBoxSettingsPage *aPage);
    120112
    121113    CMachine mMachine;
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsNetworkDetails.h

    r17789 r18235  
    5656
    5757    void accept();
    58     void hostOnlyInterfaceChanged();
    59     void hostOnlyDHCPChanged();
    6058    void genMACClicked();
    61 #if defined (Q_WS_WIN32)
    62     void addInterface();
    63     void delInterface();
    64 #endif
    6559
    6660private:
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSettingsDialog.cpp

    r17150 r18235  
    3535/* Qt includes */
    3636#include <QTimer>
    37 #include <QPushButton>
    3837#include <QStackedWidget>
    3938
     
    4342
    4443VBoxSettingsDialog::VBoxSettingsDialog (QWidget *aParent /* = NULL */)
    45     : QIWithRetranslateUI<QIMainDialog> (aParent)
     44    : QIWithRetranslateUI <QIMainDialog> (aParent)
    4645    , mPolished (false)
    4746    , mValid (true)
     
    6867    mLbTitle->setFont (f);
    6968
    70     QGridLayout *mainLayout = static_cast<QGridLayout*> (mAllWidget->layout());
     69    QGridLayout *mainLayout = static_cast <QGridLayout*> (mAllWidget->layout());
    7170#ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
    7271    mLbTitle->hide();
    7372    mLbWhatsThis->hide();
    7473    mSelector = new VBoxSettingsToolBarSelector (this);
    75     static_cast<VBoxToolBar*> (mSelector->widget())->setMacToolbar();
    76     addToolBar (qobject_cast<QToolBar*> (mSelector->widget()));
     74    static_cast <VBoxToolBar*> (mSelector->widget())->setMacToolbar();
     75    addToolBar (qobject_cast <QToolBar*> (mSelector->widget()));
    7776    /* No title in this mode, we change the title of the window. */
    7877    mainLayout->setColumnMinimumWidth (0, 0);
     
    124123}
    125124
     125void VBoxSettingsDialog::revalidate (QIWidgetValidator *aWval)
     126{
     127    /* Perform validations for particular page */
     128    VBoxSettingsPage *page = qobject_cast <VBoxSettingsPage*> (aWval->widget());
     129    AssertMsg (page, ("Every validator should corresponds a page!\n"));
     130
     131    QString warning;
     132    QString title = mSelector->itemTextByPage (page);
     133    bool valid = page->revalidate (warning, title);
     134    warning = warning.isEmpty() ? QString::null :
     135        tr ("On the <b>%1</b> page, %2").arg (title, warning);
     136    aWval->setLastWarning (warning);
     137    valid ? setWarning (warning) : setError (warning);
     138
     139    aWval->setOtherValid (valid);
     140}
     141
     142void VBoxSettingsDialog::categoryChanged (int aId)
     143{
     144    QWidget *rootPage = mSelector->rootPage (aId);
     145#ifndef Q_WS_MAC
     146    mLbTitle->setText (mSelector->itemText (aId));
     147    mStack->setCurrentIndex (mStack->indexOf (rootPage));
     148#else /* Q_WS_MAC */
     149    QSize cs = size();
     150    /* First make all fully resizeable */
     151    setMinimumSize (QSize (minimumWidth(), 0));
     152    setMaximumSize (QSize (minimumWidth(), QWIDGETSIZE_MAX));
     153    for (int i = 0; i < mStack->count(); ++i)
     154        mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Ignored);
     155    int a = mStack->indexOf (rootPage);
     156    if (a < mSizeList.count())
     157    {
     158        QSize ss = mSizeList.at (a);
     159        mStack->widget (a)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred);
     160        /* Switch to the new page first if we are shrinking */
     161        if (cs.height() > ss.height())
     162            mStack->setCurrentIndex (mStack->indexOf (rootPage));
     163        /* Do the animation */
     164        ::darwinWindowAnimateResize (this, QRect (x(), y(),
     165                                                  ss.width(), ss.height()));
     166        /* Switch to the new page last if we are zooming */
     167        if (cs.height() <= ss.height())
     168            mStack->setCurrentIndex (mStack->indexOf (rootPage));
     169        /* Make the widget fixed size */
     170        setFixedSize (ss);
     171    }
     172    ::darwinSetShowsResizeIndicator (this, false);
     173#endif /* !Q_WS_MAC */
     174# ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
     175    setWindowTitle (dialogTitle());
     176# endif
     177}
     178
    126179void VBoxSettingsDialog::retranslateUi()
    127180{
     
    136189        mIconLabel->setWarningText (mWarnHint);
    137190
    138     QList<QIWidgetValidator*> vlist = findChildren<QIWidgetValidator*>();
     191    QList <QIWidgetValidator*> vlist = findChildren <QIWidgetValidator*> ();
    139192
    140193    /* Rename all validators to make them feat new language. */
    141194    foreach (QIWidgetValidator *wval, vlist)
    142195        wval->setCaption (mSelector->itemTextByPage (
    143             qobject_cast<VBoxSettingsPage*> (wval->widget())));
     196            qobject_cast <VBoxSettingsPage*> (wval->widget())));
    144197
    145198    /* Revalidate all pages to retranslate the warning messages also. */
     
    147200        if (!wval->isValid())
    148201            revalidate (wval);
     202}
     203
     204QString VBoxSettingsDialog::titleExtension() const
     205{
     206#ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
     207    return mSelector->itemText (mSelector->currentId());
     208#else
     209    return tr ("Settings");
     210#endif
    149211}
    150212
     
    193255}
    194256
     257void VBoxSettingsDialog::addItem (const QString &aBigIcon,
     258                                  const QString &aBigIconDisabled,
     259                                  const QString &aSmallIcon,
     260                                  const QString &aSmallIconDisabled,
     261                                  int aId,
     262                                  const QString &aLink,
     263                                  VBoxSettingsPage* aPrefPage /* = NULL*/,
     264                                  int aParentId /* = -1 */)
     265{
     266    QWidget *page = mSelector->addItem (aBigIcon, aBigIconDisabled, aSmallIcon, aSmallIconDisabled,
     267                                        aId, aLink,
     268                                        aPrefPage, aParentId);
     269    if (page)
     270        mStack->addWidget (page);
     271    if (aPrefPage)
     272        attachValidator (aPrefPage);
     273}
     274
    195275void VBoxSettingsDialog::enableOk (const QIWidgetValidator*)
    196276{
    197     QList <QIWidgetValidator*> vlist (findChildren <QIWidgetValidator*>());
     277    QList <QIWidgetValidator*> vlist (findChildren <QIWidgetValidator*> ());
    198278
    199279    /* Detect ERROR presence */
     
    260340}
    261341
    262 QString VBoxSettingsDialog::titleExtension() const
    263 {
    264 #ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
    265     return mSelector->itemText (mSelector->currentId());
    266 #else
    267     return tr ("Settings");
    268 #endif
    269 }
    270 
    271 void VBoxSettingsDialog::categoryChanged (int aId)
    272 {
    273     QWidget *rootPage = mSelector->rootPage (aId);
    274 #ifndef Q_WS_MAC
    275     mLbTitle->setText (mSelector->itemText (aId));
    276     mStack->setCurrentIndex (mStack->indexOf (rootPage));
    277 #else /* Q_WS_MAC */
    278     QSize cs = size();
    279     /* First make all fully resizeable */
    280     setMinimumSize (QSize (minimumWidth(), 0));
    281     setMaximumSize (QSize (minimumWidth(), QWIDGETSIZE_MAX));
    282     for (int i = 0; i < mStack->count(); ++i)
    283         mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Ignored);
    284     int a = mStack->indexOf (rootPage);
    285     if (a < mSizeList.count())
    286     {
    287         QSize ss = mSizeList.at (a);
    288         mStack->widget (a)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred);
    289         /* Switch to the new page first if we are shrinking */
    290         if (cs.height() > ss.height())
    291             mStack->setCurrentIndex (mStack->indexOf (rootPage));
    292         /* Do the animation */
    293         ::darwinWindowAnimateResize (this, QRect (x(), y(),
    294                                                   ss.width(), ss.height()));
    295         /* Switch to the new page last if we are zooming */
    296         if (cs.height() <= ss.height())
    297             mStack->setCurrentIndex (mStack->indexOf (rootPage));
    298         /* Make the widget fixed size */
    299         setFixedSize (ss);
    300     }
    301     ::darwinSetShowsResizeIndicator (this, false);
    302 #endif /* !Q_WS_MAC */
    303 # ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
    304     setWindowTitle (dialogTitle());
    305 # endif
    306 }
    307 
    308342void VBoxSettingsDialog::updateWhatsThis (bool aGotFocus /* = false */)
    309343{
     
    353387        return QIMainDialog::eventFilter (aObject, aEvent);
    354388
    355     QWidget *widget = static_cast<QWidget*> (aObject);
     389    QWidget *widget = static_cast <QWidget*> (aObject);
    356390    if (widget->window() != this)
    357391        return QIMainDialog::eventFilter (aObject, aEvent);
     
    446480}
    447481
     482VBoxSettingsPage* VBoxSettingsDialog::attachValidator (VBoxSettingsPage *aPage)
     483{
     484    QIWidgetValidator *wval = new QIWidgetValidator (mSelector->itemTextByPage (aPage),
     485                                                     aPage, this);
     486    connect (wval, SIGNAL (validityChanged (const QIWidgetValidator*)),
     487             this, SLOT (enableOk (const QIWidgetValidator*)));
     488    connect (wval, SIGNAL (isValidRequested (QIWidgetValidator*)),
     489             this, SLOT (revalidate (QIWidgetValidator*)));
     490
     491    aPage->setValidator (wval);
     492    aPage->setOrderAfter (mSelector->widget());
     493
     494    return aPage;
     495}
     496
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSettingsDialogSpecific.cpp

    r17394 r18235  
    3333#include "VBoxGLSettingsUpdate.h"
    3434#include "VBoxGLSettingsLanguage.h"
     35#include "VBoxGLSettingsNetwork.h"
    3536
    3637#include "VBoxVMSettingsGeneral.h"
     
    6263    /* General page */
    6364    prefPage = new VBoxGLSettingsGeneral();
    64     page = mSelector->addItem (":/machine_32px.png", ":/machine_disabled_32px.png", ":/machine_16px.png", ":/machine_disabled_16px.png",
    65                                GeneralId, "#general",
    66                                prefPage);
    67     if (page)
    68         mStack->addWidget (page);
    69     prefPage->setOrderAfter (mSelector->widget());
     65    addItem (":/machine_32px.png", ":/machine_disabled_32px.png", ":/machine_16px.png", ":/machine_disabled_16px.png",
     66             GeneralId, "#general",
     67             prefPage);
    7068
    7169    /* Input page */
    7270    prefPage = new VBoxGLSettingsInput();
    73     page = mSelector->addItem (":/hostkey_32px.png", ":/hostkey_disabled_32px.png", ":/hostkey_16px.png", ":/hostkey_disabled_16px.png",
    74                                InputId, "#input",
    75                                prefPage);
    76     if (page)
    77         mStack->addWidget (page);
    78     prefPage->setOrderAfter (mSelector->widget());
     71    addItem (":/hostkey_32px.png", ":/hostkey_disabled_32px.png", ":/hostkey_16px.png", ":/hostkey_disabled_16px.png",
     72             InputId, "#input",
     73             prefPage);
    7974
    8075    /* Update page */
    8176    prefPage = new VBoxGLSettingsUpdate();
    82     page = mSelector->addItem (":/refresh_32px.png", ":/refresh_disabled_32px.png", ":/refresh_16px.png", ":/refresh_disabled_16px.png",
    83                                UpdateId, "#update",
    84                                prefPage);
    85     if (page)
    86         mStack->addWidget (page);
    87     prefPage->setOrderAfter (mSelector->widget());
     77    addItem (":/refresh_32px.png", ":/refresh_disabled_32px.png", ":/refresh_16px.png", ":/refresh_disabled_16px.png",
     78             UpdateId, "#update",
     79             prefPage);
    8880
    8981    /* Language page */
    9082    prefPage = new VBoxGLSettingsLanguage();
    91     page = mSelector->addItem (":/site_32px.png", ":/site_disabled_32px.png", ":/site_16px.png", ":/site_disabled_16px.png",
    92                                LanguageId, "#language",
    93                                prefPage);
    94     if (page)
    95         mStack->addWidget (page);
    96     prefPage->setOrderAfter (mSelector->widget());
     83    addItem (":/site_32px.png", ":/site_disabled_32px.png", ":/site_16px.png", ":/site_disabled_16px.png",
     84             LanguageId, "#language",
     85             prefPage);
    9786
    9887#ifdef ENABLE_GLOBAL_USB
    9988    /* USB page */
    10089    prefPage = VBoxVMSettingsUSB (VBoxVMSettingsUSB::HostType);
    101     page = mSelector->addItem (":/usb_32px.png", ":/usb_disabled_32px.png", ":/usb_16px.png", ":/usb_disabled_16px.png"
    102                                USBId, "#usb",
    103                                prefPage);
    104     if (page)
    105         mStack->addWidget (page);
    106     prefPage->setOrderAfter (mSelector->widget());
     90    addItem (":/usb_32px.png", ":/usb_disabled_32px.png", ":/usb_16px.png", ":/usb_disabled_16px.png"
     91             USBId, "#usb",
     92             prefPage);
    10793#endif
     94
     95    /* Network page */
     96    prefPage = new VBoxGLSettingsNetwork();
     97    addItem (":/nw_32px.png", ":/nw_disabled_32px.png", ":/nw_16px.png", ":/nw_disabled_16px.png",
     98             NetworkId, "#language",
     99             prefPage);
    108100
    109101    /* Update Selector with available items */
     
    122114    VBoxGlobalSettings sett = vboxGlobal().settings();
    123115
    124     QList<VBoxSettingsPage*> pages = mSelector->settingPages();
     116    QList <VBoxSettingsPage*> pages = mSelector->settingPages();
    125117    foreach (VBoxSettingsPage *page, pages)
    126118        if (page->isEnabled())
     
    134126    VBoxGlobalSettings newsett = sett;
    135127
    136     QList<VBoxSettingsPage*> pages = mSelector->settingPages();
     128    QList <VBoxSettingsPage*> pages = mSelector->settingPages();
    137129    foreach (VBoxSettingsPage *page, pages)
    138130        if (page->isEnabled())
     
    170162#endif
    171163
     164    /* Network page */
     165    mSelector->setItemText (NetworkId, tr ("Network"));
     166
    172167    /* Translate the selector */
    173168    mSelector->polish();
     
    310305        if (!aControl.isNull())
    311306        {
    312             if (QWidget *w = mStack->currentWidget()->findChild<QWidget*> (aControl))
     307            if (QWidget *w = mStack->currentWidget()->findChild <QWidget*> (aControl))
    313308            {
    314                 QList<QWidget*> parents;
     309                QList <QWidget*> parents;
    315310                QWidget *p = w;
    316311                while ((p = p->parentWidget()) != NULL)
    317312                {
    318                     if (QTabWidget *tb = qobject_cast<QTabWidget*> (p))
     313                    if (QTabWidget *tb = qobject_cast <QTabWidget*> (p))
    319314                    {
    320315                        /* The tab contents widget is two steps down
     
    336331}
    337332
    338 void VBoxVMSettingsDlg::addItem (const QString &aBigIcon,
    339                                  const QString &aBigIconDisabled,
    340                                  const QString &aSmallIcon,
    341                                  const QString &aSmallIconDisabled,
    342                                  int aId,
    343                                  const QString &aLink,
    344                                  VBoxSettingsPage* aPrefPage /* = NULL*/,
    345                                  int aParentId /* = -1 */)
    346 {
    347     QWidget *page = mSelector->addItem (aBigIcon, aBigIconDisabled, aSmallIcon, aSmallIconDisabled,
    348                                         aId, aLink,
    349                                         aPrefPage, aParentId);
    350     if (page)
    351         mStack->addWidget (page);
    352     if (aPrefPage)
    353         attachValidator (aPrefPage);
    354 }
    355 
    356 void VBoxVMSettingsDlg::revalidate (QIWidgetValidator *aWval)
    357 {
    358     /* Do individual validations for pages */
    359     QWidget *pg = aWval->widget();
    360     bool valid = aWval->isOtherValid();
    361 
    362     VBoxSettingsPage *page = static_cast <VBoxSettingsPage*> (pg);
    363     QString pageTitle = mSelector->itemTextByPage (page);
    364 
    365     QString text;
    366     valid = page->revalidate (text, pageTitle);
    367     text = text.isEmpty() ? QString::null :
    368            tr ("On the <b>%1</b> page, %2").arg (pageTitle, text);
    369     aWval->setLastWarning (text);
    370     valid ? setWarning (text) : setError (text);
    371 
    372     aWval->setOtherValid (valid);
    373 }
    374 
    375333void VBoxVMSettingsDlg::getFrom()
    376334{
    377     QList<VBoxSettingsPage*> pages = mSelector->settingPages();
     335    QList <VBoxSettingsPage*> pages = mSelector->settingPages();
    378336    foreach (VBoxSettingsPage *page, pages)
    379337        page->getFrom (mMachine);
     
    387345void VBoxVMSettingsDlg::putBackTo()
    388346{
    389     QList<VBoxSettingsPage*> pages = mSelector->settingPages();
     347    QList <VBoxSettingsPage*> pages = mSelector->settingPages();
    390348    foreach (VBoxSettingsPage *page, pages)
    391349        page->putBackTo();
     
    462420
    463421    /* Revalidate all pages to retranslate the warning messages also. */
    464     QList<QIWidgetValidator*> l = this->findChildren<QIWidgetValidator*>();
     422    QList <QIWidgetValidator*> l = this->findChildren <QIWidgetValidator*> ();
    465423    foreach (QIWidgetValidator *wval, l)
    466424        if (!wval->isValid())
     
    486444    if (mAllowResetFirstRunFlag)
    487445        mResetFirstRunFlag = true;
    488 }
    489 
    490 VBoxSettingsPage* VBoxVMSettingsDlg::attachValidator (VBoxSettingsPage *aPage)
    491 {
    492     QIWidgetValidator *wval = new QIWidgetValidator (mSelector->itemTextByPage (aPage),
    493                                                      aPage, this);
    494     connect (wval, SIGNAL (validityChanged (const QIWidgetValidator*)),
    495              this, SLOT (enableOk (const QIWidgetValidator*)));
    496     connect (wval, SIGNAL (isValidRequested (QIWidgetValidator*)),
    497              this, SLOT (revalidate (QIWidgetValidator*)));
    498 
    499     aPage->setValidator (wval);
    500     aPage->setOrderAfter (mSelector->widget());
    501 
    502     return aPage;
    503446}
    504447
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetwork.cpp

    r18063 r18235  
    3939    /* Setup widgets */
    4040    mTbDetails->setIcon (VBoxGlobal::iconSet (
    41         ":/global_settings_16px.png", ":/global_settings_disabled_16px.png"));
     41        ":/guesttools_16px.png", ":/guesttools_disabled_16px.png"));
    4242
    4343    /* Applying language settings */
     
    177177void VBoxVMSettingsNetwork::updateAttachmentInfo()
    178178{
    179     KNetworkAttachmentType type = attachmentType();
    180179    QString line ("<tr><td><i><b><nobr><font color=grey>%1:&nbsp;</font></nobr></b></i></td>"
    181180                  "<td><i><font color=grey>%2</font></i></td></tr>");
     181    QString info;
     182
     183    /* Append alternative information */
     184    KNetworkAttachmentType type = attachmentType();
    182185    switch (type)
    183186    {
    184187        case KNetworkAttachmentType_Bridged:
    185188        {
    186             QString info;
    187189            QString name (mDetails->currentName (type));
    188             info += line.arg (tr ("Adapter"))
    189                         .arg (name.isEmpty() ? tr ("Not Selected") : name);
    190             mLbInfo->setText ("<table>" + info + "</table>");
     190            info += line.arg (tr ("Adapter", "network"))
     191                        .arg (name.isEmpty() ? tr ("not selected", "adapter") : name);
    191192            break;
    192193        }
    193194        case KNetworkAttachmentType_Internal:
    194195        {
    195             QString info;
    196196            QString name (mDetails->currentName (type));
    197             info += line.arg (tr ("Name"))
    198                         .arg (name.isEmpty() ? tr ("Not Selected") : name);
    199             mLbInfo->setText ("<table>" + info + "</table>");
     197            info += line.arg (tr ("Network", "internal"))
     198                        .arg (name.isEmpty() ? tr ("not selected", "network") : name);
    200199            break;
    201200        }
    202201        case KNetworkAttachmentType_HostOnly:
    203202        {
    204             QString info;
    205203            QString name (mDetails->currentName (type));
    206             info += line.arg (tr ("Interface"))
    207                         .arg (name.isEmpty() ? tr ("Not Selected") : name);
    208             if (!name.isEmpty())
    209             {
    210                 bool dhcp = mDetails->property ("HOI_DhcpEnabled").toBool();
    211                 info += line.arg (tr ("Configuration"))
    212                             .arg (dhcp ? tr ("Automatic", "configuration")
    213                                        : tr ("Manual", "configuration"));
    214                 if (!dhcp)
    215                 {
    216                     QString ipv4addr (mDetails->property ("HOI_IPv4Addr").toString());
    217                     QString ipv4mask (mDetails->property ("HOI_IPv4Mask").toString());
    218                     info += line.arg (tr ("IPv4 Address"))
    219                                 .arg (ipv4addr.isEmpty() ? tr ("Not Set", "address") : ipv4addr) +
    220                             line.arg (tr ("IPv4 Mask"))
    221                                 .arg (ipv4mask.isEmpty() ? tr ("Not Set", "mask") : ipv4mask);
    222                     bool ipv6 = mDetails->property ("HOI_IPv6Supported").toBool();
    223                     if (ipv6)
    224                     {
    225                         QString ipv6addr (mDetails->property ("HOI_IPv6Addr").toString());
    226                         QString ipv6mask (mDetails->property ("HOI_IPv6Mask").toString());
    227                         info += line.arg (tr ("IPv6 Address"))
    228                                     .arg (ipv6addr.isEmpty() ? tr ("Not Set", "address") : ipv6addr) +
    229                                 line.arg (tr ("IPv6 Mask"))
    230                                     .arg (ipv6mask.isEmpty() ? tr ("Not Set", "length") : ipv6mask);
    231                     }
    232                 }
    233             }
    234             mLbInfo->setText ("<table>" + info + "</table>");
     204            info += line.arg (tr ("Interface", "network"))
     205                        .arg (name.isEmpty() ? tr ("not selected", "interface") : name);
    235206            break;
    236207        }
    237208        default:
    238             mLbInfo->clear();
    239             break;
    240     }
     209            break;
     210    }
     211
     212#if 0
     213    /* Append common information */
     214    QString macAddress (mDetails->property ("MAC_Address").toString());
     215    info += line.arg (tr ("MAC Address"))
     216                .arg (macAddress.isEmpty() ? tr ("not selected", "address") : macAddress);
     217    bool cableConnected (mDetails->property ("Cable_Connected").toBool());
     218    info += line.arg (tr ("Cable"))
     219                .arg (cableConnected ? tr ("connected", "cable") : tr ("not connected", "cable"));
     220#endif
     221
     222    /* Finally set full label text */
     223    if (info.isEmpty())
     224        mLbInfo->clear();
     225    else
     226        mLbInfo->setText ("<table>" + info + "</table>");
    241227
    242228    if (mValidator)
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetworkDetails.cpp

    r18065 r18235  
    4646    /* Setup alternative widgets */
    4747    mCbINT->setInsertPolicy (QComboBox::NoInsert);
    48     mLeIPv4->setValidator (new QRegExpValidator
    49         (QRegExp ("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"), this));
    50     mLeHMv4->setValidator (new QRegExpValidator
    51         (QRegExp ("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"), this));
    52     mLeIPv6->setValidator (new QRegExpValidator
    53         (QRegExp ("[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
    54                   "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
    55                   "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
    56                   "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}"), this));
    57     mLeHMv6->setValidator (new QRegExpValidator
    58         (QRegExp ("[1-9][0-9]|1[0-1][0-9]|12[0-8]"), this));
    59     mLeIPv6->setFixedWidthByText (QString().fill ('X', 32) + QString().fill (':', 7));
    60     connect (mCbHOI, SIGNAL (currentIndexChanged (int)),
    61              this, SLOT (hostOnlyInterfaceChanged()));
    62 #if defined (Q_WS_WIN32)
    63     mTbAdd->setIcon (VBoxGlobal::iconSet (":/add_host_iface_16px.png",
    64                                           ":/add_host_iface_disabled_16px.png"));
    65     mTbDel->setIcon (VBoxGlobal::iconSet (":/remove_host_iface_16px.png",
    66                                           ":/remove_host_iface_disabled_16px.png"));
    67     connect (mTbAdd, SIGNAL (clicked()), this, SLOT (addInterface()));
    68     connect (mTbDel, SIGNAL (clicked()), this, SLOT (delInterface()));
    69     connect (mRbAuto, SIGNAL (toggled (bool)),
    70              this, SLOT (hostOnlyDHCPChanged()));
    71     connect (mRbManual, SIGNAL (toggled (bool)),
    72              this, SLOT (hostOnlyDHCPChanged()));
    73 #endif
    7448
    7549    /* Setup common widgets */
    7650    mLeMAC->setValidator (new QRegExpValidator
    7751        (QRegExp ("[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this));
    78     mLeMAC->setFixedWidthByText (QString().fill ('X', 12));
     52    QStyleOptionFrame sof;
     53    sof.initFrom (mLeMAC);
     54    sof.rect = mLeMAC->contentsRect();
     55    sof.lineWidth = mLeMAC->style()->pixelMetric (QStyle::PM_DefaultFrameWidth);
     56    sof.midLineWidth = 0;
     57    sof.state |= QStyle::State_Sunken;
     58    QSize sc (mLeMAC->fontMetrics().width (QString().fill ('X', 12)) + 2*2,
     59              mLeMAC->fontMetrics().xHeight()                        + 2*1);
     60    QSize sa = mLeMAC->style()->sizeFromContents (QStyle::CT_LineEdit, &sof, sc, mLeMAC);
     61    mLeMAC->setMinimumWidth (sa.width());
    7962    connect (mTbMAC, SIGNAL (clicked()), this, SLOT (genMACClicked()));
    8063#if defined (Q_WS_MAC)
     
    8871    mAdapter = aAdapter;
    8972
    90     /* Load alternate attributes */
     73    /* Load alternate settings */
    9174    QString intName (mAdapter.GetInternalNetwork());
    9275    if (!intName.isEmpty())
    9376        setProperty ("INT_Name", QVariant (intName));
    94 
    9577    QString ifsName (mAdapter.GetHostInterface());
    9678    CHostNetworkInterface ifs =
    9779        vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (ifsName);
    9880    if (!ifs.isNull() && ifs.GetInterfaceType() == KHostNetworkInterfaceType_Bridged)
    99     {
    10081        setProperty ("BRG_Name", QVariant (ifsName));
    101     }
    10282    else if (!ifs.isNull() && ifs.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
    103     {
    10483        setProperty ("HOI_Name", QVariant (ifsName));
    105 #if defined (Q_WS_WIN32)
    106         setProperty ("HOI_DhcpEnabled", QVariant (ifs.GetDhcpEnabled()));
    107 #endif
    108         setProperty ("HOI_IPv6Supported", QVariant (ifs.GetIPV6Supported()));
    109         if (!ifs.GetDhcpEnabled())
    110         {
    111             setProperty ("HOI_IPv4Addr", QVariant (ifs.GetIPAddress()));
    112             setProperty ("HOI_IPv4Mask", QVariant (ifs.GetNetworkMask()));
    113             if (ifs.GetIPV6Supported())
    114             {
    115                 setProperty ("HOI_IPv6Addr", QVariant (ifs.GetIPV6Address()));
    116                 setProperty ("HOI_IPv6Mask", QVariant (QString::number (ifs.GetIPV6NetworkMaskPrefixLength())));
    117             }
    118         }
    119     }
    120 
     84
     85    /* Load common settings */
    12186    setProperty ("MAC_Address", QVariant (aAdapter.GetMACAddress()));
    12287    setProperty ("Cable_Connected", QVariant (aAdapter.GetCableConnected()));
     
    13095    {
    13196        case KNetworkAttachmentType_Bridged:
    132         {
    13397            mAdapter.SetHostInterface (name);
    13498            break;
    135         }
    136         case KNetworkAttachmentType_Internal:
    137         {
     99        case KNetworkAttachmentType_Internal:
    138100            mAdapter.SetInternalNetwork (name);
    139101            break;
    140         }
    141         case KNetworkAttachmentType_HostOnly:
    142         {
    143             CHostNetworkInterface iface =
    144                 vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (name);
    145             if (!iface.isNull())
    146             {
    147                 if (property ("HOI_DhcpEnabled").toBool())
    148                 {
    149                     iface.EnableDynamicIpConfig();
    150                 }
    151                 else
    152                 {
    153                     iface.EnableStaticIpConfig (property ("HOI_IPv4Addr").toString(),
    154                                                 property ("HOI_IPv4Mask").toString());
    155 
    156                     if (property ("HOI_IPv6Supported").toBool())
    157                     {
    158                         iface.EnableStaticIpConfigV6 (property ("HOI_IPv6Addr").toString(),
    159                                                       property ("HOI_IPv6Mask").toString().toULong());
    160                     }
    161                 }
    162             }
     102        case KNetworkAttachmentType_HostOnly:
    163103            mAdapter.SetHostInterface (name);
    164104            break;
    165         }
    166105        default:
    167106            break;
     
    187126    mLbHOI->setVisible (mType == KNetworkAttachmentType_HostOnly);
    188127    mCbHOI->setVisible (mType == KNetworkAttachmentType_HostOnly);
    189     mLbIPv4->setVisible (mType == KNetworkAttachmentType_HostOnly);
    190     mLeIPv4->setVisible (mType == KNetworkAttachmentType_HostOnly);
    191     mLbHMv4->setVisible (mType == KNetworkAttachmentType_HostOnly);
    192     mLeHMv4->setVisible (mType == KNetworkAttachmentType_HostOnly);
    193     mLbIPv6->setVisible (mType == KNetworkAttachmentType_HostOnly);
    194     mLeIPv6->setVisible (mType == KNetworkAttachmentType_HostOnly);
    195     mLbHMv6->setVisible (mType == KNetworkAttachmentType_HostOnly);
    196     mLeHMv6->setVisible (mType == KNetworkAttachmentType_HostOnly);
    197 #if defined (Q_WS_WIN32)
    198     mTbAdd->setVisible (mType == KNetworkAttachmentType_HostOnly);
    199     mTbDel->setVisible (mType == KNetworkAttachmentType_HostOnly);
    200     mLbCT->setVisible (mType == KNetworkAttachmentType_HostOnly);
    201     mRbAuto->setVisible (mType == KNetworkAttachmentType_HostOnly);
    202     mRbManual->setVisible (mType == KNetworkAttachmentType_HostOnly);
    203 #endif
    204128
    205129    /* Repopulate alternate combo-box with items */
     
    214138    }
    215139
    216     /* Reload alternate combo-box dependences */
    217     if (mType == KNetworkAttachmentType_HostOnly)
    218     {
    219         hostOnlyInterfaceChanged();
    220         if (property ("HOI_DhcpEnabled").toBool())
    221         {
    222             mRbAuto->setChecked (true);
    223         }
    224         else
    225         {
    226             mRbManual->setChecked (true);
    227             QString ipv4 (property ("HOI_IPv4Addr").toString());
    228             if (ipv4 != mLeIPv4->text())
    229                 mLeIPv4->setText (ipv4);
    230             QString nmv4 (property ("HOI_IPv4Mask").toString());
    231             if (nmv4 != mLeHMv4->text())
    232                 mLeHMv4->setText (nmv4);
    233             if (property ("HOI_IPv6Supported").toBool())
    234             {
    235                 QString ipv6 (property ("HOI_IPv6Addr").toString());
    236                 if (ipv6 != mLeIPv6->text())
    237                     mLeIPv6->setText (ipv6);
    238                 QString nmv6 (property ("HOI_IPv6Mask").toString());
    239                 if (nmv6 != mLeHMv6->text())
    240                     mLeHMv6->setText (nmv6);
    241             }
    242         }
    243     }
    244 
    245140    /* Load common settings */
    246141    mLeMAC->setText (property ("MAC_Address").toString());
     
    275170                return false;
    276171            }
    277             else if (!property ("HOI_DhcpEnabled").toBool())
    278             {
    279                 if (!property ("HOI_IPv4Addr").toString().isEmpty() &&
    280                     QHostAddress (property ("HOI_IPv4Addr").toString()).protocol()
    281                     != QAbstractSocket::IPv4Protocol)
    282                 {
    283                     aWarning = tr ("host IPv4 address is wrong");
    284                     return false;
    285                 }
    286                 if (!property ("HOI_IPv4Mask").toString().isEmpty() &&
    287                     QHostAddress (property ("HOI_IPv4Mask").toString()).protocol()
    288                     != QAbstractSocket::IPv4Protocol)
    289                 {
    290                     aWarning = tr ("host IPv4 network mask is wrong");
    291                     return false;
    292                 }
    293                 if (property ("HOI_IPv6Supported").toBool())
    294                 {
    295                     if (!property ("HOI_IPv6Addr").toString().isEmpty() &&
    296                         QHostAddress (property ("HOI_IPv6Addr").toString()).protocol()
    297                         != QAbstractSocket::IPv6Protocol)
    298                     {
    299                         aWarning = tr ("host IPv6 address is wrong");
    300                         return false;
    301                     }
    302                 }
    303             }
    304172            break;
    305173        default:
     
    356224
    357225    /* Translate empty items */
    358     mNotSelected = tr ("Not Selected");
     226    mNotSelected = tr ("Not selected");
    359227    populateComboboxes();
    360228}
     
    402270                         QVariant (mCbHOI->itemData (mCbHOI->currentIndex()).toString() == QString (emptyItemCode) ?
    403271                                   QString::null : mCbHOI->currentText()));
    404             setProperty ("HOI_DhcpEnabled", QVariant (mRbAuto->isChecked()));
    405             setProperty ("HOI_IPv6Supported", QVariant (mLeIPv6->isEnabled()));
    406             setProperty ("HOI_IPv4Addr", QVariant (mLeIPv4->text()));
    407             setProperty ("HOI_IPv4Mask", QVariant (mLeHMv4->text()));
    408             setProperty ("HOI_IPv6Addr", QVariant (mLeIPv6->text()));
    409             setProperty ("HOI_IPv6Mask", QVariant (mLeHMv6->text()));
    410             break;
    411         default:
    412             break;
    413     }
    414 
     272            break;
     273        default:
     274            break;
     275    }
    415276    setProperty ("MAC_Address", QVariant (mLeMAC->text()));
    416277    setProperty ("Cable_Connected", QVariant (mCbCable->isChecked()));
     
    419280}
    420281
    421 void VBoxVMSettingsNetworkDetails::hostOnlyInterfaceChanged()
    422 {
    423 #if defined (Q_WS_WIN32)
    424     CHostNetworkInterface iface =
    425         vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (mCbHOI->currentText());
    426 
    427     bool isValid = !iface.isNull() &&
    428                    iface.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly;
    429     bool isManual = isValid && !iface.GetDhcpEnabled();
    430 
    431     mLbCT->setEnabled (isValid);
    432     mRbAuto->setEnabled (isValid);
    433     mRbManual->setEnabled (isValid);
    434 
    435     if (isManual)
    436     {
    437         mRbManual->blockSignals (true);
    438         mRbManual->setChecked (true);
    439         mRbManual->blockSignals (false);
    440     }
    441     else
    442     {
    443         mRbAuto->blockSignals (true);
    444         mRbAuto->setChecked (true);
    445         mRbAuto->blockSignals (false);
    446     }
    447 
    448     mTbDel->setEnabled (isValid);
    449 #endif
    450 
    451     hostOnlyDHCPChanged();
    452 }
    453 
    454 void VBoxVMSettingsNetworkDetails::hostOnlyDHCPChanged()
    455 {
    456     CHostNetworkInterface iface =
    457         vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (mCbHOI->currentText());
    458 
    459     bool isManual = !iface.isNull() &&
    460                     iface.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly &&
    461                     mRbManual->isChecked();
    462     bool isIPv6Supported = isManual && iface.GetIPV6Supported();
    463 
    464     mLeIPv4->clear();
    465     mLeHMv4->clear();
    466     mLeIPv6->clear();
    467     mLeHMv6->clear();
    468 
    469     mLbIPv4->setEnabled (isManual);
    470     mLbHMv4->setEnabled (isManual);
    471     mLeIPv4->setEnabled (isManual);
    472     mLeHMv4->setEnabled (isManual);
    473     mLbIPv6->setEnabled (isIPv6Supported);
    474     mLbHMv6->setEnabled (isIPv6Supported);
    475     mLeIPv6->setEnabled (isIPv6Supported);
    476     mLeHMv6->setEnabled (isIPv6Supported);
    477 
    478     if (isManual)
    479     {
    480         mLeIPv4->setText (iface.GetIPAddress());
    481         mLeHMv4->setText (iface.GetNetworkMask());
    482 
    483         if (isIPv6Supported)
    484         {
    485             mLeIPv6->setText (iface.GetIPV6Address());
    486             mLeHMv6->setText (QString::number (iface.GetIPV6NetworkMaskPrefixLength()));
    487         }
    488     }
    489 }
    490 
    491282void VBoxVMSettingsNetworkDetails::genMACClicked()
    492283{
     
    494285    mLeMAC->setText (mAdapter.GetMACAddress());
    495286}
    496 
    497 #if defined (Q_WS_WIN32)
    498 void VBoxVMSettingsNetworkDetails::addInterface()
    499 {
    500     /* Allow the started helper process to make itself the foreground window */
    501     AllowSetForegroundWindow (ASFW_ANY);
    502 
    503     /* Creating interface */
    504     CHost host = vboxGlobal().virtualBox().GetHost();
    505     CHostNetworkInterface iface;
    506     CProgress progress = host.CreateHostOnlyNetworkInterface (iface);
    507     if (host.isOk())
    508     {
    509         vboxProblem().showModalProgressDialog (progress,
    510             tr ("Performing", "creating/removing host-only interface"), this);
    511         if (progress.GetResultCode() == 0)
    512         {
    513             mCbHOI->insertItem (mCbHOI->count(), iface.GetName());
    514             mCbHOI->setCurrentIndex (mCbHOI->count() - 1);
    515         }
    516         else
    517             vboxProblem().cannotCreateHostInterface (progress, this);
    518     }
    519     else
    520         vboxProblem().cannotCreateHostInterface (host, this);
    521 
    522     /* Allow the started helper process to make itself the foreground window */
    523     AllowSetForegroundWindow (ASFW_ANY);
    524 }
    525 
    526 void VBoxVMSettingsNetworkDetails::delInterface()
    527 {
    528     /* Allow the started helper process to make itself the foreground window */
    529     AllowSetForegroundWindow (ASFW_ANY);
    530 
    531     Assert (mCbHOI->itemData (mCbHOI->currentIndex()).toString()
    532             != QString (emptyItemCode));
    533 
    534     /* Check interface name */
    535     QString name (mCbHOI->currentText());
    536 
    537     /* Asking user about deleting selected network interface */
    538     int delNetIface = vboxProblem().confirmDeletingHostInterface (name, this);
    539     if (delNetIface == QIMessageBox::Cancel) return;
    540 
    541     /* Removing interface */
    542     CHost host = vboxGlobal().virtualBox().GetHost();
    543     CHostNetworkInterface iface = host.FindHostNetworkInterfaceByName (name);
    544     if (!iface.isNull())
    545     {
    546         /* Delete interface */
    547         CProgress progress = host.RemoveHostOnlyNetworkInterface (iface.GetId(), iface);
    548         if (host.isOk())
    549         {
    550             vboxProblem().showModalProgressDialog (progress,
    551                 tr ("Performing", "creating/removing host-only interface"), this);
    552             if (progress.GetResultCode() == 0)
    553             {
    554                 int pos = mCbHOI->findText (name);
    555                 Assert (pos != -1);
    556                 mCbHOI->removeItem (pos);
    557             }
    558             else
    559                 vboxProblem().cannotRemoveHostInterface (progress, iface, this);
    560         }
    561     }
    562     if (!host.isOk())
    563         vboxProblem().cannotRemoveHostInterface (host, iface, this);
    564 
    565     /* Allow the started helper process to make itself the foreground window */
    566     AllowSetForegroundWindow (ASFW_ANY);
    567 }
    568 #endif
    569287
    570288void VBoxVMSettingsNetworkDetails::populateComboboxes()
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsNetworkDetails.ui

    r17960 r18235  
    2828  </property>
    2929  <layout class="QGridLayout" >
    30    <item row="0" column="0" colspan="5" >
     30   <item row="0" column="0" colspan="4" >
    3131    <widget class="QILabelSeparator" name="mLsHost" >
    3232     <property name="sizePolicy" >
     
    5454    </widget>
    5555   </item>
    56    <item row="1" column="2" colspan="3" >
     56   <item row="1" column="2" colspan="2" >
    5757    <widget class="QComboBox" name="mCbBRG" >
     58     <property name="sizePolicy" >
     59      <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
     60       <horstretch>0</horstretch>
     61       <verstretch>0</verstretch>
     62      </sizepolicy>
     63     </property>
    5864     <property name="toolTip" >
    5965      <string>Displays the name of the host network adapter selected for bridged networking.</string>
     
    7480    </widget>
    7581   </item>
    76    <item row="2" column="2" colspan="3" >
     82   <item row="2" column="2" colspan="2" >
    7783    <widget class="QComboBox" name="mCbINT" >
     84     <property name="sizePolicy" >
     85      <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
     86       <horstretch>0</horstretch>
     87       <verstretch>0</verstretch>
     88      </sizepolicy>
     89     </property>
    7890     <property name="toolTip" >
    7991      <string>Displays the name of the internal network selected for this adapter.</string>
     
    97109    </widget>
    98110   </item>
    99    <item row="3" column="2" colspan="3" >
    100     <layout class="QHBoxLayout" >
    101      <item>
    102       <widget class="QComboBox" name="mCbHOI" >
    103        <property name="toolTip" >
    104         <string>Displays the name of the VirtualBox network interface selected for host-only networking.</string>
    105        </property>
    106       </widget>
    107      </item>
    108      <item>
    109       <widget class="QToolButton" name="mTbAdd" >
    110        <property name="toolTip" >
    111         <string>Add new VirtualBox host-only network interface.</string>
    112        </property>
    113        <property name="autoRaise" >
    114         <bool>true</bool>
    115        </property>
    116        <property name="visible" >
    117         <bool>false</bool>
    118        </property>
    119       </widget>
    120      </item>
    121      <item>
    122       <widget class="QToolButton" name="mTbDel" >
    123        <property name="toolTip" >
    124         <string>Remove selected VirtualBox host-only network interface.</string>
    125        </property>
    126        <property name="autoRaise" >
    127         <bool>true</bool>
    128        </property>
    129        <property name="visible" >
    130         <bool>false</bool>
    131        </property>
    132       </widget>
    133      </item>
    134     </layout>
    135    </item>
    136    <item row="4" column="1" >
    137     <widget class="QLabel" name="mLbCT" >
    138      <property name="visible" >
    139       <bool>false</bool>
    140      </property>
    141      <property name="text" >
    142       <string>Configuration Type:</string>
    143      </property>
    144      <property name="alignment" >
    145       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    146      </property>
    147     </widget>
    148    </item>
    149    <item row="4" column="2" colspan="3" >
    150     <widget class="QRadioButton" name="mRbAuto" >
    151      <property name="visible" >
    152       <bool>false</bool>
    153      </property>
    154      <property name="toolTip" >
    155       <string>Use DHCP automatic configuration for this host-only network interface.</string>
    156      </property>
    157      <property name="text" >
    158       <string>&amp;DHCP Automatic Configuration</string>
    159      </property>
    160     </widget>
    161    </item>
    162    <item row="5" column="2" colspan="3" >
    163     <widget class="QRadioButton" name="mRbManual" >
    164      <property name="visible" >
    165       <bool>false</bool>
    166      </property>
    167      <property name="checked" >
    168       <bool>true</bool>
    169      </property>
    170      <property name="toolTip" >
    171       <string>Use manual configuration for this host-only network interface.</string>
    172      </property>
    173      <property name="text" >
    174       <string>M&amp;anual Configuration</string>
    175      </property>
    176     </widget>
    177    </item>
    178    <item row="6" column="1" >
    179     <widget class="QLabel" name="mLbIPv4" >
    180      <property name="text" >
    181       <string>&amp;Host IPv4 Address:</string>
    182      </property>
    183      <property name="alignment" >
    184       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    185      </property>
    186      <property name="buddy" >
    187       <cstring>mLeIPv4</cstring>
    188      </property>
    189     </widget>
    190    </item>
    191    <item row="6" column="2" colspan="3" >
    192     <widget class="QILineEdit" name="mLeIPv4" >
    193      <property name="sizePolicy" >
    194       <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
    195        <horstretch>0</horstretch>
    196        <verstretch>0</verstretch>
    197       </sizepolicy>
    198      </property>
    199      <property name="toolTip" >
    200       <string>Displays the host IPv4 address for this interface.</string>
    201      </property>
    202     </widget>
    203    </item>
    204    <item row="7" column="1" >
    205     <widget class="QLabel" name="mLbHMv4" >
    206      <property name="text" >
    207       <string>H&amp;ost IPv4 Network Mask:</string>
    208      </property>
    209      <property name="alignment" >
    210       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    211      </property>
    212      <property name="buddy" >
    213       <cstring>mLeHMv4</cstring>
    214      </property>
    215     </widget>
    216    </item>
    217    <item row="7" column="2" colspan="3" >
    218     <widget class="QILineEdit" name="mLeHMv4" >
    219      <property name="sizePolicy" >
    220       <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
    221        <horstretch>0</horstretch>
    222        <verstretch>0</verstretch>
    223       </sizepolicy>
    224      </property>
    225      <property name="toolTip" >
    226       <string>Displays the host IPv4 network mask for this interface.</string>
    227      </property>
    228     </widget>
    229    </item>
    230    <item row="8" column="1" >
    231     <widget class="QLabel" name="mLbIPv6" >
    232      <property name="text" >
    233       <string>Ho&amp;st IPv6 Address:</string>
    234      </property>
    235      <property name="alignment" >
    236       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    237      </property>
    238      <property name="buddy" >
    239       <cstring>mLeIPv6</cstring>
    240      </property>
    241     </widget>
    242    </item>
    243    <item row="8" column="2" colspan="3" >
    244     <widget class="QILineEdit" name="mLeIPv6" >
    245      <property name="sizePolicy" >
    246       <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
    247        <horstretch>0</horstretch>
    248        <verstretch>0</verstretch>
    249       </sizepolicy>
    250      </property>
    251      <property name="toolTip" >
    252       <string>Displays the host IPv6 address for this interface if IPv6 protocol is supported.</string>
    253      </property>
    254     </widget>
    255    </item>
    256    <item row="9" column="1" >
    257     <widget class="QLabel" name="mLbHMv6" >
    258      <property name="text" >
    259       <string>Hos&amp;t IPv6 Network Mask Length:</string>
    260      </property>
    261      <property name="alignment" >
    262       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    263      </property>
    264      <property name="buddy" >
    265       <cstring>mLeHMv6</cstring>
    266      </property>
    267     </widget>
    268    </item>
    269    <item row="9" column="2" colspan="3" >
    270     <widget class="QILineEdit" name="mLeHMv6" >
    271      <property name="sizePolicy" >
    272       <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
    273        <horstretch>0</horstretch>
    274        <verstretch>0</verstretch>
    275       </sizepolicy>
    276      </property>
    277      <property name="toolTip" >
    278       <string>Displays the host IPv6 network mask prefix length for this interface if IPv6 protocol is supported.</string>
    279      </property>
    280     </widget>
    281    </item>
    282    <item row="10" column="0" colspan="5" >
     111   <item row="3" column="2" colspan="2" >
     112    <widget class="QComboBox" name="mCbHOI" >
     113     <property name="sizePolicy" >
     114      <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
     115       <horstretch>0</horstretch>
     116       <verstretch>0</verstretch>
     117      </sizepolicy>
     118     </property>
     119     <property name="toolTip" >
     120      <string>Displays the name of the VirtualBox network interface selected for host-only networking.</string>
     121     </property>
     122    </widget>
     123   </item>
     124   <item row="4" column="0" colspan="4" >
    283125    <widget class="QILabelSeparator" name="mLsGuest" >
    284126     <property name="sizePolicy" >
     
    293135    </widget>
    294136   </item>
    295    <item row="11" column="0" >
     137   <item row="5" column="0" >
    296138    <spacer>
    297139     <property name="orientation" >
     
    309151    </spacer>
    310152   </item>
    311    <item row="11" column="1" >
     153   <item row="5" column="1" >
    312154    <widget class="QLabel" name="mLbMAC" >
    313155     <property name="text" >
     
    322164    </widget>
    323165   </item>
    324    <item row="11" column="2" colspan="2" >
    325     <widget class="QILineEdit" name="mLeMAC" >
    326      <property name="sizePolicy" >
    327       <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
     166   <item row="5" column="2" >
     167    <widget class="QLineEdit" name="mLeMAC" >
     168     <property name="sizePolicy" >
     169      <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
    328170       <horstretch>0</horstretch>
    329171       <verstretch>0</verstretch>
     
    335177    </widget>
    336178   </item>
    337    <item row="11" column="4" >
     179   <item row="5" column="3" >
    338180    <widget class="QToolButton" name="mTbMAC" >
    339181     <property name="toolTip" >
     
    348190    </widget>
    349191   </item>
    350    <item row="12" column="2" colspan="3" >
     192   <item row="6" column="2" colspan="2" >
    351193    <widget class="QCheckBox" name="mCbCable" >
    352194     <property name="text" >
     
    358200    </widget>
    359201   </item>
    360    <item row="13" column="0" colspan="5" >
     202   <item row="7" column="0" colspan="4" >
    361203    <spacer name="verticalSpacer" >
    362204     <property name="orientation" >
     
    371213    </spacer>
    372214   </item>
    373    <item row="14" column="0" colspan="5" >
     215   <item row="8" column="0" colspan="4" >
    374216    <widget class="QIDialogButtonBox" name="mButtonBox" >
    375217     <property name="standardButtons" >
     
    385227   <extends>QLabel</extends>
    386228   <header>QILabelSeparator.h</header>
    387   </customwidget>
    388   <customwidget>
    389    <class>QILineEdit</class>
    390    <extends>QLineEdit</extends>
    391    <header>QILineEdit.h</header>
    392229  </customwidget>
    393230  <customwidget>
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette