VirtualBox

Changeset 57366 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 14, 2015 6:00:53 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Port-forwarding dialog: Do not allow empty guest address values for NAT network case.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r57363 r57366  
    11541154          tr("The current port forwarding rules are not valid. "
    11551155             "All of the host or guest address values should be correct or empty."));
     1156    return false;
     1157}
     1158
     1159bool UIMessageCenter::warnAboutEmptyGuestAddress(QWidget *pParent /* = 0 */) const
     1160{
     1161    alert(pParent, MessageType_Error,
     1162          tr("The current port forwarding rules are not valid. "
     1163             "None of the guest address values may be empty."));
    11561164    return false;
    11571165}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r57362 r57366  
    239239    bool warnAboutIncorrectPort(QWidget *pParent = 0) const;
    240240    bool warnAboutIncorrectAddress(QWidget *pParent = 0) const;
     241    bool warnAboutEmptyGuestAddress(QWidget *pParent = 0) const;
    241242    bool warnAboutNameShouldBeUnique(QWidget *pParent = 0) const;
    242243    bool warnAboutRulesConflict(QWidget *pParent = 0) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp

    r52730 r57366  
    5151        {
    5252            /* Create table tabs: */
    53             m_pIPv4Table = new UIPortForwardingTable(ipv4rules, false);
    54             m_pIPv6Table = new UIPortForwardingTable(ipv6rules, true);
     53            m_pIPv4Table = new UIPortForwardingTable(ipv4rules, false, false);
     54            m_pIPv6Table = new UIPortForwardingTable(ipv6rules, true, false);
    5555            /* Add widgets into tab-widget: */
    5656            m_pTabWidget->addTab(m_pIPv4Table, QString());
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp

    r52730 r57366  
    4545    {
    4646        /* Create table: */
    47         m_pTable = new UIPortForwardingTable(rules, false);
     47        m_pTable = new UIPortForwardingTable(rules, false, true);
    4848        /* Create button-box: */
    4949        m_pButtonBox = new QIDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp

    r57362 r57366  
    567567
    568568
    569 UIPortForwardingTable::UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6)
    570     : m_fIsTableDataChanged(false)
     569UIPortForwardingTable::UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6, bool fAllowEmptyGuestIPs)
     570    : m_fAllowEmptyGuestIPs(fAllowEmptyGuestIPs)
     571    , m_fIsTableDataChanged(false)
    571572    , m_pTableView(0)
    572573    , m_pToolBar(0)
     
    731732            return msgCenter().warnAboutIncorrectAddress(window());
    732733
     734        /* If empty guest address is not allowed: */
     735        if (   !m_fAllowEmptyGuestIPs
     736            && guestIp.isEmpty())
     737            return msgCenter().warnAboutEmptyGuestAddress(window());
     738
    733739        /* Make sure non of the names were previosly used: */
    734740        if (!names.contains(name))
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h

    r57361 r57366  
    130130
    131131    /* Constructor: */
    132     UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6);
     132    UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6, bool fAllowEmptyGuestIPs);
    133133
    134134    /* API: Rules stuff: */
     
    159159
    160160    /* Flags: */
     161    bool m_fAllowEmptyGuestIPs;
    161162    bool m_fIsTableDataChanged;
    162163
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