1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * VBoxVMSettingsNetwork class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 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 | /* VBox Includes */
|
---|
27 | #include "COMDefs.h"
|
---|
28 | #include "VBoxSettingsPage.h"
|
---|
29 | #include "QIArrowButtonSwitch.h"
|
---|
30 | #include "VBoxVMSettingsNetwork.gen.h"
|
---|
31 |
|
---|
32 | /* VBox Forwardes */
|
---|
33 | class VBoxVMSettingsNetworkPage;
|
---|
34 | class QIArrowButtonSwitch;
|
---|
35 |
|
---|
36 | class VBoxVMSettingsNetwork : public QIWithRetranslateUI <QWidget>,
|
---|
37 | public Ui::VBoxVMSettingsNetwork
|
---|
38 | {
|
---|
39 | Q_OBJECT;
|
---|
40 |
|
---|
41 | public:
|
---|
42 |
|
---|
43 | VBoxVMSettingsNetwork (VBoxVMSettingsNetworkPage *aParent);
|
---|
44 |
|
---|
45 | void getFromAdapter (const CNetworkAdapter &aAdapter);
|
---|
46 | void putBackToAdapter();
|
---|
47 |
|
---|
48 | void setValidator (QIWidgetValidator *aValidator);
|
---|
49 | bool revalidate (QString &aWarning, QString &aTitle);
|
---|
50 |
|
---|
51 | QWidget* setOrderAfter (QWidget *aAfter);
|
---|
52 |
|
---|
53 | QString pageTitle() const;
|
---|
54 | KNetworkAttachmentType attachmentType() const;
|
---|
55 | QString alternativeName (int aType = -1) const;
|
---|
56 |
|
---|
57 | protected:
|
---|
58 |
|
---|
59 | void retranslateUi();
|
---|
60 |
|
---|
61 | private slots:
|
---|
62 |
|
---|
63 | void updateAttachmentAlternative();
|
---|
64 | void updateAlternativeName();
|
---|
65 | void toggleAdvanced();
|
---|
66 | void generateMac();
|
---|
67 |
|
---|
68 | private:
|
---|
69 |
|
---|
70 | void populateComboboxes();
|
---|
71 |
|
---|
72 | VBoxVMSettingsNetworkPage *mParent;
|
---|
73 | CNetworkAdapter mAdapter;
|
---|
74 | QIWidgetValidator *mValidator;
|
---|
75 | QIArrowButtonSwitch *mAbsAdvanced;
|
---|
76 |
|
---|
77 | QString mBrgName;
|
---|
78 | QString mIntName;
|
---|
79 | QString mHoiName;
|
---|
80 | };
|
---|
81 |
|
---|
82 | class VBoxVMSettingsNetworkPage : public VBoxSettingsPage
|
---|
83 | {
|
---|
84 | Q_OBJECT;
|
---|
85 |
|
---|
86 | public:
|
---|
87 |
|
---|
88 | VBoxVMSettingsNetworkPage();
|
---|
89 |
|
---|
90 | QStringList brgList (bool aRefresh = false);
|
---|
91 | QStringList intList (bool aRefresh = false);
|
---|
92 | QStringList hoiList (bool aRefresh = false);
|
---|
93 |
|
---|
94 | protected:
|
---|
95 |
|
---|
96 | void getFrom (const CMachine &aMachine);
|
---|
97 | void putBackTo();
|
---|
98 |
|
---|
99 | void setValidator (QIWidgetValidator *aValidator);
|
---|
100 | bool revalidate (QString &aWarning, QString &aTitle);
|
---|
101 |
|
---|
102 | void retranslateUi();
|
---|
103 |
|
---|
104 | private slots:
|
---|
105 |
|
---|
106 | void updatePages();
|
---|
107 |
|
---|
108 | private:
|
---|
109 |
|
---|
110 | QIWidgetValidator *mValidator;
|
---|
111 | QTabWidget *mTwAdapters;
|
---|
112 |
|
---|
113 | QStringList mBrgList;
|
---|
114 | QStringList mIntList;
|
---|
115 | QStringList mHoiList;
|
---|
116 | };
|
---|
117 |
|
---|
118 | #endif // __VBoxVMSettingsNetwork_h__
|
---|
119 |
|
---|