- Timestamp:
- Jun 2, 2017 3:42:28 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkDetailsDialog.cpp
r67127 r67251 63 63 void UIHostNetworkDetailsDialog::setData(const UIDataHostNetwork &data) 64 64 { 65 /* Save olddata: */65 /* Cache old/new data: */ 66 66 m_oldData = data; 67 /* Copy old data to new one: */68 67 m_newData = m_oldData; 69 68 -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp
r67087 r67251 410 410 } 411 411 412 void UIHostNetworkManagerWidget::sltToggleHostNetworkDetailsVisibility(bool f Show)412 void UIHostNetworkManagerWidget::sltToggleHostNetworkDetailsVisibility(bool fVisible) 413 413 { 414 414 /* Show/hide details area and Apply button: */ 415 m_pDetailsWidget->setVisible(f Show);416 m_pActionCommit->setVisible(f Show);417 } 418 419 void UIHostNetworkManagerWidget::slt ApplyHostNetworkDetailsChanges()415 m_pDetailsWidget->setVisible(fVisible); 416 m_pActionCommit->setVisible(fVisible); 417 } 418 419 void UIHostNetworkManagerWidget::sltCommitHostNetworkDetailsChanges() 420 420 { 421 421 /* Disable button first of all: */ … … 654 654 655 655 /* Update actions availability: */ 656 m_pActionRemove->setEnabled(pItem); 657 m_pActionDetails->setEnabled(pItem); 658 m_pActionCommit->setEnabled(false); 656 if (m_pActionRemove) 657 m_pActionRemove->setEnabled(pItem); 658 if (m_pActionDetails) 659 m_pActionDetails->setEnabled(pItem); 660 if (m_pActionCommit) 661 m_pActionCommit->setEnabled(false); 659 662 660 663 /* If there is an item => update details data: */ … … 675 678 if (m_pTreeWidget->itemAt(pos)) 676 679 { 677 menu.addAction(m_pActionRemove); 678 menu.addAction(m_pActionDetails); 679 menu.addAction(m_pActionCommit); 680 if (m_pActionRemove) 681 menu.addAction(m_pActionRemove); 682 if (m_pActionDetails) 683 menu.addAction(m_pActionDetails); 684 if (m_pActionCommit) 685 menu.addAction(m_pActionCommit); 680 686 } 681 687 else 682 688 { 683 menu.addAction(m_pActionAdd); 689 if (m_pActionAdd) 690 menu.addAction(m_pActionAdd); 684 691 } 685 692 /* And show it: */ … … 760 767 ":/commit_host_iface_disabled_22px.png", 761 768 ":/commit_host_iface_disabled_16px.png")); 762 connect(m_pActionDetails, &QAction::toggled, m_pActionCommit, &QAction::setVisible); 763 connect(m_pActionCommit, &QAction::triggered, this, &UIHostNetworkManagerWidget::sltApplyHostNetworkDetailsChanges); 769 if (m_pActionDetails) 770 connect(m_pActionDetails, &QAction::toggled, m_pActionCommit, &QAction::setVisible); 771 connect(m_pActionCommit, &QAction::triggered, this, &UIHostNetworkManagerWidget::sltCommitHostNetworkDetailsChanges); 764 772 } 765 773 … … 775 783 { 776 784 /* Configure menu: */ 777 m_pMenu->addAction(m_pActionAdd); 778 m_pMenu->addAction(m_pActionRemove); 779 m_pMenu->addAction(m_pActionDetails); 780 m_pMenu->addAction(m_pActionCommit); 785 if (m_pActionAdd) 786 m_pMenu->addAction(m_pActionAdd); 787 if (m_pActionRemove) 788 m_pMenu->addAction(m_pActionRemove); 789 if (m_pActionDetails) 790 m_pMenu->addAction(m_pActionDetails); 791 if (m_pActionCommit) 792 m_pMenu->addAction(m_pActionCommit); 781 793 } 782 794 } … … 861 873 connect(m_pTreeWidget, &QITreeWidget::itemChanged, 862 874 this, &UIHostNetworkManagerWidget::sltHandleItemChange); 863 connect(m_pTreeWidget, &QITreeWidget::itemDoubleClicked, 864 m_pActionDetails, &QAction::setChecked); 875 if (m_pActionDetails) 876 connect(m_pTreeWidget, &QITreeWidget::itemDoubleClicked, 877 m_pActionDetails, &QAction::setChecked); 865 878 866 879 /* Add into layout: */ … … 878 891 m_pDetailsWidget->setVisible(false); 879 892 m_pDetailsWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 880 connect(m_pDetailsWidget, &UIHostNetworkDetailsDialog::sigDataChanged, 881 m_pActionCommit, &QAction::setEnabled); 893 if (m_pActionCommit) 894 connect(m_pDetailsWidget, &UIHostNetworkDetailsDialog::sigDataChanged, 895 m_pActionCommit, &QAction::setEnabled); 882 896 883 897 /* Add into layout: */ … … 1056 1070 setWidgetToolbar(pWidget->toolbar()); 1057 1071 #endif 1058 /* Add to layout: */1072 /* Add into layout: */ 1059 1073 centralWidget()->layout()->addWidget(pWidget); 1060 1074 } -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.h
r67122 r67251 80 80 /** Handles command to make host network details @a fVisible. */ 81 81 void sltToggleHostNetworkDetailsVisibility(bool fVisible); 82 /** Handles command to applyhost network details changes. */83 void slt ApplyHostNetworkDetailsChanges();82 /** Handles command to commit host network details changes. */ 83 void sltCommitHostNetworkDetailsChanges(); 84 84 /** @} */ 85 85
Note:
See TracChangeset
for help on using the changeset viewer.