Changeset 74950 in vbox
- Timestamp:
- Oct 19, 2018 4:41:15 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp
r74933 r74950 2557 2557 #endif 2558 2558 m_pool[UIActionIndexST_M_File_S_Close] = new UIActionSimpleSelectorFilePerformExit(this); 2559 2560 /* 'Welcome' actions: */ 2561 m_pool[UIActionIndexST_M_Welcome] = new UIActionMenuSelectorMachine(this); 2562 m_pool[UIActionIndexST_M_Welcome_S_New] = new UIActionSimpleSelectorMachinePerformCreate(this); 2563 m_pool[UIActionIndexST_M_Welcome_S_Add] = new UIActionSimpleSelectorMachinePerformAdd(this); 2559 2564 2560 2565 /* 'Group' actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.h
r74923 r74950 44 44 #endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */ 45 45 UIActionIndexST_M_File_S_Close, 46 47 /* 'Welcome' menu actions: */ 48 UIActionIndexST_M_Welcome, 49 UIActionIndexST_M_Welcome_S_New, 50 UIActionIndexST_M_Welcome_S_Add, 46 51 47 52 /* 'Group' menu actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r74948 r74950 112 112 , m_fFirstMediumEnumerationHandled(false) 113 113 , m_pActionPool(0) 114 , m_pWelcomeMenuAction(0) 114 115 , m_pGroupMenuAction(0) 115 116 , m_pMachineMenuAction(0) … … 1247 1248 prepareMenuFile(actionPool()->action(UIActionIndexST_M_File)->menu()); 1248 1249 menuBar()->addMenu(actionPool()->action(UIActionIndexST_M_File)->menu()); 1250 1251 /* Prepare 'Welcome' menu: */ 1252 prepareMenuWelcome(actionPool()->action(UIActionIndexST_M_Welcome)->menu()); 1253 m_pWelcomeMenuAction = menuBar()->addMenu(actionPool()->action(UIActionIndexST_M_Welcome)->menu()); 1249 1254 1250 1255 /* Prepare 'Group' / 'Start or Show' menu: */ … … 1408 1413 } 1409 1414 1415 void UIVirtualBoxManager::prepareMenuWelcome(QMenu *pMenu) 1416 { 1417 #ifdef VBOX_WS_X11 1418 // WORKAROUND: 1419 // There is an issue under Ubuntu which uses special kind of QPA 1420 // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar 1421 // directly to Ubuntu Application menu-bar. In that case action 1422 // shortcuts are not being handled by the Qt and that way ignored. 1423 // As a workaround we can add those actions into QMainWindow as well. 1424 addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_New)); 1425 addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_Add)); 1426 #endif /* VBOX_WS_X11 */ 1427 1428 /* Populate Machine-menu: */ 1429 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_New)); 1430 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_Add)); 1431 1432 /* Remember action list: */ 1433 m_welcomeActions << actionPool()->action(UIActionIndexST_M_Welcome_S_New) 1434 << actionPool()->action(UIActionIndexST_M_Welcome_S_Add); 1435 } 1436 1410 1437 void UIVirtualBoxManager::prepareMenuGroup(QMenu *pMenu) 1411 1438 { … … 1839 1866 this, &UIVirtualBoxManager::sltPerformExit); 1840 1867 1868 /* 'Welcome' menu connections: */ 1869 connect(actionPool()->action(UIActionIndexST_M_Welcome_S_Add), &UIAction::triggered, 1870 this, &UIVirtualBoxManager::sltOpenAddMachineDialogDefault); 1871 1841 1872 /* 'Group' menu connections: */ 1842 1873 connect(actionPool()->action(UIActionIndexST_M_Group_S_Add), &UIAction::triggered, … … 2062 2093 const bool fMachineMenuShown = m_pWidget->isMachineItemSelected() && !isSingleGroupSelected(); 2063 2094 const bool fGroupMenuShown = m_pWidget->isGroupItemSelected() && isSingleGroupSelected(); 2095 m_pWelcomeMenuAction->setVisible(fGlobalMenuShown); 2064 2096 m_pMachineMenuAction->setVisible(fMachineMenuShown); 2065 2097 m_pGroupMenuAction->setVisible(fGroupMenuShown); … … 2088 2120 2089 2121 /* Hide action shortcuts: */ 2122 if (!fGlobalMenuShown) 2123 foreach (UIAction *pAction, m_welcomeActions) 2124 pAction->hideShortcut(); 2090 2125 if (!fMachineMenuShown) 2091 2126 foreach (UIAction *pAction, m_machineActions) 2092 2127 pAction->hideShortcut(); 2093 else2128 if (!fGroupMenuShown) 2094 2129 foreach (UIAction *pAction, m_groupActions) 2095 2130 pAction->hideShortcut(); 2096 2131 2097 2132 /* Show action shortcuts: */ 2133 if (fGlobalMenuShown) 2134 foreach (UIAction *pAction, m_welcomeActions) 2135 pAction->showShortcut(); 2098 2136 if (fMachineMenuShown) 2099 2137 foreach (UIAction *pAction, m_machineActions) 2100 2138 pAction->showShortcut(); 2101 else2139 if (fGroupMenuShown) 2102 2140 foreach (UIAction *pAction, m_groupActions) 2103 2141 pAction->showShortcut(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r74942 r74950 241 241 /** Prepares @a pMenu File. */ 242 242 void prepareMenuFile(QMenu *pMenu); 243 /** Prepares @a pMenu Welcome. */ 244 void prepareMenuWelcome(QMenu *pMenu); 243 245 /** Prepares @a pMenu Group. */ 244 246 void prepareMenuGroup(QMenu *pMenu); … … 353 355 UIActionPool *m_pActionPool; 354 356 357 /** Holds the list of Welcome menu actions. */ 358 QList<UIAction*> m_welcomeActions; 359 /** Holds the Welcome menu parent action. */ 360 QAction *m_pWelcomeMenuAction; 361 355 362 /** Holds the list of Group menu actions. */ 356 363 QList<UIAction*> m_groupActions; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r74923 r74950 615 615 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)); 616 616 m_pToolBar->addSeparator(); 617 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_ Machine_S_New));618 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_ Machine_S_Add));617 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_New)); 618 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_Add)); 619 619 break; 620 620 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r74942 r74950 989 989 990 990 /* Lock the action preventing cascade calls: */ 991 actionPool()->action(UIActionIndexST_M_Welcome_S_New)->setEnabled(false); 991 992 actionPool()->action(UIActionIndexST_M_Machine_S_New)->setEnabled(false); 992 993 actionPool()->action(UIActionIndexST_M_Group_S_New)->setEnabled(false); … … 1007 1008 1008 1009 /* Unlock the action allowing further calls: */ 1010 actionPool()->action(UIActionIndexST_M_Welcome_S_New)->setEnabled(true); 1009 1011 actionPool()->action(UIActionIndexST_M_Machine_S_New)->setEnabled(true); 1010 1012 actionPool()->action(UIActionIndexST_M_Group_S_New)->setEnabled(true); … … 1458 1460 1459 1461 /* Setup action connections: */ 1462 connect(actionPool()->action(UIActionIndexST_M_Welcome_S_New), SIGNAL(triggered()), 1463 this, SLOT(sltCreateNewMachine())); 1460 1464 connect(actionPool()->action(UIActionIndexST_M_Group_S_New), SIGNAL(triggered()), 1461 1465 this, SLOT(sltCreateNewMachine()));
Note:
See TracChangeset
for help on using the changeset viewer.