Changeset 92810 in vbox for trunk/src/VBox
- Timestamp:
- Dec 8, 2021 1:21:20 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/networkmanager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp
r92763 r92810 915 915 void UINetworkManagerWidget::sltHandleCurrentTabWidgetIndexChange() 916 916 { 917 /* Update actions: */ 918 updateActionAvailability(); 919 917 920 /* Adjust tree-widgets first of all: */ 918 921 sltAdjustTreeWidgets(); … … 1032 1035 void UINetworkManagerWidget::sltHandleCurrentItemChangeHostNetwork() 1033 1036 { 1037 /* Update actions: */ 1038 updateActionAvailability(); 1039 1034 1040 /* Check host network tree-widget: */ 1035 1041 AssertMsgReturnVoid(m_pTreeWidgetHostNetwork, ("Host network tree-widget isn't created!\n")); … … 1037 1043 /* Get network item: */ 1038 1044 UIItemHostNetwork *pItem = static_cast<UIItemHostNetwork*>(m_pTreeWidgetHostNetwork->currentItem()); 1039 1040 /* Update actions availability: */1041 m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem);1042 1045 1043 1046 /* Check host network details-widget: */ … … 1208 1211 void UINetworkManagerWidget::sltHandleCurrentItemChangeNATNetworkHoldingPosition(bool fHoldPosition) 1209 1212 { 1213 /* Update actions: */ 1214 updateActionAvailability(); 1215 1210 1216 /* Check NAT network tree-widget: */ 1211 1217 AssertMsgReturnVoid(m_pTreeWidgetNATNetwork, ("NAT network tree-widget isn't created!\n")); … … 1213 1219 /* Get network item: */ 1214 1220 UIItemNATNetwork *pItem = static_cast<UIItemNATNetwork*>(m_pTreeWidgetNATNetwork->currentItem()); 1215 1216 /* Update actions availability: */1217 m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem);1218 1221 1219 1222 /* Check NAT network details-widget: */ … … 1376 1379 void UINetworkManagerWidget::sltHandleCurrentItemChangeCloudNetwork() 1377 1380 { 1381 /* Update actions: */ 1382 updateActionAvailability(); 1383 1378 1384 /* Check cloud network tree-widget: */ 1379 1385 AssertMsgReturnVoid(m_pTreeWidgetCloudNetwork, ("Cloud network tree-widget isn't created!\n")); … … 1381 1387 /* Get network item: */ 1382 1388 UIItemCloudNetwork *pItem = static_cast<UIItemCloudNetwork*>(m_pTreeWidgetCloudNetwork->currentItem()); 1383 1384 /* Update actions availability: */1385 m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem);1386 1389 1387 1390 /* Check Cloud network details-widget: */ … … 2071 2074 } 2072 2075 2076 void UINetworkManagerWidget::updateActionAvailability() 2077 { 2078 /* Check which tab we have currently: */ 2079 switch (m_pTabWidget->currentIndex()) 2080 { 2081 case TabWidgetIndex_HostNetwork: 2082 { 2083 AssertMsgReturnVoid(m_pTreeWidgetHostNetwork, ("Host network tree-widget isn't created!\n")); 2084 UIItemHostNetwork *pItem = static_cast<UIItemHostNetwork*>(m_pTreeWidgetHostNetwork->currentItem()); 2085 m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem); 2086 break; 2087 } 2088 case TabWidgetIndex_NATNetwork: 2089 { 2090 AssertMsgReturnVoid(m_pTreeWidgetNATNetwork, ("NAT network tree-widget isn't created!\n")); 2091 UIItemNATNetwork *pItem = static_cast<UIItemNATNetwork*>(m_pTreeWidgetNATNetwork->currentItem()); 2092 m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem); 2093 break; 2094 } 2095 case TabWidgetIndex_CloudNetwork: 2096 { 2097 AssertMsgReturnVoid(m_pTreeWidgetCloudNetwork, ("Cloud network tree-widget isn't created!\n")); 2098 UIItemCloudNetwork *pItem = static_cast<UIItemCloudNetwork*>(m_pTreeWidgetCloudNetwork->currentItem()); 2099 m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem); 2100 break; 2101 } 2102 default: 2103 break; 2104 } 2105 } 2106 2073 2107 void UINetworkManagerWidget::createItemForHostNetwork(const UIDataHostNetwork &data, bool fChooseItem) 2074 2108 { -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h
r92731 r92810 225 225 /** @} */ 226 226 227 /** @name Actions stuff. 228 * @{ */ 229 /** Updates action availability. */ 230 void updateActionAvailability(); 231 /** @} */ 232 227 233 /** @name Tree-widget stuff. 228 234 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.