VirtualBox

Changeset 74868 in vbox for trunk


Ignore:
Timestamp:
Oct 16, 2018 4:32:08 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9230: Initial set of actions for Cloud Profile Manager.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileManager.cpp

    r74855 r74868  
    101101QMenu *UICloudProfileManagerWidget::menu() const
    102102{
    103     /// @todo implement menu action!
    104     return 0;
     103    return m_pActionPool->action(UIActionIndexST_M_CloudWindow)->menu();
    105104}
    106105
     
    207206
    208207    /* Update actions availability: */
    209     /// @todo implement % enable/disable actions!
     208    m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove)->setEnabled(pItem);
     209    m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details)->setEnabled(pItem);
    210210
    211211    /* If there is an item => update details data: */
     
    224224    /* Compose temporary context-menu: */
    225225    QMenu menu;
    226     /// @todo implement & insert actions!
     226    if (m_pTreeWidget->itemAt(position))
     227    {
     228        menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove));
     229        menu.addSeparator();
     230        menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details));
     231    }
     232    else
     233    {
     234        menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Create));
     235//        menu.addSeparator();
     236//        menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Refresh));
     237    }
    227238
    228239    /* And show it: */
     
    250261{
    251262    /* Connect actions: */
    252     /// @todo implement & connect actions!
     263    connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Create), &QAction::triggered,
     264            this, &UICloudProfileManagerWidget::sltCreateCloudProfile);
     265    connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove), &QAction::triggered,
     266            this, &UICloudProfileManagerWidget::sltRemoveCloudProfile);
     267    connect(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details), &QAction::toggled,
     268            this, &UICloudProfileManagerWidget::sltToggleCloudProfileDetailsVisibility);
     269    connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Refresh), &QAction::triggered,
     270            this, &UICloudProfileManagerWidget::sltRefreshCloudProfiles);
    253271}
    254272
     
    289307
    290308        /* Add toolbar actions: */
    291         /// @todo implement & add actions!
     309        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Create));
     310        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove));
     311        m_pToolBar->addSeparator();
     312        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details));
     313//        m_pToolBar->addSeparator();
     314//        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Refresh));
    292315
    293316#ifdef VBOX_WS_MAC
     
    326349        connect(m_pTreeWidget, &QITreeWidget::itemChanged,
    327350                this, &UICloudProfileManagerWidget::sltHandleItemChange);
    328         /// @todo implement & connect actions!
     351        connect(m_pTreeWidget, &QITreeWidget::itemDoubleClicked,
     352                m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details), &QAction::setChecked);
    329353
    330354        /* Add into layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp

    r74866 r74868  
    128128        setName(QApplication::translate("UIActionPool", "&Host Network Manager..."));
    129129        setStatusTip(QApplication::translate("UIActionPool", "Display the Host Network Manager window"));
     130    }
     131};
     132
     133/** Simple action extension, used as 'Show Cloud Profile Manager' action class. */
     134class UIActionSimpleSelectorFileShowCloudProfileManager : public UIActionSimple
     135{
     136    Q_OBJECT;
     137
     138public:
     139
     140    /** Constructs action passing @a pParent to the base-class. */
     141    UIActionSimpleSelectorFileShowCloudProfileManager(UIActionPool *pParent)
     142        : UIActionSimple(pParent, ":/host_iface_manager_16px.png", ":/host_iface_manager_16px.png")
     143    {}
     144
     145protected:
     146
     147    /** Returns shortcut extra-data ID. */
     148    virtual QString shortcutExtraDataID() const /* override */
     149    {
     150        return QString("CloudProfileManager");
     151    }
     152
     153    /** Returns default shortcut. */
     154    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     155    {
     156        return QKeySequence("Ctrl+C");
     157    }
     158
     159    /** Handles translation event. */
     160    virtual void retranslateUi() /* override */
     161    {
     162        setName(QApplication::translate("UIActionPool", "&Cloud Profile Manager..."));
     163        setStatusTip(QApplication::translate("UIActionPool", "Display the Cloud Profile Manager window"));
    130164    }
    131165};
     
    15571591};
    15581592
     1593/** Simple action extension, used as 'Show Cloud Profile Manager' action class. */
     1594class UIActionSimpleSelectorToolsGlobalShowCloudProfileManager : public UIActionSimple
     1595{
     1596    Q_OBJECT;
     1597
     1598public:
     1599
     1600    /** Constructs action passing @a pParent to the base-class. */
     1601    UIActionSimpleSelectorToolsGlobalShowCloudProfileManager(UIActionPool *pParent)
     1602        : UIActionSimple(pParent,
     1603                         ":/host_iface_manager_24px.png", ":/host_iface_manager_16px.png",
     1604                         ":/host_iface_manager_24px.png", ":/host_iface_manager_16px.png")
     1605    {}
     1606
     1607protected:
     1608
     1609    /** Returns shortcut extra-data ID. */
     1610    virtual QString shortcutExtraDataID() const /* override */
     1611    {
     1612        return QString("ToolsGlobalCloudProfileManager");
     1613    }
     1614
     1615    /** Handles translation event. */
     1616    virtual void retranslateUi() /* override */
     1617    {
     1618        setName(QApplication::translate("UIActionPool", "&Cloud Profile Manager"));
     1619        setStatusTip(QApplication::translate("UIActionPool", "Open the Cloud Profile Manager"));
     1620    }
     1621};
     1622
    15591623
    15601624/** Menu action extension, used as 'Snapshot' menu class. */
     
    22832347
    22842348
     2349/** Menu action extension, used as 'Cloud' menu class. */
     2350class UIActionMenuSelectorCloud : public UIActionMenu
     2351{
     2352    Q_OBJECT;
     2353
     2354public:
     2355
     2356    /** Constructs action passing @a pParent to the base-class. */
     2357    UIActionMenuSelectorCloud(UIActionPool *pParent)
     2358        : UIActionMenu(pParent)
     2359    {}
     2360
     2361protected:
     2362
     2363    /** Returns shortcut extra-data ID. */
     2364    virtual QString shortcutExtraDataID() const /* override */
     2365    {
     2366        return QString("CloudProfileMenu");
     2367    }
     2368
     2369    /** Handles translation event. */
     2370    virtual void retranslateUi() /* override */
     2371    {
     2372        setName(QApplication::translate("UIActionPool", "&Cloud"));
     2373        setStatusTip(QApplication::translate("UIActionPool", "Open the cloud menu"));
     2374    }
     2375};
     2376
     2377/** Simple action extension, used as 'Perform Create' action class. */
     2378class UIActionMenuSelectorCloudPerformCreate : public UIActionSimple
     2379{
     2380    Q_OBJECT;
     2381
     2382public:
     2383
     2384    /** Constructs action passing @a pParent to the base-class. */
     2385    UIActionMenuSelectorCloudPerformCreate(UIActionPool *pParent)
     2386        : UIActionSimple(pParent,
     2387                         ":/host_iface_add_32px.png",          ":/host_iface_add_16px.png",
     2388                         ":/host_iface_add_disabled_32px.png", ":/host_iface_add_disabled_16px.png")
     2389    {}
     2390
     2391protected:
     2392
     2393    /** Returns shortcut extra-data ID. */
     2394    virtual QString shortcutExtraDataID() const /* override */
     2395    {
     2396        return QString("CreateCloudProfile");
     2397    }
     2398
     2399    /** Returns default shortcut. */
     2400    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2401    {
     2402        return QKeySequence("Ctrl+Shift+C");
     2403    }
     2404
     2405    /** Handles translation event. */
     2406    virtual void retranslateUi() /* override */
     2407    {
     2408        setName(QApplication::translate("UIActionPool", "&Create..."));
     2409        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
     2410        setStatusTip(QApplication::translate("UIActionPool", "Create new cloud profile"));
     2411        setToolTip(tr("Create Cloud Profile (%1)").arg(shortcut().toString()));
     2412    }
     2413};
     2414
     2415/** Simple action extension, used as 'Perform Remove' action class. */
     2416class UIActionMenuSelectorCloudPerformRemove : public UIActionSimple
     2417{
     2418    Q_OBJECT;
     2419
     2420public:
     2421
     2422    /** Constructs action passing @a pParent to the base-class. */
     2423    UIActionMenuSelectorCloudPerformRemove(UIActionPool *pParent)
     2424        : UIActionSimple(pParent,
     2425                         ":/host_iface_remove_32px.png",          ":/host_iface_remove_16px.png",
     2426                         ":/host_iface_remove_disabled_32px.png", ":/host_iface_remove_disabled_16px.png")
     2427    {}
     2428
     2429protected:
     2430
     2431    /** Returns shortcut extra-data ID. */
     2432    virtual QString shortcutExtraDataID() const /* override */
     2433    {
     2434        return QString("RemoveCloudProfile");
     2435    }
     2436
     2437    /** Returns default shortcut. */
     2438    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2439    {
     2440        return QKeySequence("Ctrl+Shift+R");
     2441    }
     2442
     2443    /** Handles translation event. */
     2444    virtual void retranslateUi() /* override */
     2445    {
     2446        setName(QApplication::translate("UIActionPool", "&Remove..."));
     2447        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
     2448        setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud profile"));
     2449        setToolTip(tr("Remove Cloud Profile (%1)").arg(shortcut().toString()));
     2450    }
     2451};
     2452
     2453/** Toggle action extension, used as 'Toggle Properties' action class. */
     2454class UIActionMenuSelectorCloudToggleProperties : public UIActionToggle
     2455{
     2456    Q_OBJECT;
     2457
     2458public:
     2459
     2460    /** Constructs action passing @a pParent to the base-class. */
     2461    UIActionMenuSelectorCloudToggleProperties(UIActionPool *pParent)
     2462        : UIActionToggle(pParent,
     2463                         ":/host_iface_edit_32px.png",          ":/host_iface_edit_16px.png",
     2464                         ":/host_iface_edit_disabled_32px.png", ":/host_iface_edit_disabled_16px.png")
     2465    {}
     2466
     2467protected:
     2468
     2469    /** Returns shortcut extra-data ID. */
     2470    virtual QString shortcutExtraDataID() const /* override */
     2471    {
     2472        return QString("ToggleCloudProfileProperties");
     2473    }
     2474
     2475    /** Returns default shortcut. */
     2476    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2477    {
     2478        return QKeySequence("Ctrl+Space");
     2479    }
     2480
     2481    /** Handles translation event. */
     2482    virtual void retranslateUi() /* override */
     2483    {
     2484        setName(QApplication::translate("UIActionPool", "&Properties"));
     2485        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
     2486        setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected cloud profile properties"));
     2487        setToolTip(tr("Open Cloud Profile Properties (%1)").arg(shortcut().toString()));
     2488    }
     2489};
     2490
     2491/** Simple action extension, used as 'Perform Refresh' action class. */
     2492class UIActionMenuSelectorCloudPerformRefresh : public UIActionSimple
     2493{
     2494    Q_OBJECT;
     2495
     2496public:
     2497
     2498    /** Constructs action passing @a pParent to the base-class. */
     2499    UIActionMenuSelectorCloudPerformRefresh(UIActionPool *pParent)
     2500        : UIActionSimple(pParent,
     2501                         ":/refresh_32px.png",          ":/refresh_16px.png",
     2502                         ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
     2503    {}
     2504
     2505protected:
     2506
     2507    /** Returns shortcut extra-data ID. */
     2508    virtual QString shortcutExtraDataID() const /* override */
     2509    {
     2510        return QString("RefreshCloudProfiles");
     2511    }
     2512
     2513    /** Returns default shortcut. */
     2514    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2515    {
     2516        return QKeySequence("Ctrl+Shift+F");
     2517    }
     2518
     2519    /** Handles translation event. */
     2520    virtual void retranslateUi() /* override */
     2521    {
     2522        setName(QApplication::translate("UIActionPool", "Re&fresh..."));
     2523        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
     2524        setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of cloud profiles"));
     2525        setToolTip(tr("Refresh Cloud Profiles (%1)").arg(shortcut().toString()));
     2526    }
     2527};
     2528
     2529
    22852530/*********************************************************************************************************************************
    22862531*   Class UIActionPoolSelector implementation.                                                                                   *
     
    22982543    m_pool[UIActionIndexST_M_File_S_ShowVirtualMediumManager] = new UIActionSimpleSelectorFileShowVirtualMediaManager(this);
    22992544    m_pool[UIActionIndexST_M_File_S_ShowHostNetworkManager] = new UIActionSimpleSelectorFileShowHostNetworkManager(this);
     2545    m_pool[UIActionIndexST_M_File_S_ShowCloudProfileManager] = new UIActionSimpleSelectorFileShowCloudProfileManager(this);
    23002546    m_pool[UIActionIndexST_M_File_S_ImportAppliance] = new UIActionSimpleSelectorFileShowImportApplianceWizard(this);
    23012547    m_pool[UIActionIndexST_M_File_S_ExportAppliance] = new UIActionSimpleSelectorFileShowExportApplianceWizard(this);
     
    23682614    m_pool[UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager] = new UIActionSimpleSelectorToolsGlobalShowVirtualMediaManager(this);
    23692615    m_pool[UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager] = new UIActionSimpleSelectorToolsGlobalShowHostNetworkManager(this);
     2616    m_pool[UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager] = new UIActionSimpleSelectorToolsGlobalShowCloudProfileManager(this);
    23702617
    23712618    /* Snapshot Pane actions: */
     
    23962643    m_pool[UIActionIndexST_M_Network_S_Refresh] = new UIActionMenuSelectorNetworkPerformRefresh(this);
    23972644
     2645    /* Cloud Profile Manager actions: */
     2646    m_pool[UIActionIndexST_M_CloudWindow] = new UIActionMenuSelectorCloud(this);
     2647    m_pool[UIActionIndexST_M_Cloud] = new UIActionMenuSelectorCloud(this);
     2648    m_pool[UIActionIndexST_M_Cloud_S_Create] = new UIActionMenuSelectorCloudPerformCreate(this);
     2649    m_pool[UIActionIndexST_M_Cloud_S_Remove] = new UIActionMenuSelectorCloudPerformRemove(this);
     2650    m_pool[UIActionIndexST_M_Cloud_T_Details] = new UIActionMenuSelectorCloudToggleProperties(this);
     2651    m_pool[UIActionIndexST_M_Cloud_S_Refresh] = new UIActionMenuSelectorCloudPerformRefresh(this);
     2652
    23982653    /* Prepare update-handlers for known menus: */
    23992654    m_menuUpdateHandlers[UIActionIndexST_M_MediumWindow].ptfs = &UIActionPoolSelector::updateMenuMediumWindow;
     
    24012656    m_menuUpdateHandlers[UIActionIndexST_M_NetworkWindow].ptfs = &UIActionPoolSelector::updateMenuNetworkWindow;
    24022657    m_menuUpdateHandlers[UIActionIndexST_M_Network].ptfs = &UIActionPoolSelector::updateMenuNetwork;
     2658    m_menuUpdateHandlers[UIActionIndexST_M_CloudWindow].ptfs = &UIActionPoolSelector::updateMenuCloudWindow;
     2659    m_menuUpdateHandlers[UIActionIndexST_M_Cloud].ptfs = &UIActionPoolSelector::updateMenuCloud;
    24032660
    24042661    /* Call to base-class: */
     
    25432800}
    25442801
     2802void UIActionPoolSelector::updateMenuCloudWindow()
     2803{
     2804    /* Update corresponding menu: */
     2805    updateMenuCloudWrapper(action(UIActionIndexST_M_CloudWindow)->menu());
     2806
     2807    /* Mark menu as valid: */
     2808    m_invalidations.remove(UIActionIndexST_M_CloudWindow);
     2809}
     2810
     2811void UIActionPoolSelector::updateMenuCloud()
     2812{
     2813    /* Update corresponding menu: */
     2814    updateMenuCloudWrapper(action(UIActionIndexST_M_Cloud)->menu());
     2815
     2816    /* Mark menu as valid: */
     2817    m_invalidations.remove(UIActionIndexST_M_Cloud);
     2818}
     2819
     2820void UIActionPoolSelector::updateMenuCloudWrapper(UIMenu *pMenu)
     2821{
     2822    /* Clear contents: */
     2823    pMenu->clear();
     2824
     2825    /* Separator? */
     2826    bool fSeparator = false;
     2827
     2828    /* 'Create' action: */
     2829    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Cloud_S_Create)) || fSeparator;
     2830    /* 'Remove' action: */
     2831    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Cloud_S_Remove)) || fSeparator;
     2832
     2833    /* Separator? */
     2834    if (fSeparator)
     2835    {
     2836        pMenu->addSeparator();
     2837        fSeparator = false;
     2838    }
     2839
     2840    /* 'Properties' action: */
     2841    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Cloud_T_Details)) || fSeparator;
     2842
     2843//    /* Separator? */
     2844//    if (fSeparator)
     2845//    {
     2846//        pMenu->addSeparator();
     2847//        fSeparator = false;
     2848//    }
     2849
     2850//    /* 'Refresh' action: */
     2851//    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Cloud_S_Refresh)) || fSeparator;;
     2852}
     2853
    25452854void UIActionPoolSelector::updateShortcuts()
    25462855{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.h

    r74866 r74868  
    3737    UIActionIndexST_M_File_S_ShowVirtualMediumManager,
    3838    UIActionIndexST_M_File_S_ShowHostNetworkManager,
     39    UIActionIndexST_M_File_S_ShowCloudProfileManager,
    3940    UIActionIndexST_M_File_S_ImportAppliance,
    4041    UIActionIndexST_M_File_S_ExportAppliance,
     
    107108    UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager,
    108109    UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager,
     110    UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager,
    109111
    110112    /* Snapshot Pane actions: */
     
    135137    UIActionIndexST_M_Network_S_Refresh,
    136138
     139    /* Host Cloud Profile actions: */
     140    UIActionIndexST_M_CloudWindow,
     141    UIActionIndexST_M_Cloud,
     142    UIActionIndexST_M_Cloud_S_Create,
     143    UIActionIndexST_M_Cloud_S_Remove,
     144    UIActionIndexST_M_Cloud_T_Details,
     145    UIActionIndexST_M_Cloud_S_Refresh,
     146
    137147    /* Maximum index: */
    138148    UIActionIndexST_Max
     
    175185    void updateMenuNetworkWrapper(UIMenu *pMenu);
    176186
     187    /** Updates 'Cloud' window menu. */
     188    void updateMenuCloudWindow();
     189    /** Updates 'Cloud' menu. */
     190    void updateMenuCloud();
     191    /** Updates 'Cloud' @a pMenu. */
     192    void updateMenuCloudWrapper(UIMenu *pMenu);
     193
    177194    /** Updates shortcuts. */
    178195    virtual void updateShortcuts() /* override */;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.cpp

    r74556 r74868  
    227227        m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager)
    228228            ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_Network));
     229
     230        /* Add 'Cloud Profile Manager' action: */
     231        pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager));
     232        connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager), &UIAction::triggered,
     233                this, &UIToolbarTools::sltHandleOpenToolGlobal);
    229234    }
    230235
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r74854 r74868  
    3030# include "QIFileDialog.h"
    3131# include "UIActionPoolSelector.h"
     32# include "UICloudProfileManager.h"
    3233# include "UIDesktopServices.h"
    3334# include "UIExtraDataManager.h"
     
    117118    , m_pVirtualMediaManagerMenuAction(0)
    118119    , m_pHostNetworkManagerMenuAction(0)
     120    , m_pCloudProfileManagerMenuAction(0)
    119121    , m_pManagerVirtualMedia(0)
    120122    , m_pManagerHostNetwork(0)
     123    , m_pManagerCloudProfile(0)
    121124{
    122125    s_pInstance = this;
     
    445448}
    446449
     450void UIVirtualBoxManager::sltOpenCloudProfileManagerWindow()
     451{
     452    /* Create instance if not yet created: */
     453    if (!m_pManagerCloudProfile)
     454    {
     455        UICloudProfileManagerFactory(m_pActionPool).prepare(m_pManagerCloudProfile, this);
     456        connect(m_pManagerCloudProfile, &QIManagerDialog::sigClose,
     457                this, &UIVirtualBoxManager::sltCloseCloudProfileManagerWindow);
     458    }
     459
     460    /* Show instance: */
     461    m_pManagerCloudProfile->show();
     462    m_pManagerCloudProfile->setWindowState(m_pManagerCloudProfile->windowState() & ~Qt::WindowMinimized);
     463    m_pManagerCloudProfile->activateWindow();
     464}
     465
     466void UIVirtualBoxManager::sltCloseCloudProfileManagerWindow()
     467{
     468    /* Destroy instance if still exists: */
     469    if (m_pManagerCloudProfile)
     470        UIHostNetworkManagerFactory().cleanup(m_pManagerCloudProfile);
     471}
     472
    447473void UIVirtualBoxManager::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */)
    448474{
     
    12501276    prepareMenuNetwork(actionPool()->action(UIActionIndexST_M_Network)->menu());
    12511277    m_pHostNetworkManagerMenuAction = menuBar()->addMenu(actionPool()->action(UIActionIndexST_M_Network)->menu());
     1278
     1279    /* Prepare 'Cloud' menu: */
     1280    //prepareMenuCloud(actionPool()->action(UIActionIndexST_M_Cloud)->menu());
     1281    //m_pCloudProfileManagerMenuAction = menuBar()->addMenu(actionPool()->action(UIActionIndexST_M_Cloud)->menu());
    12521282
    12531283#ifdef VBOX_WS_MAC
     
    13031333    /* 'Show Host Network Manager' action goes to 'File' menu: */
    13041334    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1335    /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
     1336    //pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    13051337
    13061338#else /* !VBOX_WS_MAC */
     
    13211353    addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowVirtualMediumManager));
    13221354    addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1355    //addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    13231356#  ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    13241357    addAction(actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager));
     
    13471380    /* 'Show Host Network Manager' action goes to 'File' menu: */
    13481381    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1382    /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
     1383    //pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    13491384# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    13501385    /* 'Network Access Manager' action goes to 'File' menu: */
     
    17141749}
    17151750
     1751void UIVirtualBoxManager::prepareMenuCloud(QMenu *pMenu)
     1752{
     1753    /* We are doing it inside the UIActionPoolSelector. */
     1754    Q_UNUSED(pMenu);
     1755
     1756    /* Do not touch if filled already: */
     1757    if (!m_cloudProfileManagerActions.isEmpty())
     1758        return;
     1759
     1760    /* Remember action list: */
     1761    m_cloudProfileManagerActions << actionPool()->action(UIActionIndexST_M_Cloud_S_Create)
     1762                                 << actionPool()->action(UIActionIndexST_M_Cloud_S_Remove)
     1763                                 << actionPool()->action(UIActionIndexST_M_Cloud_T_Details)
     1764                                 << actionPool()->action(UIActionIndexST_M_Cloud_S_Refresh);
     1765}
     1766
    17161767void UIVirtualBoxManager::prepareStatusBar()
    17171768{
     
    17661817    connect(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager), &UIAction::triggered,
    17671818            this, &UIVirtualBoxManager::sltOpenHostNetworkManagerWindow);
     1819    connect(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager), &UIAction::triggered,
     1820            this, &UIVirtualBoxManager::sltOpenCloudProfileManagerWindow);
    17681821    connect(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance), &UIAction::triggered,
    17691822            this, &UIVirtualBoxManager::sltOpenImportApplianceWizardDefault);
     
    19151968    sltCloseVirtualMediumManagerWindow();
    19161969    sltCloseHostNetworkManagerWindow();
     1970    sltCloseCloudProfileManagerWindow();
    19171971
    19181972    /* Save settings: */
     
    19842038            VBoxGlobal::LaunchMode enmItemLaunchMode = enmLaunchMode;
    19852039            if (enmItemLaunchMode == VBoxGlobal::LaunchMode_Invalid)
    1986                 enmItemLaunchMode = UIVirtualMachineItem::isItemRunningHeadless(pItem)         ? VBoxGlobal::LaunchMode_Separate :
    1987                                     qApp->keyboardModifiers() == Qt::ShiftModifier ? VBoxGlobal::LaunchMode_Headless :
    1988                                                                                      VBoxGlobal::LaunchMode_Default;
     2040                enmItemLaunchMode = UIVirtualMachineItem::isItemRunningHeadless(pItem) ? VBoxGlobal::LaunchMode_Separate :
     2041                                    qApp->keyboardModifiers() == Qt::ShiftModifier     ? VBoxGlobal::LaunchMode_Headless :
     2042                                                                                         VBoxGlobal::LaunchMode_Default;
    19892043
    19902044            /* Launch current VM: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r73738 r74868  
    134134        /** Handles call to close Host Network Manager window. */
    135135        void sltCloseHostNetworkManagerWindow();
     136
     137        /** Handles call to open Cloud Profile Manager window. */
     138        void sltOpenCloudProfileManagerWindow();
     139        /** Handles call to close Cloud Profile Manager window. */
     140        void sltCloseCloudProfileManagerWindow();
    136141
    137142        /** Handles call to close a Machine LogViewer window. */
     
    256261        /** Prepares @a pMenu Network. */
    257262        void prepareMenuNetwork(QMenu *pMenu);
     263        /** Prepares @a pMenu Cloud. */
     264        void prepareMenuCloud(QMenu *pMenu);
    258265        /** Prepares status-bar. */
    259266        void prepareStatusBar();
     
    376383    QAction          *m_pHostNetworkManagerMenuAction;
    377384
     385    /** Holds the list of Cloud Profile Manager menu actions. */
     386    QList<UIAction*>  m_cloudProfileManagerActions;
     387    /** Holds the Cloud Profile Manager menu parent action. */
     388    QAction          *m_pCloudProfileManagerMenuAction;
     389
    378390    /** Holds the Virtual Media Manager window instance. */
    379391    QIManagerDialog *m_pManagerVirtualMedia;
    380392    /** Holds the Host Network Manager window instance. */
    381393    QIManagerDialog *m_pManagerHostNetwork;
     394    /** Holds the Cloud Profile Manager window instance. */
     395    QIManagerDialog *m_pManagerCloudProfile;
    382396    /** Holds a map of (machineUUID, UIVMLogViewerDialog). */
    383397    VMLogViewerMap   m_logViewers;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r74586 r74868  
    13451345        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowVirtualMediumManager));
    13461346        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1347        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    13471348
    13481349#else /* !VBOX_WS_MAC */
     
    13581359        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowVirtualMediumManager));
    13591360        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1361        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    13601362# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    13611363        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager));
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r74552 r74868  
    3333# include "QISplitter.h"
    3434# include "UIActionPoolSelector.h"
     35# include "UICloudProfileManager.h"
    3536# include "UIDesktopServices.h"
    3637# include "UIErrorString.h"
     
    140141    , m_pManagerVirtualMedia(0)
    141142    , m_pManagerHostNetwork(0)
     143    , m_pManagerCloudProfile(0)
    142144{
    143145    m_spInstance = this;
     
    502504}
    503505
     506void UISelectorWindow::sltOpenCloudProfileManagerWindow()
     507{
     508    /* Create instance if not yet created: */
     509    if (!m_pManagerCloudProfile)
     510    {
     511        UICloudProfileManagerFactory(m_pActionPool).prepare(m_pManagerCloudProfile, this);
     512        connect(m_pManagerCloudProfile, &QIManagerDialog::sigClose,
     513                this, &UISelectorWindow::sltCloseCloudProfileManagerWindow);
     514    }
     515
     516    /* Show instance: */
     517    m_pManagerCloudProfile->show();
     518    m_pManagerCloudProfile->setWindowState(m_pManagerCloudProfile->windowState() & ~Qt::WindowMinimized);
     519    m_pManagerCloudProfile->activateWindow();
     520}
     521
     522void UISelectorWindow::sltCloseCloudProfileManagerWindow()
     523{
     524    /* Destroy instance if still exists: */
     525    if (m_pManagerCloudProfile)
     526        UICloudProfileManagerFactory().cleanup(m_pManagerCloudProfile);
     527}
     528
    504529void UISelectorWindow::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */)
    505530{
     
    15851610    /* 'Show Host Network Manager' action goes to 'File' menu: */
    15861611    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1612    /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
     1613    //pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    15871614
    15881615#else /* !VBOX_WS_MAC */
     
    16031630    addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowVirtualMediumManager));
    16041631    addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1632    //addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    16051633#  ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    16061634    addAction(actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager));
     
    16291657    /* 'Show Host Network Manager' action goes to 'File' menu: */
    16301658    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1659    /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
     1660    //pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager));
    16311661# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    16321662    /* 'Network Access Manager' action goes to 'File' menu: */
     
    21152145    connect(actionPool()->action(UIActionIndexST_M_File_S_ShowVirtualMediumManager), SIGNAL(triggered()), this, SLOT(sltOpenVirtualMediumManagerWindow()));
    21162146    connect(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager), SIGNAL(triggered()), this, SLOT(sltOpenHostNetworkManagerWindow()));
     2147    connect(actionPool()->action(UIActionIndexST_M_File_S_ShowCloudProfileManager), SIGNAL(triggered()), this, SLOT(sltOpenCloudProfileManagerWindow()));
    21172148    connect(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance), SIGNAL(triggered()), this, SLOT(sltOpenImportApplianceWizard()));
    21182149    connect(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance), SIGNAL(triggered()), this, SLOT(sltOpenExportApplianceWizard()));
     
    22642295        QMap<ToolTypeGlobal, QAction*> mapActionsGlobal;
    22652296        mapActionsGlobal[ToolTypeGlobal_VirtualMedia] = actionPool()->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager);
    2266         mapActionsGlobal[ToolTypeGlobal_HostNetwork] = actionPool()->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager);
     2297        mapActionsGlobal[ToolTypeGlobal_HostNetwork]  = actionPool()->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager);
     2298        mapActionsGlobal[ToolTypeGlobal_CloudProfile] = actionPool()->action(UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager);
    22672299        for (int i = m_orderGlobal.size() - 1; i >= 0; --i)
    22682300            if (m_orderGlobal.at(i) != ToolTypeGlobal_Invalid)
     
    23322364    sltCloseVirtualMediumManagerWindow();
    23332365    sltCloseHostNetworkManagerWindow();
     2366    sltCloseCloudProfileManagerWindow();
    23342367
    23352368    /* Save settings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r72707 r74868  
    131131        /** Handles call to close Host Network Manager window. */
    132132        void sltCloseHostNetworkManagerWindow();
     133        /** Handles call to open Cloud Profile Manager window. */
     134        void sltOpenCloudProfileManagerWindow();
     135        /** Handles call to close Cloud Profile Manager window. */
     136        void sltCloseCloudProfileManagerWindow();
    133137        /** Handles call to close a Machine LogViewer window. */
    134138        void sltCloseLogViewerWindow();
     
    389393    /** Holds the Host Network Manager window instance. */
    390394    QIManagerDialog *m_pManagerHostNetwork;
     395    /** Holds the Host Cloud Profile window instance. */
     396    QIManagerDialog *m_pManagerCloudProfile;
    391397    /** Holds a map of (machineUUID, UIVMLogViewerDialog). */
    392398    VMLogViewerMap m_logViewers;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsToolbar.cpp

    r70543 r74868  
    251251        m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager)
    252252            ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_HostNetwork));
     253
     254        /* Add 'Cloud Profile Manager' action: */
     255        pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager));
     256        connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager), &UIAction::triggered,
     257                this, &UIToolsToolbar::sltHandleOpenToolGlobal);
    253258    }
    254259
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