Changeset 87232 in vbox for trunk/src/VBox
- Timestamp:
- Jan 13, 2021 11:00:34 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/networkmanager
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.h
r87219 r87232 39 39 40 40 41 /** HostNetwork Manager: Host Network Interface data structure. */41 /** Network Manager: Host Network Interface data structure. */ 42 42 struct UIDataHostNetworkInterface 43 43 { … … 89 89 90 90 91 /** HostNetwork Manager: DHCP Server data structure. */91 /** Network Manager: DHCP Server data structure. */ 92 92 struct UIDataDHCPServer 93 93 { … … 131 131 132 132 133 /** HostNetwork Manager: Host network data structure. */133 /** Network Manager: Host network data structure. */ 134 134 struct UIDataHostNetwork 135 135 { … … 161 161 162 162 163 /** HostNetwork Manager: Host network details-widget. */163 /** Network Manager: Host network details-widget. */ 164 164 class UIDetailsWidgetHostNetwork : public QIWithRetranslateUI<QWidget> 165 165 { -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp
r87220 r87232 48 48 49 49 50 /** Tab-widget indexes. */ 51 enum TabWidgetIndex 52 { 53 TabWidgetIndex_HostNetwork, 54 }; 55 56 50 57 /** Host network tree-widget column indexes. */ 51 58 enum HostNetworkColumn … … 267 274 switch (m_pTabWidget->currentIndex()) 268 275 { 269 case 0: 270 { 271 sltHandleCurrentItemChangeHostNetwork(); 272 break; 273 } 274 default: 275 break; 276 case TabWidgetIndex_HostNetwork: sltHandleCurrentItemChangeHostNetwork(); break; 277 default: break; 276 278 } 277 279 } … … 285 287 switch (m_pTabWidget->currentIndex()) 286 288 { 287 case 0: 288 { 289 sltApplyDetailsChangesHostNetwork(); 290 break; 291 } 292 default: 293 break; 289 case TabWidgetIndex_HostNetwork: sltApplyDetailsChangesHostNetwork(); break; 290 default: break; 294 291 } 295 292 } … … 297 294 void UINetworkManagerWidget::sltCreateHostNetwork() 298 295 { 296 /* For host networks only: */ 297 if (m_pTabWidget->currentIndex() != TabWidgetIndex_HostNetwork) 298 return; 299 299 300 /* Get host for further activities: */ 300 301 CHost comHost = uiCommon().host(); … … 341 342 UIDataHostNetwork data; 342 343 loadHostNetwork(comInterface, data); 343 createItemFor NetworkHost(data, true);344 createItemForHostNetwork(data, true); 344 345 345 346 /* Adjust tree-widgets: */ … … 351 352 void UINetworkManagerWidget::sltRemoveHostNetwork() 352 353 { 354 /* For host networks only: */ 355 if (m_pTabWidget->currentIndex() != TabWidgetIndex_HostNetwork) 356 return; 357 353 358 /* Check host network tree-widget: */ 354 359 AssertMsgReturnVoid(m_pTreeWidgetHostNetwork, ("Host network tree-widget isn't created!\n")); … … 542 547 UIDataHostNetwork data; 543 548 loadHostNetwork(comInterface, data); 544 updateItemFor NetworkHost(data, true, pChangedItem);549 updateItemForHostNetwork(data, true, pChangedItem); 545 550 546 551 /* Make sure current item fetched: */ … … 573 578 if (pItem) 574 579 m_pDetailsWidgetHostNetwork->setData(*pItem); 580 /* Otherwise => clear details: */ 575 581 else 576 {577 /* Otherwise => clear details and close the area: */578 582 m_pDetailsWidgetHostNetwork->setData(UIDataHostNetwork()); 579 sltToggleDetailsVisibility(false);580 }581 583 } 582 584 … … 717 719 UIDataHostNetwork data; 718 720 loadHostNetwork(comInterface, data); 719 updateItemFor NetworkHost(data, true, pItem);721 updateItemForHostNetwork(data, true, pItem); 720 722 721 723 /* Make sure current item fetched: */ … … 845 847 846 848 /* Add into tab-widget: */ 847 m_pTabWidget-> addTab(m_pTabHostNetwork, QString());849 m_pTabWidget->insertTab(TabWidgetIndex_HostNetwork, m_pTabHostNetwork, QString()); 848 850 } 849 851 } … … 933 935 UIDataHostNetwork data; 934 936 loadHostNetwork(comInterface, data); 935 createItemFor NetworkHost(data, false);937 createItemForHostNetwork(data, false); 936 938 } 937 939 … … 1003 1005 } 1004 1006 1005 void UINetworkManagerWidget::createItemFor NetworkHost(const UIDataHostNetwork &data, bool fChooseItem)1007 void UINetworkManagerWidget::createItemForHostNetwork(const UIDataHostNetwork &data, bool fChooseItem) 1006 1008 { 1007 1009 /* Create new item: */ … … 1020 1022 } 1021 1023 1022 void UINetworkManagerWidget::updateItemFor NetworkHost(const UIDataHostNetwork &data, bool fChooseItem, UIItemHostNetwork *pItem)1024 void UINetworkManagerWidget::updateItemForHostNetwork(const UIDataHostNetwork &data, bool fChooseItem, UIItemHostNetwork *pItem) 1023 1025 { 1024 1026 /* Update passed item: */ -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h
r87220 r87232 161 161 * @{ */ 162 162 /** Creates a new host network tree-widget item on the basis of passed @a data, @a fChooseItem if requested. */ 163 void createItemFor NetworkHost(const UIDataHostNetwork &data, bool fChooseItem);163 void createItemForHostNetwork(const UIDataHostNetwork &data, bool fChooseItem); 164 164 /** Updates passed host network tree-widget item on the basis of passed @a data, @a fChooseItem if requested. */ 165 void updateItemFor NetworkHost(const UIDataHostNetwork &data, bool fChooseItem, UIItemHostNetwork *pItem);165 void updateItemForHostNetwork(const UIDataHostNetwork &data, bool fChooseItem, UIItemHostNetwork *pItem); 166 166 /** @} */ 167 167
Note:
See TracChangeset
for help on using the changeset viewer.