VirtualBox

Changeset 85572 in vbox for trunk/src


Ignore:
Timestamp:
Jul 31, 2020 11:01:41 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686, bugref:9510: A bit of cleanup for action-pool stuff changed in r139640.

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

Legend:

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

    r85571 r85572  
    22702270    virtual QString shortcutExtraDataID() const /* override */
    22712271    {
    2272         return QString("PerformanceMenu");
     2272        return QString("PerformanceMonitorMenu");
    22732273    }
    22742274
     
    22802280};
    22812281
    2282 /** Simple action extension, used as 'Export' action class. */
    2283 class UIActionMenuSelectorPerformanceExport : public UIActionSimple
    2284 {
    2285     Q_OBJECT;
    2286 
    2287 public:
    2288 
    2289     /** Constructs action passing @a pParent to the base-class. */
    2290     UIActionMenuSelectorPerformanceExport(UIActionPool *pParent)
     2282/** Simple action extension, used as 'Perform Export' action class. */
     2283class UIActionMenuSelectorPerformancePerformExport : public UIActionSimple
     2284{
     2285    Q_OBJECT;
     2286
     2287public:
     2288
     2289    /** Constructs action passing @a pParent to the base-class. */
     2290    UIActionMenuSelectorPerformancePerformExport(UIActionPool *pParent)
    22912291        : UIActionSimple(pParent,
    22922292                         ":/log_viewer_save_32px.png", ":/log_viewer_save_16px.png",
     
    25262526    m_pool[UIActionIndex_M_Log_S_Refresh] = new UIActionMenuSelectorLogPerformRefresh(this);
    25272527    m_pool[UIActionIndex_M_Log_S_Save] = new UIActionMenuSelectorLogPerformSave(this);
     2528
     2529    /* Create 'Performance Monitor' actions: */
     2530    m_pool[UIActionIndex_M_Performance] = new UIActionMenuSelectorPerformance(this);
     2531    m_pool[UIActionIndex_M_Performance_S_Export] = new UIActionMenuSelectorPerformancePerformExport(this);
    25282532
    25292533    /* Create 'File Manager' actions: */
     
    25642568    m_pool[UIActionIndex_M_FileManager_S_Guest_ShowProperties] = new UIActionMenuFileManagerShowProperties(this);
    25652569
    2566     /* Performance Monitor actions: */
    2567     m_pool[UIActionIndex_M_Performance] = new UIActionMenuSelectorPerformance(this);
    2568     m_pool[UIActionIndex_M_Performance_S_Export] = new UIActionMenuSelectorPerformanceExport(this);
    2569 
    25702570    /* Prepare update-handlers for known menus: */
    25712571#ifdef VBOX_WS_MAC
     
    25762576    m_menuUpdateHandlers[UIActionIndex_M_LogWindow].ptf = &UIActionPool::updateMenuLogViewerWindow;
    25772577    m_menuUpdateHandlers[UIActionIndex_M_Log].ptf = &UIActionPool::updateMenuLogViewer;
    2578 
     2578    m_menuUpdateHandlers[UIActionIndex_M_Performance].ptf = &UIActionPool::updateMenuPerformanceMonitor;
    25792579    m_menuUpdateHandlers[UIActionIndex_M_FileManager].ptf = &UIActionPool::updateMenuFileManager;
    25802580
     
    28752875}
    28762876
     2877void UIActionPool::updateMenuPerformanceMonitor()
     2878{
     2879    /* Get corresponding menu: */
     2880    UIMenu *pMenu = action(UIActionIndex_M_Performance)->menu();
     2881    AssertPtrReturnVoid(pMenu);
     2882    /* Clear contents: */
     2883    pMenu->clear();
     2884
     2885    /* 'Export' action: */
     2886    pMenu->addAction(action(UIActionIndex_M_Performance_S_Export));
     2887
     2888    /* Mark menu as valid: */
     2889    m_invalidations.remove(UIActionIndex_M_Performance);
     2890}
     2891
    28772892void UIActionPool::updateMenuFileManager()
    28782893{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r85571 r85572  
    100100    UIActionIndex_M_Log_S_Refresh,
    101101    UIActionIndex_M_Log_S_Save,
     102
     103    /* 'Performance' menu actions: */
     104    UIActionIndex_M_Performance,
     105    UIActionIndex_M_Performance_S_Export,
    102106
    103107    /* File Manager actions: */
     
    136140    UIActionIndex_M_FileManager_S_Guest_ShowProperties,
    137141
    138     /* Performance Monitor actions: */
    139     UIActionIndex_M_Performance,
    140     UIActionIndex_M_Performance_S_Export,
    141 
    142142    /* Maximum index: */
    143143    UIActionIndex_Max
     
    626626    /** Updates 'Log Viewer' @a pMenu. */
    627627    virtual void updateMenuLogViewerWrapper(UIMenu *pMenu);
    628 
     628    /** Updates 'Performance Monitor' menu. */
     629    virtual void updateMenuPerformanceMonitor();
    629630    /** Updates 'File Manager' menu. */
    630631    virtual void updateMenuFileManager();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp

    r85571 r85572  
    42014201    /* Mark menu as valid: */
    42024202    m_invalidations.remove(UIActionIndexST_M_Snapshot);
    4203 }
    4204 
    4205 void UIActionPoolManager::updateMenuPerformanceMonitor()
    4206 {
    4207     /* Get corresponding menu: */
    4208     UIMenu *pMenu = action(UIActionIndex_M_Performance)->menu();
    4209     AssertPtrReturnVoid(pMenu);
    4210     /* Clear contents: */
    4211     pMenu->clear();
    4212 
    4213     /* Populate Performance-menu: */
    4214     pMenu->addAction(action(UIActionIndex_M_Performance_S_Export));
    4215 
    4216     /* Mark menu as valid: */
    4217     m_invalidations.remove(UIActionIndex_M_Performance);
    42184203}
    42194204
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r85571 r85572  
    287287    void updateMenuSnapshot();
    288288
    289     /** Updates 'Performance' menu. */
    290     void updateMenuPerformanceMonitor();
    291 
    292 
    293289    /** Updates shortcuts. */
    294290    virtual void updateShortcuts() /* override */;
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