VirtualBox

Ignore:
Timestamp:
Jan 25, 2024 12:34:41 PM (13 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161299
Message:

FE/Qt: UIActionPool: A bit of cleanup for Online Documentation code.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

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

    r100943 r103058  
    710710};
    711711
     712/** Simple action extension, used as 'Online Documentation' action class. */
     713class UIActionSimpleOnlineDocumentation : public UIActionSimple
     714{
     715    Q_OBJECT;
     716
     717public:
     718
     719    /** Constructs action passing @a pParent to the base-class. */
     720    UIActionSimpleOnlineDocumentation(UIActionPool *pParent)
     721        : UIActionSimple(pParent, ":/site_oracle_16px.png", ":/site_oracle_16px.png", true)
     722    {
     723        retranslateUi();
     724    }
     725
     726protected:
     727
     728    /** Returns action extra-data ID. */
     729    virtual int extraDataID() const RT_OVERRIDE
     730    {
     731        return UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation;
     732    }
     733    /** Returns action extra-data key. */
     734    virtual QString extraDataKey() const RT_OVERRIDE
     735    {
     736        return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation);
     737    }
     738    /** Returns whether action is allowed. */
     739    virtual bool isAllowed() const RT_OVERRIDE
     740    {
     741        return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation);
     742    }
     743
     744    /** Returns shortcut extra-data ID. */
     745    virtual QString shortcutExtraDataID() const RT_OVERRIDE
     746    {
     747        return QString("OnlineDocumentation");
     748    }
     749
     750    /** Handles translation event. */
     751    virtual void retranslateUi() RT_OVERRIDE
     752    {
     753        setName(QApplication::translate("UIActionPool", "&Online Documentation..."));
     754        setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox user manual"));
     755    }
     756};
     757
    712758/** Simple action extension, used as 'Web Site' action class. */
    713759class UIActionSimpleWebSite : public UIActionSimple
     
    848894};
    849895
    850 
    851896/** Simple action extension, used as 'Oracle' action class. */
    852897class UIActionSimpleOracle : public UIActionSimple
     
    892937        setName(QApplication::translate("UIActionPool", "&Oracle Web Site..."));
    893938        setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the Oracle web site"));
    894     }
    895 };
    896 
    897 
    898 /** Simple action extension, used as 'Online Documentation' action class. */
    899 class UIActionSimpleOnlineDocumentation : public UIActionSimple
    900 {
    901     Q_OBJECT;
    902 
    903 public:
    904 
    905     /** Constructs action passing @a pParent to the base-class. */
    906     UIActionSimpleOnlineDocumentation(UIActionPool *pParent)
    907         : UIActionSimple(pParent, ":/site_oracle_16px.png", ":/site_oracle_16px.png", true)
    908     {
    909         retranslateUi();
    910     }
    911 
    912 protected:
    913 
    914     /** Returns action extra-data ID. */
    915     virtual int extraDataID() const RT_OVERRIDE
    916     {
    917         return UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation;
    918     }
    919     /** Returns action extra-data key. */
    920     virtual QString extraDataKey() const RT_OVERRIDE
    921     {
    922         return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation);
    923     }
    924     /** Returns whether action is allowed. */
    925     virtual bool isAllowed() const RT_OVERRIDE
    926     {
    927         return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation);
    928     }
    929 
    930     /** Returns shortcut extra-data ID. */
    931     virtual QString shortcutExtraDataID() const RT_OVERRIDE
    932     {
    933         return QString("OnlineDocumentation");
    934     }
    935 
    936     /** Handles translation event. */
    937     virtual void retranslateUi() RT_OVERRIDE
    938     {
    939         setName(QApplication::translate("UIActionPool", "&Online Documentation..."));
    940         setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox user manual"));
    941939    }
    942940};
     
    34903488    m_pool[UIActionIndex_Menu_Help] = new UIActionMenuHelp(this);
    34913489    m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this);
     3490    m_pool[UIActionIndex_Simple_OnlineDocumentation] = new UIActionSimpleOnlineDocumentation(this);
    34923491    m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this);
    34933492    m_pool[UIActionIndex_Simple_BugTracker] = new UIActionSimpleBugTracker(this);
    34943493    m_pool[UIActionIndex_Simple_Forums] = new UIActionSimpleForums(this);
    34953494    m_pool[UIActionIndex_Simple_Oracle] = new UIActionSimpleOracle(this);
    3496     m_pool[UIActionIndex_Simple_OnlineDocumentation] = new UIActionSimpleOnlineDocumentation(this);
    34973495#ifndef VBOX_WS_MAC
    34983496    m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this);
     
    36253623            &msgCenter(), &UIMessageCenter::sltResetSuppressedMessages, Qt::UniqueConnection);
    36263624
    3627     /* 'Help' menu connections. Note that connections for UIActionIndex_Simple_Contents is done
    3628      *   in manager and runtime uis separately in their respective classes: */
     3625    /* 'Help' menu connections. Note that connections for UIActionIndex_Simple_Contents
     3626     * are done in manager and runtime UIs separately in their respective classes: */
     3627    connect(action(UIActionIndex_Simple_OnlineDocumentation), &UIAction::triggered,
     3628            &msgCenter(), &UIMessageCenter::sltShowOnlineDocumentation, Qt::UniqueConnection);
    36293629    connect(action(UIActionIndex_Simple_WebSite), &UIAction::triggered,
    36303630            &msgCenter(), &UIMessageCenter::sltShowHelpWebDialog, Qt::UniqueConnection);
     
    36353635    connect(action(UIActionIndex_Simple_Oracle), &UIAction::triggered,
    36363636            &msgCenter(), &UIMessageCenter::sltShowOracle, Qt::UniqueConnection);
    3637     connect(action(UIActionIndex_Simple_OnlineDocumentation), &UIAction::triggered,
    3638             &msgCenter(), &UIMessageCenter::sltShowOnlineDocumentation, Qt::UniqueConnection);
    36393637#ifndef VBOX_WS_MAC
    36403638    connect(action(UIActionIndex_Simple_About), &UIAction::triggered,
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r100943 r103058  
    8989    UIActionIndex_Menu_Help,
    9090    UIActionIndex_Simple_Contents,
     91    UIActionIndex_Simple_OnlineDocumentation,
    9192    UIActionIndex_Simple_WebSite,
    9293    UIActionIndex_Simple_BugTracker,
    9394    UIActionIndex_Simple_Forums,
    9495    UIActionIndex_Simple_Oracle,
    95     UIActionIndex_Simple_OnlineDocumentation,
    9696#ifndef VBOX_WS_MAC
    9797    UIActionIndex_Simple_About,
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