VirtualBox

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


Ignore:
Timestamp:
Jul 26, 2008 12:53:27 AM (17 years ago)
Author:
vboxsync
Message:

VirtualBox4: Host interface networking for Darwin.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsNetwork.h

    r10698 r10897  
    2828#include "COMDefs.h"
    2929
    30 #ifdef Q_WS_WIN
     30#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    3131class QTreeWidget;
    3232class QTreeWidgetItem;
     
    5757    void setNetworksList (const QStringList &aList);
    5858
    59 #ifdef Q_WS_WIN
     59#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    6060    void setInterfaceName (const QString &);
    6161    QString interfaceName() const;
     
    8686    QIWidgetValidator *mValidator;
    8787
    88 #ifdef Q_WS_WIN
     88#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    8989    QString mInterfaceName;
    9090#endif
     
    9292
    9393
    94 #ifdef Q_WS_WIN
     94#if defined (Q_WS_WIN) || defined (Q_OS_MAC) || defined(__APPLE__) /// @todo fix stupid stupid moc.
    9595/*
    9696 * QGroupBox sub-class which represents network interface list.
     
    129129    QTreeWidget      *mList;
    130130
     131# if defined (Q_WS_WIN)
    131132    QAction *mAddAction;
    132133    QAction *mDelAction;
     134# endif
    133135};
    134 #endif
     136#endif /* Q_WS_WIN || Q_OS_MAC */
    135137
    136138
     
    159161
    160162    void updateNetworksList();
    161 #ifdef Q_WS_WIN
     163#if defined (Q_WS_WIN) || defined (Q_OS_MAC) || defined (__APPLE__) /// @todo fix stupid stupid moc.
    162164    void onCurrentPageChanged (int);
    163165    void onCurrentInterfaceChanged (const QString &);
     
    170172    /* Widgets */
    171173    QTabWidget *mTwAdapters;
    172 #ifdef Q_WS_WIN
     174#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    173175    VBoxNIList *mNIList;
    174176#endif
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsNetwork.cpp

    r10759 r10897  
    2525#include "QIWidgetValidator.h"
    2626#include "VBoxGlobal.h"
    27 #ifdef Q_WS_WIN
     27#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    2828#include "VBoxToolBar.h"
    2929#include "VBoxSettingsUtils.h"
     
    3535#include <QFileDialog>
    3636#endif
    37 #ifdef Q_WS_WIN
     37#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    3838#include <QTreeWidget>
    3939#endif
    4040
    4141/* Common Stuff */
    42 #ifdef Q_WS_WIN
     42#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    4343static QTreeWidgetItem* findItem (QTreeWidget *aList,
    4444                                  const QString &aMatch)
     
    6565    /* Setup dialog for current platform */
    6666#ifndef Q_WS_X11
    67     setTapVisible (false);
    68 #endif
    69 #ifdef Q_WS_MAC /// @todo hif on mac
    70     /* No Host Interface Networking on the Mac yet */
    7167    setTapVisible (false);
    7268#endif
     
    107103    mCbNetwork->setCurrentIndex (inPos == -1 ? 0 : inPos);
    108104
    109 #ifdef Q_WS_WIN
     105#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    110106    mInterfaceName = aAdapter.GetHostInterface().isEmpty() ?
    111107                     QString::null : aAdapter.GetHostInterface();
     
    152148    if (type == KNetworkAttachmentType_HostInterface)
    153149    {
    154 #ifdef Q_WS_WIN
     150#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    155151        mAdapter.SetHostInterface (mInterfaceName);
    156152#endif
     
    226222}
    227223
    228 #ifdef Q_WS_WIN
     224#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    229225void VBoxVMSettingsNetwork::setInterfaceName (const QString &aName)
    230226{
     
    380376
    381377/* VBoxNIList Stuff */
    382 #ifdef Q_WS_WIN
     378#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    383379class VBoxNIListItem : public QTreeWidgetItem
    384380{
     
    440436
    441437    /* Prepare actions */
     438# if defined (Q_WS_WIN)
    442439    mAddAction = new QAction (mList);
    443440    mDelAction = new QAction (mList);
     
    450447    mDelAction->setIcon (VBoxGlobal::iconSet (":/remove_host_iface_16px.png",
    451448                                              ":/remove_host_iface_disabled_16px.png"));
     449# endif /* Q_WS_WIN */
    452450
    453451    /* Prepare toolbar */
     
    456454    toolBar->setUsesBigPixmaps (false);
    457455    toolBar->setOrientation (Qt::Vertical);
     456# if defined (Q_WS_WIN)
    458457    toolBar->addAction (mAddAction);
    459458    toolBar->addAction (mDelAction);
     459# endif /* Q_WS_WIN */
    460460    layout->addWidget (toolBar);
    461461
     
    463463    connect (mList, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
    464464             this, SLOT (onCurrentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)));
     465# if defined (Q_WS_WIN)
    465466    connect (mAddAction, SIGNAL (triggered (bool)),
    466467             this, SLOT (addHostInterface()));
    467468    connect (mDelAction, SIGNAL (triggered (bool)),
    468469             this, SLOT (delHostInterface()));
     470# endif /* Q_WS_WIN */
    469471
    470472    /* Populating interface list */
     
    516518                                       QTreeWidgetItem *)
    517519{
     520# if defined (Q_WS_WIN)
    518521    VBoxNIListItem *item = aCurrent &&
    519522        aCurrent->type() == VBoxNIListItem::typeId ?
    520523        static_cast<VBoxNIListItem*> (aCurrent) : 0;
    521524    mDelAction->setEnabled (item && !item->isWrong());
     525# else
     526    NOREF (aCurrent);
     527# endif
    522528
    523529    emit currentInterfaceChanged (mList->currentItem() ?
     
    527533void VBoxNIList::addHostInterface()
    528534{
     535# if defined (Q_WS_WIN)
    529536    /* Allow the started helper process to make itself the foreground window */
    530537    AllowSetForegroundWindow (ASFW_ANY);
     
    569576    /* Allow the started helper process to make itself the foreground window */
    570577    AllowSetForegroundWindow (ASFW_ANY);
     578# endif /* Q_WS_WIN */
    571579}
    572580
     
    575583    Assert (mList->currentItem());
    576584
     585# if defined (Q_WS_WIN)
    577586    /* Allow the started helper process to make itself the foreground window */
    578587    AllowSetForegroundWindow (ASFW_ANY);
     
    618627
    619628    emit listChanged();
     629# endif /* Q_WS_WIN */
    620630}
    621631
     
    626636    mList->setWhatsThis (tr ("Lists all available host interfaces."));
    627637
     638# if defined (Q_WS_WIN)
    628639    mAddAction->setText (tr ("A&dd New Host Interface"));
    629640    mDelAction->setText (tr ("&Remove Selected Host Interface"));
     
    634645    mDelAction->setToolTip (mDelAction->text().remove ('&') +
    635646        QString (" (%1)").arg (mDelAction->shortcut().toString()));
     647# endif /* Q_WS_WIN */
    636648}
    637649
     
    661673    onCurrentItemChanged (mList->currentItem());
    662674}
    663 #endif
     675#endif /* Q_WS_WIN || Q_OS_MAC */
    664676
    665677
     
    678690    populateNetworksList();
    679691
    680 #ifdef Q_WS_WIN
     692#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    681693    /* Creating Interfaces List */
    682694    mNIList = new VBoxNIList (this);
     
    725737    }
    726738
    727 #ifdef Q_WS_WIN
     739#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    728740    setTabOrder (lastFocusWidget, mNIList->focusProxy());
    729741    connect (mTwAdapters, SIGNAL (currentChanged (int)),
     
    752764{
    753765    mValidator = aVal;
    754 #ifdef Q_WS_WIN
     766#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    755767    connect (mNIList, SIGNAL (listChanged()), mValidator, SLOT (revalidate()));
    756768#endif
     
    771783            vboxGlobal().toNetworkAttachmentType (page->mCbNAType->currentText());
    772784
    773 #ifdef Q_WS_WIN
     785#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    774786        if (type == KNetworkAttachmentType_HostInterface &&
    775787            page->interfaceName().isNull())
     
    840852}
    841853
    842 #ifdef Q_WS_WIN
     854#if defined (Q_WS_WIN) || defined (Q_OS_MAC)
    843855void VBoxVMSettingsNetworkPage::onCurrentPageChanged (int aIndex)
    844856{
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