Changeset 87572 in vbox for trunk/src/VBox
- Timestamp:
- Feb 3, 2021 3:23:34 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp
r87565 r87572 74 74 { 75 75 NATNetworkColumn_Name, 76 NATNetworkColumn_IPv4, 77 NATNetworkColumn_IPv6, 78 NATNetworkColumn_DHCP, 76 79 NATNetworkColumn_Max, 77 80 }; … … 233 236 /* Compose item fields: */ 234 237 setText(NATNetworkColumn_Name, m_strName); 235 236 /* Compose tool-tip: */ 238 setText(NATNetworkColumn_IPv4, m_strPrefixIPv4); 239 setText(NATNetworkColumn_IPv6, m_strPrefixIPv6); 240 setText(NATNetworkColumn_DHCP, m_fSupportsDHCP ? tr("Enabled", "DHCP Server") : tr("Disabled", "DHCP Server")); 241 242 /* Compose item tool-tip: */ 237 243 const QString strTable("<table cellspacing=5>%1</table>"); 238 244 const QString strHeader("<tr><td><nobr>%1: </nobr></td><td><nobr>%2</nobr></td></tr>"); … … 324 330 { 325 331 const QStringList fields = QStringList() 326 << UINetworkManager::tr("Name"); 332 << UINetworkManager::tr("Name") 333 << UINetworkManager::tr("IPv4 Prefix") 334 << UINetworkManager::tr("IPv6 Prefix") 335 << UINetworkManager::tr("DHCP Server"); 327 336 m_pTreeWidgetNATNetwork->setHeaderLabels(fields); 328 337 } … … 680 689 void UINetworkManagerWidget::sltHandleCurrentTabWidgetIndexChange() 681 690 { 691 /* Adjust tree-widgets first of all: */ 692 sltAdjustTreeWidgets(); 693 682 694 /* Show/hide details area and Apply/Reset buttons: */ 683 695 const bool fVisible = m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->isChecked(); … … 730 742 } 731 743 732 #if 0733 744 /* Check NAT network tree-widget: */ 734 745 if (m_pTreeWidgetNATNetwork) … … 742 753 const int iTotal = m_pTreeWidgetNATNetwork->viewport()->width(); 743 754 /* Look for a minimum width hints for non-important columns: */ 744 const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(NATNetworkColumn_Availability), pItemHeader->sectionSizeHint(NATNetworkColumn_Availability)); 755 const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(NATNetworkColumn_IPv4), pItemHeader->sectionSizeHint(NATNetworkColumn_IPv4)); 756 const int iMinWidth2 = qMax(pItemView->sizeHintForColumn(NATNetworkColumn_IPv6), pItemHeader->sectionSizeHint(NATNetworkColumn_IPv6)); 757 const int iMinWidth3 = qMax(pItemView->sizeHintForColumn(NATNetworkColumn_DHCP), pItemHeader->sectionSizeHint(NATNetworkColumn_DHCP)); 745 758 /* Propose suitable width hints for non-important columns: */ 746 759 const int iWidth1 = iMinWidth1 < iTotal / NATNetworkColumn_Max ? iMinWidth1 : iTotal / NATNetworkColumn_Max; 760 const int iWidth2 = iMinWidth2 < iTotal / NATNetworkColumn_Max ? iMinWidth2 : iTotal / NATNetworkColumn_Max; 761 const int iWidth3 = iMinWidth3 < iTotal / NATNetworkColumn_Max ? iMinWidth3 : iTotal / NATNetworkColumn_Max; 747 762 /* Apply the proposal: */ 748 m_pTreeWidgetNATNetwork->setColumnWidth(NATNetworkColumn_Availability, iWidth1); 749 m_pTreeWidgetNATNetwork->setColumnWidth(NATNetworkColumn_Name, iTotal - iWidth1); 750 } 751 #endif 763 m_pTreeWidgetNATNetwork->setColumnWidth(NATNetworkColumn_IPv4, iWidth1); 764 m_pTreeWidgetNATNetwork->setColumnWidth(NATNetworkColumn_IPv6, iWidth2); 765 m_pTreeWidgetNATNetwork->setColumnWidth(NATNetworkColumn_DHCP, iWidth3); 766 m_pTreeWidgetNATNetwork->setColumnWidth(NATNetworkColumn_Name, iTotal - iWidth1 - iWidth2 - iWidth3); 767 } 752 768 } 753 769
Note:
See TracChangeset
for help on using the changeset viewer.