1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * VBoxVMSettingsNetwork class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2008 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VBoxVMSettingsNetwork_h__
|
---|
24 | #define __VBoxVMSettingsNetwork_h__
|
---|
25 |
|
---|
26 | #include "VBoxVMSettingsNetwork.gen.h"
|
---|
27 | #include "QIWithRetranslateUI.h"
|
---|
28 | #include "COMDefs.h"
|
---|
29 |
|
---|
30 | class VBoxVMSettingsDlg;
|
---|
31 | class QIWidgetValidator;
|
---|
32 |
|
---|
33 | class VBoxVMSettingsNetwork : public QIWithRetranslateUI<QWidget>,
|
---|
34 | public Ui::VBoxVMSettingsNetwork
|
---|
35 | {
|
---|
36 | Q_OBJECT;
|
---|
37 |
|
---|
38 | public:
|
---|
39 |
|
---|
40 | VBoxVMSettingsNetwork (QWidget *aParent = NULL);
|
---|
41 |
|
---|
42 | static void getFromMachine (const CMachine &aMachine,
|
---|
43 | QWidget *aPage,
|
---|
44 | VBoxVMSettingsDlg *aDlg,
|
---|
45 | const QString &aPath);
|
---|
46 | static void putBackToMachine();
|
---|
47 | static bool revalidate (QString &aWarning, QString &aTitle);
|
---|
48 |
|
---|
49 | void loadListNetworks (const QStringList &aList);
|
---|
50 |
|
---|
51 | void getFromAdapter (const CNetworkAdapter &aAdapter);
|
---|
52 | void putBackToAdapter();
|
---|
53 |
|
---|
54 | void setValidator (QIWidgetValidator *aValidator);
|
---|
55 |
|
---|
56 | protected:
|
---|
57 |
|
---|
58 | void retranslateUi();
|
---|
59 |
|
---|
60 | private slots:
|
---|
61 |
|
---|
62 | static void updateListNetworks();
|
---|
63 | // #ifdef Q_WS_WIN
|
---|
64 | // static void addHostInterface();
|
---|
65 | // static void delHostInterface();
|
---|
66 | // #endif
|
---|
67 |
|
---|
68 | void adapterToggled (bool aOn);
|
---|
69 | void naTypeChanged (const QString &aString);
|
---|
70 | void genMACClicked();
|
---|
71 | #ifdef Q_WS_X11
|
---|
72 | void tapSetupClicked();
|
---|
73 | void tapTerminateClicked();
|
---|
74 | #endif
|
---|
75 |
|
---|
76 | private:
|
---|
77 |
|
---|
78 | QString pageTitle() const;
|
---|
79 | void prepareComboboxes();
|
---|
80 |
|
---|
81 | static void prepareListNetworks();
|
---|
82 | // #ifdef Q_WS_WIN
|
---|
83 | // static void prepareListInterfaces();
|
---|
84 | // #endif
|
---|
85 |
|
---|
86 | /* Widgets */
|
---|
87 | static QTabWidget *mTwAdapters;
|
---|
88 | // #ifdef Q_WS_WIN
|
---|
89 | // static QGroupBox *mGbInterfaces;
|
---|
90 | // static QListWidget *mLwInterfaces;
|
---|
91 | // #endif
|
---|
92 |
|
---|
93 | /* Actions */
|
---|
94 | // #ifdef Q_WS_WIN
|
---|
95 | // static QAction *mAddAction;
|
---|
96 | // static QAction *mDelAction;
|
---|
97 | // #endif
|
---|
98 |
|
---|
99 | /* Flags */
|
---|
100 | static bool mLockNetworkListUpdate;
|
---|
101 |
|
---|
102 | /* Lists */
|
---|
103 | static QStringList mListNetworks;
|
---|
104 | // #ifdef Q_WS_WIN
|
---|
105 | // static QStringList mListInterface;
|
---|
106 | // static QString mNoInterfaces;
|
---|
107 | // #endif
|
---|
108 |
|
---|
109 | QIWidgetValidator *mValidator;
|
---|
110 | CNetworkAdapter mAdapter;
|
---|
111 | // #ifdef Q_WS_WIN
|
---|
112 | // QString mInterface_win;
|
---|
113 | // #endif
|
---|
114 | };
|
---|
115 |
|
---|
116 | #endif // __VBoxVMSettingsNetwork_h__
|
---|
117 |
|
---|