Changeset 87271 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 15, 2021 1:09:39 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/UINetworkManager.cpp
r87232 r87271 441 441 /* Save the setting: */ 442 442 gEDataManager->setHostNetworkManagerDetailsExpanded(fVisible); 443 /* Show/hide details area and Apply button: */ 444 if (m_pDetailsWidgetHostNetwork) 445 m_pDetailsWidgetHostNetwork->setVisible(fVisible); 443 /* Show/hide details area and Apply/Reset buttons: */ 444 switch (m_pTabWidget->currentIndex()) 445 { 446 case TabWidgetIndex_HostNetwork: 447 { 448 if (m_pDetailsWidgetHostNetwork) 449 m_pDetailsWidgetHostNetwork->setVisible(fVisible); 450 break; 451 } 452 } 446 453 /* Notify external listeners: */ 447 454 emit sigDetailsVisibilityChanged(fVisible); 455 } 456 457 void UINetworkManagerWidget::sltHandleCurrentTabWidgetIndexChange() 458 { 459 /* Show/hide details area and Apply/Reset buttons: */ 460 const bool fVisible = m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->isChecked(); 461 switch (m_pTabWidget->currentIndex()) 462 { 463 case TabWidgetIndex_HostNetwork: 464 { 465 if (m_pDetailsWidgetHostNetwork) 466 m_pDetailsWidgetHostNetwork->setVisible(fVisible); 467 break; 468 } 469 } 448 470 } 449 471 … … 543 565 if (!comServer.isOk()) 544 566 msgCenter().cannotSaveDHCPServerParameter(comServer, this); 567 else 545 568 { 546 569 /* Update interface in the tree: */ … … 570 593 /* Update actions availability: */ 571 594 m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem); 572 m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->setEnabled(pItem);573 595 574 596 /* Check host network details-widget: */ … … 783 805 if (m_fShowToolbar) 784 806 prepareToolBar(); 807 785 808 /* Prepare tab-widget: */ 786 809 prepareTabWidget(); 810 811 /* Prepare details widgets: */ 812 prepareDetailsWidgetHostNetwork(); 787 813 } 788 814 } … … 790 816 void UINetworkManagerWidget::prepareToolBar() 791 817 { 792 /* Create toolbar: */818 /* Prepare toolbar: */ 793 819 m_pToolBar = new QIToolBar(parentWidget()); 794 820 if (m_pToolBar) 795 821 { 796 /* Configure toolbar: */797 822 const int iIconMetric = (int)(QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize)); 798 823 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 799 824 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 800 801 /* Add toolbar actions: */802 825 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexMN_M_Network_S_Create)); 803 826 m_pToolBar->addSeparator(); … … 825 848 if (m_pTabWidget) 826 849 { 850 connect(m_pTabWidget, &QITabWidget::currentChanged, 851 this, &UINetworkManagerWidget::sltHandleCurrentTabWidgetIndexChange); 852 827 853 prepareTabHostNetwork(); 828 854 … … 841 867 m_pLayoutHostNetwork = new QVBoxLayout(m_pTabHostNetwork); 842 868 if (m_pLayoutHostNetwork) 843 {844 869 prepareTreeWidgetHostNetwork(); 845 prepareDetailsWidgetHostNetwork();846 }847 870 848 871 /* Add into tab-widget: */ … … 882 905 { 883 906 /* Prepare host network details-widget: */ 884 m_pDetailsWidgetHostNetwork = new UIDetailsWidgetHostNetwork(m_enmEmbedding, m_pTabHostNetwork);907 m_pDetailsWidgetHostNetwork = new UIDetailsWidgetHostNetwork(m_enmEmbedding, this); 885 908 if (m_pDetailsWidgetHostNetwork) 886 909 { … … 895 918 896 919 /* Add into layout: */ 897 m_pLayoutHostNetwork->addWidget(m_pDetailsWidgetHostNetwork);920 layout()->addWidget(m_pDetailsWidgetHostNetwork); 898 921 } 899 922 } -
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h
r87232 r87271 113 113 /** @name Tree-widget stuff. 114 114 * @{ */ 115 /** Handles current tab-widget's index change. */ 116 void sltHandleCurrentTabWidgetIndexChange(); 117 115 118 /** Handles command to adjust tree-widget. */ 116 119 void sltAdjustTreeWidgets();
Note:
See TracChangeset
for help on using the changeset viewer.