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