VirtualBox

Changeset 52203 in vbox


Ignore:
Timestamp:
Jul 25, 2014 11:46:23 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95263
Message:

FE/Qt: 7462: Runtime UI: Menu-bar, menu cleanup/rework (part 09).

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

Legend:

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

    r52190 r52203  
    449449        case RuntimeMenuMachineActionType_TakeScreenshot:    strResult = "TakeScreenshot"; break;
    450450        case RuntimeMenuMachineActionType_InformationDialog: strResult = "InformationDialog"; break;
     451        case RuntimeMenuMachineActionType_Keyboard:          strResult = "Keyboard"; break;
    451452        case RuntimeMenuMachineActionType_KeyboardSettings:  strResult = "KeyboardSettings"; break;
     453        case RuntimeMenuMachineActionType_Mouse:             strResult = "Mouse"; break;
    452454        case RuntimeMenuMachineActionType_MouseIntegration:  strResult = "MouseIntegration"; break;
    453455        case RuntimeMenuMachineActionType_TypeCAD:           strResult = "TypeCAD"; break;
     
    483485    keys << "TakeScreenshot";    values << RuntimeMenuMachineActionType_TakeScreenshot;
    484486    keys << "InformationDialog"; values << RuntimeMenuMachineActionType_InformationDialog;
     487    keys << "Keyboard";          values << RuntimeMenuMachineActionType_Keyboard;
    485488    keys << "KeyboardSettings";  values << RuntimeMenuMachineActionType_KeyboardSettings;
     489    keys << "Mouse";             values << RuntimeMenuMachineActionType_Mouse;
    486490    keys << "MouseIntegration";  values << RuntimeMenuMachineActionType_MouseIntegration;
    487491    keys << "TypeCAD";           values << RuntimeMenuMachineActionType_TypeCAD;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r52190 r52203  
    394394    RuntimeMenuMachineActionType_TakeScreenshot    = RT_BIT(2),
    395395    RuntimeMenuMachineActionType_InformationDialog = RT_BIT(3),
    396     RuntimeMenuMachineActionType_KeyboardSettings  = RT_BIT(4),
    397     RuntimeMenuMachineActionType_MouseIntegration  = RT_BIT(5),
    398     RuntimeMenuMachineActionType_TypeCAD           = RT_BIT(6),
     396    RuntimeMenuMachineActionType_Keyboard          = RT_BIT(4),
     397    RuntimeMenuMachineActionType_KeyboardSettings  = RT_BIT(5),
     398    RuntimeMenuMachineActionType_Mouse             = RT_BIT(6),
     399    RuntimeMenuMachineActionType_MouseIntegration  = RT_BIT(7),
     400    RuntimeMenuMachineActionType_TypeCAD           = RT_BIT(8),
    399401#ifdef Q_WS_X11
    400     RuntimeMenuMachineActionType_TypeCABS          = RT_BIT(7),
     402    RuntimeMenuMachineActionType_TypeCABS          = RT_BIT(9),
    401403#endif /* Q_WS_X11 */
    402     RuntimeMenuMachineActionType_Pause             = RT_BIT(8),
    403     RuntimeMenuMachineActionType_Reset             = RT_BIT(9),
    404     RuntimeMenuMachineActionType_SaveState         = RT_BIT(10),
    405     RuntimeMenuMachineActionType_Shutdown          = RT_BIT(11),
    406     RuntimeMenuMachineActionType_PowerOff          = RT_BIT(12),
     404    RuntimeMenuMachineActionType_Pause             = RT_BIT(10),
     405    RuntimeMenuMachineActionType_Reset             = RT_BIT(11),
     406    RuntimeMenuMachineActionType_SaveState         = RT_BIT(12),
     407    RuntimeMenuMachineActionType_Shutdown          = RT_BIT(13),
     408    RuntimeMenuMachineActionType_PowerOff          = RT_BIT(14),
    407409#ifndef Q_WS_MAC
    408     RuntimeMenuMachineActionType_Close             = RT_BIT(13),
     410    RuntimeMenuMachineActionType_Close             = RT_BIT(15),
    409411#endif /* !Q_WS_MAC */
    410412    RuntimeMenuMachineActionType_All               = 0xFFFF
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r52202 r52203  
    651651bool UIActionPool::processHotKey(const QKeySequence &key)
    652652{
    653     /* Get the list of keys: */
    654     QList<int> keys = m_pool.keys();
    655653    /* Iterate through the whole list of keys: */
    656     for (int i = 0; i < keys.size(); ++i)
     654    foreach (const int &iKey, m_pool.keys())
    657655    {
    658656        /* Get current action: */
    659         UIAction *pAction = m_pool[keys[i]];
     657        UIAction *pAction = m_pool.value(iKey);
    660658        /* Skip menus/separators: */
    661659        if (pAction->type() == UIActionType_Menu)
    662660            continue;
    663         /* Get the hot key of the current action: */
    664         QString strHotKey = VBoxGlobal::extractKeyFromActionText(pAction->text());
     661        /* Get the hot-key of the current action: */
     662        const QString strHotKey = gShortcutPool->shortcut(this, pAction).toString();
    665663        if (pAction->isEnabled() && pAction->isVisible() && !strHotKey.isEmpty())
    666664        {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r52202 r52203  
    34573457}
    34583458
    3459 /* static */
    3460 QString VBoxGlobal::extractKeyFromActionText (const QString &aText)
    3461 {
    3462     QString key;
    3463 #ifdef Q_WS_MAC
    3464     QRegExp re (".* \\(Host\\+(.+)\\)");
    3465 #else
    3466     QRegExp re (".* \\t\\Host\\+(.+)");
    3467 #endif
    3468     if (re.exactMatch (aText))
    3469         key = re.cap (1);
    3470     return key;
    3471 }
    3472 
    34733459/**
    34743460 * Joins two pixmaps horizontally with 2px space between them and returns the
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r51666 r52203  
    323323
    324324    static QString insertKeyToActionText (const QString &aText, const QString &aKey);
    325     static QString extractKeyFromActionText (const QString &aText);
    326325
    327326    static QPixmap joinPixmaps (const QPixmap &aPM1, const QPixmap &aPM2);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r52202 r52203  
    15261526        m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = (RuntimeMenuMachineActionType)
    15271527            (m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] | RuntimeMenuMachineActionType_SettingsDialog);
     1528        m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = (RuntimeMenuMachineActionType)
     1529            (m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] | RuntimeMenuMachineActionType_KeyboardSettings);
    15281530        m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (RuntimeMenuDevicesActionType)
    15291531            (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | RuntimeMenuDevicesActionType_HardDrivesSettings);
     
    16781680    bool fSeparator2 = false;
    16791681
    1680     /* 'Keyboard Settings' action: */
    1681     const bool fAllowToShowActionKeyboardSettings = isAllowedInMenuMachine(RuntimeMenuMachineActionType_KeyboardSettings);
    1682     action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)->setEnabled(fAllowToShowActionKeyboardSettings);
    1683     if (fAllowToShowActionKeyboardSettings)
    1684     {
    1685 //        pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings));
     1682    /* 'Keyboard' submenu: */
     1683    const bool fAllowToShowActionKeyboard = isAllowedInMenuMachine(RuntimeMenuMachineActionType_Keyboard);
     1684    action(UIActionIndexRT_M_Machine_M_Keyboard)->setEnabled(fAllowToShowActionKeyboard);
     1685    if (fAllowToShowActionKeyboard)
     1686    {
     1687//        pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Keyboard));
    16861688//        fSeparator2 = true;
    16871689    }
     1690    updateMenuMachineKeyboard();
     1691
     1692    /* 'Mouse' submenu: */
     1693    const bool fAllowToShowActionMouse = isAllowedInMenuMachine(RuntimeMenuMachineActionType_Mouse);
     1694    action(UIActionIndexRT_M_Machine_M_Mouse)->setEnabled(fAllowToShowActionMouse);
     1695    if (fAllowToShowActionMouse)
     1696    {
     1697//        pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Mouse));
     1698//        fSeparator2 = true;
     1699    }
     1700    updateMenuMachineMouse();
    16881701
    16891702    /* 'Mouse Integration' action: */
     
    17931806    pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Close));
    17941807    action(UIActionIndexRT_M_Machine_S_Close)->setEnabled(fAllowToShowActionClose);
     1808}
     1809
     1810void UIActionPoolRuntime::updateMenuMachineKeyboard()
     1811{
     1812    /* Get corresponding menu: */
     1813    QMenu *pMenu = action(UIActionIndexRT_M_Machine_M_Keyboard)->menu();
     1814    AssertPtrReturnVoid(pMenu);
     1815    /* Clear contents: */
     1816    pMenu->clear();
     1817
     1818    /* 'Keyboard Settings' action: */
     1819    const bool fAllowToShowActionKeyboardSettings = isAllowedInMenuMachine(RuntimeMenuMachineActionType_KeyboardSettings);
     1820    action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)->setEnabled(fAllowToShowActionKeyboardSettings);
     1821    if (fAllowToShowActionKeyboardSettings)
     1822        pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings));
     1823}
     1824
     1825void UIActionPoolRuntime::updateMenuMachineMouse()
     1826{
     1827    /* Get corresponding menu: */
     1828    QMenu *pMenu = action(UIActionIndexRT_M_Machine_M_Mouse)->menu();
     1829    AssertPtrReturnVoid(pMenu);
     1830    /* Clear contents: */
     1831    pMenu->clear();
     1832
     1833    /* 'Machine Integration' action: */
     1834    const bool fAllowToShowActionMouseIntegration = isAllowedInMenuMachine(RuntimeMenuMachineActionType_MouseIntegration);
     1835    action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration)->setEnabled(fAllowToShowActionMouseIntegration);
     1836    if (fAllowToShowActionMouseIntegration)
     1837        pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration));
    17951838}
    17961839
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r52202 r52203  
    191191    /** Update 'Machine' menu routine. */
    192192    void updateMenuMachine();
     193    /** Update 'Machine' : 'Keyboard' menu routine. */
     194    void updateMenuMachineKeyboard();
     195    /** Update 'Machine' : 'Mouse' menu routine. */
     196    void updateMenuMachineMouse();
    193197    /** Update 'View' menu routine. */
    194198    void updateMenuView();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r52202 r52203  
    767767    bool fIsVRDEServerAvailable = !server.isNull();
    768768    /* Show/Hide VRDE action depending on VRDE server availability status: */
     769    // TODO: Is this status can be changed at runtime?
     770    //       Because if no => the place for that stuff is in prepareActions().
    769771    actionPool()->action(UIActionIndexRT_M_Devices_T_VRDEServer)->setVisible(fIsVRDEServerAvailable);
    770772    /* Check/Uncheck VRDE action depending on VRDE server activity status: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r52202 r52203  
    2828#include "UIMachineWindowFullscreen.h"
    2929#include "UIMultiScreenLayout.h"
     30#include "UIShortcutPool.h"
    3031#include "QIMenu.h"
    3132#ifdef Q_WS_MAC
     
    7172    }
    7273
    73     /* Take the toggle hot key from the menu item.
    74      * Since VBoxGlobal::extractKeyFromActionText gets exactly
    75      * the linked key without the 'Host+' part we are adding it here. */
    76     QString hotKey = QString("Host+%1")
    77         .arg(VBoxGlobal::extractKeyFromActionText(actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen)->text()));
    78     Assert(!hotKey.isEmpty());
    79 
    8074    /* Show the info message. */
    81     if (!msgCenter().confirmGoingFullscreen(hotKey))
     75    const UIShortcut &shortcut =
     76            gShortcutPool->shortcut(actionPool()->shortcutsExtraDataID(),
     77                                    actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen)->shortcutExtraDataID());
     78    const QString strHotKey = QString("Host+%1").arg(shortcut.toString());
     79    if (!msgCenter().confirmGoingFullscreen(strHotKey))
    8280        return false;
    8381
     
    467465    UIMachineLogic::prepareActionConnections();
    468466
    469     /* "View" actions connections: */
     467    /* Prepare 'View' actions connections: */
    470468    connect(actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen), SIGNAL(triggered(bool)),
    471469            this, SLOT(sltChangeVisualStateToNormal()));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r52202 r52203  
    132132}
    133133
    134 void UIMachineLogicNormal::sltPrepareHardDisksMenu()
    135 {
    136     QMenu *pMenu = qobject_cast<QMenu*>(sender());
    137     AssertMsg(pMenu, ("This slot should be called only on Hard Disks menu show!\n"));
    138     pMenu->clear();
    139     pMenu->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings));
    140 }
    141 
    142 void UIMachineLogicNormal::sltPrepareSharedFoldersMenu()
    143 {
    144     QMenu *menu = qobject_cast<QMenu*>(sender());
    145     AssertMsg(menu, ("This slot should be called only on Shared Folders menu show!\n"));
    146     menu->clear();
    147     menu->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings));
    148 }
    149 
    150 void UIMachineLogicNormal::sltPrepareVideoCaptureMenu()
    151 {
    152     QMenu *pMenu = qobject_cast<QMenu*>(sender());
    153     AssertMsg(pMenu, ("This slot should be called only on Video Capture menu show!\n"));
    154     pMenu->clear();
    155     pMenu->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_VideoCapture_S_Settings));
    156     pMenu->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_VideoCapture_T_Start));
    157 }
    158 
    159 void UIMachineLogicNormal::sltPrepareKeyboardMenu()
    160 {
    161     QMenu *pMenu = qobject_cast<QMenu*>(sender());
    162     AssertMsg(pMenu, ("This slot should be called only on Keyboard menu show!\n"));
    163     pMenu->clear();
    164     pMenu->addAction(actionPool()->action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings));
    165 }
    166 
    167 void UIMachineLogicNormal::sltPrepareMouseIntegrationMenu()
    168 {
    169     QMenu *menu = qobject_cast<QMenu*>(sender());
    170     AssertMsg(menu, ("This slot should be called only on Mouse Integration Menu show!\n"));
    171     menu->clear();
    172     menu->addAction(actionPool()->action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration));
    173 }
    174 
    175134void UIMachineLogicNormal::prepareActionConnections()
    176135{
     
    178137    UIMachineLogic::prepareActionConnections();
    179138
    180     /* "View" actions connections: */
    181     connect(actionPool(), SIGNAL(sigNotifyAboutTriggeringViewResize(int, const QSize&)),
    182             this, SLOT(sltHandleActionTriggerViewResize(int, const QSize&)));
     139    /* Prepare 'View' actions connections: */
    183140    connect(actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen), SIGNAL(triggered(bool)),
    184141            this, SLOT(sltChangeVisualStateToFullscreen()));
     
    191148    connect(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility), SIGNAL(triggered(bool)),
    192149            this, SLOT(sltToggleStatusBar()));
    193 
    194     /* "Device" actions connections: */
    195     connect(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives)->menu(), SIGNAL(aboutToShow()),
    196             this, SLOT(sltPrepareHardDisksMenu()));
    197     connect(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders)->menu(), SIGNAL(aboutToShow()),
    198             this, SLOT(sltPrepareSharedFoldersMenu()));
    199     connect(actionPool()->action(UIActionIndexRT_M_Devices_M_VideoCapture)->menu(), SIGNAL(aboutToShow()),
    200             this, SLOT(sltPrepareVideoCaptureMenu()));
    201     connect(actionPool()->action(UIActionIndexRT_M_Machine_M_Keyboard)->menu(), SIGNAL(aboutToShow()),
    202             this, SLOT(sltPrepareKeyboardMenu()));
    203     connect(actionPool()->action(UIActionIndexRT_M_Machine_M_Mouse)->menu(), SIGNAL(aboutToShow()),
    204             this, SLOT(sltPrepareMouseIntegrationMenu()));
     150    connect(actionPool(), SIGNAL(sigNotifyAboutTriggeringViewResize(int, const QSize&)),
     151            this, SLOT(sltHandleActionTriggerViewResize(int, const QSize&)));
    205152}
    206153
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h

    r52184 r52203  
    4545    void sltHandleActionTriggerViewResize(int iIndex, const QSize &size);
    4646
    47     /* Devices menu functionality: */
    48     void sltPrepareHardDisksMenu();
    49     void sltPrepareSharedFoldersMenu();
    50     void sltPrepareVideoCaptureMenu();
    51     void sltPrepareKeyboardMenu();
    52     void sltPrepareMouseIntegrationMenu();
    53 
    5447private:
    5548
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r52202 r52203  
    148148    switch (indicatorType)
    149149    {
    150         case IndicatorType_HardDisks:     pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives);       break;
    151         case IndicatorType_OpticalDisks:  pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices);   break;
    152         case IndicatorType_FloppyDisks:   pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices);    break;
    153         case IndicatorType_USB:           pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices);       break;
    154         case IndicatorType_Network:       pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_Network);          break;
    155         case IndicatorType_SharedFolders: pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders);    break;
    156         case IndicatorType_Display:       pAction = actionPool()->action(UIActionIndexRT_M_ViewPopup);                  break;
    157         case IndicatorType_VideoCapture:  pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_VideoCapture);     break;
    158         case IndicatorType_Mouse:         pAction = actionPool()->action(UIActionIndexRT_M_Machine_M_Mouse);            break;
    159         case IndicatorType_Keyboard:      pAction = actionPool()->action(UIActionIndexRT_M_Machine_M_Keyboard);         break;
     150        case IndicatorType_HardDisks:     pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives);     break;
     151        case IndicatorType_OpticalDisks:  pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices); break;
     152        case IndicatorType_FloppyDisks:   pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices);  break;
     153        case IndicatorType_USB:           pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices);     break;
     154        case IndicatorType_Network:       pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_Network);        break;
     155        case IndicatorType_SharedFolders: pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders);  break;
     156        case IndicatorType_Display:       pAction = actionPool()->action(UIActionIndexRT_M_ViewPopup);                break;
     157        case IndicatorType_VideoCapture:  pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_VideoCapture);   break;
     158        case IndicatorType_Mouse:         pAction = actionPool()->action(UIActionIndexRT_M_Machine_M_Mouse);          break;
     159        case IndicatorType_Keyboard:      pAction = actionPool()->action(UIActionIndexRT_M_Machine_M_Keyboard);       break;
    160160        default: break;
    161161    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp

    r52202 r52203  
    2828#include "UIMachineLogicScale.h"
    2929#include "UIMachineWindow.h"
     30#include "UIShortcutPool.h"
    3031#ifndef Q_WS_MAC
    3132# include "QIMenu.h"
     
    4445bool UIMachineLogicScale::checkAvailability()
    4546{
    46     /* Take the toggle hot key from the menu item.
    47      * Since VBoxGlobal::extractKeyFromActionText gets exactly
    48      * the linked key without the 'Host+' part we are adding it here. */
    49     QString strHotKey = QString("Host+%1")
    50         .arg(VBoxGlobal::extractKeyFromActionText(actionPool()->action(UIActionIndexRT_M_View_T_Scale)->text()));
    51     Assert(!strHotKey.isEmpty());
    52 
    5347    /* Show the info message. */
     48    const UIShortcut &shortcut =
     49            gShortcutPool->shortcut(actionPool()->shortcutsExtraDataID(),
     50                                    actionPool()->action(UIActionIndexRT_M_View_T_Scale)->shortcutExtraDataID());
     51    const QString strHotKey = QString("Host+%1").arg(shortcut.toString());
    5452    if (!msgCenter().confirmGoingScale(strHotKey))
    5553        return false;
     
    9896    UIMachineLogic::prepareActionConnections();
    9997
    100     /* "View" actions connections: */
     98    /* Prepare 'View' actions connections: */
    10199    connect(actionPool()->action(UIActionIndexRT_M_View_T_Scale), SIGNAL(triggered(bool)),
    102100            this, SLOT(sltChangeVisualStateToNormal()));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r52202 r52203  
    3131#include "UIMachineWindowSeamless.h"
    3232#include "UIMultiScreenLayout.h"
     33#include "UIShortcutPool.h"
    3334#ifndef Q_WS_MAC
    3435# include "QIMenu.h"
     
    7172    }
    7273
    73     /* Take the toggle hot key from the menu item.
    74      * Since VBoxGlobal::extractKeyFromActionText gets exactly
    75      * the linked key without the 'Host+' part we are adding it here. */
    76     QString hotKey = QString("Host+%1")
    77         .arg(VBoxGlobal::extractKeyFromActionText(actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->text()));
    78     Assert(!hotKey.isEmpty());
    79 
    8074    /* Show the info message. */
    81     if (!msgCenter().confirmGoingSeamless(hotKey))
     75    const UIShortcut &shortcut =
     76            gShortcutPool->shortcut(actionPool()->shortcutsExtraDataID(),
     77                                    actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->shortcutExtraDataID());
     78    const QString strHotKey = QString("Host+%1").arg(shortcut.toString());
     79    if (!msgCenter().confirmGoingSeamless(strHotKey))
    8280        return false;
    8381
     
    229227    UIMachineLogic::prepareActionConnections();
    230228
    231     /* "View" actions connections: */
     229    /* Prepare 'View' actions connections: */
    232230    connect(actionPool()->action(UIActionIndexRT_M_View_T_Seamless), SIGNAL(triggered(bool)),
    233231            this, SLOT(sltChangeVisualStateToNormal()));
Note: See TracChangeset for help on using the changeset viewer.

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