Changeset 85796 in vbox
- Timestamp:
- Aug 17, 2020 11:02:54 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r85792 r85796 28 28 src/settings/global/UIGlobalSettingsDisplay.ui \ 29 29 src/settings/global/UIGlobalSettingsNetwork.ui \ 30 src/settings/global/UIGlobalSettingsNetworkDetailsNAT.ui \31 30 src/settings/global/UIGlobalSettingsExtension.ui \ 32 31 src/settings/global/UIGlobalSettingsProxy.ui -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsNAT.cpp
r82968 r85796 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 19 20 #include <QRegExpValidator> 21 #include <QLabel> 22 #include <QLineEdit> 23 #include <QPushButton> 20 24 21 25 /* GUI includes: */ 26 #include "QIDialogButtonBox.h" 22 27 #include "UIGlobalSettingsNetwork.h" 23 28 #include "UIGlobalSettingsNetworkDetailsNAT.h" … … 33 38 , m_ipv4rules(ipv4rules) 34 39 , m_ipv6rules(ipv6rules) 35 { 36 /* Apply UI decorations: */ 37 Ui::UIGlobalSettingsNetworkDetailsNAT::setupUi(this); 40 , m_pCheckboxNetwork(0) 41 , m_pLabelNetworkName(0) 42 , m_pLabelNetworkCIDR(0) 43 , m_pLabelOptionsAdvanced(0) 44 , m_pEditorNetworkName(0) 45 , m_pEditorNetworkCIDR(0) 46 , m_pCheckboxSupportsDHCP(0) 47 , m_pCheckboxSupportsIPv6(0) 48 , m_pCheckboxAdvertiseDefaultIPv6Route(0) 49 , m_pButtonPortForwarding(0) 50 , m_pContainerOptions(0) 51 { 52 prepareWidgets(); 38 53 39 54 /* Setup dialog: */ … … 51 66 } 52 67 68 void UIGlobalSettingsNetworkDetailsNAT::prepareWidgets() 69 { 70 if (objectName().isEmpty()) 71 setObjectName(QStringLiteral("UIGlobalSettingsNetworkDetailsNAT")); 72 QGridLayout *pGridLayout = new QGridLayout(this); 73 pGridLayout->setObjectName(QStringLiteral("pGridLayout")); 74 m_pCheckboxNetwork = new QCheckBox(); 75 m_pCheckboxNetwork->setObjectName(QStringLiteral("m_pCheckboxNetwork")); 76 pGridLayout->addWidget(m_pCheckboxNetwork, 0, 0, 1, 1); 77 78 m_pContainerOptions = new QWidget(); 79 m_pContainerOptions->setObjectName(QStringLiteral("m_pContainerOptions")); 80 QGridLayout *pGridLayout1 = new QGridLayout(m_pContainerOptions); 81 pGridLayout1->setObjectName(QStringLiteral("pGridLayout1")); 82 pGridLayout1->setContentsMargins(0, 0, 0, 0); 83 QSpacerItem *pSpacerItem = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); 84 pGridLayout1->addItem(pSpacerItem, 0, 0, 1, 1); 85 86 m_pLabelNetworkName = new QLabel(m_pContainerOptions); 87 m_pLabelNetworkName->setObjectName(QStringLiteral("m_pLabelNetworkName")); 88 m_pLabelNetworkName->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 89 pGridLayout1->addWidget(m_pLabelNetworkName, 0, 1, 1, 1); 90 91 m_pEditorNetworkName = new QLineEdit(m_pContainerOptions); 92 m_pEditorNetworkName->setObjectName(QStringLiteral("m_pEditorNetworkName")); 93 pGridLayout1->addWidget(m_pEditorNetworkName, 0, 2, 1, 2); 94 95 m_pLabelNetworkCIDR = new QLabel(m_pContainerOptions); 96 m_pLabelNetworkCIDR->setObjectName(QStringLiteral("m_pLabelNetworkCIDR")); 97 m_pLabelNetworkCIDR->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 98 pGridLayout1->addWidget(m_pLabelNetworkCIDR, 1, 1, 1, 1); 99 100 m_pEditorNetworkCIDR = new QLineEdit(m_pContainerOptions); 101 m_pEditorNetworkCIDR->setObjectName(QStringLiteral("m_pEditorNetworkCIDR")); 102 pGridLayout1->addWidget(m_pEditorNetworkCIDR, 1, 2, 1, 2); 103 104 m_pLabelOptionsAdvanced = new QLabel(m_pContainerOptions); 105 m_pLabelOptionsAdvanced->setObjectName(QStringLiteral("m_pLabelOptionsAdvanced")); 106 m_pLabelOptionsAdvanced->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignTop); 107 pGridLayout1->addWidget(m_pLabelOptionsAdvanced, 2, 1, 1, 1); 108 109 m_pCheckboxSupportsDHCP = new QCheckBox(m_pContainerOptions); 110 m_pCheckboxSupportsDHCP->setObjectName(QStringLiteral("m_pCheckboxSupportsDHCP")); 111 pGridLayout1->addWidget(m_pCheckboxSupportsDHCP, 2, 2, 1, 1); 112 113 m_pCheckboxSupportsIPv6 = new QCheckBox(m_pContainerOptions); 114 m_pCheckboxSupportsIPv6->setObjectName(QStringLiteral("m_pCheckboxSupportsIPv6")); 115 pGridLayout1->addWidget(m_pCheckboxSupportsIPv6, 3, 2, 1, 1); 116 117 m_pCheckboxAdvertiseDefaultIPv6Route = new QCheckBox(m_pContainerOptions); 118 m_pCheckboxAdvertiseDefaultIPv6Route->setObjectName(QStringLiteral("m_pCheckboxAdvertiseDefaultIPv6Route")); 119 pGridLayout1->addWidget(m_pCheckboxAdvertiseDefaultIPv6Route, 4, 2, 1, 1); 120 121 m_pButtonPortForwarding = new QPushButton(m_pContainerOptions); 122 m_pButtonPortForwarding->setObjectName(QStringLiteral("m_pButtonPortForwarding")); 123 pGridLayout1->addWidget(m_pButtonPortForwarding, 5, 2, 1, 1); 124 pGridLayout->addWidget(m_pContainerOptions, 1, 0, 1, 2); 125 126 QSpacerItem *pSpacerItem1 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 127 pGridLayout->addItem(pSpacerItem1, 2, 0, 1, 2); 128 129 QIDialogButtonBox *pButtonBox = new QIDialogButtonBox(); 130 pButtonBox->setObjectName(QStringLiteral("pButtonBox")); 131 pButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); 132 pGridLayout->addWidget(pButtonBox, 3, 0, 1, 2); 133 134 m_pLabelNetworkName->setBuddy(m_pEditorNetworkName); 135 m_pLabelNetworkCIDR->setBuddy(m_pEditorNetworkCIDR); 136 137 QObject::connect(m_pCheckboxNetwork, &QCheckBox::toggled, m_pContainerOptions, &QWidget::setEnabled); 138 QObject::connect(m_pCheckboxSupportsIPv6, &QCheckBox::toggled, m_pCheckboxAdvertiseDefaultIPv6Route, &QCheckBox::setEnabled); 139 QObject::connect(m_pButtonPortForwarding, &QPushButton::clicked, this, &UIGlobalSettingsNetworkDetailsNAT::sltEditPortForwarding); 140 QObject::connect(pButtonBox, &QIDialogButtonBox::accepted, this, &UIGlobalSettingsNetworkDetailsNAT::accept); 141 QObject::connect(pButtonBox, &QIDialogButtonBox::rejected, this, &UIGlobalSettingsNetworkDetailsNAT::reject); 142 143 } 144 53 145 void UIGlobalSettingsNetworkDetailsNAT::retranslateUi() 54 146 { 55 /* Translate uic generated strings: */ 56 Ui::UIGlobalSettingsNetworkDetailsNAT::retranslateUi(this); 147 setWindowTitle(tr("NAT Network Details")); 148 m_pCheckboxNetwork->setText(tr("&Enable Network")); 149 m_pCheckboxNetwork->setToolTip(tr("When checked, this network will be enabled.")); 150 m_pLabelNetworkName->setText(tr("Network &Name:")); 151 m_pEditorNetworkName->setToolTip(tr("Holds the name for this network.")); 152 m_pLabelNetworkCIDR->setText(tr("Network &CIDR:")); 153 m_pEditorNetworkCIDR->setToolTip(tr("Holds the CIDR for this network.")); 154 m_pLabelOptionsAdvanced->setText(tr("Network Options:")); 155 m_pCheckboxSupportsDHCP->setText(tr("Supports &DHCP")); 156 m_pCheckboxSupportsDHCP->setToolTip(tr("When checked, this network will support DHCP.")); 157 m_pCheckboxSupportsIPv6->setText(tr("Supports &IPv6")); 158 m_pCheckboxSupportsIPv6->setToolTip(tr("When checked, this network will support IPv6.")); 159 m_pCheckboxAdvertiseDefaultIPv6Route->setText(tr("Advertise Default IPv6 &Route")); 160 m_pCheckboxAdvertiseDefaultIPv6Route->setToolTip(tr("When checked, this network will be advertised as the default IPv6 route.")); 161 m_pButtonPortForwarding->setToolTip(tr("Displays a window to configure port forwarding rules.")); 162 m_pButtonPortForwarding->setText(tr("&Port Forwarding")); 57 163 } 58 164 … … 107 213 m_data.m_fAdvertiseDefaultIPv6Route = m_pCheckboxAdvertiseDefaultIPv6Route->isChecked(); 108 214 } 109 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsNAT.h
r82968 r85796 25 25 #include "QIDialog.h" 26 26 #include "QIWithRetranslateUI.h" 27 #include "UIGlobalSettingsNetworkDetailsNAT.gen.h"28 27 #include "UIPortForwardingTable.h" 29 28 29 /* Forward declarations. */ 30 class QCheckBox; 31 class QLabel; 32 class QLineEdit; 30 33 31 34 /** Global settings: Network page: NAT network data structure. */ … … 80 83 81 84 /* Global settings / Network page / Details sub-dialog: */ 82 class SHARED_LIBRARY_STUFF UIGlobalSettingsNetworkDetailsNAT : public QIWithRetranslateUI2<QIDialog> , public Ui::UIGlobalSettingsNetworkDetailsNAT85 class SHARED_LIBRARY_STUFF UIGlobalSettingsNetworkDetailsNAT : public QIWithRetranslateUI2<QIDialog> 83 86 { 84 87 Q_OBJECT; … … 107 110 private: 108 111 112 /* Prepares widgets. */ 113 void prepareWidgets(); 114 109 115 /* Helpers: Load/Save stuff: */ 110 116 void load(); … … 118 124 /** Holds IPv6 port forwarding rules. */ 119 125 UIPortForwardingDataList &m_ipv6rules; 126 127 /** @name Widgets 128 * @{ */ 129 QCheckBox *m_pCheckboxNetwork; 130 QLabel *m_pLabelNetworkName; 131 QLabel *m_pLabelNetworkCIDR; 132 QLabel *m_pLabelOptionsAdvanced; 133 QLineEdit *m_pEditorNetworkName; 134 QLineEdit *m_pEditorNetworkCIDR; 135 QCheckBox *m_pCheckboxSupportsDHCP; 136 QCheckBox *m_pCheckboxSupportsIPv6; 137 QCheckBox *m_pCheckboxAdvertiseDefaultIPv6Route; 138 QPushButton *m_pButtonPortForwarding; 139 QWidget *m_pContainerOptions; 140 /** @} */ 120 141 }; 121 142
Note:
See TracChangeset
for help on using the changeset viewer.