Changeset 87275 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 15, 2021 1:53:46 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/networkmanager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.cpp
r87269 r87275 775 775 void UIDetailsWidgetHostNetwork::loadDataForInterface() 776 776 { 777 /* Check whether interface exists and configurable: */ 778 const bool fIsInterfaceExists = m_newData.m_interface.m_fExists; 779 const bool fIsInterfaceConfigurable = !m_newData.m_interface.m_fDHCPEnabled; 780 781 /* Toggle radio-buttons availability: */ 782 if (m_pButtonAutomatic) 783 m_pButtonAutomatic->setEnabled(fIsInterfaceExists); 784 if (m_pButtonManual) 785 m_pButtonManual->setEnabled(fIsInterfaceExists); 786 777 787 /* Toggle IPv4 & IPv6 interface fields availability: */ 778 const bool fIsInterfaceConfigurable = !m_newData.m_interface.m_fDHCPEnabled;779 788 if (m_pLabelIPv4) 780 m_pLabelIPv4->setEnabled(fIsInterface Configurable);789 m_pLabelIPv4->setEnabled(fIsInterfaceExists && fIsInterfaceConfigurable); 781 790 if (m_pLabelNMv4) 782 m_pLabelNMv4->setEnabled(fIsInterface Configurable);791 m_pLabelNMv4->setEnabled(fIsInterfaceExists && fIsInterfaceConfigurable); 783 792 if (m_pEditorIPv4) 784 m_pEditorIPv4->setEnabled(fIsInterface Configurable);793 m_pEditorIPv4->setEnabled(fIsInterfaceExists && fIsInterfaceConfigurable); 785 794 if (m_pEditorNMv4) 786 m_pEditorNMv4->setEnabled(fIsInterface Configurable);795 m_pEditorNMv4->setEnabled(fIsInterfaceExists && fIsInterfaceConfigurable); 787 796 788 797 /* Load IPv4 interface fields: */ … … 799 808 const bool fIsIpv6Configurable = fIsInterfaceConfigurable && m_newData.m_interface.m_fSupportedIPv6; 800 809 if (m_pLabelIPv6) 801 m_pLabelIPv6->setEnabled(fIsI pv6Configurable);810 m_pLabelIPv6->setEnabled(fIsInterfaceExists && fIsIpv6Configurable); 802 811 if (m_pLabelNMv6) 803 m_pLabelNMv6->setEnabled(fIsI pv6Configurable);812 m_pLabelNMv6->setEnabled(fIsInterfaceExists && fIsIpv6Configurable); 804 813 if (m_pEditorIPv6) 805 m_pEditorIPv6->setEnabled(fIsI pv6Configurable);814 m_pEditorIPv6->setEnabled(fIsInterfaceExists && fIsIpv6Configurable); 806 815 if (m_pEditorNMv6) 807 m_pEditorNMv6->setEnabled(fIsI pv6Configurable);816 m_pEditorNMv6->setEnabled(fIsInterfaceExists && fIsIpv6Configurable); 808 817 809 818 /* Load IPv6 interface fields: */ … … 816 825 void UIDetailsWidgetHostNetwork::loadDataForDHCPServer() 817 826 { 827 /* Check whether interface exists and DHCP server available: */ 828 const bool fIsInterfaceExists = m_newData.m_interface.m_fExists; 829 const bool fIsDHCPServerEnabled = m_newData.m_dhcpserver.m_fEnabled; 830 831 /* Toggle check-box availability: */ 832 m_pCheckBoxDHCP->setEnabled(fIsInterfaceExists); 833 818 834 /* Toggle DHCP server fields availability: */ 819 const bool fIsDHCPServerEnabled = m_newData.m_dhcpserver.m_fEnabled;820 835 if (m_pLabelDHCPAddress) 821 m_pLabelDHCPAddress->setEnabled(fIs DHCPServerEnabled);836 m_pLabelDHCPAddress->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 822 837 if (m_pLabelDHCPMask) 823 m_pLabelDHCPMask->setEnabled(fIs DHCPServerEnabled);838 m_pLabelDHCPMask->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 824 839 if (m_pLabelDHCPLowerAddress) 825 m_pLabelDHCPLowerAddress->setEnabled(fIs DHCPServerEnabled);840 m_pLabelDHCPLowerAddress->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 826 841 if (m_pLabelDHCPUpperAddress) 827 m_pLabelDHCPUpperAddress->setEnabled(fIs DHCPServerEnabled);842 m_pLabelDHCPUpperAddress->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 828 843 if (m_pEditorDHCPAddress) 829 m_pEditorDHCPAddress->setEnabled(fIs DHCPServerEnabled);844 m_pEditorDHCPAddress->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 830 845 if (m_pEditorDHCPMask) 831 m_pEditorDHCPMask->setEnabled(fIs DHCPServerEnabled);846 m_pEditorDHCPMask->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 832 847 if (m_pEditorDHCPLowerAddress) 833 m_pEditorDHCPLowerAddress->setEnabled(fIs DHCPServerEnabled);848 m_pEditorDHCPLowerAddress->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 834 849 if (m_pEditorDHCPUpperAddress) 835 m_pEditorDHCPUpperAddress->setEnabled(fIs DHCPServerEnabled);850 m_pEditorDHCPUpperAddress->setEnabled(fIsInterfaceExists && fIsDHCPServerEnabled); 836 851 837 852 /* Load DHCP server fields: */ -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.h
r87232 r87275 44 44 /** Constructs data. */ 45 45 UIDataHostNetworkInterface() 46 : m_strName(QString()) 46 : m_fExists(false) 47 , m_strName(QString()) 47 48 , m_fDHCPEnabled(false) 48 49 , m_strAddress(QString()) … … 57 58 { 58 59 return true 60 && (m_fExists == other.m_fExists) 59 61 && (m_strName == other.m_strName) 60 62 && (m_fDHCPEnabled == other.m_fDHCPEnabled) … … 72 74 bool operator!=(const UIDataHostNetworkInterface &other) const { return !equal(other); } 73 75 76 /** Holds this interface is not NULL. */ 77 bool m_fExists; 74 78 /** Holds interface name. */ 75 79 QString m_strName;
Note:
See TracChangeset
for help on using the changeset viewer.