Changeset 74556 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 1, 2018 3:30:56 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r74464 r74556 653 653 654 654 655 #ifndef VBOX_GUI_WITH_NEW_MANAGER 656 655 657 /** Selector UI: Machine tool types. */ 656 658 enum ToolTypeMachine … … 674 676 }; 675 677 Q_DECLARE_METATYPE(ToolTypeGlobal); 678 679 #else /* VBOX_GUI_WITH_NEW_MANAGER */ 680 681 /** Tool item classes. */ 682 enum UIToolsClass 683 { 684 UIToolsClass_Invalid, 685 UIToolsClass_Global, 686 UIToolsClass_Machine 687 }; 688 689 690 /** Tool item types. */ 691 enum UIToolsType 692 { 693 UIToolsType_Invalid, 694 /* Global types: */ 695 UIToolsType_Welcome, 696 UIToolsType_Media, 697 UIToolsType_Network, 698 /* Machine types: */ 699 UIToolsType_Details, 700 UIToolsType_Snapshots, 701 UIToolsType_Logs, 702 }; 703 704 705 /** Selector UI: Global tool types. */ 706 enum ToolTypeGlobal 707 { 708 ToolTypeGlobal_Invalid, 709 ToolTypeGlobal_Welcome, 710 ToolTypeGlobal_Media, 711 ToolTypeGlobal_Network, 712 }; 713 Q_DECLARE_METATYPE(ToolTypeGlobal); 714 715 716 /** Selector UI: Machine tool types. */ 717 enum ToolTypeMachine 718 { 719 ToolTypeMachine_Invalid, 720 ToolTypeMachine_Error, 721 ToolTypeMachine_Details, 722 ToolTypeMachine_Snapshots, 723 ToolTypeMachine_Logs 724 }; 725 Q_DECLARE_METATYPE(ToolTypeMachine); 726 727 #endif /* VBOX_GUI_WITH_NEW_MANAGER */ 676 728 677 729 … … 831 883 832 884 833 #ifdef VBOX_GUI_WITH_NEW_MANAGER834 /** Tool item classes. */835 enum UIToolsClass836 {837 UIToolsClass_Invalid,838 UIToolsClass_Global,839 UIToolsClass_Machine840 };841 842 843 /** Tool item types. */844 enum UIToolsType845 {846 UIToolsType_Invalid,847 /* Global types: */848 UIToolsType_Media,849 UIToolsType_Network,850 /* Machine types: */851 UIToolsType_Details,852 UIToolsType_Snapshots,853 UIToolsType_Logs,854 };855 #endif /* VBOX_GUI_WITH_NEW_MANAGER */856 857 858 885 #endif /* !___UIExtraDataDefs_h___ */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp
r74505 r74556 93 93 switch (enmType) 94 94 { 95 case ToolTypeGlobal_ Desktop:95 case ToolTypeGlobal_Welcome: 96 96 { 97 97 /* Create Desktop pane: */ … … 100 100 { 101 101 /* Configure pane: */ 102 m_pPaneDesktop->setProperty("ToolType", QVariant::fromValue(ToolTypeGlobal_ Desktop));102 m_pPaneDesktop->setProperty("ToolType", QVariant::fromValue(ToolTypeGlobal_Welcome)); 103 103 104 104 /* Add into layout: */ … … 111 111 break; 112 112 } 113 case ToolTypeGlobal_ VirtualMedia:113 case ToolTypeGlobal_Media: 114 114 { 115 115 /* Create Virtual Media Manager: */ … … 123 123 124 124 /* Configure pane: */ 125 m_pPaneMedia->setProperty("ToolType", QVariant::fromValue(ToolTypeGlobal_ VirtualMedia));125 m_pPaneMedia->setProperty("ToolType", QVariant::fromValue(ToolTypeGlobal_Media)); 126 126 127 127 /* Add into layout: */ … … 131 131 break; 132 132 } 133 case ToolTypeGlobal_ HostNetwork:133 case ToolTypeGlobal_Network: 134 134 { 135 135 /* Create Host Network Manager: */ … … 143 143 144 144 /* Configure pane: */ 145 m_pPaneNetwork->setProperty("ToolType", QVariant::fromValue(ToolTypeGlobal_ HostNetwork));145 m_pPaneNetwork->setProperty("ToolType", QVariant::fromValue(ToolTypeGlobal_Network)); 146 146 147 147 /* Add into layout: */ … … 171 171 switch (enmType) 172 172 { 173 case ToolTypeGlobal_ Desktop:m_pPaneDesktop = 0; break;174 case ToolTypeGlobal_ VirtualMedia:m_pPaneMedia = 0; break;175 case ToolTypeGlobal_ HostNetwork:m_pPaneNetwork = 0; break;173 case ToolTypeGlobal_Welcome: m_pPaneDesktop = 0; break; 174 case ToolTypeGlobal_Media: m_pPaneMedia = 0; break; 175 case ToolTypeGlobal_Network: m_pPaneNetwork = 0; break; 176 176 default: break; 177 177 } … … 201 201 202 202 /* Create desktop pane: */ 203 openTool(ToolTypeGlobal_ VirtualMedia);203 openTool(ToolTypeGlobal_Media); 204 204 205 205 /* Apply language settings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r74505 r74556 97 97 switch (enmType) 98 98 { 99 case ToolTypeMachine_ Desktop:99 case ToolTypeMachine_Error: 100 100 { 101 101 /* Create Desktop pane: */ … … 104 104 { 105 105 /* Configure pane: */ 106 m_pPaneDesktop->setProperty("ToolType", QVariant::fromValue(ToolTypeMachine_ Desktop));106 m_pPaneDesktop->setProperty("ToolType", QVariant::fromValue(ToolTypeMachine_Error)); 107 107 108 108 /* Add into layout: */ … … 154 154 break; 155 155 } 156 case ToolTypeMachine_Log Viewer:156 case ToolTypeMachine_Logs: 157 157 { 158 158 /* Create the Logviewer pane: */ … … 166 166 167 167 /* Configure pane: */ 168 m_pPaneLogViewer->setProperty("ToolType", QVariant::fromValue(ToolTypeMachine_Log Viewer));168 m_pPaneLogViewer->setProperty("ToolType", QVariant::fromValue(ToolTypeMachine_Logs)); 169 169 170 170 /* Add into layout: */ … … 194 194 switch (enmType) 195 195 { 196 case ToolTypeMachine_ Desktop:m_pPaneDesktop = 0; break;196 case ToolTypeMachine_Error: m_pPaneDesktop = 0; break; 197 197 case ToolTypeMachine_Details: m_pPaneDetails = 0; break; 198 198 case ToolTypeMachine_Snapshots: m_pPaneSnapshots = 0; break; 199 case ToolTypeMachine_Log Viewer:m_pPaneLogViewer = 0; break;199 case ToolTypeMachine_Logs: m_pPaneLogViewer = 0; break; 200 200 default: break; 201 201 } … … 249 249 } 250 250 /* Update logviewer pane is it is open: */ 251 if (isToolOpened(ToolTypeMachine_Log Viewer))251 if (isToolOpened(ToolTypeMachine_Logs)) 252 252 { 253 253 AssertPtrReturnVoid(m_pPaneLogViewer); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.cpp
r73881 r74556 210 210 void UIToolbarTools::prepareMenu() 211 211 { 212 /* Configure 'Global' menu: */ 213 UIMenu *pMenuGlobal = m_pActionPool->action(UIActionIndexST_M_Tools_M_Global)->menu(); 214 if (pMenuGlobal) 215 { 216 /* Add 'Virtual Media Manager' action: */ 217 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager)); 218 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager), &UIAction::triggered, 219 this, &UIToolbarTools::sltHandleOpenToolGlobal); 220 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager) 221 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_Media)); 222 223 /* Add 'Host Network Manager' action: */ 224 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager)); 225 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager), &UIAction::triggered, 226 this, &UIToolbarTools::sltHandleOpenToolGlobal); 227 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager) 228 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_Network)); 229 } 230 231 /* Configure 'Global' toggle action: */ 232 m_pActionPool->action(UIActionIndexST_M_Tools_T_Global)->setMenu(pMenuGlobal); 233 212 234 /* Configure 'Machine' menu: */ 213 235 UIMenu *pMenuMachine = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine)->menu(); … … 233 255 this, &UIToolbarTools::sltHandleOpenToolMachine); 234 256 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer) 235 ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Log Viewer));257 ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Logs)); 236 258 } 237 259 238 260 /* Configure 'Machine' toggle action: */ 239 261 m_pActionPool->action(UIActionIndexST_M_Tools_T_Machine)->setMenu(pMenuMachine); 240 241 /* Configure 'Global' menu: */242 UIMenu *pMenuGlobal = m_pActionPool->action(UIActionIndexST_M_Tools_M_Global)->menu();243 if (pMenuGlobal)244 {245 /* Add 'Virtual Media Manager' action: */246 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager));247 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager), &UIAction::triggered,248 this, &UIToolbarTools::sltHandleOpenToolGlobal);249 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager)250 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_VirtualMedia));251 252 /* Add 'Host Network Manager' action: */253 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager));254 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager), &UIAction::triggered,255 this, &UIToolbarTools::sltHandleOpenToolGlobal);256 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager)257 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_HostNetwork));258 }259 260 /* Configure 'Global' toggle action: */261 m_pActionPool->action(UIActionIndexST_M_Tools_T_Global)->setMenu(pMenuGlobal);262 262 } 263 263 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r74504 r74556 286 286 * otherwise user sees everything himself: */ 287 287 if ( m_pManagerVirtualMedia 288 || m_pWidget->isToolOpened(ToolTypeGlobal_ VirtualMedia))288 || m_pWidget->isToolOpened(ToolTypeGlobal_Media)) 289 289 return; 290 290 … … 386 386 { 387 387 /* First check if instance of widget opened the embedded way: */ 388 if (m_pWidget->isToolOpened(ToolTypeGlobal_ VirtualMedia))389 { 390 m_pWidget->switchToTool(ToolTypeGlobal_ VirtualMedia);388 if (m_pWidget->isToolOpened(ToolTypeGlobal_Media)) 389 { 390 m_pWidget->switchToTool(ToolTypeGlobal_Media); 391 391 return; 392 392 } … … 416 416 { 417 417 /* First check if instance of widget opened the embedded way: */ 418 if (m_pWidget->isToolOpened(ToolTypeGlobal_ HostNetwork))419 { 420 m_pWidget->switchToTool(ToolTypeGlobal_ HostNetwork);418 if (m_pWidget->isToolOpened(ToolTypeGlobal_Network)) 419 { 420 m_pWidget->switchToTool(ToolTypeGlobal_Network); 421 421 return; 422 422 } … … 1017 1017 1018 1018 /* First check if a logviewer is already opened in embedded mode: */ 1019 if (m_pWidget->isToolOpened(ToolTypeMachine_Log Viewer))1020 { 1021 m_pWidget->switchToTool(ToolTypeMachine_Log Viewer);1019 if (m_pWidget->isToolOpened(ToolTypeMachine_Logs)) 1020 { 1021 m_pWidget->switchToTool(ToolTypeMachine_Logs); 1022 1022 return; 1023 1023 } … … 1993 1993 m_pGroupMenuAction->setVisible(fMachineOrGroupMenuShown && !fMachineMenuShown); 1994 1994 1995 /* Determine whether Snapshot actions should be visible: */ 1995 /* Determine whether Media actions should be visible: */ 1996 const bool fMediumMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_Media; 1997 const bool fMediumActionsShown = fMediumMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_Media); 1998 m_pVirtualMediaManagerMenuAction->setVisible(fMediumMenuShown); 1999 2000 /* Determine whether Network actions should be visible: */ 2001 const bool fNetworkMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_Network; 2002 const bool fNetworkActionsShown = fNetworkMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_Network); 2003 m_pHostNetworkManagerMenuAction->setVisible(fNetworkMenuShown); 2004 2005 /* Determine whether Snapshots actions should be visible: */ 1996 2006 const bool fSnapshotMenuShown = fMachineOrGroupMenuShown && m_pWidget->currentMachineTool() == ToolTypeMachine_Snapshots; 1997 2007 m_pSnapshotMenuAction->setVisible(fSnapshotMenuShown); 1998 2008 1999 /* Determine whether Log Vieweractions should be visible: */2000 const bool fLogViewerMenuShown = fMachineOrGroupMenuShown && m_pWidget->currentMachineTool() == ToolTypeMachine_Log Viewer;2001 const bool fLogViewerActionsShown = fLogViewerMenuShown || !m_pWidget->isToolOpened(ToolTypeMachine_Log Viewer);2009 /* Determine whether Logs actions should be visible: */ 2010 const bool fLogViewerMenuShown = fMachineOrGroupMenuShown && m_pWidget->currentMachineTool() == ToolTypeMachine_Logs; 2011 const bool fLogViewerActionsShown = fLogViewerMenuShown || !m_pWidget->isToolOpened(ToolTypeMachine_Logs); 2002 2012 m_pLogViewerMenuAction->setVisible(fLogViewerMenuShown); 2003 2004 /* Determine whether VirtualMediaManager actions should be visible: */2005 const bool fMediumMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_VirtualMedia;2006 const bool fMediumActionsShown = fMediumMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_VirtualMedia);2007 m_pVirtualMediaManagerMenuAction->setVisible(fMediumMenuShown);2008 2009 /* Determine whether HostNetworkManager actions should be visible: */2010 const bool fNetworkMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_HostNetwork;2011 const bool fNetworkActionsShown = fNetworkMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_HostNetwork);2012 m_pHostNetworkManagerMenuAction->setVisible(fNetworkMenuShown);2013 2013 2014 2014 /* Hide action shortcuts: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r74502 r74556 134 134 m_pPaneToolsMachine->setItems(currentItems()); 135 135 /* If that was 'Snapshot' or 'LogViewer' => pass there current or null machine: */ 136 if (enmType == ToolTypeMachine_Snapshots || enmType == ToolTypeMachine_Log Viewer)136 if (enmType == ToolTypeMachine_Snapshots || enmType == ToolTypeMachine_Logs) 137 137 { 138 138 UIVirtualMachineItem *pItem = currentItem(); … … 254 254 if (pItem && pItem->accessible()) 255 255 { 256 /* If Desktoppane is chosen currently => open tool currently chosen in Tools-pane: */257 if (m_pPaneToolsMachine->currentTool() == ToolTypeMachine_ Desktop)256 /* If Error pane is chosen currently => open tool currently chosen in Tools-pane: */ 257 if (m_pPaneToolsMachine->currentTool() == ToolTypeMachine_Error) 258 258 sltHandleToolsPaneIndexChange(); 259 259 … … 268 268 else 269 269 { 270 /* Make sure Desktop-pane raised: */271 m_pPaneToolsMachine->openTool(ToolTypeMachine_ Desktop);270 /* Make sure Error pane raised: */ 271 m_pPaneToolsMachine->openTool(ToolTypeMachine_Error); 272 272 273 273 /* Note that the machine becomes inaccessible (or if the last VM gets … … 332 332 ToolTypeGlobal enmType = ToolTypeGlobal_Invalid; 333 333 if (!m_pPaneTools->areToolsEnabled(UIToolsClass_Global)) 334 enmType = ToolTypeGlobal_ Desktop;334 enmType = ToolTypeGlobal_Media; 335 335 else 336 336 { 337 337 switch (m_pPaneTools->toolsType()) 338 338 { 339 case UIToolsType_Media: enmType = ToolTypeGlobal_ VirtualMedia; break;340 case UIToolsType_Network: enmType = ToolTypeGlobal_ HostNetwork; break;339 case UIToolsType_Media: enmType = ToolTypeGlobal_Media; break; 340 case UIToolsType_Network: enmType = ToolTypeGlobal_Network; break; 341 341 default: break; 342 342 } … … 350 350 ToolTypeMachine enmType = ToolTypeMachine_Invalid; 351 351 if (!m_pPaneTools->areToolsEnabled(UIToolsClass_Machine)) 352 enmType = ToolTypeMachine_De sktop;352 enmType = ToolTypeMachine_Details; 353 353 else 354 354 { … … 357 357 case UIToolsType_Details: enmType = ToolTypeMachine_Details; break; 358 358 case UIToolsType_Snapshots: enmType = ToolTypeMachine_Snapshots; break; 359 case UIToolsType_Logs: enmType = ToolTypeMachine_Log Viewer; break;359 case UIToolsType_Logs: enmType = ToolTypeMachine_Logs; break; 360 360 default: break; 361 361 } … … 603 603 /* Separator: */ 604 604 if ( isToolOpened(ToolTypeMachine_Snapshots) 605 || isToolOpened(ToolTypeMachine_Log Viewer)606 || isToolOpened(ToolTypeGlobal_ VirtualMedia)607 || isToolOpened(ToolTypeGlobal_ HostNetwork))605 || isToolOpened(ToolTypeMachine_Logs) 606 || isToolOpened(ToolTypeGlobal_Media) 607 || isToolOpened(ToolTypeGlobal_Network)) 608 608 m_pToolBar->addSeparator(); 609 609 610 /* Add 'Snapshot ' actions block: */610 /* Add 'Snapshots' actions block: */ 611 611 if (isToolOpened(ToolTypeMachine_Snapshots)) 612 612 { … … 618 618 } 619 619 620 /* Add 'Log Viewer' actions block: */621 if (isToolOpened(ToolTypeMachine_Log Viewer))620 /* Add 'Logs' actions block: */ 621 if (isToolOpened(ToolTypeMachine_Logs)) 622 622 { 623 623 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_S_Save)); … … 629 629 } 630 630 631 /* Add 'Medi um' actions block: */632 if (isToolOpened(ToolTypeGlobal_ VirtualMedia))631 /* Add 'Media' actions block: */ 632 if (isToolOpened(ToolTypeGlobal_Media)) 633 633 { 634 634 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Add)); … … 642 642 643 643 /* Add 'Network' actions block: */ 644 if (isToolOpened(ToolTypeGlobal_ HostNetwork))644 if (isToolOpened(ToolTypeGlobal_Network)) 645 645 { 646 646 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_S_Create));
Note:
See TracChangeset
for help on using the changeset viewer.