VirtualBox

Changeset 44434 in vbox


Ignore:
Timestamp:
Jan 28, 2013 4:48:34 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Reworking shortcut providers into singleton shortcut-pool. Integrate shortcut-pool with corresponding action-pools.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
1 added
4 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r44315 r44434  
    279279        src/globals/UIMainEventListener.h \
    280280        src/globals/UIMessageCenter.h \
     281        src/globals/UIShortcuts.h \
    281282        src/globals/VBoxGlobal.h \
    282283        src/globals/VBoxUtils.h \
     
    511512        src/globals/UIMainEventListener.cpp \
    512513        src/globals/UIMessageCenter.cpp \
     514        src/globals/UIShortcuts.cpp \
    513515        src/globals/VBoxGlobal.cpp \
    514516        src/medium/UIMediumDefs.cpp \
     
    539541        src/runtime/UIMachineLogic.cpp \
    540542        src/runtime/UIMachineMenuBar.cpp \
    541         src/runtime/UIMachineShortcuts.cpp \
    542543        src/runtime/UIMachineView.cpp \
    543544        src/runtime/UIMachineWindow.cpp \
     
    563564        src/runtime/seamless/UIMachineWindowSeamless.cpp \
    564565        src/selector/UIActionPoolSelector.cpp \
    565         src/selector/UISelectorShortcuts.cpp \
    566566        src/selector/UIVMDesktop.cpp \
    567567        src/selector/UIVMItem.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r44354 r44434  
    2828#include "UIIconPool.h"
    2929#include "VBoxGlobal.h"
    30 #include "UISelectorShortcuts.h"
    31 #include "UIMachineShortcuts.h"
     30#include "UIShortcuts.h"
    3231
    3332/* Action activation event: */
     
    4746
    4847/* UIAction stuff: */
    49 UIAction::UIAction(QObject *pParent, UIActionType type)
     48UIAction::UIAction(UIActionPool *pParent, UIActionType type)
    5049    : QIWithRetranslateUI3<QAction>(pParent)
     50    , m_pActionPool(pParent)
    5151    , m_type(type)
     52    , m_actionPoolType(pParent->type())
    5253{
    5354    /* By default there is no specific menu role.
     
    5960{
    6061    return qobject_cast<UIActionState*>(this);
     62}
     63
     64void UIAction::setName(const QString &strName)
     65{
     66    /* Remember internal name: */
     67    m_strName = strName;
     68    /* Update text according new name: */
     69    updateText();
    6170}
    6271
     
    6776    /* Remember shortcut: */
    6877    m_shortcut = shortcut;
     78    /* Update text according new shortcut: */
     79    updateText();
    6980}
    7081
     
    8192}
    8293
    83 QString UIAction::menuText(const QString &strText)
    84 {
    85     return vboxGlobal().isVMConsoleProcess() ? VBoxGlobal::removeAccelMark(strText) : strText;
     94QString UIAction::nameInMenu() const
     95{
     96    /* Action-name format depends on action-pool type: */
     97    switch (m_actionPoolType)
     98    {
     99        /* Unchanged name for Selector UI: */
     100        case UIActionPoolType_Selector: return name();
     101        /* Filtered name for Runtime UI: */
     102        case UIActionPoolType_Runtime: return VBoxGlobal::removeAccelMark(name());
     103    }
     104    /* Nothing by default: */
     105    return QString();
     106}
     107
     108void UIAction::updateText()
     109{
     110    /* Action-text format depends on action-pool type: */
     111    switch (m_actionPoolType)
     112    {
     113        /* The same as menu name for Selector UI: */
     114        case UIActionPoolType_Selector:
     115            setText(nameInMenu());
     116            break;
     117        /* With shortcut appended for Runtime UI: */
     118        case UIActionPoolType_Runtime:
     119            setText(vboxGlobal().insertKeyToActionText(nameInMenu(),
     120                                                       gShortcutPool->shortcut(actionPool(), this).toString()));
     121            break;
     122    }
    86123}
    87124
     
    117154
    118155/* UIActionSimple stuff: */
    119 UIActionSimple::UIActionSimple(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     156UIActionSimple::UIActionSimple(UIActionPool *pParent,
     157                               const QString &strIcon, const QString &strIconDis)
    120158    : UIAction(pParent, UIActionType_Simple)
    121159{
     
    124162}
    125163
    126 UIActionSimple::UIActionSimple(QObject *pParent,
     164UIActionSimple::UIActionSimple(UIActionPool *pParent,
    127165                               const QSize &normalSize, const QSize &smallSize,
    128166                               const QString &strNormalIcon, const QString &strSmallIcon,
     
    133171}
    134172
    135 UIActionSimple::UIActionSimple(QObject *pParent, const QIcon& icon)
     173UIActionSimple::UIActionSimple(UIActionPool *pParent,
     174                               const QIcon& icon)
    136175    : UIAction(pParent, UIActionType_Simple)
    137176{
     
    141180
    142181/* UIActionState stuff: */
    143 UIActionState::UIActionState(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     182UIActionState::UIActionState(UIActionPool *pParent,
     183                             const QString &strIcon, const QString &strIconDis)
    144184    : UIAction(pParent, UIActionType_State)
    145185    , m_iState(0)
     
    149189}
    150190
    151 UIActionState::UIActionState(QObject *pParent,
     191UIActionState::UIActionState(UIActionPool *pParent,
    152192                             const QSize &normalSize, const QSize &smallSize,
    153193                             const QString &strNormalIcon, const QString &strSmallIcon,
     
    159199}
    160200
    161 UIActionState::UIActionState(QObject *pParent, const QIcon& icon)
     201UIActionState::UIActionState(UIActionPool *pParent,
     202                             const QIcon& icon)
    162203    : UIAction(pParent, UIActionType_State)
    163204    , m_iState(0)
     
    168209
    169210/* UIActionToggle stuff: */
    170 UIActionToggle::UIActionToggle(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     211UIActionToggle::UIActionToggle(UIActionPool *pParent,
     212                               const QString &strIcon, const QString &strIconDis)
    171213    : UIAction(pParent, UIActionType_Toggle)
    172214{
     
    176218}
    177219
    178 UIActionToggle::UIActionToggle(QObject *pParent,
     220UIActionToggle::UIActionToggle(UIActionPool *pParent,
    179221                               const QSize &normalSize, const QSize &smallSize,
    180222                               const QString &strNormalIcon, const QString &strSmallIcon,
     
    186228}
    187229
    188 UIActionToggle::UIActionToggle(QObject *pParent,
     230UIActionToggle::UIActionToggle(UIActionPool *pParent,
    189231               const QString &strIconOn, const QString &strIconOff,
    190232               const QString &strIconOnDis, const QString &strIconOffDis)
     
    195237}
    196238
    197 UIActionToggle::UIActionToggle(QObject *pParent, const QIcon &icon)
     239UIActionToggle::UIActionToggle(UIActionPool *pParent,
     240                               const QIcon &icon)
    198241    : UIAction(pParent, UIActionType_Toggle)
    199242{
     
    215258
    216259/* UIActionMenu stuff: */
    217 UIActionMenu::UIActionMenu(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     260UIActionMenu::UIActionMenu(UIActionPool *pParent,
     261                           const QString &strIcon, const QString &strIconDis)
    218262    : UIAction(pParent, UIActionType_Menu)
    219263{
     
    223267}
    224268
    225 UIActionMenu::UIActionMenu(QObject *pParent, const QIcon &icon)
     269UIActionMenu::UIActionMenu(UIActionPool *pParent,
     270                           const QIcon &icon)
    226271    : UIAction(pParent, UIActionType_Menu)
    227272{
     
    238283public:
    239284
    240     UIActionSimpleLogDialog(QObject *pParent)
     285    UIActionSimpleLogDialog(UIActionPool *pParent)
    241286        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    242287                         ":/vm_show_logs_32px.png", ":/show_logs_16px.png",
    243288                         ":/vm_show_logs_disabled_32px.png", ":/show_logs_disabled_16px.png")
    244289    {
    245         switch (gActionPool->type())
     290        retranslateUi();
     291    }
     292
     293protected:
     294
     295    QString shortcutExtraDataID() const
     296    {
     297        return QString("ShowVMLog");
     298    }
     299
     300    QKeySequence defaultShortcut(UIActionPoolType actionPoolType) const
     301    {
     302        switch (actionPoolType)
    246303        {
    247             case UIActionPoolType_Selector:
    248                 setShortcut(gSS->keySequence(UISelectorShortcuts::ShowVMLogShortcut));
    249                 break;
    250             case UIActionPoolType_Runtime:
    251                 break;
     304            case UIActionPoolType_Selector: return QKeySequence("Ctrl+L");
     305            case UIActionPoolType_Runtime: break;
    252306        }
    253         retranslateUi();
    254     }
    255 
    256 protected:
    257 
    258     void retranslateUi()
    259     {
    260         setText(QApplication::translate("UIActionPool", "Show &Log..."));
     307        return QKeySequence();
     308    }
     309
     310    void retranslateUi()
     311    {
     312        setName(QApplication::translate("UIActionPool", "Show &Log..."));
    261313        setStatusTip(QApplication::translate("UIActionPool", "Show the log files of the selected virtual machine"));
    262314    }
     
    269321public:
    270322
    271     UIActionMenuHelp(QObject *pParent)
     323    UIActionMenuHelp(UIActionPool *pParent)
    272324        : UIActionMenu(pParent)
    273325    {
     
    279331    void retranslateUi()
    280332    {
    281         setText(menuText(QApplication::translate("UIActionPool", "&Help")));
     333        setName(QApplication::translate("UIActionPool", "&Help"));
    282334    }
    283335};
     
    289341public:
    290342
    291     UIActionSimpleContents(QObject *pParent)
     343    UIActionSimpleContents(UIActionPool *pParent)
    292344        : UIActionSimple(pParent, UIIconPool::defaultIcon(UIIconPool::DialogHelpIcon))
    293345    {
    294         switch (gActionPool->type())
     346        retranslateUi();
     347    }
     348
     349protected:
     350
     351    QString shortcutExtraDataID() const
     352    {
     353        return QString("Help");
     354    }
     355
     356    QKeySequence defaultShortcut(UIActionPoolType actionPoolType) const
     357    {
     358        switch (actionPoolType)
    295359        {
    296             case UIActionPoolType_Selector:
    297                 setShortcut(gSS->keySequence(UISelectorShortcuts::HelpShortcut));
    298                 break;
    299             case UIActionPoolType_Runtime:
    300                 setShortcut(gMS->keySequence(UIMachineShortcuts::HelpShortcut));
    301                 break;
     360            case UIActionPoolType_Selector: return QKeySequence(QKeySequence::HelpContents);
     361            case UIActionPoolType_Runtime: break;
    302362        }
    303         retranslateUi();
    304     }
    305 
    306 protected:
    307 
    308     void retranslateUi()
    309     {
    310         setText(menuText(QApplication::translate("UIActionPool", "&Contents...")));
     363        return QKeySequence();
     364    }
     365
     366    void retranslateUi()
     367    {
     368        setName(QApplication::translate("UIActionPool", "&Contents..."));
    311369        setStatusTip(QApplication::translate("UIActionPool", "Show help contents"));
    312370    }
     
    319377public:
    320378
    321     UIActionSimpleWebSite(QObject *pParent)
     379    UIActionSimpleWebSite(UIActionPool *pParent)
    322380        : UIActionSimple(pParent, ":/site_16px.png")
    323381    {
    324         switch (gActionPool->type())
    325         {
    326             case UIActionPoolType_Selector:
    327                 setShortcut(gSS->keySequence(UISelectorShortcuts::WebShortcut));
    328                 break;
    329             case UIActionPoolType_Runtime:
    330                 setShortcut(gMS->keySequence(UIMachineShortcuts::WebShortcut));
    331                 break;
    332         }
    333         retranslateUi();
    334     }
    335 
    336 protected:
    337 
    338     void retranslateUi()
    339     {
    340         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&VirtualBox Web Site...")), gMS->shortcut(UIMachineShortcuts::WebShortcut)));
     382        retranslateUi();
     383    }
     384
     385protected:
     386
     387    QString shortcutExtraDataID() const
     388    {
     389        return QString("Web");
     390    }
     391
     392    void retranslateUi()
     393    {
     394        setName(QApplication::translate("UIActionPool", "&VirtualBox Web Site..."));
    341395        setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product web site"));
    342396    }
     
    349403public:
    350404
    351     UIActionSimpleResetWarnings(QObject *pParent)
     405    UIActionSimpleResetWarnings(UIActionPool *pParent)
    352406        : UIActionSimple(pParent, ":/reset_16px.png")
    353407    {
    354         switch (gActionPool->type())
    355         {
    356             case UIActionPoolType_Selector:
    357                 setShortcut(gSS->keySequence(UISelectorShortcuts::ResetWarningsShortcut));
    358                 break;
    359             case UIActionPoolType_Runtime:
    360                 setShortcut(gMS->keySequence(UIMachineShortcuts::ResetWarningsShortcut));
    361                 break;
    362         }
    363         retranslateUi();
    364     }
    365 
    366 protected:
    367 
    368     void retranslateUi()
    369     {
    370         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Reset All Warnings")), gMS->shortcut(UIMachineShortcuts::ResetWarningsShortcut)));
     408        retranslateUi();
     409    }
     410
     411protected:
     412
     413    QString shortcutExtraDataID() const
     414    {
     415        return QString("ResetWarnings");
     416    }
     417
     418    void retranslateUi()
     419    {
     420        setName(QApplication::translate("UIActionPool", "&Reset All Warnings"));
    371421        setStatusTip(QApplication::translate("UIActionPool", "Go back to showing all suppressed warnings and messages"));
    372422    }
     
    379429public:
    380430
    381     UIActionSimpleNetworkAccessManager(QObject *pParent)
     431    UIActionSimpleNetworkAccessManager(UIActionPool *pParent)
    382432        : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
    383433    {
    384         switch (gActionPool->type())
    385         {
    386             case UIActionPoolType_Selector:
    387                 setShortcut(gSS->keySequence(UISelectorShortcuts::NetworkAccessManager));
    388                 break;
    389             case UIActionPoolType_Runtime:
    390                 setShortcut(gMS->keySequence(UIMachineShortcuts::NetworkAccessManager));
    391                 break;
    392         }
    393         retranslateUi();
    394     }
    395 
    396 protected:
    397 
    398     void retranslateUi()
    399     {
    400         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Network Operations Manager...")), gMS->shortcut(UIMachineShortcuts::NetworkAccessManager)));
     434        retranslateUi();
     435    }
     436
     437protected:
     438
     439    QString shortcutExtraDataID() const
     440    {
     441        return QString("NetworkAccessManager");
     442    }
     443
     444    void retranslateUi()
     445    {
     446        setName(QApplication::translate("UIActionPool", "&Network Operations Manager..."));
    401447        setStatusTip(QApplication::translate("UIActionPool", "Show Network Operations Manager"));
    402448    }
     
    409455public:
    410456
    411     UIActionSimpleCheckForUpdates(QObject *pParent)
     457    UIActionSimpleCheckForUpdates(UIActionPool *pParent)
    412458        : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png")
    413459    {
    414460        setMenuRole(QAction::ApplicationSpecificRole);
    415         switch (gActionPool->type())
    416         {
    417             case UIActionPoolType_Selector:
    418                 setShortcut(gSS->keySequence(UISelectorShortcuts::UpdateShortcut));
    419                 break;
    420             case UIActionPoolType_Runtime:
    421                 setShortcut(gMS->keySequence(UIMachineShortcuts::UpdateShortcut));
    422                 break;
    423         }
    424         retranslateUi();
    425     }
    426 
    427 protected:
    428 
    429     void retranslateUi()
    430     {
    431         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "C&heck for Updates...")), gMS->shortcut(UIMachineShortcuts::UpdateShortcut)));
     461        retranslateUi();
     462    }
     463
     464protected:
     465
     466    QString shortcutExtraDataID() const
     467    {
     468        return QString("Update");
     469    }
     470
     471    void retranslateUi()
     472    {
     473        setName(QApplication::translate("UIActionPool", "C&heck for Updates..."));
    432474        setStatusTip(QApplication::translate("UIActionPool", "Check for a new VirtualBox version"));
    433475    }
     
    440482public:
    441483
    442     UIActionSimpleAbout(QObject *pParent)
     484    UIActionSimpleAbout(UIActionPool *pParent)
    443485        : UIActionSimple(pParent, ":/about_16px.png")
    444486    {
    445487        setMenuRole(QAction::AboutRole);
    446         switch (gActionPool->type())
    447         {
    448             case UIActionPoolType_Selector:
    449                 setShortcut(gSS->keySequence(UISelectorShortcuts::AboutShortcut));
    450                 break;
    451             case UIActionPoolType_Runtime:
    452                 setShortcut(gMS->keySequence(UIMachineShortcuts::AboutShortcut));
    453                 break;
    454         }
    455         retranslateUi();
    456     }
    457 
    458 protected:
    459 
    460     void retranslateUi()
    461     {
    462         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&About VirtualBox...")), gMS->shortcut(UIMachineShortcuts::AboutShortcut)));
     488        retranslateUi();
     489    }
     490
     491protected:
     492
     493    QString shortcutExtraDataID() const
     494    {
     495        return QString("About");
     496    }
     497
     498    void retranslateUi()
     499    {
     500        setName(QApplication::translate("UIActionPool", "&About VirtualBox..."));
    463501        setStatusTip(QApplication::translate("UIActionPool", "Show a dialog with product information"));
    464502    }
     
    482520        return;
    483521
    484     /* Depending on passed type: */
     522    /* Create instance: */
    485523    switch (type)
    486524    {
    487         case UIActionPoolType_Selector: m_pInstance = new UIActionPoolSelector; break;
    488         case UIActionPoolType_Runtime: m_pInstance = new UIActionPoolRuntime; break;
     525        case UIActionPoolType_Selector: new UIActionPoolSelector; break;
     526        case UIActionPoolType_Runtime: new UIActionPoolRuntime; break;
    489527        default: break;
    490528    }
     
    506544    /* Delete instance: */
    507545    delete m_pInstance;
    508     m_pInstance = 0;
    509546}
    510547
     
    530567    /* Create menus: */
    531568    createMenus();
     569    /* Apply shortcuts: */
     570    gShortcutPool->applyShortcuts(this);
    532571}
    533572
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r44354 r44434  
    2929/* Forward declarations: */
    3030class UIActionState;
     31class UIActionPool;
     32
     33/* Action pool types: */
     34enum UIActionPoolType
     35{
     36    UIActionPoolType_Selector,
     37    UIActionPoolType_Runtime
     38};
    3139
    3240/* Action types: */
     
    6876    UIActionType type() const { return m_type; }
    6977
     78    /* API: Parent stuff: */
     79    UIActionPool* actionPool() const { return m_pActionPool; }
     80
    7081    /* API: Update stuff: */
    7182    virtual void update() {}
     
    7485    UIActionState* toStateAction();
    7586
     87    /* API: Name stuff: */
     88    const QString& name() const { return m_strName; }
     89    void setName(const QString &strName);
     90
    7691    /* API: Shortcut stuff: */
     92    virtual QString shortcutExtraDataID() const { return QString(); }
     93    virtual QKeySequence defaultShortcut(UIActionPoolType) const { return QKeySequence(); }
    7794    void setShortcut(const QKeySequence &shortcut);
    7895    void showShortcut();
     
    8299
    83100    /* Constructor: */
    84     UIAction(QObject *pParent, UIActionType type);
     101    UIAction(UIActionPool *pParent, UIActionType type);
    85102
    86103    /* Protected API: Menu stuff: */
    87     QString menuText(const QString &strText);
     104    QString nameInMenu() const;
    88105
    89106private:
    90107
     108    /* Helper: Text stuff: */
     109    void updateText();
     110
    91111    /* Variables: */
     112    UIActionPool *m_pActionPool;
    92113    UIActionType m_type;
     114    UIActionPoolType m_actionPoolType;
     115    QString m_strName;
    93116    QKeySequence m_shortcut;
    94117};
     
    125148
    126149    /* Constructors: */
    127     UIActionSimple(QObject *pParent,
     150    UIActionSimple(UIActionPool *pParent,
    128151                   const QString &strIcon = QString(), const QString &strIconDis = QString());
    129     UIActionSimple(QObject *pParent,
     152    UIActionSimple(UIActionPool *pParent,
    130153                   const QSize &normalSize, const QSize &smallSize,
    131154                   const QString &strNormalIcon, const QString &strSmallIcon,
    132155                   const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
    133     UIActionSimple(QObject *pParent, const QIcon& icon);
     156    UIActionSimple(UIActionPool *pParent,
     157                   const QIcon& icon);
    134158};
    135159
     
    147171
    148172    /* Constructors: */
    149     UIActionState(QObject *pParent,
     173    UIActionState(UIActionPool *pParent,
    150174                  const QString &strIcon = QString(), const QString &strIconDis = QString());
    151     UIActionState(QObject *pParent,
     175    UIActionState(UIActionPool *pParent,
    152176                  const QSize &normalSize, const QSize &smallSize,
    153177                  const QString &strNormalIcon, const QString &strSmallIcon,
    154178                  const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
    155     UIActionState(QObject *pParent, const QIcon& icon);
     179    UIActionState(UIActionPool *pParent,
     180                  const QIcon& icon);
    156181
    157182    /* Variables: */
     
    167192
    168193    /* Constructors: */
    169     UIActionToggle(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());
    170     UIActionToggle(QObject *pParent,
     194    UIActionToggle(UIActionPool *pParent,
     195                   const QString &strIcon = QString(), const QString &strIconDis = QString());
     196    UIActionToggle(UIActionPool *pParent,
    171197                   const QSize &normalSize, const QSize &smallSize,
    172198                   const QString &strNormalIcon, const QString &strSmallIcon,
    173199                   const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
    174     UIActionToggle(QObject *pParent, const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis);
    175     UIActionToggle(QObject *pParent, const QIcon &icon);
     200    UIActionToggle(UIActionPool *pParent,
     201                   const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis);
     202    UIActionToggle(UIActionPool *pParent,
     203                   const QIcon &icon);
    176204
    177205    /* API reimplementation: Update stuff: */
     
    197225
    198226    /* Constructors: */
    199     UIActionMenu(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());
    200     UIActionMenu(QObject *pParent, const QIcon &icon);
    201 };
    202 
    203 /* Action pool types: */
    204 enum UIActionPoolType
    205 {
    206     UIActionPoolType_Selector,
    207     UIActionPoolType_Runtime
     227    UIActionMenu(UIActionPool *pParent,
     228                 const QString &strIcon = QString(), const QString &strIconDis = QString());
     229    UIActionMenu(UIActionPool *pParent,
     230                 const QIcon &icon);
    208231};
    209232
     
    225248    /* API: Action stuff: */
    226249    UIAction* action(int iIndex) const { return m_pool[iIndex]; }
     250    QList<UIAction*> actions() const { return m_pool.values(); }
     251
     252    /* API: Shortcuts stuff: */
     253    virtual QString shortcutsExtraDataID() const = 0;
    227254
    228255    /* API: Prepare stuff: */
     
    242269    void cleanup();
    243270
    244     /* Virtual helping stuff: */
     271    /* Virtual helpers: Prepare/cleanup stuff: */
    245272    virtual void createActions();
    246273    virtual void createMenus();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcuts.h

    r35634 r44434  
    22 *
    33 * VBox frontends: Qt GUI ("VirtualBox"):
    4  * UIShortcuts class declarations
     4 * UIShortcuts class declaration
    55 */
    66
    77/*
    8  * Copyright (C) 2011 Oracle Corporation
     8 * Copyright (C) 2011-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIShortcuts_h__
    2121
     22/* Qt includes: */
     23#include <QMap>
     24
     25/* GUI includes: */
    2226#include "VBoxGlobal.h"
    2327
    24 /* Qt includes */
    25 #include <QHash>
     28/* Forward declarations: */
     29class UIActionPool;
     30class UIAction;
    2631
    27 class UIKeySequence
     32/* Shortcut descriptor: */
     33class UIShortcut
    2834{
    2935public:
    30     UIKeySequence() {}
    3136
    32     UIKeySequence(const QString &strId, const QString strKeySeq = "")
    33       : m_strId(strId)
    34       , m_strDefKeySeq(strKeySeq)
    35       , m_strCurKeySeq(strKeySeq) {}
     37    /* Constructor: */
     38    UIShortcut(const QString &strDescription = QString(),
     39               const QKeySequence &sequence = QKeySequence())
     40        : m_strDescription(strDescription), m_sequence(sequence) {}
    3641
    37     UIKeySequence(const QString &strId, QKeySequence::StandardKey seq)
    38       : m_strId(strId)
    39     {
    40         QKeySequence ks(seq);
    41         m_strDefKeySeq = m_strCurKeySeq = ks.toString();
    42     }
     42    /* API: Description stuff: */
     43    void setDescription(const QString &strDescription);
     44    const QString& description() const;
    4345
    44     QString id() const
    45     {
    46         return m_strId;
    47     }
     46    /* API: Sequence stuff: */
     47    void setSequence(const QKeySequence &sequence);
     48    const QKeySequence& sequence() const;
    4849
    49     QString defaultKeySequence() const
    50     {
    51         return m_strDefKeySeq;
    52     }
    53 
    54     void setKeySequence(const QString& strKeySeq)
    55     {
    56         m_strCurKeySeq = strKeySeq;
    57     }
    58 
    59     QString keySequence() const
    60     {
    61         return m_strCurKeySeq;
    62     }
     50    /* API: Conversion stuff: */
     51    QString toString() const;
    6352
    6453private:
    65     /* Private member vars */
    66     QString m_strId;
    67     QString m_strDefKeySeq;
    68     QString m_strCurKeySeq;
     54
     55    /* Variables: */
     56    QString m_strDescription;
     57    QKeySequence m_sequence;
    6958};
    7059
    71 template <class T>
    72 class UIShortcuts
     60/* Singleton shortcut pool: */
     61class UIShortcutPool : public QObject
    7362{
     63    Q_OBJECT;
     64
    7465public:
    75     static T *instance()
    76     {
    77         if (!m_pInstance)
    78             m_pInstance = new T();
    79         return m_pInstance;
    80     }
    8166
    82     static void destroy()
    83     {
    84         if (m_pInstance)
    85         {
    86             delete m_pInstance;
    87             m_pInstance = 0;
    88         }
    89     }
     67    /* API: Singleton stuff: */
     68    static UIShortcutPool* instance();
     69    static void create();
     70    static void destroy();
    9071
    91     QString shortcut(int type) const
    92     {
    93         return m_Shortcuts[type].keySequence();
    94     }
     72    /* API: Shortcut stuff: */
     73    UIShortcut& shortcut(UIActionPool *pActionPool, UIAction *pAction);
     74    UIShortcut& shortcut(const QString &strPoolID, const QString &strActionID);
    9575
    96     QKeySequence keySequence(int type) const
    97     {
    98         return QKeySequence(m_Shortcuts[type].keySequence());
    99     }
     76    /* API: Action-pool stuff: */
     77    void applyShortcuts(UIActionPool *pActionPool);
    10078
    101 protected:
     79private:
    10280
    103     UIShortcuts() {}
     81    /* Constructor/destructor: */
     82    UIShortcutPool();
     83    ~UIShortcutPool();
    10484
    105     void loadExtraData(const QString &strKey, int cSize)
    106     {
    107         QStringList newKeys = vboxGlobal().virtualBox().GetExtraDataStringList(strKey);
    108         for (int i = 0; i < newKeys.size(); ++i)
    109         {
    110             const QString &s = newKeys.at(i);
    111             int w = s.indexOf('=');
    112             if (w < 0)
    113                 continue;
    114             QString id = s.left(w);
    115             QString value = s.right(s.length() - w - 1);
    116             for (int a = 0; a < cSize; ++a)
    117                 if (m_Shortcuts[a].id().compare(id, Qt::CaseInsensitive) == 0)
    118                 {
    119                     if (value.compare("None", Qt::CaseInsensitive) == 0)
    120                         m_Shortcuts[a].setKeySequence("");
    121                     else
    122                         m_Shortcuts[a].setKeySequence(value);
    123                 }
    124         }
    125     }
     85    /* Prepare/cleanup helpers: */
     86    void prepare();
     87    void cleanup() {}
    12688
    127     static T *m_pInstance;
    128     QHash<int, UIKeySequence> m_Shortcuts;
     89    /* Helpers: Shortcuts stuff: */
     90    void loadDefaults();
     91    void loadOverrides();
     92    void parseOverrides(const QStringList &overrides, const QString &strTemplate);
     93
     94    /* Helper: Shortcut stuff: */
     95    UIShortcut& shortcut(const QString &strShortcutKey);
     96
     97    /* Variables: */
     98    static UIShortcutPool *m_pInstance;
     99    static const QString m_strShortcutKeyTemplate;
     100    QMap<QString, UIShortcut> m_shortcuts;
    129101};
     102
     103#define gShortcutPool UIShortcutPool::instance()
    130104
    131105#endif /* __UIShortcuts_h__ */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r44354 r44434  
    5757#include "QIDialogButtonBox.h"
    5858#include "UIIconPool.h"
     59#include "UIShortcuts.h"
    5960#include "UIActionPoolSelector.h"
    6061#include "UIActionPoolRuntime.h"
     
    46364637    sltProcessGlobalSettingChange();
    46374638
     4639    /* Create shortcut pool: */
     4640    UIShortcutPool::create();
     4641
    46384642    /* Create action pool: */
    46394643    if (isVMConsoleProcess())
     
    46644668
    46654669    /* Destroy action pool: */
    4666     if (isVMConsoleProcess())
    4667         UIActionPoolRuntime::destroy();
    4668     else
    4669         UIActionPoolSelector::destroy();
     4670    UIActionPool::destroy();
     4671
     4672    /* Destroy shortcut pool: */
     4673    UIShortcutPool::destroy();
    46704674
    46714675    /* sanity check */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r44354 r44434  
    2020/* Local includes: */
    2121#include "UIActionPoolRuntime.h"
    22 #include "UIMachineShortcuts.h"
     22#include "UIShortcuts.h"
    2323#include "VBoxGlobal.h"
    2424
     
    2929public:
    3030
    31     MenuMachineAction(QObject *pParent)
     31    MenuMachineAction(UIActionPool *pParent)
    3232        : UIActionMenu(pParent)
    3333    {
     
    3939    void retranslateUi()
    4040    {
    41         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "&Machine")));
     41        setName(QApplication::translate("UIActionPool", "&Machine"));
    4242    }
    4343};
     
    4949public:
    5050
    51     ShowSettingsDialogAction(QObject *pParent)
     51    ShowSettingsDialogAction(UIActionPool *pParent)
    5252        : UIActionSimple(pParent, ":/settings_16px.png", ":/settings_dis_16px.png")
    5353    {
     
    5757protected:
    5858
    59     void retranslateUi()
    60     {
    61         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Settings...")), gMS->shortcut(UIMachineShortcuts::SettingsDialogShortcut)));
     59    QString shortcutExtraDataID() const
     60    {
     61        return QString("SettingsDialog");
     62    }
     63
     64    QKeySequence defaultShortcut(UIActionPoolType) const
     65    {
     66        return QKeySequence("S");
     67    }
     68
     69    void retranslateUi()
     70    {
     71        setName(QApplication::translate("UIActionPool", "&Settings..."));
    6272        setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings"));
    6373    }
     
    7080public:
    7181
    72     PerformTakeSnapshotAction(QObject *pParent)
     82    PerformTakeSnapshotAction(UIActionPool *pParent)
    7383        : UIActionSimple(pParent, ":/take_snapshot_16px.png", ":/take_snapshot_dis_16px.png")
    7484    {
     
    7888protected:
    7989
    80     void retranslateUi()
    81     {
    82         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Take Sn&apshot...")), gMS->shortcut(UIMachineShortcuts::TakeSnapshotShortcut)));
     90    QString shortcutExtraDataID() const
     91    {
     92        return QString("TakeSnapshot");
     93    }
     94
     95    QKeySequence defaultShortcut(UIActionPoolType) const
     96    {
     97        return QKeySequence("T");
     98    }
     99
     100    void retranslateUi()
     101    {
     102        setName(QApplication::translate("UIActionPool", "Take Sn&apshot..."));
    83103        setStatusTip(QApplication::translate("UIActionPool", "Take a snapshot of the virtual machine"));
    84104    }
     
    91111public:
    92112
    93     PerformTakeScreenshotAction(QObject *pParent)
     113    PerformTakeScreenshotAction(UIActionPool *pParent)
    94114        : UIActionSimple(pParent, ":/take_screenshot_16px.png", ":/take_screenshot_disabled_16px.png")
    95115    {
     
    99119protected:
    100120
    101     void retranslateUi()
    102     {
    103         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Take Screensh&ot...")), gMS->shortcut(UIMachineShortcuts::TakeScreenshotShortcut)));
     121    QString shortcutExtraDataID() const
     122    {
     123        return QString("TakeScreenshot");
     124    }
     125
     126    QKeySequence defaultShortcut(UIActionPoolType) const
     127    {
     128        return QKeySequence("E");
     129    }
     130
     131    void retranslateUi()
     132    {
     133        setName(QApplication::translate("UIActionPool", "Take Screensh&ot..."));
    104134        setStatusTip(QApplication::translate("UIActionPool", "Take a screenshot of the virtual machine"));
    105135    }
     
    112142public:
    113143
    114     ShowInformationDialogAction(QObject *pParent)
     144    ShowInformationDialogAction(UIActionPool *pParent)
    115145        : UIActionSimple(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png")
    116146    {
     
    120150protected:
    121151
    122     void retranslateUi()
    123     {
    124         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Session I&nformation...")), gMS->shortcut(UIMachineShortcuts::InformationDialogShortcut)));
     152    QString shortcutExtraDataID() const
     153    {
     154        return QString("InformationDialog");
     155    }
     156
     157    QKeySequence defaultShortcut(UIActionPoolType) const
     158    {
     159        return QKeySequence("N");
     160    }
     161
     162    void retranslateUi()
     163    {
     164        setName(QApplication::translate("UIActionPool", "Session I&nformation..."));
    125165        setStatusTip(QApplication::translate("UIActionPool", "Show Session Information Dialog"));
    126166    }
     
    133173public:
    134174
    135     MenuMouseIntegrationAction(QObject *pParent)
     175    MenuMouseIntegrationAction(UIActionPool *pParent)
    136176        : UIActionMenu(pParent)
    137177    {
     
    150190public:
    151191
    152     ToggleMouseIntegrationAction(QObject *pParent)
     192    ToggleMouseIntegrationAction(UIActionPool *pParent)
    153193        : UIActionToggle(pParent,
    154194                         ":/mouse_can_seamless_on_16px.png", ":/mouse_can_seamless_16px.png",
     
    160200protected:
    161201
    162     void retranslateUi()
    163     {
    164         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Disable &Mouse Integration")), gMS->shortcut(UIMachineShortcuts::MouseIntegrationShortcut)));
     202    QString shortcutExtraDataID() const
     203    {
     204        return QString("MouseIntegration");
     205    }
     206
     207    QKeySequence defaultShortcut(UIActionPoolType) const
     208    {
     209        return QKeySequence("I");
     210    }
     211
     212    void retranslateUi()
     213    {
     214        setName(QApplication::translate("UIActionPool", "Disable &Mouse Integration"));
    165215        setStatusTip(QApplication::translate("UIActionPool", "Temporarily disable host mouse pointer integration"));
    166216    }
     
    173223public:
    174224
    175     PerformTypeCADAction(QObject *pParent)
     225    PerformTypeCADAction(UIActionPool *pParent)
    176226        : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")
    177227    {
     
    181231protected:
    182232
    183     void retranslateUi()
    184     {
    185         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Insert Ctrl-Alt-Del")), gMS->shortcut(UIMachineShortcuts::TypeCADShortcut)));
     233    QString shortcutExtraDataID() const
     234    {
     235        return QString("TypeCAD");
     236    }
     237
     238    QKeySequence defaultShortcut(UIActionPoolType) const
     239    {
     240        return QKeySequence("Del");
     241    }
     242
     243    void retranslateUi()
     244    {
     245        setName(QApplication::translate("UIActionPool", "&Insert Ctrl-Alt-Del"));
    186246        setStatusTip(QApplication::translate("UIActionPool", "Send the Ctrl-Alt-Del sequence to the virtual machine"));
    187247    }
     
    195255public:
    196256
    197     PerformTypeCABSAction(QObject *pParent)
     257    PerformTypeCABSAction(UIActionPool *pParent)
    198258        : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")
    199259    {
     
    203263protected:
    204264
    205     void retranslateUi()
    206     {
    207         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Ins&ert Ctrl-Alt-Backspace")), gMS->shortcut(UIMachineShortcuts::TypeCABSShortcut)));
     265    QString shortcutExtraDataID() const
     266    {
     267        return QString("TypeCABS");
     268    }
     269
     270    QKeySequence defaultShortcut(UIActionPoolType) const
     271    {
     272        return QKeySequence("Backspace");
     273    }
     274
     275    void retranslateUi()
     276    {
     277        setName(QApplication::translate("UIActionPool", "Ins&ert Ctrl-Alt-Backspace"));
    208278        setStatusTip(QApplication::translate("UIActionPool", "Send the Ctrl-Alt-Backspace sequence to the virtual machine"));
    209279    }
     
    217287public:
    218288
    219     TogglePauseAction(QObject *pParent)
     289    TogglePauseAction(UIActionPool *pParent)
    220290        : UIActionToggle(pParent, ":/pause_16px.png", ":/pause_disabled_16px.png")
    221291    {
     
    225295protected:
    226296
    227     void retranslateUi()
    228     {
    229         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Pause")), gMS->shortcut(UIMachineShortcuts::PauseShortcut)));
     297    QString shortcutExtraDataID() const
     298    {
     299        return QString("Pause");
     300    }
     301
     302    QKeySequence defaultShortcut(UIActionPoolType) const
     303    {
     304        return QKeySequence("P");
     305    }
     306
     307    void retranslateUi()
     308    {
     309        setName(QApplication::translate("UIActionPool", "&Pause"));
    230310        setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine"));
    231311    }
     
    238318public:
    239319
    240     PerformResetAction(QObject *pParent)
     320    PerformResetAction(UIActionPool *pParent)
    241321        : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
    242322    {
     
    246326protected:
    247327
    248     void retranslateUi()
    249     {
    250         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Reset")), gMS->shortcut(UIMachineShortcuts::ResetShortcut)));
     328    QString shortcutExtraDataID() const
     329    {
     330        return QString("Reset");
     331    }
     332
     333    QKeySequence defaultShortcut(UIActionPoolType) const
     334    {
     335        return QKeySequence("R");
     336    }
     337
     338    void retranslateUi()
     339    {
     340        setName(QApplication::translate("UIActionPool", "&Reset"));
    251341        setStatusTip(QApplication::translate("UIActionPool", "Reset the virtual machine"));
    252342    }
     
    259349public:
    260350
    261     PerformShutdownAction(QObject *pParent)
     351    PerformShutdownAction(UIActionPool *pParent)
    262352        : UIActionSimple(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")
    263353    {
     
    267357protected:
    268358
    269     void retranslateUi()
    270     {
    271         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "ACPI Sh&utdown")), gMS->shortcut(UIMachineShortcuts::ShutdownShortcut)));
     359    QString shortcutExtraDataID() const
     360    {
     361        return QString("Shutdown");
     362    }
     363
     364    QKeySequence defaultShortcut(UIActionPoolType) const
     365    {
     366#ifdef Q_WS_MAC
     367        return QKeySequence("U");
     368#else /* Q_WS_MAC */
     369        return QKeySequence("H");
     370#endif /* !Q_WS_MAC */
     371    }
     372
     373    void retranslateUi()
     374    {
     375        setName(QApplication::translate("UIActionPool", "ACPI Sh&utdown"));
    272376        setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Power Button press event to the virtual machine"));
    273377    }
     
    280384public:
    281385
    282     PerformCloseAction(QObject *pParent)
     386    PerformCloseAction(UIActionPool *pParent)
    283387        : UIActionSimple(pParent, ":/exit_16px.png")
    284388    {
     
    289393protected:
    290394
    291     void retranslateUi()
    292     {
    293         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Close...")), gMS->shortcut(UIMachineShortcuts::CloseShortcut)));
     395    QString shortcutExtraDataID() const
     396    {
     397        return QString("Close");
     398    }
     399
     400    QKeySequence defaultShortcut(UIActionPoolType) const
     401    {
     402        return QKeySequence("Q");
     403    }
     404
     405    void retranslateUi()
     406    {
     407        setName(QApplication::translate("UIActionPool", "&Close..."));
    294408        setStatusTip(QApplication::translate("UIActionPool", "Close the virtual machine"));
    295409    }
     
    302416public:
    303417
    304     MenuViewAction(QObject *pParent)
     418    MenuViewAction(UIActionPool *pParent)
    305419        : UIActionMenu(pParent)
    306420    {
     
    312426    void retranslateUi()
    313427    {
    314         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "&View")));
     428        setName(QApplication::translate("UIActionPool", "&View"));
    315429    }
    316430};
     
    322436public:
    323437
    324     ToggleFullscreenModeAction(QObject *pParent)
     438    ToggleFullscreenModeAction(UIActionPool *pParent)
    325439        : UIActionToggle(pParent,
    326440                         ":/fullscreen_on_16px.png", ":/fullscreen_16px.png",
     
    332446protected:
    333447
    334     void retranslateUi()
    335     {
    336         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Switch to &Fullscreen")), gMS->shortcut(UIMachineShortcuts::FullscreenModeShortcut)));
     448    QString shortcutExtraDataID() const
     449    {
     450        return QString("FullscreenMode");
     451    }
     452
     453    QKeySequence defaultShortcut(UIActionPoolType) const
     454    {
     455        return QKeySequence("F");
     456    }
     457
     458    void retranslateUi()
     459    {
     460        setName(QApplication::translate("UIActionPool", "Switch to &Fullscreen"));
    337461        setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and fullscreen mode"));
    338462    }
     
    345469public:
    346470
    347     ToggleSeamlessModeAction(QObject *pParent)
     471    ToggleSeamlessModeAction(UIActionPool *pParent)
    348472        : UIActionToggle(pParent,
    349473                         ":/seamless_on_16px.png", ":/seamless_16px.png",
     
    355479protected:
    356480
    357     void retranslateUi()
    358     {
    359         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Switch to Seam&less Mode")), gMS->shortcut(UIMachineShortcuts::SeamlessModeShortcut)));
     481    QString shortcutExtraDataID() const
     482    {
     483        return QString("SeamlessMode");
     484    }
     485
     486    QKeySequence defaultShortcut(UIActionPoolType) const
     487    {
     488        return QKeySequence("L");
     489    }
     490
     491    void retranslateUi()
     492    {
     493        setName(QApplication::translate("UIActionPool", "Switch to Seam&less Mode"));
    360494        setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and seamless desktop integration mode"));
    361495    }
     
    368502public:
    369503
    370     ToggleScaleModeAction(QObject *pParent)
     504    ToggleScaleModeAction(UIActionPool *pParent)
    371505        : UIActionToggle(pParent,
    372506                         ":/scale_on_16px.png", ":/scale_16px.png",
     
    378512protected:
    379513
    380     void retranslateUi()
    381     {
    382         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Switch to &Scale Mode")), gMS->shortcut(UIMachineShortcuts::ScaleModeShortcut)));
     514    QString shortcutExtraDataID() const
     515    {
     516        return QString("ScaleMode");
     517    }
     518
     519    QKeySequence defaultShortcut(UIActionPoolType) const
     520    {
     521        return QKeySequence("C");
     522    }
     523
     524    void retranslateUi()
     525    {
     526        setName(QApplication::translate("UIActionPool", "Switch to &Scale Mode"));
    383527        setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and scale mode"));
    384528    }
     
    391535public:
    392536
    393     ToggleGuestAutoresizeAction(QObject *pParent)
     537    ToggleGuestAutoresizeAction(UIActionPool *pParent)
    394538        : UIActionToggle(pParent,
    395539                         ":/auto_resize_on_on_16px.png", ":/auto_resize_on_16px.png",
     
    401545protected:
    402546
    403     void retranslateUi()
    404     {
    405         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Auto-resize &Guest Display")), gMS->shortcut(UIMachineShortcuts::GuestAutoresizeShortcut)));
     547    QString shortcutExtraDataID() const
     548    {
     549        return QString("GuestAutoresize");
     550    }
     551
     552    QKeySequence defaultShortcut(UIActionPoolType) const
     553    {
     554        return QKeySequence("G");
     555    }
     556
     557    void retranslateUi()
     558    {
     559        setName(QApplication::translate("UIActionPool", "Auto-resize &Guest Display"));
    406560        setStatusTip(QApplication::translate("UIActionPool", "Automatically resize the guest display when the window is resized (requires Guest Additions)"));
    407561    }
     
    414568public:
    415569
    416     PerformWindowAdjustAction(QObject *pParent)
     570    PerformWindowAdjustAction(UIActionPool *pParent)
    417571        : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png")
    418572    {
     
    422576protected:
    423577
    424     void retranslateUi()
    425     {
    426         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Adjust Window Size")), gMS->shortcut(UIMachineShortcuts::WindowAdjustShortcut)));
     578    QString shortcutExtraDataID() const
     579    {
     580        return QString("WindowAdjust");
     581    }
     582
     583    QKeySequence defaultShortcut(UIActionPoolType) const
     584    {
     585        return QKeySequence("A");
     586    }
     587
     588    void retranslateUi()
     589    {
     590        setName(QApplication::translate("UIActionPool", "&Adjust Window Size"));
    427591        setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display"));
    428592    }
     
    435599public:
    436600
    437     MenuDevicesAction(QObject *pParent)
     601    MenuDevicesAction(UIActionPool *pParent)
    438602        : UIActionMenu(pParent)
    439603    {
     
    445609    void retranslateUi()
    446610    {
    447         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "&Devices")));
     611        setName(QApplication::translate("UIActionPool", "&Devices"));
    448612    }
    449613};
     
    455619public:
    456620
    457     MenuOpticalDevicesAction(QObject *pParent)
     621    MenuOpticalDevicesAction(UIActionPool *pParent)
    458622        : UIActionMenu(pParent, ":/cd_16px.png", ":/cd_disabled_16px.png")
    459623    {
     
    466630    void retranslateUi()
    467631    {
    468         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "&CD/DVD Devices")));
     632        setName(QApplication::translate("UIActionPool", "&CD/DVD Devices"));
    469633    }
    470634};
     
    476640public:
    477641
    478     MenuFloppyDevicesAction(QObject *pParent)
     642    MenuFloppyDevicesAction(UIActionPool *pParent)
    479643        : UIActionMenu(pParent, ":/fd_16px.png", ":/fd_disabled_16px.png")
    480644    {
     
    487651    void retranslateUi()
    488652    {
    489         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "&Floppy Devices")));
     653        setName(QApplication::translate("UIActionPool", "&Floppy Devices"));
    490654    }
    491655};
     
    497661public:
    498662
    499     MenuUSBDevicesAction(QObject *pParent)
     663    MenuUSBDevicesAction(UIActionPool *pParent)
    500664        : UIActionMenu(pParent, ":/usb_16px.png", ":/usb_disabled_16px.png")
    501665    {
     
    508672    void retranslateUi()
    509673    {
    510         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "&USB Devices")));
     674        setName(QApplication::translate("UIActionPool", "&USB Devices"));
    511675    }
    512676};
     
    518682public:
    519683
    520     MenuSharedClipboardAction(QObject *pParent)
     684    MenuSharedClipboardAction(UIActionPool *pParent)
    521685        : UIActionMenu(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
    522686    {
     
    528692    void retranslateUi()
    529693    {
    530         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "Shared &Clipboard")));
     694        setName(QApplication::translate("UIActionPool", "Shared &Clipboard"));
    531695    }
    532696};
     
    538702public:
    539703
    540     MenuDragAndDropAction(QObject *pParent)
     704    MenuDragAndDropAction(UIActionPool *pParent)
    541705        : UIActionMenu(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
    542706    {
     
    548712    void retranslateUi()
    549713    {
    550         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "Drag'n'Drop")));
     714        setName(QApplication::translate("UIActionPool", "Drag'n'Drop"));
    551715    }
    552716};
     
    558722public:
    559723
    560     MenuNetworkAdaptersAction(QObject *pParent)
     724    MenuNetworkAdaptersAction(UIActionPool *pParent)
    561725        : UIActionMenu(pParent)
    562726    {
     
    575739public:
    576740
    577     ShowNetworkAdaptersDialogAction(QObject *pParent)
     741    ShowNetworkAdaptersDialogAction(UIActionPool *pParent)
    578742        : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
    579743    {
     
    583747protected:
    584748
    585     void retranslateUi()
    586     {
    587         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Network Adapters...")), gMS->shortcut(UIMachineShortcuts::NetworkAdaptersDialogShortcut)));
     749    QString shortcutExtraDataID() const
     750    {
     751        return QString("NetworkAdaptersDialog");
     752    }
     753
     754    void retranslateUi()
     755    {
     756        setName(QApplication::translate("UIActionPool", "&Network Adapters..."));
    588757        setStatusTip(QApplication::translate("UIActionPool", "Change the settings of network adapters"));
    589758    }
     
    596765public:
    597766
    598     MenuSharedFoldersAction(QObject *pParent)
     767    MenuSharedFoldersAction(UIActionPool *pParent)
    599768        : UIActionMenu(pParent)
    600769    {
     
    613782public:
    614783
    615     ShowSharedFoldersDialogAction(QObject *pParent)
     784    ShowSharedFoldersDialogAction(UIActionPool *pParent)
    616785        : UIActionSimple(pParent, ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png")
    617786    {
     
    621790protected:
    622791
    623     void retranslateUi()
    624     {
    625         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Shared Folders...")), gMS->shortcut(UIMachineShortcuts::SharedFoldersDialogShortcut)));
     792    QString shortcutExtraDataID() const
     793    {
     794        return QString("SharedFoldersDialog");
     795    }
     796
     797    void retranslateUi()
     798    {
     799        setName(QApplication::translate("UIActionPool", "&Shared Folders..."));
    626800        setStatusTip(QApplication::translate("UIActionPool", "Create or modify shared folders"));
    627801    }
     
    634808public:
    635809
    636     ToggleVRDEServerAction(QObject *pParent)
     810    ToggleVRDEServerAction(UIActionPool *pParent)
    637811        : UIActionToggle(pParent,
    638812                         ":/vrdp_on_16px.png", ":/vrdp_16px.png",
     
    644818protected:
    645819
    646     void retranslateUi()
    647     {
    648         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Enable R&emote Display")), gMS->shortcut(UIMachineShortcuts::VRDPServerShortcut)));
     820    QString shortcutExtraDataID() const
     821    {
     822        return QString("VRDPServer");
     823    }
     824
     825    void retranslateUi()
     826    {
     827        setName(QApplication::translate("UIActionPool", "Enable R&emote Display"));
    649828        setStatusTip(QApplication::translate("UIActionPool", "Enable remote desktop (RDP) connections to this machine"));
    650829    }
     
    657836public:
    658837
    659     PerformInstallGuestToolsAction(QObject *pParent)
     838    PerformInstallGuestToolsAction(UIActionPool *pParent)
    660839        : UIActionSimple(pParent, ":/guesttools_16px.png", ":/guesttools_disabled_16px.png")
    661840    {
     
    665844protected:
    666845
    667     void retranslateUi()
    668     {
    669         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Install Guest Additions...")), gMS->shortcut(UIMachineShortcuts::InstallGuestAdditionsShortcut)));
     846    QString shortcutExtraDataID() const
     847    {
     848        return QString("InstallGuestAdditions");
     849    }
     850
     851    QKeySequence defaultShortcut(UIActionPoolType) const
     852    {
     853        return QKeySequence("D");
     854    }
     855
     856    void retranslateUi()
     857    {
     858        setName(QApplication::translate("UIActionPool", "&Install Guest Additions..."));
    670859        setStatusTip(QApplication::translate("UIActionPool", "Mount the Guest Additions installation image"));
    671860    }
     
    679868public:
    680869
    681     MenuDebugAction(QObject *pParent)
     870    MenuDebugAction(UIActionPool *pParent)
    682871        : UIActionMenu(pParent)
    683872    {
     
    689878    void retranslateUi()
    690879    {
    691         menu()->setTitle(menuText(QApplication::translate("UIActionPool", "De&bug")));
     880        setName(QApplication::translate("UIActionPool", "De&bug"));
    692881    }
    693882};
     
    699888public:
    700889
    701     ShowStatisticsAction(QObject *pParent)
     890    ShowStatisticsAction(UIActionPool *pParent)
    702891        : UIActionSimple(pParent)
    703892    {
     
    707896protected:
    708897
    709     void retranslateUi()
    710     {
    711         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Statistics...", "debug action")), gMS->shortcut(UIMachineShortcuts::StatisticWindowShortcut)));
     898    QString shortcutExtraDataID() const
     899    {
     900        return QString("StatisticWindow");
     901    }
     902
     903    void retranslateUi()
     904    {
     905        setName(QApplication::translate("UIActionPool", "&Statistics...", "debug action"));
    712906    }
    713907};
     
    719913public:
    720914
    721     ShowCommandLineAction(QObject *pParent)
     915    ShowCommandLineAction(UIActionPool *pParent)
    722916        : UIActionSimple(pParent)
    723917    {
     
    727921protected:
    728922
    729     void retranslateUi()
    730     {
    731         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Command Line...", "debug action")), gMS->shortcut(UIMachineShortcuts::CommandLineWindowShortcut)));
     923    QString shortcutExtraDataID() const
     924    {
     925        return QString("CommandLineWindow");
     926    }
     927
     928    void retranslateUi()
     929    {
     930        setName(QApplication::translate("UIActionPool", "&Command Line...", "debug action"));
    732931    }
    733932};
     
    739938public:
    740939
    741     ToggleLoggingAction(QObject *pParent)
     940    ToggleLoggingAction(UIActionPool *pParent)
    742941        : UIActionToggle(pParent)
    743942    {
     
    747946protected:
    748947
    749     void retranslateUi()
    750     {
    751         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Enable &Logging...", "debug action")), gMS->shortcut(UIMachineShortcuts::LoggingShortcut)));
     948    QString shortcutExtraDataID() const
     949    {
     950        return QString("Logging");
     951    }
     952
     953    void retranslateUi()
     954    {
     955        setName(QApplication::translate("UIActionPool", "Enable &Logging...", "debug action"));
    752956    }
    753957};
     
    761965public:
    762966
    763     DockMenuAction(QObject *pParent)
     967    DockMenuAction(UIActionPool *pParent)
    764968        : UIActionMenu(pParent)
    765969    {
     
    778982public:
    779983
    780     DockSettingsMenuAction(QObject *pParent)
     984    DockSettingsMenuAction(UIActionPool *pParent)
    781985        : UIActionMenu(pParent)
    782986    {
     
    788992    void retranslateUi()
    789993    {
    790         setText(QApplication::translate("UIActionPool", "Dock Icon"));
     994        setName(QApplication::translate("UIActionPool", "Dock Icon"));
    791995    }
    792996};
     
    7981002public:
    7991003
    800     ToggleDockPreviewMonitorAction(QObject *pParent)
     1004    ToggleDockPreviewMonitorAction(UIActionPool *pParent)
    8011005        : UIActionToggle(pParent)
    8021006    {
     
    8061010protected:
    8071011
    808     void retranslateUi()
    809     {
    810         setText(QApplication::translate("UIActionPool", "Show Monitor Preview"));
     1012    QString shortcutExtraDataID() const
     1013    {
     1014        return QString("DockPreviewMonitor");
     1015    }
     1016
     1017    void retranslateUi()
     1018    {
     1019        setName(QApplication::translate("UIActionPool", "Show Monitor Preview"));
    8111020    }
    8121021};
     
    8181027public:
    8191028
    820     ToggleDockDisableMonitorAction(QObject *pParent)
     1029    ToggleDockDisableMonitorAction(UIActionPool *pParent)
    8211030        : UIActionToggle(pParent)
    8221031    {
     
    8261035protected:
    8271036
    828     void retranslateUi()
    829     {
    830         setText(QApplication::translate("UIActionPool", "Show Application Icon"));
     1037    QString shortcutExtraDataID() const
     1038    {
     1039        return QString("DockDisableMonitor");
     1040    }
     1041
     1042    void retranslateUi()
     1043    {
     1044        setName(QApplication::translate("UIActionPool", "Show Application Icon"));
    8311045    }
    8321046};
    8331047#endif /* Q_WS_MAC */
    8341048
     1049
     1050QString UIActionPoolRuntime::shortcutsExtraDataID() const
     1051{
     1052    return GUI_Input_MachineShortcuts;
     1053}
    8351054
    8361055void UIActionPoolRuntime::createActions()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r44354 r44434  
    9595    UIActionPoolRuntime() : UIActionPool(UIActionPoolType_Runtime) {}
    9696
     97    /* Helper: Shortcuts stuff: */
     98    QString shortcutsExtraDataID() const;
     99
    97100    /* Helpers: Prepare stuff: */
    98101    void createActions();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIKeyboardHandlerFullscreen.cpp

    r41107 r44434  
    2626#include "UIKeyboardHandlerFullscreen.h"
    2727#include "UIMachineWindow.h"
    28 #include "UIMachineShortcuts.h"
     28#include "UIShortcuts.h"
    2929
    3030/* Fullscreen keyboard-handler constructor: */
     
    5656                QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
    5757                /* Process Host+Home for menu popup: */
    58                 if (isHostKeyPressed() && pKeyEvent->key() == gMS->keySequence(UIMachineShortcuts::PopupMenuShortcut))
     58                if (isHostKeyPressed() && pKeyEvent->key() == gShortcutPool->shortcut(GUI_Input_MachineShortcuts, QString("PopupMenu")).sequence())
    5959                {
    6060                    /* Post request to show popup-menu: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIKeyboardHandlerNormal.cpp

    r41107 r44434  
    2626#include "UIKeyboardHandlerNormal.h"
    2727#include "UIMachineWindow.h"
    28 #include "UIMachineShortcuts.h"
     28#include "UIShortcuts.h"
    2929
    3030/* Fullscreen keyboard-handler constructor: */
     
    5959                QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
    6060                /* Process Host+Home as menu-bar activator: */
    61                 if (isHostKeyPressed() && pKeyEvent->key() == gMS->keySequence(UIMachineShortcuts::PopupMenuShortcut))
     61                if (isHostKeyPressed() && pKeyEvent->key() == gShortcutPool->shortcut(GUI_Input_MachineShortcuts, QString("PopupMenu")).sequence())
    6262                {
    6363                    /* Trying to get menu-bar: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIKeyboardHandlerScale.cpp

    r41107 r44434  
    2626#include "UIKeyboardHandlerScale.h"
    2727#include "UIMachineWindow.h"
    28 #include "UIMachineShortcuts.h"
     28#include "UIShortcuts.h"
    2929
    3030/* Fullscreen keyboard-handler constructor: */
     
    5959                QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
    6060                /* Process Host+Home for menu popup: */
    61                 if (isHostKeyPressed() && pKeyEvent->key() == gMS->keySequence(UIMachineShortcuts::PopupMenuShortcut))
     61                if (isHostKeyPressed() && pKeyEvent->key() == gShortcutPool->shortcut(GUI_Input_MachineShortcuts, QString("PopupMenu")).sequence())
    6262                {
    6363                    /* Post request to show popup-menu: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIKeyboardHandlerSeamless.cpp

    r41107 r44434  
    2626#include "UIKeyboardHandlerSeamless.h"
    2727#include "UIMachineWindow.h"
    28 #include "UIMachineShortcuts.h"
     28#include "UIShortcuts.h"
    2929
    3030/* Fullscreen keyboard-handler constructor: */
     
    5656                QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
    5757                /* Process Host+Home for menu popup: */
    58                 if (isHostKeyPressed() && pKeyEvent->key() == gMS->keySequence(UIMachineShortcuts::PopupMenuShortcut))
     58                if (isHostKeyPressed() && pKeyEvent->key() == gShortcutPool->shortcut(GUI_Input_MachineShortcuts, QString("PopupMenu")).sequence())
    5959                {
    6060                    /* Post request to show popup-menu: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r44354 r44434  
    2020/* Local includes: */
    2121#include "UIActionPoolSelector.h"
    22 #include "UISelectorShortcuts.h"
     22#include "UIDefs.h"
    2323
    2424class UIActionMenuFile : public UIActionMenu
     
    2828public:
    2929
    30     UIActionMenuFile(QObject *pParent)
     30    UIActionMenuFile(UIActionPool *pParent)
    3131        : UIActionMenu(pParent)
    3232    {
     
    3939    {
    4040#ifdef Q_WS_MAC
    41         menu()->setTitle(QApplication::translate("UIActionPool", "&File", "Mac OS X version"));
     41        setName(QApplication::translate("UIActionPool", "&File", "Mac OS X version"));
    4242#else /* Q_WS_MAC */
    43         menu()->setTitle(QApplication::translate("UIActionPool", "&File", "Non Mac OS X version"));
     43        setName(QApplication::translate("UIActionPool", "&File", "Non Mac OS X version"));
    4444#endif /* !Q_WS_MAC */
    4545    }
     
    5252public:
    5353
    54     UIActionSimpleMediumManagerDialog(QObject *pParent)
     54    UIActionSimpleMediumManagerDialog(UIActionPool *pParent)
    5555        : UIActionSimple(pParent, ":/diskimage_16px.png")
    5656    {
    57         setShortcut(gSS->keySequence(UISelectorShortcuts::VirtualMediaManagerShortcut));
    58         retranslateUi();
    59     }
    60 
    61 protected:
    62 
    63     void retranslateUi()
    64     {
    65         setText(QApplication::translate("UIActionPool", "&Virtual Media Manager..."));
     57        retranslateUi();
     58    }
     59
     60protected:
     61
     62    QString shortcutExtraDataID() const
     63    {
     64        return QString("VirtualMediaManager");
     65    }
     66
     67    QKeySequence defaultShortcut(UIActionPoolType) const
     68    {
     69        return QKeySequence("Ctrl+D");
     70    }
     71
     72    void retranslateUi()
     73    {
     74        setName(QApplication::translate("UIActionPool", "&Virtual Media Manager..."));
    6675        setStatusTip(QApplication::translate("UIActionPool", "Display the Virtual Media Manager dialog"));
    6776    }
     
    7483public:
    7584
    76     UIActionSimpleImportApplianceWizard(QObject *pParent)
     85    UIActionSimpleImportApplianceWizard(UIActionPool *pParent)
    7786        : UIActionSimple(pParent, ":/import_16px.png")
    7887    {
    79         setShortcut(gSS->keySequence(UISelectorShortcuts::ImportApplianceShortcut));
    80         retranslateUi();
    81     }
    82 
    83 protected:
    84 
    85     void retranslateUi()
    86     {
    87         setText(QApplication::translate("UIActionPool", "&Import Appliance..."));
     88        retranslateUi();
     89    }
     90
     91protected:
     92
     93    QString shortcutExtraDataID() const
     94    {
     95        return QString("ImportAppliance");
     96    }
     97
     98    QKeySequence defaultShortcut(UIActionPoolType) const
     99    {
     100        return QKeySequence("Ctrl+I");
     101    }
     102
     103    void retranslateUi()
     104    {
     105        setName(QApplication::translate("UIActionPool", "&Import Appliance..."));
    88106        setStatusTip(QApplication::translate("UIActionPool", "Import an appliance into VirtualBox"));
    89107    }
     
    96114public:
    97115
    98     UIActionSimpleExportApplianceWizard(QObject *pParent)
     116    UIActionSimpleExportApplianceWizard(UIActionPool *pParent)
    99117        : UIActionSimple(pParent, ":/export_16px.png")
    100118    {
    101         setShortcut(gSS->keySequence(UISelectorShortcuts::ExportApplianceShortcut));
    102         retranslateUi();
    103     }
    104 
    105 protected:
    106 
    107     void retranslateUi()
    108     {
    109         setText(QApplication::translate("UIActionPool", "&Export Appliance..."));
     119        retranslateUi();
     120    }
     121
     122protected:
     123
     124    QString shortcutExtraDataID() const
     125    {
     126        return QString("ExportAppliance");
     127    }
     128
     129    QKeySequence defaultShortcut(UIActionPoolType) const
     130    {
     131        return QKeySequence("Ctrl+E");
     132    }
     133
     134    void retranslateUi()
     135    {
     136        setName(QApplication::translate("UIActionPool", "&Export Appliance..."));
    110137        setStatusTip(QApplication::translate("UIActionPool", "Export one or more VirtualBox virtual machines as an appliance"));
    111138    }
     
    118145public:
    119146
    120     UIActionSimplePreferencesDialog(QObject *pParent)
     147    UIActionSimplePreferencesDialog(UIActionPool *pParent)
    121148        : UIActionSimple(pParent, ":/global_settings_16px.png")
    122149    {
    123150        setMenuRole(QAction::PreferencesRole);
    124         setShortcut(gSS->keySequence(UISelectorShortcuts::PreferencesShortcut));
    125         retranslateUi();
    126     }
    127 
    128 protected:
    129 
    130     void retranslateUi()
    131     {
    132         setText(QApplication::translate("UIActionPool", "&Preferences...", "global settings"));
     151        retranslateUi();
     152    }
     153
     154protected:
     155
     156    QString shortcutExtraDataID() const
     157    {
     158        return QString("Preferences");
     159    }
     160
     161    QKeySequence defaultShortcut(UIActionPoolType) const
     162    {
     163        return QKeySequence("Ctrl+G");
     164    }
     165
     166    void retranslateUi()
     167    {
     168        setName(QApplication::translate("UIActionPool", "&Preferences...", "global settings"));
    133169        setStatusTip(QApplication::translate("UIActionPool", "Display the global settings dialog"));
    134170    }
     
    141177public:
    142178
    143     UIActionSimpleExit(QObject *pParent)
     179    UIActionSimpleExit(UIActionPool *pParent)
    144180        : UIActionSimple(pParent, ":/exit_16px.png")
    145181    {
    146182        setMenuRole(QAction::QuitRole);
    147         setShortcut(gSS->keySequence(UISelectorShortcuts::ExitShortcut));
    148         retranslateUi();
    149     }
    150 
    151 protected:
    152 
    153     void retranslateUi()
    154     {
    155         setText(QApplication::translate("UIActionPool", "E&xit"));
     183        retranslateUi();
     184    }
     185
     186protected:
     187
     188    QString shortcutExtraDataID() const
     189    {
     190        return QString("Exit");
     191    }
     192
     193    QKeySequence defaultShortcut(UIActionPoolType) const
     194    {
     195        return QKeySequence("Ctrl+Q");
     196    }
     197
     198    void retranslateUi()
     199    {
     200        setName(QApplication::translate("UIActionPool", "E&xit"));
    156201        setStatusTip(QApplication::translate("UIActionPool", "Close application"));
    157202    }
     
    165210public:
    166211
    167     UIActionMenuGroup(QObject *pParent)
     212    UIActionMenuGroup(UIActionPool *pParent)
    168213        : UIActionMenu(pParent)
    169214    {
     
    175220    void retranslateUi()
    176221    {
    177         menu()->setTitle(QApplication::translate("UIActionPool", "&Group"));
     222        setName(QApplication::translate("UIActionPool", "&Group"));
    178223    }
    179224};
     
    185230public:
    186231
    187     UIActionSimpleGroupNew(QObject *pParent)
     232    UIActionSimpleGroupNew(UIActionPool *pParent)
    188233        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png")
    189234    {
    190         setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut));
    191         retranslateUi();
    192     }
    193 
    194 protected:
    195 
    196     void retranslateUi()
    197     {
    198         setText(QApplication::translate("UIActionPool", "&New Machine..."));
     235        retranslateUi();
     236    }
     237
     238protected:
     239
     240    QString shortcutExtraDataID() const
     241    {
     242        return QString("NewVM");
     243    }
     244
     245    QKeySequence defaultShortcut(UIActionPoolType) const
     246    {
     247        return QKeySequence("Ctrl+N");
     248    }
     249
     250    void retranslateUi()
     251    {
     252        setName(QApplication::translate("UIActionPool", "&New Machine..."));
    199253        setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine"));
    200254        setToolTip(text().remove('&').remove('.') +
     
    209263public:
    210264
    211     UIActionSimpleGroupAdd(QObject *pParent)
     265    UIActionSimpleGroupAdd(UIActionPool *pParent)
    212266        : UIActionSimple(pParent, ":/vm_add_16px.png")
    213267    {
    214         setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut));
    215         retranslateUi();
    216     }
    217 
    218 protected:
    219 
    220     void retranslateUi()
    221     {
    222         setText(QApplication::translate("UIActionPool", "&Add Machine..."));
     268        retranslateUi();
     269    }
     270
     271protected:
     272
     273    QString shortcutExtraDataID() const
     274    {
     275        return QString("AddVM");
     276    }
     277
     278    QKeySequence defaultShortcut(UIActionPoolType) const
     279    {
     280        return QKeySequence("Ctrl+A");
     281    }
     282
     283    void retranslateUi()
     284    {
     285        setName(QApplication::translate("UIActionPool", "&Add Machine..."));
    223286        setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine"));
    224287    }
     
    231294public:
    232295
    233     UIActionSimpleGroupRename(QObject *pParent)
     296    UIActionSimpleGroupRename(UIActionPool *pParent)
    234297        : UIActionSimple(pParent, ":/name_16px.png")
    235298    {
    236         setShortcut(gSS->keySequence(UISelectorShortcuts::RenameVMGroupShortcut));
    237         retranslateUi();
    238     }
    239 
    240 protected:
    241 
    242     void retranslateUi()
    243     {
    244         setText(QApplication::translate("UIActionPool", "Rena&me Group..."));
     299        retranslateUi();
     300    }
     301
     302protected:
     303
     304    QString shortcutExtraDataID() const
     305    {
     306        return QString("RenameVMGroup");
     307    }
     308
     309    QKeySequence defaultShortcut(UIActionPoolType) const
     310    {
     311        return QKeySequence("Ctrl+M");
     312    }
     313
     314    void retranslateUi()
     315    {
     316        setName(QApplication::translate("UIActionPool", "Rena&me Group..."));
    245317        setStatusTip(QApplication::translate("UIActionPool", "Rename the selected virtual machine group"));
    246318    }
     
    253325public:
    254326
    255     UIActionSimpleGroupRemove(QObject *pParent)
     327    UIActionSimpleGroupRemove(UIActionPool *pParent)
    256328        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    257329                         ":/vm_delete_32px.png", ":/delete_16px.png",
    258330                         ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
    259331    {
    260         setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMGroupShortcut));
    261         retranslateUi();
    262     }
    263 
    264 protected:
    265 
    266     void retranslateUi()
    267     {
    268         setText(QApplication::translate("UIActionPool", "&Ungroup..."));
     332        retranslateUi();
     333    }
     334
     335protected:
     336
     337    QString shortcutExtraDataID() const
     338    {
     339        return QString("AddVMGroup");
     340    }
     341
     342    QKeySequence defaultShortcut(UIActionPoolType) const
     343    {
     344        return QKeySequence("Ctrl+U");
     345    }
     346
     347    void retranslateUi()
     348    {
     349        setName(QApplication::translate("UIActionPool", "&Ungroup..."));
    269350        setStatusTip(QApplication::translate("UIActionPool", "Ungroup items of the selected virtual machine group"));
    270351    }
     
    277358public:
    278359
    279     UIActionSimpleGroupSort(QObject *pParent)
     360    UIActionSimpleGroupSort(UIActionPool *pParent)
    280361        : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
    281362    {
    282         setShortcut(gSS->keySequence(UISelectorShortcuts::SortGroup));
    283         retranslateUi();
    284     }
    285 
    286 protected:
    287 
    288     void retranslateUi()
    289     {
    290         setText(QApplication::translate("UIActionPool", "Sort"));
     363        retranslateUi();
     364    }
     365
     366protected:
     367
     368    QString shortcutExtraDataID() const
     369    {
     370        return QString("SortGroup");
     371    }
     372
     373    void retranslateUi()
     374    {
     375        setName(QApplication::translate("UIActionPool", "Sort"));
    291376        setStatusTip(QApplication::translate("UIActionPool", "Sort the items of the selected virtual machine group alphabetically"));
    292377    }
     
    300385public:
    301386
    302     UIActionMenuMachine(QObject *pParent)
     387    UIActionMenuMachine(UIActionPool *pParent)
    303388        : UIActionMenu(pParent)
    304389    {
     
    310395    void retranslateUi()
    311396    {
    312         menu()->setTitle(QApplication::translate("UIActionPool", "&Machine"));
     397        setName(QApplication::translate("UIActionPool", "&Machine"));
    313398    }
    314399};
     
    320405public:
    321406
    322     UIActionSimpleMachineNew(QObject *pParent)
     407    UIActionSimpleMachineNew(UIActionPool *pParent)
    323408        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png")
    324409    {
    325         setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut));
    326         retranslateUi();
    327     }
    328 
    329 protected:
    330 
    331     void retranslateUi()
    332     {
    333         setText(QApplication::translate("UIActionPool", "&New..."));
     410        retranslateUi();
     411    }
     412
     413protected:
     414
     415    QString shortcutExtraDataID() const
     416    {
     417        return QString("NewVM");
     418    }
     419
     420    QKeySequence defaultShortcut(UIActionPoolType) const
     421    {
     422        return QKeySequence("Ctrl+N");
     423    }
     424
     425    void retranslateUi()
     426    {
     427        setName(QApplication::translate("UIActionPool", "&New..."));
    334428        setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine"));
    335429        setToolTip(text().remove('&').remove('.') +
     
    344438public:
    345439
    346     UIActionSimpleMachineAdd(QObject *pParent)
     440    UIActionSimpleMachineAdd(UIActionPool *pParent)
    347441        : UIActionSimple(pParent, ":/vm_add_16px.png")
    348442    {
    349         setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut));
    350         retranslateUi();
    351     }
    352 
    353 protected:
    354 
    355     void retranslateUi()
    356     {
    357         setText(QApplication::translate("UIActionPool", "&Add..."));
     443        retranslateUi();
     444    }
     445
     446protected:
     447
     448    QString shortcutExtraDataID() const
     449    {
     450        return QString("AddVM");
     451    }
     452
     453    QKeySequence defaultShortcut(UIActionPoolType) const
     454    {
     455        return QKeySequence("Ctrl+A");
     456    }
     457
     458    void retranslateUi()
     459    {
     460        setName(QApplication::translate("UIActionPool", "&Add..."));
    358461        setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine"));
    359462    }
     
    366469public:
    367470
    368     UIActionSimpleMachineAddGroup(QObject *pParent)
     471    UIActionSimpleMachineAddGroup(UIActionPool *pParent)
    369472        : UIActionSimple(pParent, ":/add_shared_folder_16px.png")
    370473    {
    371         setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMGroupShortcut));
    372         retranslateUi();
    373     }
    374 
    375 protected:
    376 
    377     void retranslateUi()
    378     {
    379         setText(QApplication::translate("UIActionPool", "Gro&up"));
     474        retranslateUi();
     475    }
     476
     477protected:
     478
     479    QString shortcutExtraDataID() const
     480    {
     481        return QString("AddVMGroup");
     482    }
     483
     484    QKeySequence defaultShortcut(UIActionPoolType) const
     485    {
     486        return QKeySequence("Ctrl+U");
     487    }
     488
     489    void retranslateUi()
     490    {
     491        setName(QApplication::translate("UIActionPool", "Gro&up"));
    380492        setStatusTip(QApplication::translate("UIActionPool", "Add a new group based on the items selected"));
    381493    }
     
    388500public:
    389501
    390     UIActionSimpleMachineSettings(QObject *pParent)
     502    UIActionSimpleMachineSettings(UIActionPool *pParent)
    391503        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    392504                         ":/vm_settings_32px.png", ":/settings_16px.png",
    393505                         ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png")
    394506    {
    395         setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut));
    396         retranslateUi();
    397     }
    398 
    399 protected:
    400 
    401     void retranslateUi()
    402     {
    403         setText(QApplication::translate("UIActionPool", "&Settings..."));
     507        retranslateUi();
     508    }
     509
     510protected:
     511
     512    QString shortcutExtraDataID() const
     513    {
     514        return QString("SettingsVM");
     515    }
     516
     517    QKeySequence defaultShortcut(UIActionPoolType) const
     518    {
     519        return QKeySequence("Ctrl+S");
     520    }
     521
     522    void retranslateUi()
     523    {
     524        setName(QApplication::translate("UIActionPool", "&Settings..."));
    404525        setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings"));
    405526        setToolTip(text().remove('&').remove('.') +
     
    414535public:
    415536
    416     UIActionSimpleMachineClone(QObject *pParent)
     537    UIActionSimpleMachineClone(UIActionPool *pParent)
    417538        : UIActionSimple(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")
    418539    {
    419         setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut));
    420         retranslateUi();
    421     }
    422 
    423 protected:
    424 
    425     void retranslateUi()
    426     {
    427         setText(QApplication::translate("UIActionPool", "Cl&one..."));
     540        retranslateUi();
     541    }
     542
     543protected:
     544
     545    QString shortcutExtraDataID() const
     546    {
     547        return QString("CloneVM");
     548    }
     549
     550    QKeySequence defaultShortcut(UIActionPoolType) const
     551    {
     552        return QKeySequence("Ctrl+O");
     553    }
     554
     555    void retranslateUi()
     556    {
     557        setName(QApplication::translate("UIActionPool", "Cl&one..."));
    428558        setStatusTip(QApplication::translate("UIActionPool", "Clone the selected virtual machine"));
    429559    }
     
    436566public:
    437567
    438     UIActionSimpleMachineRemove(QObject *pParent)
     568    UIActionSimpleMachineRemove(UIActionPool *pParent)
    439569        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    440570                         ":/vm_delete_32px.png", ":/delete_16px.png",
    441571                         ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
    442572    {
    443         setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut));
    444         retranslateUi();
    445     }
    446 
    447 protected:
    448 
    449     void retranslateUi()
    450     {
    451         setText(QApplication::translate("UIActionPool", "&Remove..."));
     573        retranslateUi();
     574    }
     575
     576protected:
     577
     578    QString shortcutExtraDataID() const
     579    {
     580        return QString("RemoveVM");
     581    }
     582
     583    QKeySequence defaultShortcut(UIActionPoolType) const
     584    {
     585        return QKeySequence("Ctrl+R");
     586    }
     587
     588    void retranslateUi()
     589    {
     590        setName(QApplication::translate("UIActionPool", "&Remove..."));
    452591        setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machines"));
    453592    }
     
    461600public:
    462601
    463     UIActionStateCommonStartOrShow(QObject *pParent)
     602    UIActionStateCommonStartOrShow(UIActionPool *pParent)
    464603        : UIActionState(pParent, QSize(32, 32), QSize(16, 16),
    465604                        ":/vm_start_32px.png", ":/start_16px.png",
    466605                        ":/vm_start_disabled_32px.png", ":/start_dis_16px.png")
    467606    {
    468         setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
    469         retranslateUi();
    470     }
    471 
    472 protected:
     607        retranslateUi();
     608    }
     609
     610protected:
     611
     612    QString shortcutExtraDataID() const
     613    {
     614        return QString("StartVM");
     615    }
    473616
    474617    void retranslateUi()
     
    478621            case 1:
    479622            {
    480                 setText(QApplication::translate("UIActionPool", "S&tart"));
     623                setName(QApplication::translate("UIActionPool", "S&tart"));
    481624                setStatusTip(QApplication::translate("UIActionPool", "Start the selected virtual machines"));
    482625                setToolTip(text().remove('&').remove('.') +
     
    486629            case 2:
    487630            {
    488                 setText(QApplication::translate("UIActionPool", "S&how"));
     631                setName(QApplication::translate("UIActionPool", "S&how"));
    489632                setStatusTip(QApplication::translate("UIActionPool", "Switch to the windows of the selected virtual machines"));
    490633                setToolTip(text().remove('&').remove('.') +
     
    504647public:
    505648
    506     UIActionToggleCommonPauseAndResume(QObject *pParent)
     649    UIActionToggleCommonPauseAndResume(UIActionPool *pParent)
    507650        : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16),
    508651                         ":/vm_pause_32px.png", ":/pause_16px.png",
    509652                         ":/vm_pause_disabled_32px.png", ":/pause_disabled_16px.png")
    510653    {
    511         setShortcut(gSS->keySequence(UISelectorShortcuts::PauseVMShortcut));
    512         retranslateUi();
    513     }
    514 
    515 protected:
    516 
    517     void retranslateUi()
    518     {
    519         setText(QApplication::translate("UIActionPool", "&Pause"));
     654        retranslateUi();
     655    }
     656
     657protected:
     658
     659    QString shortcutExtraDataID() const
     660    {
     661        return QString("PauseVM");
     662    }
     663
     664    QKeySequence defaultShortcut(UIActionPoolType) const
     665    {
     666        return QKeySequence("Ctrl+P");
     667    }
     668
     669    void retranslateUi()
     670    {
     671        setName(QApplication::translate("UIActionPool", "&Pause"));
    520672        setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the selected virtual machines"));
    521673    }
     
    528680public:
    529681
    530     UIActionSimpleCommonReset(QObject *pParent)
     682    UIActionSimpleCommonReset(UIActionPool *pParent)
    531683        : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
    532684    {
    533         setShortcut(gSS->keySequence(UISelectorShortcuts::ResetVMShortcut));
    534         retranslateUi();
    535     }
    536 
    537 protected:
    538 
    539     void retranslateUi()
    540     {
    541         setText(QApplication::translate("UIActionPool", "&Reset"));
     685        retranslateUi();
     686    }
     687
     688protected:
     689
     690    QString shortcutExtraDataID() const
     691    {
     692        return QString("ResetVM");
     693    }
     694
     695    QKeySequence defaultShortcut(UIActionPoolType) const
     696    {
     697        return QKeySequence("Ctrl+T");
     698    }
     699
     700    void retranslateUi()
     701    {
     702        setName(QApplication::translate("UIActionPool", "&Reset"));
    542703        setStatusTip(QApplication::translate("UIActionPool", "Reset the selected virtual machines"));
    543704    }
     
    550711public:
    551712
    552     UIActionSimpleCommonDiscard(QObject *pParent)
     713    UIActionSimpleCommonDiscard(UIActionPool *pParent)
    553714        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    554715                         ":/vm_discard_32px.png", ":/discard_16px.png",
    555716                         ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png")
    556717    {
    557         setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut));
    558         retranslateUi();
    559     }
    560 
    561 protected:
     718        retranslateUi();
     719    }
     720
     721protected:
     722
     723    QString shortcutExtraDataID() const
     724    {
     725        return QString("DiscardVM");
     726    }
     727
     728    QKeySequence defaultShortcut(UIActionPoolType) const
     729    {
     730        return QKeySequence("Ctrl+J");
     731    }
    562732
    563733    void retranslateUi()
    564734    {
    565735        setIconText(QApplication::translate("UIActionPool", "Discard"));
    566         setText(QApplication::translate("UIActionPool", "D&iscard saved state..."));
     736        setName(QApplication::translate("UIActionPool", "D&iscard saved state..."));
    567737        setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machines"));
    568738        setToolTip(text().remove('&').remove('.') +
     
    577747public:
    578748
    579     UIActionSimpleCommonRefresh(QObject *pParent)
     749    UIActionSimpleCommonRefresh(UIActionPool *pParent)
    580750        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    581751                         ":/refresh_32px.png", ":/refresh_16px.png",
    582752                         ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
    583753    {
    584         setShortcut(gSS->keySequence(UISelectorShortcuts::RefreshVMShortcut));
    585         retranslateUi();
    586     }
    587 
    588 protected:
    589 
    590     void retranslateUi()
    591     {
    592         setText(QApplication::translate("UIActionPool", "Re&fresh..."));
     754        retranslateUi();
     755    }
     756
     757protected:
     758
     759    QString shortcutExtraDataID() const
     760    {
     761        return QString("RefreshVM");
     762    }
     763
     764    void retranslateUi()
     765    {
     766        setName(QApplication::translate("UIActionPool", "Re&fresh..."));
    593767        setStatusTip(QApplication::translate("UIActionPool", "Refresh the accessibility state of the selected virtual machine"));
    594768    }
     
    601775public:
    602776
    603     UIActionSimpleCommonShowInFileManager(QObject *pParent)
     777    UIActionSimpleCommonShowInFileManager(UIActionPool *pParent)
    604778        : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
    605779    {
    606         setShortcut(gSS->keySequence(UISelectorShortcuts::ShowVMInFileManagerShortcut));
    607         retranslateUi();
    608     }
    609 
    610 protected:
     780        retranslateUi();
     781    }
     782
     783protected:
     784
     785    QString shortcutExtraDataID() const
     786    {
     787        return QString("ShowVMInFileManager");
     788    }
    611789
    612790    void retranslateUi()
    613791    {
    614792#if defined(Q_WS_MAC)
    615         setText(QApplication::translate("UIActionPool", "Show in Finder"));
     793        setName(QApplication::translate("UIActionPool", "Show in Finder"));
    616794        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Finder"));
    617795#elif defined(Q_WS_WIN)
    618         setText(QApplication::translate("UIActionPool", "Show in Explorer"));
     796        setName(QApplication::translate("UIActionPool", "Show in Explorer"));
    619797        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Explorer"));
    620798#else
    621         setText(QApplication::translate("UIActionPool", "Show in File Manager"));
     799        setName(QApplication::translate("UIActionPool", "Show in File Manager"));
    622800        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in the File Manager"));
    623801#endif
     
    631809public:
    632810
    633     UIActionSimpleCommonCreateShortcut(QObject *pParent)
     811    UIActionSimpleCommonCreateShortcut(UIActionPool *pParent)
    634812        : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
    635813    {
    636         setShortcut(gSS->keySequence(UISelectorShortcuts::CreateVMAliasShortcut));
    637         retranslateUi();
    638     }
    639 
    640 protected:
     814        retranslateUi();
     815    }
     816
     817protected:
     818
     819    QString shortcutExtraDataID() const
     820    {
     821        return QString("CreateVMAlias");
     822    }
    641823
    642824    void retranslateUi()
    643825    {
    644826#if defined(Q_WS_MAC)
    645         setText(QApplication::translate("UIActionPool", "Create Alias on Desktop"));
     827        setName(QApplication::translate("UIActionPool", "Create Alias on Desktop"));
    646828        setStatusTip(QApplication::translate("UIActionPool", "Creates an alias file to the VirtualBox Machine Definition file on your desktop"));
    647829#else
    648         setText(QApplication::translate("UIActionPool", "Create Shortcut on Desktop"));
     830        setName(QApplication::translate("UIActionPool", "Create Shortcut on Desktop"));
    649831        setStatusTip(QApplication::translate("UIActionPool", "Creates an shortcut file to the VirtualBox Machine Definition file on your desktop"));
    650832#endif
     
    658840public:
    659841
    660     UIActionSimpleMachineSortParent(QObject *pParent)
     842    UIActionSimpleMachineSortParent(UIActionPool *pParent)
    661843        : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
    662844    {
    663         setShortcut(gSS->keySequence(UISelectorShortcuts::SortParentGroup));
    664         retranslateUi();
    665     }
    666 
    667 protected:
    668 
    669     void retranslateUi()
    670     {
    671         setText(QApplication::translate("UIActionPool", "Sort"));
     845        retranslateUi();
     846    }
     847
     848protected:
     849
     850    QString shortcutExtraDataID() const
     851    {
     852        return QString("SortParentGroup");
     853    }
     854
     855    void retranslateUi()
     856    {
     857        setName(QApplication::translate("UIActionPool", "Sort"));
    672858        setStatusTip(QApplication::translate("UIActionPool", "Sort the group of the first selected machine alphabetically"));
    673859    }
     
    681867public:
    682868
    683     UIActionMenuClose(QObject *pParent)
     869    UIActionMenuClose(UIActionPool *pParent)
    684870        : UIActionMenu(pParent, ":/exit_16px.png")
    685871    {
     
    691877    void retranslateUi()
    692878    {
    693         menu()->setTitle(QApplication::translate("UIActionPool", "&Close"));
     879        setName(QApplication::translate("UIActionPool", "&Close"));
    694880    }
    695881};
     
    701887public:
    702888
    703     UIActionSimpleSave(QObject *pParent)
     889    UIActionSimpleSave(UIActionPool *pParent)
    704890        : UIActionSimple(pParent, ":/state_saved_16px.png")
    705891    {
    706         setShortcut(gSS->keySequence(UISelectorShortcuts::SaveVMShortcut));
    707         retranslateUi();
    708     }
    709 
    710 protected:
    711 
    712     void retranslateUi()
    713     {
    714         setText(QApplication::translate("UIActionPool", "Save State"));
     892        retranslateUi();
     893    }
     894
     895protected:
     896
     897    QString shortcutExtraDataID() const
     898    {
     899        return QString("SaveVM");
     900    }
     901
     902    QKeySequence defaultShortcut(UIActionPoolType) const
     903    {
     904        return QKeySequence("Ctrl+V");
     905    }
     906
     907    void retranslateUi()
     908    {
     909        setName(QApplication::translate("UIActionPool", "Save State"));
    715910        setStatusTip(QApplication::translate("UIActionPool", "Save the machine state of the selected virtual machines"));
    716911    }
     
    723918public:
    724919
    725     UIActionSimpleACPIShutdown(QObject *pParent)
     920    UIActionSimpleACPIShutdown(UIActionPool *pParent)
    726921        : UIActionSimple(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")
    727922    {
    728         setShortcut(gSS->keySequence(UISelectorShortcuts::ACPIShutdownVMShortcut));
    729         retranslateUi();
    730     }
    731 
    732 protected:
    733 
    734     void retranslateUi()
    735     {
    736         setText(QApplication::translate("UIActionPool", "ACPI Sh&utdown"));
     923        retranslateUi();
     924    }
     925
     926protected:
     927
     928    QString shortcutExtraDataID() const
     929    {
     930        return QString("ACPIShutdownVM");
     931    }
     932
     933    QKeySequence defaultShortcut(UIActionPoolType) const
     934    {
     935        return QKeySequence("Ctrl+H");
     936    }
     937
     938    void retranslateUi()
     939    {
     940        setName(QApplication::translate("UIActionPool", "ACPI Sh&utdown"));
    737941        setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Power Button press event to the selected virtual machines"));
    738942    }
     
    745949public:
    746950
    747     UIActionSimplePowerOff(QObject *pParent)
     951    UIActionSimplePowerOff(UIActionPool *pParent)
    748952        : UIActionSimple(pParent, ":/poweroff_16px.png", ":/poweroff_disabled_16px.png")
    749953    {
    750         setShortcut(gSS->keySequence(UISelectorShortcuts::PowerOffVMShortcut));
    751         retranslateUi();
    752     }
    753 
    754 protected:
    755 
    756     void retranslateUi()
    757     {
    758         setText(QApplication::translate("UIActionPool", "Po&wer Off"));
     954        retranslateUi();
     955    }
     956
     957protected:
     958
     959    QString shortcutExtraDataID() const
     960    {
     961        return QString("PowerOffVM");
     962    }
     963
     964    QKeySequence defaultShortcut(UIActionPoolType) const
     965    {
     966        return QKeySequence("Ctrl+F");
     967    }
     968
     969    void retranslateUi()
     970    {
     971        setName(QApplication::translate("UIActionPool", "Po&wer Off"));
    759972        setStatusTip(QApplication::translate("UIActionPool", "Power off the selected virtual machines"));
    760973    }
    761974};
    762975
     976
     977QString UIActionPoolSelector::shortcutsExtraDataID() const
     978{
     979    return GUI_Input_SelectorShortcuts;
     980}
    763981
    764982void UIActionPoolSelector::createActions()
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h

    r44354 r44434  
    8383    UIActionPoolSelector() : UIActionPool(UIActionPoolType_Selector) {}
    8484
     85    /* Helper: Shortcuts stuff: */
     86    QString shortcutsExtraDataID() const;
     87
    8588    /* Helpers: Prepare stuff: */
    8689    void createActions();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r44354 r44434  
    4949#include "UIToolBar.h"
    5050#include "UIVMLogViewer.h"
    51 #include "UISelectorShortcuts.h"
    5251#include "UIDesktopServices.h"
    5352#include "UIGlobalSettingsExtension.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp

    r43920 r44434  
    3939#include "UIToolBar.h"
    4040#include "UIVirtualBoxEventHandler.h"
    41 #include "UISelectorShortcuts.h"
    4241#include "UIConverter.h"
    4342
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