VirtualBox

Changeset 79258 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 20, 2019 3:21:37 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9495: Add New Cloud VM wizard into File menu of VirtualBox Manager.

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  
    237237        setName(QApplication::translate("UIActionPool", "&Export Appliance..."));
    238238        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. */
     245class UIActionSimpleSelectorFileShowNewCloudVMWizard : public UIActionSimple
     246{
     247    Q_OBJECT;
     248
     249public:
     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
     258protected:
     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"));
    239271        setToolTip(text().remove('&').remove('.') +
    240272                   (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     
    27192751    m_pool[UIActionIndexST_M_File_S_ImportAppliance] = new UIActionSimpleSelectorFileShowImportApplianceWizard(this);
    27202752    m_pool[UIActionIndexST_M_File_S_ExportAppliance] = new UIActionSimpleSelectorFileShowExportApplianceWizard(this);
     2753    m_pool[UIActionIndexST_M_File_S_NewCloudVM] = new UIActionSimpleSelectorFileShowNewCloudVMWizard(this);
    27212754#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    27222755    m_pool[UIActionIndexST_M_File_S_ShowExtraDataManager] = new UIActionSimpleSelectorFileShowExtraDataManager(this);
     
    29883021    /* 'Export Appliance' action goes to 'File' menu: */
    29893022    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));
    29903025# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    29913026    /* 'Show Extra-data Manager' action goes to 'File' menu for Debug build: */
     
    30103045    /* 'Export Appliance' action goes to 'File' menu: */
    30113046    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));
    30123049    /* Separator after 'Export Appliance' action of the 'File' menu: */
    30133050    pMenu->addSeparator();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r78323 r79258  
    4646    UIActionIndexST_M_File_S_ImportAppliance,
    4747    UIActionIndexST_M_File_S_ExportAppliance,
     48    UIActionIndexST_M_File_S_NewCloudVM,
    4849#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    4950    UIActionIndexST_M_File_S_ShowExtraDataManager,
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r78722 r79258  
    4646#include "UIWizardExportApp.h"
    4747#include "UIWizardImportApp.h"
     48#include "UIWizardNewCloudVM.h"
    4849#ifdef VBOX_WS_MAC
    4950# include "UIImageTools.h"
     
    554555}
    555556
     557void 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
    556579#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    557580void UIVirtualBoxManager::sltOpenExtraDataManagerWindow()
     
    13971420    connect(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance), &UIAction::triggered,
    13981421            this, &UIVirtualBoxManager::sltOpenExportApplianceWizard);
     1422    connect(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM), &UIAction::triggered,
     1423            this, &UIVirtualBoxManager::sltOpenNewCloudVMWizard);
    13991424#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    14001425    connect(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager), &UIAction::triggered,
     
    17011726    actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)->setEnabled(isActionEnabled(UIActionIndexST_M_File_S_ExportAppliance, items));
    17021727    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));
    17031729
    17041730    /* Enable/disable welcome actions: */
     
    18401866        case UIActionIndexST_M_File_S_ExportAppliance:
    18411867        case UIActionIndexST_M_File_S_ImportAppliance:
     1868        case UIActionIndexST_M_File_S_NewCloudVM:
    18421869        case UIActionIndexST_M_Welcome_S_Add:
    18431870        {
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r78722 r79258  
    163163        /** Handles call to open Export Appliance wizard. */
    164164        void sltOpenExportApplianceWizard();
     165        /** Handles call to open New Cloud VM wizard. */
     166        void sltOpenNewCloudVMWizard();
    165167
    166168#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r78323 r79258  
    562562                    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance));
    563563                    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance));
     564                    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM));
    564565                    m_pToolBar->addSeparator();
    565566                    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Welcome_S_New));
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r78294 r79258  
    11401140        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance));
    11411141        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance));
     1142        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM));
    11421143# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    11431144        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager));
     
    11541155        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance));
    11551156        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance));
     1157        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_NewCloudVM));
    11561158        m_pContextMenuGlobal->addSeparator();
    11571159# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette