Changeset 85764 in vbox for trunk/src/VBox
- Timestamp:
- Aug 14, 2020 11:06:06 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139915
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r85751 r85764 32 32 src/settings/global/UIGlobalSettingsExtension.ui \ 33 33 src/settings/global/UIGlobalSettingsProxy.ui \ 34 src/settings/machine/UIMachineSettingsNetwork.ui \35 34 src/settings/machine/UIMachineSettingsUSB.ui \ 36 35 src/settings/machine/UIMachineSettingsUSBFilterDetails.ui -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r82968 r85764 16 16 */ 17 17 18 /* Qt includes: */ 19 #include <QCheckBox> 20 #include <QComboBox> 21 #include <QGridLayout> 22 #include <QLabel> 23 #include <QPushButton> 24 #include <QTextEdit> 25 18 26 /* GUI includes: */ 19 27 #include "QIArrowButtonSwitch.h" 28 #include "QILineEdit.h" 20 29 #include "QITabWidget.h" 30 #include "QIToolButton.h" 21 31 #include "QIWidgetValidator.h" 32 #include "UICommon.h" 22 33 #include "UIConverter.h" 34 #include "UIErrorString.h" 23 35 #include "UIIconPool.h" 24 36 #include "UIMachineSettingsNetwork.h" 25 #include "UIErrorString.h"26 37 #include "UIExtraDataManager.h" 27 #include "UI Common.h"38 #include "UINetworkAttachmentEditor.h" 28 39 29 40 /* COM includes: */ … … 142 153 143 154 /** Machine settings: Network Adapter tab. */ 144 class UIMachineSettingsNetwork : public QIWithRetranslateUI<QWidget>, 145 public Ui::UIMachineSettingsNetwork 155 class UIMachineSettingsNetwork : public QIWithRetranslateUI<QWidget> 146 156 { 147 157 Q_OBJECT; … … 200 210 void prepareValidation(); 201 211 212 /* Prepares widgets: */ 213 void prepareWidgets(); 214 202 215 /* Helping stuff: */ 203 216 void populateComboboxes(); … … 217 230 KNetworkAdapterType m_enmAdapterType; 218 231 UIPortForwardingDataList m_portForwardingRules; 232 233 /** @name Widgets 234 * @{ */ 235 QLabel *m_pAttachmentTypeLabel; 236 QLabel *m_pAdapterNameLabel; 237 QLabel *m_pAdapterTypeLabel; 238 QLabel *m_pPromiscuousModeLabel; 239 QLabel *m_pMACLabel; 240 QLabel *m_pGenericPropertiesLabel; 241 UINetworkAttachmentEditor *m_pAttachmentTypeEditor; 242 QILineEdit *m_pMACEditor; 243 QIToolButton *m_pMACButton; 244 QIArrowButtonSwitch *m_pAdvancedArrow; 245 QCheckBox *m_pEnableAdapterCheckBox; 246 QCheckBox *m_pCableConnectedCheckBox; 247 QPushButton *m_pPortForwardingButton; 248 QComboBox *m_pPromiscuousModeCombo; 249 QComboBox *m_pAdapterTypeCombo; 250 QTextEdit *m_pGenericPropertiesTextEdit; 251 QWidget *m_pAdapterOptionsContainer; 252 /** @} */ 219 253 }; 220 254 … … 230 264 , m_enmAdapterType(KNetworkAdapterType_Null) 231 265 { 232 /* Apply UI decorations: */ 233 Ui::UIMachineSettingsNetwork::setupUi(this); 266 prepareWidgets(); 234 267 235 268 /* Determine icon metric: */ … … 567 600 void UIMachineSettingsNetwork::retranslateUi() 568 601 { 569 /* Translate uic generated strings: */ 570 Ui::UIMachineSettingsNetwork::retranslateUi(this); 602 m_pEnableAdapterCheckBox->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "When checked, plugs this virtual " 603 "network adapter into the virtual machine.")); 604 m_pEnableAdapterCheckBox->setText(QApplication::translate("UIMachineSettingsNetwork", "&Enable Network Adapter")); 605 m_pAttachmentTypeLabel->setText(QApplication::translate("UIMachineSettingsNetwork", "&Attached to:")); 606 m_pAttachmentTypeEditor->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Selects how this virtual adapter " 607 "is attached to the real network of the Host OS.")); 608 m_pAdapterNameLabel->setText(QApplication::translate("UIMachineSettingsNetwork", "&Name:")); 609 m_pAdvancedArrow->setText(QApplication::translate("UIMachineSettingsNetwork", "A&dvanced")); 610 m_pAdvancedArrow->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Shows additional network adapter options.")); 611 m_pAdapterTypeLabel->setText(QApplication::translate("UIMachineSettingsNetwork", "Adapter &Type:")); 612 m_pAdapterTypeCombo->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Selects the type of the virtual network " 613 "adapter. Depending on this value, VirtualBox will provide different " 614 "network hardware to the virtual machine.")); 615 m_pPromiscuousModeLabel->setText(QApplication::translate("UIMachineSettingsNetwork", "&Promiscuous Mode:")); 616 m_pPromiscuousModeCombo->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Selects the promiscuous mode policy " 617 "of the network adapter when attached to an internal network, " 618 "host only network or a bridge.")); 619 m_pMACLabel->setText(QApplication::translate("UIMachineSettingsNetwork", "&MAC Address:")); 620 m_pMACEditor->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Holds the MAC address of this adapter. It contains " 621 "exactly 12 characters chosen from {0-9,A-F}. Note that the second character " 622 "must be an even digit.")); 623 m_pMACButton->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Generates a new random MAC address.")); 624 m_pGenericPropertiesLabel->setText(QApplication::translate("UIMachineSettingsNetwork", "Generic Properties:")); 625 m_pGenericPropertiesTextEdit->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Holds the configuration settings " 626 "for the network attachment driver. The settings should be of " 627 "the form <b>name=value</b> and will depend on the driver. " 628 "Use <b>shift-enter</b> to add a new entry.")); 629 m_pCableConnectedCheckBox->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "When checked, the virtual network " 630 "cable is plugged in.")); 631 m_pCableConnectedCheckBox->setText(QApplication::translate("UIMachineSettingsNetwork", "&Cable Connected")); 632 m_pPortForwardingButton->setWhatsThis(QApplication::translate("UIMachineSettingsNetwork", "Displays a window to configure port " 633 "forwarding rules.")); 634 m_pPortForwardingButton->setText(QApplication::translate("UIMachineSettingsNetwork", "&Port Forwarding")); 571 635 572 636 /* Translate combo-boxes content: */ … … 666 730 /* Configure validation: */ 667 731 connect(m_pMACEditor, &QILineEdit::textChanged, m_pParent, &UIMachineSettingsNetworkPage::revalidate); 732 } 733 734 void UIMachineSettingsNetwork::prepareWidgets() 735 { 736 if (objectName().isEmpty()) 737 setObjectName(QStringLiteral("UIMachineSettingsNetwork")); 738 resize(430, 250); 739 QGridLayout *pMainLayout = new QGridLayout(this); 740 pMainLayout->setObjectName(QStringLiteral("pMainLayout")); 741 m_pEnableAdapterCheckBox = new QCheckBox(this); 742 m_pEnableAdapterCheckBox->setObjectName(QStringLiteral("m_pEnableAdapterCheckBox")); 743 744 pMainLayout->addWidget(m_pEnableAdapterCheckBox, 0, 0, 1, 2); 745 QSpacerItem *pHorizontalSpacer1 = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); 746 pMainLayout->addItem(pHorizontalSpacer1, 1, 0, 1, 1); 747 748 m_pAdapterOptionsContainer = new QWidget(); 749 m_pAdapterOptionsContainer->setObjectName(QStringLiteral("m_pAdapterOptionsContainer")); 750 QGridLayout *pAdapterOptionsLayout = new QGridLayout(m_pAdapterOptionsContainer); 751 pAdapterOptionsLayout->setContentsMargins(0, 0, 0, 0); 752 pAdapterOptionsLayout->setObjectName(QStringLiteral("pAdapterOptionsLayout")); 753 m_pAttachmentTypeLabel = new QLabel(m_pAdapterOptionsContainer); 754 m_pAttachmentTypeLabel->setObjectName(QStringLiteral("m_pAttachmentTypeLabel")); 755 m_pAttachmentTypeLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 756 pAdapterOptionsLayout->addWidget(m_pAttachmentTypeLabel, 0, 0, 1, 1); 757 758 m_pAttachmentTypeEditor = new UINetworkAttachmentEditor(m_pAdapterOptionsContainer); 759 m_pAttachmentTypeEditor->setObjectName(QStringLiteral("m_pAttachmentTypeEditor")); 760 pAdapterOptionsLayout->addWidget(m_pAttachmentTypeEditor, 0, 1, 2, 3); 761 762 m_pAdapterNameLabel = new QLabel(m_pAdapterOptionsContainer); 763 m_pAdapterNameLabel->setObjectName(QStringLiteral("m_pAdapterNameLabel")); 764 m_pAdapterNameLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 765 pAdapterOptionsLayout->addWidget(m_pAdapterNameLabel, 1, 0, 1, 1); 766 767 QHBoxLayout *pAdvancedButtonLayout = new QHBoxLayout(); 768 pAdvancedButtonLayout->setContentsMargins(0, 0, 0, 0); 769 pAdvancedButtonLayout->setObjectName(QStringLiteral("pAdvancedButtonLayout")); 770 QSpacerItem *pHorizontalSpacer2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); 771 pAdvancedButtonLayout->addItem(pHorizontalSpacer2); 772 773 m_pAdvancedArrow = new QIArrowButtonSwitch(m_pAdapterOptionsContainer); 774 m_pAdvancedArrow->setObjectName(QStringLiteral("m_pAdvancedArrow")); 775 pAdvancedButtonLayout->addWidget(m_pAdvancedArrow); 776 pAdapterOptionsLayout->addLayout(pAdvancedButtonLayout, 2, 0, 1, 1); 777 778 m_pAdapterTypeLabel = new QLabel(m_pAdapterOptionsContainer); 779 m_pAdapterTypeLabel->setObjectName(QStringLiteral("m_pAdapterTypeLabel")); 780 m_pAdapterTypeLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 781 pAdapterOptionsLayout->addWidget(m_pAdapterTypeLabel, 3, 0, 1, 1); 782 783 m_pAdapterTypeCombo = new QComboBox(m_pAdapterOptionsContainer); 784 m_pAdapterTypeCombo->setObjectName(QStringLiteral("m_pAdapterTypeCombo")); 785 QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 786 sizePolicy.setHorizontalStretch(1); 787 sizePolicy.setVerticalStretch(0); 788 sizePolicy.setHeightForWidth(m_pAdapterTypeCombo->sizePolicy().hasHeightForWidth()); 789 m_pAdapterTypeCombo->setSizePolicy(sizePolicy); 790 pAdapterOptionsLayout->addWidget(m_pAdapterTypeCombo, 3, 1, 1, 3); 791 792 m_pPromiscuousModeLabel = new QLabel(m_pAdapterOptionsContainer); 793 m_pPromiscuousModeLabel->setObjectName(QStringLiteral("m_pPromiscuousModeLabel")); 794 m_pPromiscuousModeLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 795 pAdapterOptionsLayout->addWidget(m_pPromiscuousModeLabel, 4, 0, 1, 1); 796 797 m_pPromiscuousModeCombo = new QComboBox(m_pAdapterOptionsContainer); 798 m_pPromiscuousModeCombo->setObjectName(QStringLiteral("m_pPromiscuousModeCombo")); 799 sizePolicy.setHeightForWidth(m_pPromiscuousModeCombo->sizePolicy().hasHeightForWidth()); 800 m_pPromiscuousModeCombo->setSizePolicy(sizePolicy); 801 pAdapterOptionsLayout->addWidget(m_pPromiscuousModeCombo, 4, 1, 1, 3); 802 803 m_pMACLabel = new QLabel(m_pAdapterOptionsContainer); 804 m_pMACLabel->setObjectName(QStringLiteral("m_pMACLabel")); 805 m_pMACLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 806 pAdapterOptionsLayout->addWidget(m_pMACLabel, 5, 0, 1, 1); 807 808 m_pMACEditor = new QILineEdit(m_pAdapterOptionsContainer); 809 m_pMACEditor->setObjectName(QStringLiteral("m_pMACEditor")); 810 sizePolicy.setHeightForWidth(m_pMACEditor->sizePolicy().hasHeightForWidth()); 811 m_pMACEditor->setSizePolicy(sizePolicy); 812 pAdapterOptionsLayout->addWidget(m_pMACEditor, 5, 1, 1, 2); 813 814 m_pMACButton = new QIToolButton(m_pAdapterOptionsContainer); 815 m_pMACButton->setObjectName(QStringLiteral("m_pMACButton")); 816 pAdapterOptionsLayout->addWidget(m_pMACButton, 5, 3, 1, 1); 817 818 m_pGenericPropertiesLabel = new QLabel(m_pAdapterOptionsContainer); 819 m_pGenericPropertiesLabel->setObjectName(QStringLiteral("m_pGenericPropertiesLabel")); 820 m_pGenericPropertiesLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignTop); 821 pAdapterOptionsLayout->addWidget(m_pGenericPropertiesLabel, 6, 0, 1, 1); 822 823 m_pGenericPropertiesTextEdit = new QTextEdit(m_pAdapterOptionsContainer); 824 m_pGenericPropertiesTextEdit->setObjectName(QStringLiteral("m_pGenericPropertiesTextEdit")); 825 pAdapterOptionsLayout->addWidget(m_pGenericPropertiesTextEdit, 6, 1, 1, 3); 826 827 m_pCableConnectedCheckBox = new QCheckBox(m_pAdapterOptionsContainer); 828 m_pCableConnectedCheckBox->setObjectName(QStringLiteral("m_pCableConnectedCheckBox")); 829 pAdapterOptionsLayout->addWidget(m_pCableConnectedCheckBox, 7, 1, 1, 3); 830 831 m_pPortForwardingButton = new QPushButton(m_pAdapterOptionsContainer); 832 m_pPortForwardingButton->setObjectName(QStringLiteral("m_pPortForwardingButton")); 833 pAdapterOptionsLayout->addWidget(m_pPortForwardingButton, 8, 1, 1, 1); 834 835 QSpacerItem *pVerticalSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 836 pAdapterOptionsLayout->addItem(pVerticalSpacer, 9, 0, 1, 4); 837 pMainLayout->addWidget(m_pAdapterOptionsContainer, 1, 1, 1, 1); 838 839 m_pAdapterTypeLabel->setBuddy(m_pAdapterTypeCombo); 840 m_pPromiscuousModeLabel->setBuddy(m_pPromiscuousModeCombo); 841 m_pMACLabel->setBuddy(m_pMACEditor); 668 842 } 669 843 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h
r82968 r85764 24 24 /* GUI includes: */ 25 25 #include "UISettingsPage.h" 26 #include "UIMachineSettingsNetwork.gen.h"27 26 #include "UIMachineSettingsPortForwardingDlg.h" 28 27
Note:
See TracChangeset
for help on using the changeset viewer.