VirtualBox

Changeset 103578 in vbox


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

FE/Qt: UIShortcutPool: macOS no more support CMD+? as the default one help Contents shortcut; Let's use another one like CMD+/ (which is same just with Shift modifier released, because CMD+Shift+? now used for system-wide help Search menu).

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

Legend:

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

    r101560 r103578  
    4141#include "UIDesktopWidgetWatchdog.h"
    4242#include "UIHelpBrowserDialog.h"
     43#include "UIShortcutPool.h"
    4344#include "UITakeSnapshotDialog.h"
    4445
     
    118119        m_pButtonBox->button(QDialogButtonBox::Help)->setStatusTip(tr("Show dialog help"));
    119120
    120         m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
     121        m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    121122
    122123        if (m_pButtonBox->button(QDialogButtonBox::Ok)->shortcut().toString().isEmpty())
     
    304305            connect(m_pButtonBox->button(QIDialogButtonBox::Help), &QPushButton::pressed,
    305306                    m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    306             m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
     307            m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    307308            uiCommon().setHelpKeyword(m_pButtonBox->button(QIDialogButtonBox::Help), "snapshots");
    308309
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.cpp

    r102269 r103578  
    4646#include "UIMessageCenter.h"
    4747#include "UINotificationCenter.h"
     48#include "UIShortcutPool.h"
    4849#include "UIVirtualBoxEventHandler.h"
    4950
     
    966967    button(ButtonType_Apply)->setShortcut(QString("Ctrl+Return"));
    967968    button(ButtonType_Close)->setShortcut(Qt::Key_Escape);
    968     button(ButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     969    button(ButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    969970    button(ButtonType_Reset)->setToolTip(tr("Reset Changes (%1)").arg(button(ButtonType_Reset)->shortcut().toString()));
    970971    button(ButtonType_Apply)->setToolTip(tr("Apply Changes (%1)").arg(button(ButtonType_Apply)->shortcut().toString()));
  • trunk/src/VBox/Frontends/VirtualBox/src/extensionpackmanager/UIExtensionPackManager.cpp

    r102269 r103578  
    4545#include "UIMessageCenter.h"
    4646#include "UINotificationCenter.h"
     47#include "UIShortcutPool.h"
    4748#include "UIVirtualBoxEventHandler.h"
    4849
     
    615616    button(ButtonType_Help)->setStatusTip(tr("Show dialog help"));
    616617    button(ButtonType_Close)->setShortcut(Qt::Key_Escape);
    617     button(ButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     618    button(ButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    618619    button(ButtonType_Close)->setToolTip(tr("Close Window (%1)").arg(button(ButtonType_Close)->shortcut().toString()));
    619620    button(ButtonType_Help)->setToolTip(tr("Show Help (%1)").arg(button(ButtonType_Help)->shortcut().toString()));
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp

    r102731 r103578  
    3939#include "UIHelpBrowserDialog.h"
    4040#include "UIMessageCenter.h"
     41#include "UIShortcutPool.h"
    4142#ifdef VBOX_WS_MAC
    4243# include "QIToolBar.h"
     
    195196        /* Assign shortcuts: */
    196197        button(ButtonType_Close)->setShortcut(Qt::Key_Escape);
    197         button(ButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     198        button(ButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    198199
    199200        /* Hide some of buttons initially: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r103577 r103578  
    702702        switch (enmActionPoolType)
    703703        {
    704             case UIType_ManagerUI: return QKeySequence(QKeySequence::HelpContents);
     704            case UIType_ManagerUI: return UIShortcutPool::standardSequence(QKeySequence::HelpContents);
    705705            case UIType_RuntimeUI: break;
    706706        }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp

    r103552 r103578  
    32433243    virtual QKeySequence standardShortcut(UIType) const RT_OVERRIDE
    32443244    {
    3245         return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::HelpContents);
     3245        return   actionPool()->isTemporary()
     3246               ? QKeySequence()
     3247               : UIShortcutPool::standardSequence(QKeySequence::HelpContents);
    32463248    }
    32473249
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcutPool.cpp

    r98103 r103578  
    227227}
    228228
     229/* static */
     230QKeySequence UIShortcutPool::standardSequence(QKeySequence::StandardKey enmKey)
     231{
     232    /* We have some overrides: */
     233    switch (enmKey)
     234    {
     235#ifdef VBOX_WS_MAC
     236        /* So called Apple default sequence for HelpContents action (CMD+?)
     237         * is no more the default one on macOS for many years.
     238         * Instead they have redesigned this shortcut to open
     239         * system-wide Help menu with native search field.
     240         * But the Contents action has no shortcut anymore.
     241         * We could leave it empty or make it CMD+/ instead. */
     242        case QKeySequence::HelpContents:
     243            return QKeySequence("Ctrl+/");
     244#endif
     245        default:
     246            break;
     247    }
     248
     249    /* Use QKeySequence constructor by default: */
     250    return QKeySequence(enmKey);
     251}
     252
    229253void UIShortcutPool::retranslateUi()
    230254{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcutPool.h

    r98103 r103578  
    155155    void applyShortcuts(UIActionPool *pActionPool);
    156156
     157    /** Returns standard QKeySequence for passed QKeySequence::StandardKey. */
     158    static QKeySequence standardSequence(QKeySequence::StandardKey enmKey);
     159
    157160protected:
    158161
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp

    r103538 r103578  
    3838#include "UIFileManagerDialog.h"
    3939#include "UILoggingDefs.h"
     40#include "UIShortcutPool.h"
    4041#ifdef VBOX_WS_MAC
    4142# include "VBoxUtils-darwin.h"
     
    109110        button(ButtonType_Help)->setText(UIFileManager::tr("Help"));
    110111        button(ButtonType_Help)->setStatusTip(UIFileManager::tr("Show dialog help"));
    111         button(ButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     112        button(ButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    112113        button(ButtonType_Help)->setToolTip(UIFileManager::tr("Show Help (%1)").arg(button(ButtonType_Help)->shortcut().toString()));
    113114    }
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp

    r103538 r103578  
    4040#include "UIIconPool.h"
    4141#include "UILoggingDefs.h"
     42#include "UIShortcutPool.h"
    4243#include "UIVMLogViewerDialog.h"
    4344#include "UIVMLogViewerWidget.h"
     
    110111    button(ButtonType_Embed)->setStatusTip(UIVMLogViewerWidget::tr("Embed to manager window"));
    111112    button(ButtonType_Close)->setShortcut(Qt::Key_Escape);
    112     button(ButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     113    button(ButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    113114    button(ButtonType_Close)->setToolTip(UIVMLogViewerWidget::tr("Close Window (%1)").arg(button(ButtonType_Close)->shortcut().toString()));
    114115    button(ButtonType_Help)->setToolTip(UIVMLogViewerWidget::tr("Show Help (%1)").arg(button(ButtonType_Help)->shortcut().toString()));
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r103538 r103578  
    5050#include "UIMediumManager.h"
    5151#include "UIMediumSearchWidget.h"
     52#include "UIMessageCenter.h"
    5253#include "UINotificationCenter.h"
     54#include "UIShortcutPool.h"
    5355#include "UIWizardCloneVD.h"
    54 #include "UIMessageCenter.h"
    5556#include "QIToolBar.h"
    5657#include "UIIconPool.h"
     
    17401741    button(ButtonType_Apply)->setShortcut(QString("Ctrl+Return"));
    17411742    button(ButtonType_Close)->setShortcut(Qt::Key_Escape);
    1742     button(ButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     1743    button(ButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    17431744    button(ButtonType_Reset)->setToolTip(tr("Reset Changes (%1)").arg(button(ButtonType_Reset)->shortcut().toString()));
    17441745    button(ButtonType_Apply)->setToolTip(tr("Apply Changes (%1)").arg(button(ButtonType_Apply)->shortcut().toString()));
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r103538 r103578  
    5151#include "UIModalWindowManager.h"
    5252#include "UIPaneContainer.h"
     53#include "UIShortcutPool.h"
    5354#include "UIVisoCreator.h"
    5455#include "UIVisoContentBrowser.h"
     
    831832            m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    832833
    833     m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
     834    m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    834835
    835836    connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIVisoCreatorDialog::close);
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp

    r103362 r103578  
    3737#include "QITabWidget.h"
    3838#include "QITreeWidget.h"
     39#include "QIToolBar.h"
    3940#include "UIActionPoolManager.h"
     41#include "UICommon.h"
    4042#include "UIConverter.h"
    4143#include "UIDetailsWidgetCloudNetwork.h"
     
    4850#include "UINetworkManagerUtils.h"
    4951#include "UINotificationCenter.h"
    50 #include "QIToolBar.h"
     52#include "UIShortcutPool.h"
    5153#ifdef VBOX_WS_MAC
    5254# include "UIWindowMenuManager.h"
    5355#endif
    54 #include "UICommon.h"
    5556
    5657/* COM includes: */
     
    25772578    button(ButtonType_Apply)->setShortcut(QString("Ctrl+Return"));
    25782579    button(ButtonType_Close)->setShortcut(Qt::Key_Escape);
    2579     button(ButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     2580    button(ButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    25802581    button(ButtonType_Reset)->setToolTip(tr("Reset Changes (%1)").arg(button(ButtonType_Reset)->shortcut().toString()));
    25812582    button(ButtonType_Apply)->setToolTip(tr("Apply Changes (%1)").arg(button(ButtonType_Apply)->shortcut().toString()));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp

    r101563 r103578  
    4747#include "UIMachine.h"
    4848#include "UIMessageCenter.h"
     49#include "UIShortcutPool.h"
    4950#include "UIVMCloseDialog.h"
    5051
     
    528529        connect(pButtonBox->button(QIDialogButtonBox::Help), &QPushButton::pressed,
    529530                pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    530         pButtonBox->button(QIDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
     531        pButtonBox->button(QIDialogButtonBox::Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    531532
    532533        /* Add into layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r103538 r103578  
    4848#include "UIVMActivityMonitor.h"
    4949#include "UISession.h"
     50#include "UIShortcutPool.h"
    5051#include "UIVirtualBoxEventHandler.h"
    5152#include "UIVMInformationDialog.h"
     
    8586        m_pButtonBox->button(QDialogButtonBox::Help)->setStatusTip(tr("Show dialog help"));
    8687        m_pButtonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape);
    87         m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
     88        m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    8889        m_pButtonBox->button(QDialogButtonBox::Close)->setToolTip(tr("Close this dialog (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Close)->shortcut().toString()));
    8990        m_pButtonBox->button(QDialogButtonBox::Help)->setToolTip(tr("Show Help (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Help)->shortcut().toString()));
     
    260261        m_pButtonBox->setStandardButtons(QDialogButtonBox::Close | QDialogButtonBox::Help);
    261262        m_pButtonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape);
    262         m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
     263        m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    263264        uiCommon().setHelpKeyword(m_pButtonBox->button(QDialogButtonBox::Help), "vm-session-information");
    264265        connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIVMInformationDialog::sigClose);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp

    r103538 r103578  
    14251425        m_pButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel |
    14261426                                         QDialogButtonBox::NoButton | QDialogButtonBox::Help);
    1427         m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
     1427        m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    14281428#else
    14291429        // WORKAROUND:
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.cpp

    r101561 r103578  
    3737/* GUI includes: */
    3838#include "UIIconPool.h"
     39#include "UIShortcutPool.h"
    3940#include "UISpecialControls.h"
    4041
     
    6970    : QPushButton(pParent)
    7071{
    71     setShortcut(QKeySequence(QKeySequence::HelpContents));
     72    setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    7273    m_pButton = new UICocoaButton(this, UICocoaButton::HelpButton);
    7374    connect(m_pButton, SIGNAL(clicked()), this, SIGNAL(clicked()));
     
    140141    QPushButton::setText(tr("&Help"));
    141142    if (QPushButton::shortcut().isEmpty())
    142         QPushButton::setShortcut(QKeySequence::HelpContents);
     143        QPushButton::setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    143144}
    144145
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp

    r101559 r103578  
    4646#include "UINativeWizardPage.h"
    4747#include "UINotificationCenter.h"
     48#include "UIShortcutPool.h"
    4849
    4950
     
    578579                    connect(wizardButton(WizardButtonType_Help), &QPushButton::clicked,
    579580                            this, &UINativeWizard::sltHandleHelpRequest);
    580                     wizardButton(WizardButtonType_Help)->setShortcut(QKeySequence::HelpContents);
     581                    wizardButton(WizardButtonType_Help)->setShortcut(UIShortcutPool::standardSequence(QKeySequence::HelpContents));
    581582                    uiCommon().setHelpKeyword(this, m_strHelpKeyword);
    582583                }
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