VirtualBox

Changeset 61333 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 31, 2016 1:25:21 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107628
Message:

FE/Qt: X11: Yet another Qt5 migration consequence: Add the Selector UI actions into internal QMainWindow action list to be able to handle their shortcuts under Unity.

File:
1 edited

Legend:

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

    r61248 r61333  
    12881288#else /* !VBOX_WS_MAC */
    12891289
     1290# ifdef VBOX_WS_X11
     1291    // WORKAROUND:
     1292    // There is an issue under Ubuntu which uses special kind of QPA
     1293    // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar
     1294    // directly to Ubuntu Application menu-bar. In that case action
     1295    // shortcuts are not being handled by the Qt and that way ignored.
     1296    // As a workaround we can add those actions into QMainWindow as well.
     1297    addAction(actionPool()->action(UIActionIndex_M_Application_S_Preferences));
     1298    addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance));
     1299    addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance));
     1300#  ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
     1301    addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager));
     1302#  endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
     1303    addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowMediumManager));
     1304#  ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     1305    addAction(actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager));
     1306    addAction(actionPool()->action(UIActionIndex_M_Application_S_CheckForUpdates));
     1307#  endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
     1308    addAction(actionPool()->action(UIActionIndex_M_Application_S_ResetWarnings));
     1309    addAction(actionPool()->action(UIActionIndexST_M_File_S_Close));
     1310# endif /* VBOX_WS_X11 */
     1311
    12901312    /* 'Preferences' action goes to 'File' menu: */
    12911313    pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_Preferences));
     
    13251347        return;
    13261348
     1349#ifdef VBOX_WS_X11
     1350    // WORKAROUND:
     1351    // There is an issue under Ubuntu which uses special kind of QPA
     1352    // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar
     1353    // directly to Ubuntu Application menu-bar. In that case action
     1354    // shortcuts are not being handled by the Qt and that way ignored.
     1355    // As a workaround we can add those actions into QMainWindow as well.
     1356    addAction(actionPool()->action(UIActionIndexST_M_Group_S_New));
     1357    addAction(actionPool()->action(UIActionIndexST_M_Group_S_Add));
     1358    addAction(actionPool()->action(UIActionIndexST_M_Group_S_Rename));
     1359    addAction(actionPool()->action(UIActionIndexST_M_Group_S_Remove));
     1360    addAction(actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow));
     1361    addAction(actionPool()->action(UIActionIndexST_M_Group_T_Pause));
     1362    addAction(actionPool()->action(UIActionIndexST_M_Group_S_Reset));
     1363    addAction(actionPool()->action(UIActionIndexST_M_Group_S_Discard));
     1364    addAction(actionPool()->action(UIActionIndexST_M_Group_S_ShowLogDialog));
     1365    addAction(actionPool()->action(UIActionIndexST_M_Group_S_Refresh));
     1366    addAction(actionPool()->action(UIActionIndexST_M_Group_S_ShowInFileManager));
     1367    addAction(actionPool()->action(UIActionIndexST_M_Group_S_CreateShortcut));
     1368    addAction(actionPool()->action(UIActionIndexST_M_Group_S_Sort));
     1369#endif /* VBOX_WS_X11 */
     1370
    13271371    /* Populate Machine-menu: */
    13281372    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_S_New));
     
    13671411    if (!pMenu->isEmpty())
    13681412        return;
     1413
     1414#ifdef VBOX_WS_X11
     1415    // WORKAROUND:
     1416    // There is an issue under Ubuntu which uses special kind of QPA
     1417    // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar
     1418    // directly to Ubuntu Application menu-bar. In that case action
     1419    // shortcuts are not being handled by the Qt and that way ignored.
     1420    // As a workaround we can add those actions into QMainWindow as well.
     1421    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_New));
     1422    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Add));
     1423    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings));
     1424    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Clone));
     1425    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Remove));
     1426    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_AddGroup));
     1427    addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow));
     1428    addAction(actionPool()->action(UIActionIndexST_M_Machine_T_Pause));
     1429    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Reset));
     1430    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard));
     1431    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_ShowLogDialog));
     1432    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Refresh));
     1433    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_ShowInFileManager));
     1434    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_CreateShortcut));
     1435    addAction(actionPool()->action(UIActionIndexST_M_Machine_S_SortParent));
     1436#endif /* VBOX_WS_X11 */
    13691437
    13701438    /* Populate Machine-menu: */
     
    14141482        return;
    14151483
     1484#ifdef VBOX_WS_X11
     1485    // WORKAROUND:
     1486    // There is an issue under Ubuntu which uses special kind of QPA
     1487    // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar
     1488    // directly to Ubuntu Application menu-bar. In that case action
     1489    // shortcuts are not being handled by the Qt and that way ignored.
     1490    // As a workaround we can add those actions into QMainWindow as well.
     1491    addAction(actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow_S_StartNormal));
     1492    addAction(actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow_S_StartHeadless));
     1493    addAction(actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow_S_StartDetachable));
     1494#endif /* VBOX_WS_X11 */
     1495
    14161496    /* Populate 'Group' / 'Start or Show' menu: */
    14171497    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow_S_StartNormal));
     
    14311511        return;
    14321512
     1513#ifdef VBOX_WS_X11
     1514    // WORKAROUND:
     1515    // There is an issue under Ubuntu which uses special kind of QPA
     1516    // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar
     1517    // directly to Ubuntu Application menu-bar. In that case action
     1518    // shortcuts are not being handled by the Qt and that way ignored.
     1519    // As a workaround we can add those actions into QMainWindow as well.
     1520    addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal));
     1521    addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartHeadless));
     1522    addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartDetachable));
     1523#endif /* VBOX_WS_X11 */
     1524
    14331525    /* Populate 'Machine' / 'Start or Show' menu: */
    14341526    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal));
     
    14471539    if (!pMenu->isEmpty())
    14481540        return;
     1541
     1542#ifdef VBOX_WS_X11
     1543    // WORKAROUND:
     1544    // There is an issue under Ubuntu which uses special kind of QPA
     1545    // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar
     1546    // directly to Ubuntu Application menu-bar. In that case action
     1547    // shortcuts are not being handled by the Qt and that way ignored.
     1548    // As a workaround we can add those actions into QMainWindow as well.
     1549    // addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Detach));
     1550    addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState));
     1551    addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown));
     1552    addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_PowerOff));
     1553#endif /* VBOX_WS_X11 */
    14491554
    14501555    /* Populate 'Group' / 'Close' menu: */
     
    14661571    if (!pMenu->isEmpty())
    14671572        return;
     1573
     1574#ifdef VBOX_WS_X11
     1575    // WORKAROUND:
     1576    // There is an issue under Ubuntu which uses special kind of QPA
     1577    // plugin (appmenu-qt5) which redirects actions added to Qt menu-bar
     1578    // directly to Ubuntu Application menu-bar. In that case action
     1579    // shortcuts are not being handled by the Qt and that way ignored.
     1580    // As a workaround we can add those actions into QMainWindow as well.
     1581    // addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Detach));
     1582    addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState));
     1583    addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown));
     1584    addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_PowerOff));
     1585#endif /* VBOX_WS_X11 */
    14681586
    14691587    /* Populate 'Machine' / 'Close' menu: */
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