VirtualBox

Ignore:
Timestamp:
Mar 13, 2009 1:06:28 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 2869: Rework network adapter UI - Initial Version!

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r17730 r17784  
    263263#if defined Q_WS_WIN
    264264    int confirmDeletingHostInterface (const QString &aName, QWidget *aParent = 0);
    265     void cannotCreateHostInterface (const CHost &aHost,
    266                                     QWidget *aParent = 0);
    267     void cannotCreateHostInterface (const CProgress &aProgress, const QString &aName,
    268                                     QWidget *aParent = 0);
     265    void cannotCreateHostInterface (const CHost &aHost, QWidget *aParent = 0);
     266    void cannotCreateHostInterface (const CProgress &aProgress, QWidget *aParent = 0);
    269267    void cannotRemoveHostInterface (const CHost &aHost,
    270268                                    const CHostNetworkInterface &aIface,
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsNetwork.h

    r17217 r17784  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2008 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424#define __VBoxVMSettingsNetwork_h__
    2525
     26/* VBox Includes */
     27#include "COMDefs.h"
    2628#include "VBoxSettingsPage.h"
    2729#include "VBoxVMSettingsNetwork.gen.h"
    28 #include "COMDefs.h"
    2930
    30 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT)
    31 class QTreeWidget;
    32 class QTreeWidgetItem;
    33 #endif
     31/* VBox Forwardes */
     32class VBoxVMSettingsNetworkPage;
     33class VBoxVMSettingsNetworkDetails;
    3434
    35 /*
    36  * QWidget sub-class which represents one tab-page per each network adapter.
    37  * It has generated UI part.
    38  */
    39 class VBoxVMSettingsNetwork : public QIWithRetranslateUI<QWidget>,
     35class VBoxVMSettingsNetwork : public QIWithRetranslateUI <QWidget>,
    4036                              public Ui::VBoxVMSettingsNetwork
    4137{
     
    4440public:
    4541
    46     VBoxVMSettingsNetwork();
     42    VBoxVMSettingsNetwork (VBoxVMSettingsNetworkPage *aParent);
    4743
    4844    void getFromAdapter (const CNetworkAdapter &aAdapter);
    4945    void putBackToAdapter();
    5046
    51     QString pageTitle() const;
    52 
    5347    void setValidator (QIWidgetValidator *aValidator);
     48    bool revalidate (QString &aWarning, QString &aTitle);
    5449
    5550    QWidget* setOrderAfter (QWidget *aAfter);
    5651
    57     void setNetworksList (const QStringList &aList);
    58 
    59 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT)
    60     void setInterfaceName (const QString &);
    61     QString interfaceName() const;
    62 #endif
     52    QString pageTitle() const;
     53    QString currentName (KNetworkAttachmentType aType = KNetworkAttachmentType_Null) const;
    6354
    6455protected:
     
    6859private slots:
    6960
    70     void adapterToggled (bool aOn);
    71     void naTypeChanged (const QString &aString);
    72     void genMACClicked();
     61    void updateCableConnectedState();
     62    void detailsClicked();
    7363
    7464private:
    7565
    76     void prepareComboboxes();
     66    void populateComboboxes();
     67    KNetworkAttachmentType attachmentType() const;
    7768
    78     void setTapEnabled (bool aEnabled);
    79     void setTapVisible (bool aVisible);
    80 
     69    VBoxVMSettingsNetworkPage *mParent;
     70    VBoxVMSettingsNetworkDetails *mDetails;
    8171    CNetworkAdapter mAdapter;
    8272    QIWidgetValidator *mValidator;
    83 
    84 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT)
    85     QString mInterfaceName;
    86 #endif
    8773};
    8874
    89 
    90 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT)
    91 /*
    92  * QGroupBox sub-class which represents network interface list.
    93  */
    94 class VBoxNIList : public QIWithRetranslateUI<QWidget>
    95 {
    96     Q_OBJECT;
    97 
    98 public:
    99 
    100     VBoxNIList (QWidget *aParent);
    101 
    102     bool isWrongInterface() const;
    103     void setCurrentInterface (const QString &aName);
    104 #if defined (Q_WS_WIN) && defined(VBOX_WITH_NETFLT)
    105     void updateInterfacesList(KNetworkAttachmentType enmAttachmentType);
    106 #endif
    107 signals:
    108 
    109     void listChanged();
    110     void currentInterfaceChanged (const QString &);
    111 
    112 private slots:
    113 
    114     void onCurrentItemChanged (QTreeWidgetItem *aCurrent, QTreeWidgetItem *aPrev = 0);
    115     void addHostInterface();
    116     void delHostInterface();
    117 
    118 protected:
    119 
    120     void retranslateUi();
    121 
    122 private:
    123 #if defined (Q_WS_WIN) && defined(VBOX_WITH_NETFLT)
    124     void populateInterfacesList(KNetworkAttachmentType enmAttachmentType);
    125 #else
    126     void populateInterfacesList();
    127 #endif
    128     QILabelSeparator *mLbTitle;
    129     QTreeWidget      *mList;
    130 
    131 # if defined (Q_WS_WIN)
    132     QAction *mAddAction;
    133     QAction *mDelAction;
    134 #  ifdef VBOX_WITH_NETFLT
    135     KNetworkAttachmentType mEnmAttachmentType;
    136 #  endif
    137 # endif
    138 };
    139 #endif /* Q_WS_WIN || VBOX_WITH_NETFLT */
    140 
    141 
    142 /*
    143  * QWidget sub-class which represents network settings page itself.
    144  */
    14575class VBoxVMSettingsNetworkPage : public VBoxSettingsPage
    14676{
     
    15181    VBoxVMSettingsNetworkPage();
    15282
     83    QStringList natList() const;
     84    QStringList netList() const;
     85    QStringList intList (KHostNetworkInterfaceType aType) const;
     86
    15387protected:
    15488
     
    15690    void putBackTo();
    15791
    158     void setValidator (QIWidgetValidator *aVal);
     92    void setValidator (QIWidgetValidator *aValidator);
    15993    bool revalidate (QString &aWarning, QString &aTitle);
    16094
    16195    void retranslateUi();
    16296
    163 private slots:
    164 
    165     void updateNetworksList();
    166 #if defined (VBOX_WITH_NETFLT)
    167     void updateInterfaceList();
    168 #endif
    169 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT)
    170     void onCurrentPageChanged (int);
    171     void onCurrentInterfaceChanged (const QString &);
    172 #endif
    173 
    17497private:
    17598
    176     void populateNetworksList();
    177 
    178     /* Widgets */
     99    QIWidgetValidator *mValidator;
    179100    QTabWidget *mTwAdapters;
    180 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT)
    181     VBoxNIList *mNIList;
    182 #endif
    183 
    184     /* Widget Validator*/
    185     QIWidgetValidator *mValidator;
    186 
    187     /* Lists */
    188     QStringList mListNetworks;
    189 
    190     /* Flags */
    191     bool mLockNetworkListUpdate;
    192101};
    193102
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