VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxGLSettingsNetwork.h@ 18235

Last change on this file since 18235 was 18235, checked in by vboxsync, 16 years ago

FE/Qt4: 2869: Rework network adapter UI - Host-only Interface settings moved to Global Settings.

  • Property svn:eol-style set to native
File size: 4.4 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt4 GUI ("VirtualBox"):
4 * VBoxGLSettingsNetwork class declaration
5 */
6
7/*
8 * Copyright (C) 2009 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 __VBoxGLSettingsNetwork_h__
24#define __VBoxGLSettingsNetwork_h__
25
26#include "VBoxSettingsPage.h"
27#include "VBoxGLSettingsNetwork.gen.h"
28
29class NetworkItem : public QTreeWidgetItem
30{
31public:
32
33 NetworkItem();
34
35 void getFromInterface (const CHostNetworkInterface &aInterface);
36 void putBackToInterface();
37
38 bool revalidate (QString &aWarning, QString &aTitle);
39
40 QString updateInfo();
41
42 /* Common getters */
43 bool isChanged() const { return mChanged; }
44
45 /* Common setters */
46 void setChanged (bool aChanged) { mChanged = aChanged; }
47
48 /* Page getters */
49 bool isDhcpClientEnabled() const { return mDhcpClientEnabled; }
50 QString interfaceAddress() const { return mInterfaceAddress; }
51 QString interfaceMask() const { return mInterfaceMask; }
52 bool isIpv6Supported() const { return mIpv6Supported; }
53 QString interfaceAddress6() const { return mInterfaceAddress6; }
54 QString interfaceMaskLength6() const { return mInterfaceMaskLength6; }
55
56 bool isDhcpServerEnabled() const { return mDhcpServerEnabled; }
57 QString dhcpServerAddress() const { return mDhcpServerAddress; }
58 QString dhcpServerMask() const { return mDhcpServerMask; }
59 QString dhcpLowerAddress() const { return mDhcpLowerAddress; }
60 QString dhcpUpperAddress() const { return mDhcpUpperAddress; }
61
62 /* Page setters */
63 void setDhcpClientEnabled (bool aEnabled) { mDhcpClientEnabled = aEnabled; }
64 void setInterfaceAddress (const QString &aValue) { mInterfaceAddress = aValue; }
65 void setInterfaceMask (const QString &aValue) { mInterfaceMask = aValue; }
66 void setIp6Supported (bool aSupported) { mIpv6Supported = aSupported; }
67 void setInterfaceAddress6 (const QString &aValue) { mInterfaceAddress6 = aValue; }
68 void setInterfaceMaskLength6 (const QString &aValue) { mInterfaceMaskLength6 = aValue; }
69
70 void setDhcpServerEnabled (bool aEnabled) { mDhcpServerEnabled = aEnabled; }
71 void setDhcpServerAddress (const QString &aValue) { mDhcpServerAddress = aValue; }
72 void setDhcpServerMask (const QString &aValue) { mDhcpServerMask = aValue; }
73 void setDhcpLowerAddress (const QString &aValue) { mDhcpLowerAddress = aValue; }
74 void setDhcpUpperAddress (const QString &aValue) { mDhcpUpperAddress = aValue; }
75
76private:
77
78 /* Common */
79 CHostNetworkInterface mInterface;
80 bool mChanged;
81
82 /* Host-only Interface */
83 bool mDhcpClientEnabled;
84 QString mInterfaceAddress;
85 QString mInterfaceMask;
86 bool mIpv6Supported;
87 QString mInterfaceAddress6;
88 QString mInterfaceMaskLength6;
89
90 /* DHCP Server */
91 bool mDhcpServerEnabled;
92 QString mDhcpServerAddress;
93 QString mDhcpServerMask;
94 QString mDhcpLowerAddress;
95 QString mDhcpUpperAddress;
96};
97
98class VBoxGLSettingsNetwork : public VBoxSettingsPage,
99 public Ui::VBoxGLSettingsNetwork
100{
101 Q_OBJECT;
102
103public:
104
105 VBoxGLSettingsNetwork();
106
107protected:
108
109 void getFrom (const CSystemProperties &aProps,
110 const VBoxGlobalSettings &aGs);
111 void putBackTo (CSystemProperties &aProps,
112 VBoxGlobalSettings &aGs);
113
114 void setValidator (QIWidgetValidator *aVal);
115 bool revalidate (QString &aWarning, QString &aTitle);
116
117 void setOrderAfter (QWidget *aWidget);
118
119 void retranslateUi();
120
121private slots:
122
123 void addInterface();
124 void remInterface();
125 void editInterface();
126 void updateCurrentItem();
127 void showContextMenu (const QPoint &aPos);
128
129private:
130
131 QAction *mAddInterface;
132 QAction *mRemInterface;
133 QAction *mEditInterface;
134
135 QIWidgetValidator *mValidator;
136};
137
138#endif // __VBoxGLSettingsNetwork_h__
139
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette