VirtualBox

Changeset 85796 in vbox


Ignore:
Timestamp:
Aug 17, 2020 11:02:54 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9812. Removing UIGlobalSettingsNetworkDetailsNAT.ui

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro

    r85792 r85796  
    2828    src/settings/global/UIGlobalSettingsDisplay.ui \
    2929    src/settings/global/UIGlobalSettingsNetwork.ui \
    30     src/settings/global/UIGlobalSettingsNetworkDetailsNAT.ui \
    3130    src/settings/global/UIGlobalSettingsExtension.ui \
    3231    src/settings/global/UIGlobalSettingsProxy.ui
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsNAT.cpp

    r82968 r85796  
    1717
    1818/* Qt includes: */
     19#include <QCheckBox>
    1920#include <QRegExpValidator>
     21#include <QLabel>
     22#include <QLineEdit>
     23#include <QPushButton>
    2024
    2125/* GUI includes: */
     26#include "QIDialogButtonBox.h"
    2227#include "UIGlobalSettingsNetwork.h"
    2328#include "UIGlobalSettingsNetworkDetailsNAT.h"
     
    3338    , m_ipv4rules(ipv4rules)
    3439    , 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();
    3853
    3954    /* Setup dialog: */
     
    5166}
    5267
     68void 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
    53145void UIGlobalSettingsNetworkDetailsNAT::retranslateUi()
    54146{
    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"));
    57163}
    58164
     
    107213    m_data.m_fAdvertiseDefaultIPv6Route = m_pCheckboxAdvertiseDefaultIPv6Route->isChecked();
    108214}
    109 
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsNAT.h

    r82968 r85796  
    2525#include "QIDialog.h"
    2626#include "QIWithRetranslateUI.h"
    27 #include "UIGlobalSettingsNetworkDetailsNAT.gen.h"
    2827#include "UIPortForwardingTable.h"
    2928
     29/* Forward declarations. */
     30class QCheckBox;
     31class QLabel;
     32class QLineEdit;
    3033
    3134/** Global settings: Network page: NAT network data structure. */
     
    8083
    8184/* Global settings / Network page / Details sub-dialog: */
    82 class SHARED_LIBRARY_STUFF UIGlobalSettingsNetworkDetailsNAT : public QIWithRetranslateUI2<QIDialog>, public Ui::UIGlobalSettingsNetworkDetailsNAT
     85class SHARED_LIBRARY_STUFF UIGlobalSettingsNetworkDetailsNAT : public QIWithRetranslateUI2<QIDialog>
    8386{
    8487    Q_OBJECT;
     
    107110private:
    108111
     112    /* Prepares widgets. */
     113    void prepareWidgets();
     114
    109115    /* Helpers: Load/Save stuff: */
    110116    void load();
     
    118124    /** Holds IPv6 port forwarding rules. */
    119125    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    /** @} */
    120141};
    121142
Note: See TracChangeset for help on using the changeset viewer.

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