VirtualBox

Ignore:
Timestamp:
Apr 26, 2019 1:07:58 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9438: Adding Try Oracle Cloud for Free button to Cloud Profile Manager.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp

    r77677 r78323  
    26142614        setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected cloud profile properties"));
    26152615        setToolTip(QApplication::translate("UIActionPool", "Open Cloud Profile Properties (%1)").arg(shortcut().toString()));
     2616    }
     2617};
     2618
     2619/** Simple action extension, used as 'Try Page' action class. */
     2620class UIActionMenuSelectorCloudShowTryPage : public UIActionSimple
     2621{
     2622    Q_OBJECT;
     2623
     2624public:
     2625
     2626    /** Constructs action passing @a pParent to the base-class. */
     2627    UIActionMenuSelectorCloudShowTryPage(UIActionPool *pParent)
     2628        : UIActionSimple(pParent,
     2629                         ":/cloud_profile_try_32px.png",          ":/cloud_profile_try_16px.png",
     2630                         ":/cloud_profile_try_disabled_32px.png", ":/cloud_profile_try_disabled_16px.png")
     2631    {
     2632        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     2633    }
     2634
     2635protected:
     2636
     2637    /** Returns shortcut extra-data ID. */
     2638    virtual QString shortcutExtraDataID() const /* override */
     2639    {
     2640        return QString("ShowCloudProfileTryPage");
     2641    }
     2642
     2643    /** Returns default shortcut. */
     2644    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2645    {
     2646        return QKeySequence("Ctrl+Shift+T");
     2647    }
     2648
     2649    /** Handles translation event. */
     2650    virtual void retranslateUi() /* override */
     2651    {
     2652        setIconText(QApplication::translate("UIActionPool", "Try"));
     2653        setName(QApplication::translate("UIActionPool", "&Try Oracle Cloud for Free..."));
     2654        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
     2655        setStatusTip(QApplication::translate("UIActionPool", "Try Oracle cloud for free"));
     2656        const QString strToolTip = QApplication::translate("UIActionPool", "Try Oracle Cloud for Free");
     2657        setToolTip(shortcut().isEmpty() ? strToolTip : QString("%1 (%2)").arg(strToolTip, shortcut().toString()));
    26162658    }
    26172659};
     
    27902832    m_pool[UIActionIndexST_M_Cloud_S_Remove] = new UIActionMenuSelectorCloudPerformRemove(this);
    27912833    m_pool[UIActionIndexST_M_Cloud_T_Details] = new UIActionMenuSelectorCloudToggleProperties(this);
     2834    m_pool[UIActionIndexST_M_Cloud_S_TryPage] = new UIActionMenuSelectorCloudShowTryPage(this);
    27922835    m_pool[UIActionIndexST_M_Cloud_S_Help] = new UIActionMenuSelectorCloudShowHelp(this);
    27932836
     
    33603403    }
    33613404
     3405    /* 'Try Page' action: */
     3406    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Cloud_S_TryPage)) || fSeparator;
    33623407    /* 'Help' action: */
    33633408    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Cloud_S_Help)) || fSeparator;
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