VirtualBox

Changeset 103579 in vbox


Ignore:
Timestamp:
Feb 26, 2024 5:35:20 PM (13 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161931
Message:

FE/Qt: UIShortcutPool: Make sure shortcuts for actions common for both Manager and Runtime action-pools not being overridden by temporary action-pools of other types; That means shortcut-pool is now aware of it's own type now.

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

Legend:

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

    r103551 r103579  
    748748
    749749    /* Create shortcut pool: */
    750     UIShortcutPool::create();
     750    UIShortcutPool::create(uiType());
    751751
    752752#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcutPool.cpp

    r103578 r103579  
    111111const QString UIShortcutPool::s_strShortcutKeyTemplateRuntime = s_strShortcutKeyTemplate.arg(GUI_Input_MachineShortcuts);
    112112
    113 void UIShortcutPool::create()
     113void UIShortcutPool::create(UIType enmType)
    114114{
    115115    /* Check that instance do NOT exists: */
     
    118118
    119119    /* Create instance: */
    120     new UIShortcutPool;
     120    new UIShortcutPool(enmType);
    121121
    122122    /* Prepare instance: */
     
    204204            pAction->retranslateUi();
    205205            /* Copy default and standard sequences from the action to the shortcut: */
    206             existingShortcut.setDefaultSequence(pAction->defaultShortcut(pActionPool->type()));
    207             existingShortcut.setStandardSequence(pAction->standardShortcut(pActionPool->type()));
     206            if (pActionPool->type() == m_enmType)
     207            {
     208                existingShortcut.setDefaultSequence(pAction->defaultShortcut(pActionPool->type()));
     209                existingShortcut.setStandardSequence(pAction->standardShortcut(pActionPool->type()));
     210            }
    208211        }
    209212        /* If shortcut key is NOT known yet: */
     
    292295}
    293296
    294 UIShortcutPool::UIShortcutPool()
     297UIShortcutPool::UIShortcutPool(UIType enmType)
     298    : m_enmType(enmType)
    295299{
    296300    /* Prepare instance: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcutPool.h

    r103578 r103579  
    3737/* GUI includes: */
    3838#include "QIWithRetranslateUI.h"
     39#include "UIDefs.h"
    3940#include "UILibraryDefs.h"
    4041
     
    139140    static UIShortcutPool *instance() { return s_pInstance; }
    140141    /** Creates singleton instance. */
    141     static void create();
     142    static void create(UIType enmType);
    142143    /** Destroys singleton instance. */
    143144    static void destroy();
     
    173174
    174175    /** Constructs shortcut pool. */
    175     UIShortcutPool();
     176    UIShortcutPool(UIType enmType);
    176177    /** Destructs shortcut pool. */
    177     ~UIShortcutPool();
     178    virtual ~UIShortcutPool() RT_OVERRIDE;
    178179
    179180    /** Prepares all. */
     
    208209    static const QString   s_strShortcutKeyTemplateRuntime;
    209210
     211    /** Holds the pool type. */
     212    UIType                     m_enmType;
    210213    /** Holds the pool shortcuts. */
    211     QMap<QString, UIShortcut> m_shortcuts;
     214    QMap<QString, UIShortcut>  m_shortcuts;
    212215};
    213216
Note: See TracChangeset for help on using the changeset viewer.

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