Changeset 79258 in vbox for trunk/src/VBox
- Timestamp:
- Jun 20, 2019 3:21:37 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/UIActionPoolManager.cpp
r78323 r79258 237 237 setName(QApplication::translate("UIActionPool", "&Export Appliance...")); 238 238 setStatusTip(QApplication::translate("UIActionPool", "Export one or more VirtualBox virtual machines as an appliance")); 239 setToolTip(text().remove('&').remove('.') + 240 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 241 } 242 }; 243 244 /** Simple action extension, used as 'Show New Cloud VM Wizard' action class. */ 245 class UIActionSimpleSelectorFileShowNewCloudVMWizard : public UIActionSimple 246 { 247 Q_OBJECT; 248 249 public: 250 251 /** Constructs action passing @a pParent to the base-class. */ 252 UIActionSimpleSelectorFileShowNewCloudVMWizard(UIActionPool *pParent) 253 : UIActionSimple(pParent, 254 ":/import_32px.png", ":/import_16px.png", 255 ":/import_disabled_32px.png", ":/import_disabled_16px.png") 256 {} 257 258 protected: 259 260 /** Returns shortcut extra-data ID. */ 261 virtual QString shortcutExtraDataID() const /* override */ 262 { 263 return QString("NewCloudVM"); 264 } 265 266 /** Handles translation event. */ 267 virtual void retranslateUi() /* override */ 268 { 269 setName(QApplication::translate("UIActionPool", "&New Cloud VM...")); 270 setStatusTip(QApplication::translate("UIActionPool", "Create new cloud virtual machine")); 239 271 setToolTip(text().remove('&').remove('.') + 240 272 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); … … 2719 2751 m_pool[UIActionIndexST_M_File_S_ImportAppliance] = new UIActionSimpleSelectorFileShowImportApplianceWizard(this); 2720 2752 m_pool[UIActionIndexST_M_File_S_ExportAppliance] = new UIActionSimpleSelectorFileShowExportApplianceWizard(this); 2753 m_pool[UIActionIndexST_M_File_S_NewCloudVM] = new UIActionSimpleSelectorFileShowNewCloudVMWizard(this); 2721 2754 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 2722 2755 m_pool[UIActionIndexST_M_File_S_ShowExtraDataManager] = new UIActionSimpleSelectorFileShowExtraDataManager(this); … … 2988 3021 /* 'Export Appliance' action goes to 'File' menu: */ 2989 3022 pMenu->addAction(action(UIActionIndexST_M_File_S_ExportAppliance)); 3023 /* 'New Cloud VM' action goes to 'File' menu: */ 3024 pMenu->addAction(action(UIActionIndexST_M_File_S_NewCloudVM)); 2990 3025 # ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 2991 3026 /* 'Show Extra-data Manager' action goes to 'File' menu for Debug build: */ … … 3010 3045 /* 'Export Appliance' action goes to 'File' menu: */ 3011 3046 pMenu->addAction(action(UIActionIndexST_M_File_S_ExportAppliance)); 3047 /* 'New Cloud VM' action goes to 'File' menu: */ 3048 pMenu->addAction(action(UIActionIndexST_M_File_S_NewCloudVM)); 3012 3049 /* Separator after 'Export Appliance' action of the 'File' menu: */ 3013 3050 pMenu->addSeparator(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r78323 r79258 46 46 UIActionIndexST_M_File_S_ImportAppliance, 47 47 UIActionIndexST_M_File_S_ExportAppliance, 48 UIActionIndexST_M_File_S_NewCloudVM, 48 49 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 49 50 UIActionIndexST_M_File_S_ShowExtraDataManager, -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r78722 r79258 46 46 #include "UIWizardExportApp.h" 47 47 #include "UIWizardImportApp.h" 48 #include "UIWizardNewCloudVM.h" 48 49 #ifdef VBOX_WS_MAC 49 50 # include "UIImageTools.h" … … 554 555 } 555 556 557 void UIVirtualBoxManager::sltOpenNewCloudVMWizard() 558 { 559 /* Lock the action preventing cascade calls: */ 560 actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM)->setProperty("opened", true); 561 updateActionsAppearance(); 562 563 /* Use the "safe way" to open stack of Mac OS X Sheets: */ 564 QWidget *pWizardParent = windowManager().realParentWindow(this); 565 UISafePointerWizardNewCloudVM pWizard = new UIWizardNewCloudVM(pWizardParent); 566 windowManager().registerNewParent(pWizard, pWizardParent); 567 pWizard->prepare(); 568 pWizard->exec(); 569 delete pWizard; 570 571 /* Unlock the action allowing further calls: */ 572 if (actionPool()) 573 { 574 actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM)->setProperty("opened", QVariant()); 575 updateActionsAppearance(); 576 } 577 } 578 556 579 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 557 580 void UIVirtualBoxManager::sltOpenExtraDataManagerWindow() … … 1397 1420 connect(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance), &UIAction::triggered, 1398 1421 this, &UIVirtualBoxManager::sltOpenExportApplianceWizard); 1422 connect(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM), &UIAction::triggered, 1423 this, &UIVirtualBoxManager::sltOpenNewCloudVMWizard); 1399 1424 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 1400 1425 connect(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager), &UIAction::triggered, … … 1701 1726 actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)->setEnabled(isActionEnabled(UIActionIndexST_M_File_S_ExportAppliance, items)); 1702 1727 actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance)->setEnabled(isActionEnabled(UIActionIndexST_M_File_S_ImportAppliance, items)); 1728 actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM)->setEnabled(isActionEnabled(UIActionIndexST_M_File_S_NewCloudVM, items)); 1703 1729 1704 1730 /* Enable/disable welcome actions: */ … … 1840 1866 case UIActionIndexST_M_File_S_ExportAppliance: 1841 1867 case UIActionIndexST_M_File_S_ImportAppliance: 1868 case UIActionIndexST_M_File_S_NewCloudVM: 1842 1869 case UIActionIndexST_M_Welcome_S_Add: 1843 1870 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r78722 r79258 163 163 /** Handles call to open Export Appliance wizard. */ 164 164 void sltOpenExportApplianceWizard(); 165 /** Handles call to open New Cloud VM wizard. */ 166 void sltOpenNewCloudVMWizard(); 165 167 166 168 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r78323 r79258 562 562 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance)); 563 563 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)); 564 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM)); 564 565 m_pToolBar->addSeparator(); 565 566 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_New)); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r78294 r79258 1140 1140 m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance)); 1141 1141 m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)); 1142 m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM)); 1142 1143 # ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 1143 1144 m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager)); … … 1154 1155 m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance)); 1155 1156 m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)); 1157 m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM)); 1156 1158 m_pContextMenuGlobal->addSeparator(); 1157 1159 # ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
Note:
See TracChangeset
for help on using the changeset viewer.