Changeset 73735 in vbox
- Timestamp:
- Aug 17, 2018 12:57:53 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp
r73734 r73735 2084 2084 setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of disk image files")); 2085 2085 setToolTip(tr("Refresh Disk Image Files (%1)").arg(shortcut().toString())); 2086 } 2087 }; 2088 2089 2090 /** Menu action extension, used as 'Network' menu class. */ 2091 class UIActionMenuSelectorNetwork : public UIActionMenu 2092 { 2093 Q_OBJECT; 2094 2095 public: 2096 2097 /** Constructs action passing @a pParent to the base-class. */ 2098 UIActionMenuSelectorNetwork(UIActionPool *pParent) 2099 : UIActionMenu(pParent) 2100 {} 2101 2102 protected: 2103 2104 /** Returns shortcut extra-data ID. */ 2105 virtual QString shortcutExtraDataID() const /* override */ 2106 { 2107 return QString("NetworkMenu"); 2108 } 2109 2110 /** Handles translation event. */ 2111 virtual void retranslateUi() /* override */ 2112 { 2113 setName(QApplication::translate("UIActionPool", "&Network")); 2114 setStatusTip(QApplication::translate("UIActionPool", "Open the network menu")); 2115 } 2116 }; 2117 2118 /** Simple action extension, used as 'Perform Create' action class. */ 2119 class UIActionMenuSelectorNetworkPerformCreate : public UIActionSimple 2120 { 2121 Q_OBJECT; 2122 2123 public: 2124 2125 /** Constructs action passing @a pParent to the base-class. */ 2126 UIActionMenuSelectorNetworkPerformCreate(UIActionPool *pParent) 2127 : UIActionSimple(pParent, 2128 ":/host_iface_add_22px.png", ":/host_iface_add_16px.png", 2129 ":/host_iface_add_disabled_22px.png", ":/host_iface_add_disabled_16px.png") 2130 {} 2131 2132 protected: 2133 2134 /** Returns shortcut extra-data ID. */ 2135 virtual QString shortcutExtraDataID() const /* override */ 2136 { 2137 return QString("CreateNetwork"); 2138 } 2139 2140 /** Returns default shortcut. */ 2141 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 2142 { 2143 return QKeySequence("Ctrl+Shift+C"); 2144 } 2145 2146 /** Handles translation event. */ 2147 virtual void retranslateUi() /* override */ 2148 { 2149 setName(QApplication::translate("UIActionPool", "&Create...")); 2150 setStatusTip(QApplication::translate("UIActionPool", "Create new host-only network")); 2151 setToolTip(tr("Create Host-only Network (%1)").arg(shortcut().toString())); 2152 } 2153 }; 2154 2155 /** Simple action extension, used as 'Perform Remove' action class. */ 2156 class UIActionMenuSelectorNetworkPerformRemove : public UIActionSimple 2157 { 2158 Q_OBJECT; 2159 2160 public: 2161 2162 /** Constructs action passing @a pParent to the base-class. */ 2163 UIActionMenuSelectorNetworkPerformRemove(UIActionPool *pParent) 2164 : UIActionSimple(pParent, 2165 ":/host_iface_remove_22px.png", ":/host_iface_remove_16px.png", 2166 ":/host_iface_remove_disabled_22px.png", ":/host_iface_remove_disabled_16px.png") 2167 {} 2168 2169 protected: 2170 2171 /** Returns shortcut extra-data ID. */ 2172 virtual QString shortcutExtraDataID() const /* override */ 2173 { 2174 return QString("RemoveNetwork"); 2175 } 2176 2177 /** Returns default shortcut. */ 2178 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 2179 { 2180 return QKeySequence("Ctrl+Shift+R"); 2181 } 2182 2183 /** Handles translation event. */ 2184 virtual void retranslateUi() /* override */ 2185 { 2186 setName(QApplication::translate("UIActionPool", "&Remove...")); 2187 setStatusTip(QApplication::translate("UIActionPool", "Remove selected host-only network")); 2188 setToolTip(tr("Remove Host-only Network (%1)").arg(shortcut().toString())); 2189 } 2190 }; 2191 2192 /** Toggle action extension, used as 'Toggle Network Properties' action class. */ 2193 class UIActionMenuSelectorNetworkToggleProperties : public UIActionToggle 2194 { 2195 Q_OBJECT; 2196 2197 public: 2198 2199 /** Constructs action passing @a pParent to the base-class. */ 2200 UIActionMenuSelectorNetworkToggleProperties(UIActionPool *pParent) 2201 : UIActionToggle(pParent, 2202 ":/host_iface_edit_22px.png", ":/host_iface_edit_16px.png", 2203 ":/host_iface_edit_disabled_22px.png", ":/host_iface_edit_disabled_16px.png") 2204 {} 2205 2206 protected: 2207 2208 /** Returns shortcut extra-data ID. */ 2209 virtual QString shortcutExtraDataID() const /* override */ 2210 { 2211 return QString("ToggleNetworkProperties"); 2212 } 2213 2214 /** Returns default shortcut. */ 2215 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 2216 { 2217 return QKeySequence("Ctrl+Space"); 2218 } 2219 2220 /** Handles translation event. */ 2221 virtual void retranslateUi() /* override */ 2222 { 2223 setName(QApplication::translate("UIActionPool", "&Properties")); 2224 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected host-only network properties")); 2225 setToolTip(tr("Open Host-only Network Properties (%1)").arg(shortcut().toString())); 2226 } 2227 }; 2228 2229 /** Simple action extension, used as 'Perform Refresh' action class. */ 2230 class UIActionMenuSelectorNetworkPerformRefresh : public UIActionSimple 2231 { 2232 Q_OBJECT; 2233 2234 public: 2235 2236 /** Constructs action passing @a pParent to the base-class. */ 2237 UIActionMenuSelectorNetworkPerformRefresh(UIActionPool *pParent) 2238 : UIActionSimple(pParent, 2239 ":/refresh_22px.png", ":/refresh_16px.png", 2240 ":/refresh_disabled_22px.png", ":/refresh_disabled_16px.png") 2241 {} 2242 2243 protected: 2244 2245 /** Returns shortcut extra-data ID. */ 2246 virtual QString shortcutExtraDataID() const /* override */ 2247 { 2248 return QString("RefreshNetworks"); 2249 } 2250 2251 /** Returns default shortcut. */ 2252 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 2253 { 2254 return QKeySequence("Ctrl+Shift+F"); 2255 } 2256 2257 /** Handles translation event. */ 2258 virtual void retranslateUi() /* override */ 2259 { 2260 setName(QApplication::translate("UIActionPool", "Re&fresh...")); 2261 setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of host-only networks")); 2262 setToolTip(tr("Refresh Host-only Networks (%1)").arg(shortcut().toString())); 2086 2263 } 2087 2264 }; … … 2192 2369 m_pool[UIActionIndexST_M_Medium_S_Refresh] = new UIActionMenuSelectorMediumPerformRefresh(this); 2193 2370 2371 /* Host Network Manager actions: */ 2372 m_pool[UIActionIndexST_M_Network] = new UIActionMenuSelectorNetwork(this); 2373 m_pool[UIActionIndexST_M_Network_S_Create] = new UIActionMenuSelectorNetworkPerformCreate(this); 2374 m_pool[UIActionIndexST_M_Network_S_Remove] = new UIActionMenuSelectorNetworkPerformRemove(this); 2375 m_pool[UIActionIndexST_M_Network_T_Details] = new UIActionMenuSelectorNetworkToggleProperties(this); 2376 m_pool[UIActionIndexST_M_Network_S_Refresh] = new UIActionMenuSelectorNetworkPerformRefresh(this); 2377 2194 2378 /* Prepare update-handlers for known menus: */ 2195 2379 m_menuUpdateHandlers[UIActionIndexST_M_Medium].ptfs = &UIActionPoolSelector::updateMenuMedium; 2380 m_menuUpdateHandlers[UIActionIndexST_M_Network].ptfs = &UIActionPoolSelector::updateMenuNetwork; 2196 2381 2197 2382 /* Call to base-class: */ … … 2219 2404 /* 'Virtual Media Manager' menu: */ 2220 2405 updateMenuMedium(); 2406 /* 'Host Network Manager' menu: */ 2407 updateMenuNetwork(); 2221 2408 } 2222 2409 … … 2266 2453 } 2267 2454 2455 void UIActionPoolSelector::updateMenuNetwork() 2456 { 2457 /* Get corresponding menu: */ 2458 UIMenu *pMenu = action(UIActionIndexST_M_Network)->menu(); 2459 /* Clear contents: */ 2460 pMenu->clear(); 2461 2462 /* Separator? */ 2463 bool fSeparator = false; 2464 2465 /* 'Create' action: */ 2466 fSeparator = addAction(pMenu, action(UIActionIndexST_M_Network_S_Create)) || fSeparator; 2467 /* 'Remove' action: */ 2468 fSeparator = addAction(pMenu, action(UIActionIndexST_M_Network_S_Remove)) || fSeparator; 2469 2470 /* Separator? */ 2471 if (fSeparator) 2472 { 2473 pMenu->addSeparator(); 2474 fSeparator = false; 2475 } 2476 2477 /* 'Properties' action: */ 2478 fSeparator = addAction(pMenu, action(UIActionIndexST_M_Network_T_Details)) || fSeparator; 2479 2480 // /* Separator? */ 2481 // if (fSeparator) 2482 // { 2483 // pMenu->addSeparator(); 2484 // fSeparator = false; 2485 // } 2486 2487 // /* 'Refresh' action: */ 2488 // fSeparator = addAction(pMenu, action(UIActionIndexST_M_Network_S_Refresh)) || fSeparator;; 2489 2490 /* Mark menu as valid: */ 2491 m_invalidations.remove(UIActionIndexST_M_Network); 2492 } 2493 2268 2494 void UIActionPoolSelector::updateShortcuts() 2269 2495 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.h
r73717 r73735 126 126 UIActionIndexST_M_Medium_S_Refresh, 127 127 128 /* Host Network Manager actions: */ 129 UIActionIndexST_M_Network, 130 UIActionIndexST_M_Network_S_Create, 131 UIActionIndexST_M_Network_S_Remove, 132 UIActionIndexST_M_Network_T_Details, 133 UIActionIndexST_M_Network_S_Refresh, 134 128 135 /* Maximum index: */ 129 136 UIActionIndexST_Max … … 154 161 /** Updates 'Medium' menu. */ 155 162 void updateMenuMedium(); 163 /** Updates 'Network' menu. */ 164 void updateMenuNetwork(); 156 165 157 166 /** Updates shortcuts. */ -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp
r72696 r73735 29 29 # include "QIDialogButtonBox.h" 30 30 # include "QITreeWidget.h" 31 # include "UIActionPoolSelector.h" 31 32 # include "UIExtraDataManager.h" 32 33 # include "UIIconPool.h" … … 192 193 *********************************************************************************************************************************/ 193 194 194 UIHostNetworkManagerWidget::UIHostNetworkManagerWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)195 UIHostNetworkManagerWidget::UIHostNetworkManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, QWidget *pParent /* = 0 */) 195 196 : QIWithRetranslateUI<QWidget>(pParent) 196 197 , m_enmEmbedding(enmEmbedding) 198 , m_pActionPool(pActionPool) 197 199 , m_pToolBar(0) 198 , m_pMenu(0)199 , m_pActionAdd(0)200 , m_pActionRemove(0)201 , m_pActionDetails(0)202 , m_pActionRefresh(0)203 200 , m_pTreeWidget(0) 204 201 , m_pDetailsWidget(0) … … 208 205 } 209 206 207 QMenu *UIHostNetworkManagerWidget::menu() const 208 { 209 return m_pActionPool->action(UIActionIndexST_M_Network)->menu(); 210 } 211 210 212 void UIHostNetworkManagerWidget::retranslateUi() 211 213 { 212 /* Translate menu: */213 if (m_pMenu)214 m_pMenu->setTitle(UIHostNetworkManager::tr("&Network"));215 216 /* Translate actions: */217 if (m_pActionAdd)218 {219 m_pActionAdd->setText(UIHostNetworkManager::tr("&Create"));220 m_pActionAdd->setToolTip(UIHostNetworkManager::tr("Create Host-only Network (%1)").arg(m_pActionAdd->shortcut().toString()));221 m_pActionAdd->setStatusTip(UIHostNetworkManager::tr("Create new host-only network"));222 }223 if (m_pActionRemove)224 {225 m_pActionRemove->setText(UIHostNetworkManager::tr("&Remove..."));226 m_pActionRemove->setToolTip(UIHostNetworkManager::tr("Remove Host-only Network (%1)").arg(m_pActionRemove->shortcut().toString()));227 m_pActionRemove->setStatusTip(UIHostNetworkManager::tr("Remove selected host-only network"));228 }229 if (m_pActionDetails)230 {231 m_pActionDetails->setText(UIHostNetworkManager::tr("&Properties..."));232 m_pActionDetails->setToolTip(UIHostNetworkManager::tr("Open Host-only Network Properties (%1)").arg(m_pActionDetails->shortcut().toString()));233 m_pActionDetails->setStatusTip(UIHostNetworkManager::tr("Open pane with selected host-only network properties"));234 }235 if (m_pActionRefresh)236 {237 m_pActionRefresh->setText(UIHostNetworkManager::tr("&Refresh..."));238 m_pActionRefresh->setToolTip(UIHostNetworkManager::tr("Refresh Host-only Networks (%1)").arg(m_pActionRefresh->shortcut().toString()));239 m_pActionRefresh->setStatusTip(UIHostNetworkManager::tr("Refresh the list of host-only networks"));240 }241 242 214 /* Adjust toolbar: */ 243 215 #ifdef VBOX_WS_MAC … … 404 376 } 405 377 406 void UIHostNetworkManagerWidget::slt AddHostNetwork()378 void UIHostNetworkManagerWidget::sltCreateHostNetwork() 407 379 { 408 380 /* Get host for further activities: */ … … 668 640 669 641 /* Update actions availability: */ 670 if (m_pActionRemove) 671 m_pActionRemove->setEnabled(pItem); 672 if (m_pActionDetails) 673 m_pActionDetails->setEnabled(pItem); 642 m_pActionPool->action(UIActionIndexST_M_Network_S_Remove)->setEnabled(pItem); 643 m_pActionPool->action(UIActionIndexST_M_Network_T_Details)->setEnabled(pItem); 674 644 675 645 /* If there is an item => update details data: */ … … 684 654 } 685 655 686 void UIHostNetworkManagerWidget::sltHandleContextMenuRequest(const QPoint &pos )656 void UIHostNetworkManagerWidget::sltHandleContextMenuRequest(const QPoint &position) 687 657 { 688 658 /* Compose temporary context-menu: */ 689 659 QMenu menu; 690 if (m_pTreeWidget->itemAt(pos)) 691 { 692 if (m_pActionRemove) 693 menu.addAction(m_pActionRemove); 694 if (m_pActionDetails) 695 menu.addAction(m_pActionDetails); 660 if (m_pTreeWidget->itemAt(position)) 661 { 662 menu.addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Remove)); 663 menu.addSeparator(); 664 menu.addAction(m_pActionPool->action(UIActionIndexST_M_Network_T_Details)); 696 665 } 697 666 else 698 667 { 699 if (m_pActionAdd) 700 menu.addAction(m_pActionAdd); 668 menu.addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Create)); 669 // menu.addSeparator(); 670 // menu.addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Refresh)); 701 671 } 702 672 /* And show it: */ 703 menu.exec(m_pTreeWidget->mapToGlobal(pos ));673 menu.exec(m_pTreeWidget->mapToGlobal(position)); 704 674 } 705 675 … … 729 699 void UIHostNetworkManagerWidget::prepareActions() 730 700 { 731 /* Create 'Add' action: */ 732 m_pActionAdd = new QAction(this); 733 AssertPtrReturnVoid(m_pActionAdd); 734 { 735 /* Configure 'Add' action: */ 736 m_pActionAdd->setShortcut(QKeySequence("Ctrl+A")); 737 m_pActionAdd->setIcon(UIIconPool::iconSetFull(":/host_iface_add_22px.png", 738 ":/host_iface_add_16px.png", 739 ":/host_iface_add_disabled_22px.png", 740 ":/host_iface_add_disabled_16px.png")); 741 connect(m_pActionAdd, &QAction::triggered, this, &UIHostNetworkManagerWidget::sltAddHostNetwork); 742 } 743 744 /* Create 'Remove' action: */ 745 m_pActionRemove = new QAction(this); 746 AssertPtrReturnVoid(m_pActionRemove); 747 { 748 /* Configure 'Remove' action: */ 749 m_pActionRemove->setShortcut(QKeySequence("Del")); 750 m_pActionRemove->setIcon(UIIconPool::iconSetFull(":/host_iface_remove_22px.png", 751 ":/host_iface_remove_16px.png", 752 ":/host_iface_remove_disabled_22px.png", 753 ":/host_iface_remove_disabled_16px.png")); 754 connect(m_pActionRemove, &QAction::triggered, this, &UIHostNetworkManagerWidget::sltRemoveHostNetwork); 755 } 756 757 /* Create 'Details' action: */ 758 m_pActionDetails = new QAction(this); 759 AssertPtrReturnVoid(m_pActionDetails); 760 { 761 /* Configure 'Details' action: */ 762 m_pActionDetails->setCheckable(true); 763 m_pActionDetails->setShortcut(QKeySequence("Ctrl+Space")); 764 m_pActionDetails->setIcon(UIIconPool::iconSetFull(":/host_iface_edit_22px.png", 765 ":/host_iface_edit_16px.png", 766 ":/host_iface_edit_disabled_22px.png", 767 ":/host_iface_edit_disabled_16px.png")); 768 connect(m_pActionDetails, &QAction::toggled, this, &UIHostNetworkManagerWidget::sltToggleHostNetworkDetailsVisibility); 769 } 770 771 /* Create 'Refresh' action: */ 772 m_pActionRefresh = new QAction(this); 773 AssertPtrReturnVoid(m_pActionRefresh); 774 { 775 /* Configure 'Details' action: */ 776 m_pActionRefresh->setCheckable(true); 777 m_pActionRefresh->setShortcut(QKeySequence(QKeySequence::Refresh)); 778 m_pActionRefresh->setIcon(UIIconPool::iconSetFull(":/refresh_22px.png", 779 ":/refresh_16px.png", 780 ":/refresh_disabled_22px.png", 781 ":/refresh_disabled_16px.png")); 782 connect(m_pActionRefresh, &QAction::toggled, this, &UIHostNetworkManagerWidget::sltRefreshHostNetworks); 783 } 784 785 /* Prepare menu: */ 786 prepareMenu(); 787 } 788 789 void UIHostNetworkManagerWidget::prepareMenu() 790 { 791 /* Create 'Network' menu: */ 792 m_pMenu = new QMenu(this); 793 AssertPtrReturnVoid(m_pMenu); 794 { 795 /* Configure menu: */ 796 if (m_pActionAdd) 797 m_pMenu->addAction(m_pActionAdd); 798 if (m_pActionRemove) 799 m_pMenu->addAction(m_pActionRemove); 800 if (m_pActionDetails) 801 m_pMenu->addAction(m_pActionDetails); 802 // if (m_pActionRefresh) 803 // m_pMenu->addAction(m_pActionRefresh); 804 } 701 /* Connect actions: */ 702 connect(m_pActionPool->action(UIActionIndexST_M_Network_S_Create), &QAction::triggered, 703 this, &UIHostNetworkManagerWidget::sltCreateHostNetwork); 704 connect(m_pActionPool->action(UIActionIndexST_M_Network_S_Remove), &QAction::triggered, 705 this, &UIHostNetworkManagerWidget::sltRemoveHostNetwork); 706 connect(m_pActionPool->action(UIActionIndexST_M_Network_T_Details), &QAction::toggled, 707 this, &UIHostNetworkManagerWidget::sltToggleHostNetworkDetailsVisibility); 708 connect(m_pActionPool->action(UIActionIndexST_M_Network_S_Refresh), &QAction::triggered, 709 this, &UIHostNetworkManagerWidget::sltRefreshHostNetworks); 805 710 } 806 711 … … 839 744 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 840 745 /* Add toolbar actions: */ 841 if (m_pActionAdd) 842 m_pToolBar->addAction(m_pActionAdd); 843 if (m_pActionRemove) 844 m_pToolBar->addAction(m_pActionRemove); 845 if ((m_pActionAdd || m_pActionRemove) && m_pActionDetails) 846 m_pToolBar->addSeparator(); 847 if (m_pActionDetails) 848 m_pToolBar->addAction(m_pActionDetails); 849 // if (m_pActionDetails && m_pActionRefresh) 850 // m_pToolBar->addSeparator(); 851 // if (m_pActionRefresh) 852 // m_pToolBar->addAction(m_pActionRefresh); 746 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Create)); 747 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Remove)); 748 m_pToolBar->addSeparator(); 749 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Network_T_Details)); 750 // m_pToolBar->addSeparator(); 751 // m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Refresh)); 853 752 #ifdef VBOX_WS_MAC 854 753 /* Check whether we are embedded into a stack: */ … … 886 785 connect(m_pTreeWidget, &QITreeWidget::itemChanged, 887 786 this, &UIHostNetworkManagerWidget::sltHandleItemChange); 888 if (m_pActionDetails) 889 connect(m_pTreeWidget, &QITreeWidget::itemDoubleClicked, 890 m_pActionDetails, &QAction::setChecked); 787 connect(m_pTreeWidget, &QITreeWidget::itemDoubleClicked, 788 m_pActionPool->action(UIActionIndexST_M_Network_T_Details), &QAction::setChecked); 891 789 892 790 /* Add into layout: */ … … 919 817 { 920 818 /* Details action/widget: */ 921 m_pAction Details->setChecked(gEDataManager->hostNetworkManagerDetailsExpanded());819 m_pActionPool->action(UIActionIndexST_M_Network_T_Details)->setChecked(gEDataManager->hostNetworkManagerDetailsExpanded()); 922 820 } 923 821 … … 1050 948 *********************************************************************************************************************************/ 1051 949 950 UIHostNetworkManagerFactory::UIHostNetworkManagerFactory(UIActionPool *pActionPool /* = 0 */) 951 : m_pActionPool(pActionPool) 952 { 953 } 954 1052 955 void UIHostNetworkManagerFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) 1053 956 { 1054 pDialog = new UIHostNetworkManager(pCenterWidget );957 pDialog = new UIHostNetworkManager(pCenterWidget, m_pActionPool); 1055 958 } 1056 959 … … 1060 963 *********************************************************************************************************************************/ 1061 964 1062 UIHostNetworkManager::UIHostNetworkManager(QWidget *pCenterWidget )965 UIHostNetworkManager::UIHostNetworkManager(QWidget *pCenterWidget, UIActionPool *pActionPool) 1063 966 : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget) 967 , m_pActionPool(pActionPool) 1064 968 { 1065 969 } … … 1108 1012 { 1109 1013 /* Create widget: */ 1110 UIHostNetworkManagerWidget *pWidget = new UIHostNetworkManagerWidget(EmbedTo_Dialog, this);1014 UIHostNetworkManagerWidget *pWidget = new UIHostNetworkManagerWidget(EmbedTo_Dialog, m_pActionPool, this); 1111 1015 AssertPtrReturnVoid(pWidget); 1112 1016 { -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.h
r68962 r73735 32 32 class QIDialogButtonBox; 33 33 class QITreeWidget; 34 class UIActionPool; 34 35 class UIHostNetworkDetailsWidget; 35 36 class UIItemHostNetwork; … … 53 54 54 55 /** Constructs Host Network Manager widget. */ 55 UIHostNetworkManagerWidget(EmbedTo enmEmbedding, QWidget *pParent = 0);56 UIHostNetworkManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, QWidget *pParent = 0); 56 57 57 58 /** Returns the menu. */ 58 QMenu *menu() const { return m_pMenu; }59 QMenu *menu() const; 59 60 60 61 #ifdef VBOX_WS_MAC … … 91 92 /** @name Menu/action stuff. 92 93 * @{ */ 93 /** Handles command to addhost network. */94 void slt AddHostNetwork();94 /** Handles command to create host network. */ 95 void sltCreateHostNetwork(); 95 96 /** Handles command to remove host network. */ 96 97 void sltRemoveHostNetwork(); … … 124 125 /** Prepares actions. */ 125 126 void prepareActions(); 126 /** Prepares menu. */127 void prepareMenu();128 127 /** Prepares widgets. */ 129 128 void prepareWidgets(); … … 158 157 /** Holds the widget embedding type. */ 159 158 const EmbedTo m_enmEmbedding; 159 /** Holds the action-pool reference. */ 160 UIActionPool *m_pActionPool; 160 161 /** @} */ 161 162 … … 164 165 /** Holds the toolbar instance. */ 165 166 UIToolBar *m_pToolBar; 166 /** Holds menu-bar menu object instance. */167 QMenu *m_pMenu;168 /** Holds the Add action instance. */169 QAction *m_pActionAdd;170 /** Holds the Remove action instance. */171 QAction *m_pActionRemove;172 /** Holds the Details action instance. */173 QAction *m_pActionDetails;174 /** Holds the Refresh action instance. */175 QAction *m_pActionRefresh;176 167 /** @} */ 177 168 … … 189 180 class UIHostNetworkManagerFactory : public QIManagerDialogFactory 190 181 { 182 public: 183 184 /** Constructs Media Manager factory acquiring additional arguments. 185 * @param pActionPool Brings the action-pool reference. */ 186 UIHostNetworkManagerFactory(UIActionPool *pActionPool = 0); 187 191 188 protected: 192 189 … … 194 191 * @param pCenterWidget Brings the widget reference to center according to. */ 195 192 virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) /* override */; 193 194 /** Holds the action-pool reference. */ 195 UIActionPool *m_pActionPool; 196 196 }; 197 197 … … 220 220 221 221 /** Constructs Host Network Manager dialog. 222 * @param pCenterWidget Brings the widget reference to center according to. */ 223 UIHostNetworkManager(QWidget *pCenterWidget); 222 * @param pCenterWidget Brings the widget reference to center according to. 223 * @param pActionPool Brings the action-pool reference. */ 224 UIHostNetworkManager(QWidget *pCenterWidget, UIActionPool *pActionPool); 224 225 225 226 /** @name Event-handling stuff. … … 247 248 /** @} */ 248 249 250 /** @name Action related variables. 251 * @{ */ 252 /** Holds the action-pool reference. */ 253 UIActionPool *m_pActionPool; 254 /** @} */ 255 249 256 /** Allow factory access to private/protected members: */ 250 257 friend class UIHostNetworkManagerFactory; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp
r73721 r73735 131 131 { 132 132 /* Create Host Network Manager: */ 133 m_pPaneNetwork = new UIHostNetworkManagerWidget(EmbedTo_Stack );133 m_pPaneNetwork = new UIHostNetworkManagerWidget(EmbedTo_Stack, m_pActionPool); 134 134 AssertPtrReturnVoid(m_pPaneNetwork); 135 135 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r73721 r73735 428 428 if (!m_pManagerHostNetwork) 429 429 { 430 UIHostNetworkManagerFactory( ).prepare(m_pManagerHostNetwork, this);430 UIHostNetworkManagerFactory(m_pActionPool).prepare(m_pManagerHostNetwork, this); 431 431 connect(m_pManagerHostNetwork, &QIManagerDialog::sigClose, 432 432 this, &UIVirtualBoxManager::sltCloseHostNetworkManagerWindow); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r73717 r73735 484 484 if (!m_pManagerHostNetwork) 485 485 { 486 UIHostNetworkManagerFactory( ).prepare(m_pManagerHostNetwork, this);486 UIHostNetworkManagerFactory(m_pActionPool).prepare(m_pManagerHostNetwork, this); 487 487 connect(m_pManagerHostNetwork, &QIManagerDialog::sigClose, 488 488 this, &UISelectorWindow::sltCloseHostNetworkManagerWindow); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.cpp
r73717 r73735 123 123 { 124 124 /* Create Host Network Manager: */ 125 m_pPaneNetwork = new UIHostNetworkManagerWidget(EmbedTo_Stack );125 m_pPaneNetwork = new UIHostNetworkManagerWidget(EmbedTo_Stack, m_pActionPool); 126 126 AssertPtrReturnVoid(m_pPaneNetwork); 127 127 {
Note:
See TracChangeset
for help on using the changeset viewer.