VirtualBox

Changeset 19684 in vbox


Ignore:
Timestamp:
May 14, 2009 10:17:06 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 3865: Host key shortcut for installing Guest Additions - Implemented.

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

Legend:

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

    r19191 r19684  
    34173417    {
    34183418        if (QMenu *menu = pAction->menu())
    3419             return processHotKey (aKey, menu->actions());
    3420 
    3421         QString hotkey = VBoxGlobal::extractKeyFromActionText (pAction->text());
    3422         if (pAction->isEnabled() && !hotkey.isEmpty())
    3423         {
    3424             if (aKey.matches (QKeySequence (hotkey)) == QKeySequence::ExactMatch)
    3425             {
    3426                 /*
    3427                  *  we asynchronously post a special event instead of calling
    3428                  *  pAction->trigger() directly, to let key presses and
    3429                  *  releases be processed correctly by Qt first. Note: we
    3430                  *  assume that nobody will delete the menu item corresponding
    3431                  *  to the key sequence, so that the pointer to menu data
    3432                  *  posted along with the event will remain valid in the event
    3433                  *  handler, at least until the main window is closed.
    3434                  */
    3435                 QApplication::postEvent (this,
    3436                                          new ActivateMenuEvent (pAction));
     3419        {
     3420            /* Process recursively for each sub-menu */
     3421            if (processHotKey (aKey, menu->actions()))
    34373422                return true;
     3423        }
     3424        else
     3425        {
     3426            QString hotkey = VBoxGlobal::extractKeyFromActionText (pAction->text());
     3427            if (pAction->isEnabled() && !hotkey.isEmpty())
     3428            {
     3429                if (aKey.matches (QKeySequence (hotkey)) == QKeySequence::ExactMatch)
     3430                {
     3431                    /* We asynchronously post a special event instead of calling
     3432                     * pAction->trigger() directly, to let key presses and
     3433                     * releases be processed correctly by Qt first.
     3434                     * Note: we assume that nobody will delete the menu item
     3435                     * corresponding to the key sequence, so that the pointer to
     3436                     * menu data posted along with the event will remain valid in
     3437                     * the event handler, at least until the main window is closed. */
     3438                    QApplication::postEvent (this, new ActivateMenuEvent (pAction));
     3439                    return true;
     3440                }
    34383441            }
    34393442        }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r19239 r19684  
    17131713        tr ("Open the dialog to operate on shared folders"));
    17141714
    1715     mDevicesInstallGuestToolsAction->setText (tr ("&Install Guest Additions..."));
     1715    mDevicesInstallGuestToolsAction->setText (VBoxGlobal::insertKeyToActionText (tr ("&Install Guest Additions..."),
     1716                                                                                 "D"));
    17161717    mDevicesInstallGuestToolsAction->setStatusTip (
    17171718        tr ("Mount the Guest Additions installation image"));
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