VirtualBox

Changeset 35634 in vbox for trunk


Ignore:
Timestamp:
Jan 19, 2011 4:13:31 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt4: allow free configurable key shortcuts in the selector and machine window

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
5 added
7 edited

Legend:

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

    r35564 r35634  
    507507        src/widgets/VBoxOSTypeSelectorWidget.cpp \
    508508        src/widgets/VBoxWarningPane.cpp \
     509        src/selector/UISelectorShortcuts.cpp \
    509510        src/selector/UIVMDesktop.cpp \
    510511        src/selector/UIVMItem.cpp \
     
    525526        src/runtime/UIMachineLogic.cpp \
    526527        src/runtime/UIMachineMenuBar.cpp \
     528        src/runtime/UIMachineShortcuts.cpp \
    527529        src/runtime/UIMachineView.cpp \
    528530        src/runtime/UIMachineWindow.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxHelpActions.cpp

    r30677 r35634  
    2222#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    2323#include "VBoxHelpActions.h"
     24#include "UIExtraDataEventHandler.h"
     25#include "UIIconPool.h"
     26#include "UISelectorShortcuts.h"
    2427#include "VBoxGlobal.h"
    2528#include "VBoxProblemReporter.h"
    26 #include "UIIconPool.h"
    27 #include "UIExtraDataEventHandler.h"
    2829
    2930/* Qt includes */
     
    106107
    107108    contentsAction->setText (VBoxProblemReporter::tr ("&Contents..."));
    108     contentsAction->setShortcut (QKeySequence::HelpContents);
     109    contentsAction->setShortcut (gSS->keySequence(UISelectorShortcuts::HelpShortcut));
    109110    contentsAction->setStatusTip (VBoxProblemReporter::tr (
    110111        "Show the online help contents"));
    111112
    112113    webAction->setText (VBoxProblemReporter::tr ("&VirtualBox Web Site..."));
     114    webAction->setShortcut (gSS->keySequence(UISelectorShortcuts::WebShortcut));
    113115    webAction->setStatusTip (VBoxProblemReporter::tr (
    114116        "Open the browser and go to the VirtualBox product web site"));
    115117
    116118    resetMessagesAction->setText (VBoxProblemReporter::tr ("&Reset All Warnings"));
     119    resetMessagesAction->setShortcut (gSS->keySequence(UISelectorShortcuts::ResetWarningsShortcut));
    117120    resetMessagesAction->setStatusTip (VBoxProblemReporter::tr (
    118121        "Go back to showing all suppressed warnings and messages"));
    119122
     123#ifdef VBOX_WITH_REGISTRATION
    120124    registerAction->setText (VBoxProblemReporter::tr ("R&egister VirtualBox..."));
     125    registerAction->setShortcut (gSS->keySequence(UISelectorShortcuts::RegisterShortcut));
    121126    registerAction->setStatusTip (VBoxProblemReporter::tr (
    122127        "Open VirtualBox registration form"));
     128#endif /* VBOX_WITH_REGISTRATION */
    123129
    124130    updateAction->setText (VBoxProblemReporter::tr ("C&heck for Updates..."));
     131    updateAction->setShortcut (gSS->keySequence(UISelectorShortcuts::UpdateShortcut));
    125132    updateAction->setStatusTip (VBoxProblemReporter::tr (
    126133        "Check for a new VirtualBox version"));
    127134
    128135    aboutAction->setText (VBoxProblemReporter::tr ("&About VirtualBox..."));
     136    aboutAction->setShortcut (gSS->keySequence(UISelectorShortcuts::AboutShortcut));
    129137    aboutAction->setStatusTip (VBoxProblemReporter::tr (
    130138        "Show a dialog with product information"));
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.cpp

    r34961 r35634  
    5050const char* VBoxDefs::GUI_DetailsPageBoxes = "GUI/DetailsPageBoxes";
    5151const char* VBoxDefs::GUI_SelectorVMPositions = "GUI/SelectorVMPositions";
     52const char* VBoxDefs::GUI_Input_MachineShortcuts = "GUI/Input/MachineShortcuts";
     53const char* VBoxDefs::GUI_Input_SelectorShortcuts = "GUI/Input/SelectorShortcuts";
    5254#ifdef Q_WS_X11
    5355const char* VBoxDefs::GUI_LicenseKey = "GUI/LicenseAgreed";
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h

    r34961 r35634  
    125125    static const char* GUI_DetailsPageBoxes;
    126126    static const char* GUI_SelectorVMPositions;
     127    static const char* GUI_Input_MachineShortcuts;
     128    static const char* GUI_Input_SelectorShortcuts;
    127129#ifdef Q_WS_X11
    128130    static const char* GUI_LicenseKey;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r35564 r35634  
    42064206
    42074207/* static */
    4208 QString VBoxGlobal::insertKeyToActionText (const QString &aText, const QString &aKey)
     4208QString VBoxGlobal::insertKeyToActionText(const QString &strText, const QString &strKey)
    42094209{
    42104210#ifdef Q_WS_MAC
    4211     QString key ("%1 (Host+%2)");
     4211    QString pattern("%1 (Host+%2)");
    42124212#else
    4213     QString key ("%1 \tHost+%2");
     4213    QString pattern("%1 \tHost+%2");
    42144214#endif
    4215     return key.arg (aText).arg (QKeySequence (aKey).toString (QKeySequence::NativeText));
     4215    if (strKey.isEmpty())
     4216        return strText;
     4217    else
     4218        return pattern.arg(strText).arg(QKeySequence(strKey).toString(QKeySequence::NativeText));
    42164219}
    42174220
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionsPool.cpp

    r34158 r35634  
    2121#include "UIActionsPool.h"
    2222#include "UIIconPool.h"
     23#include "UIMachineShortcuts.h"
    2324#include "VBoxGlobal.h"
    2425
     
    240241    void retranslateUi()
    241242    {
    242         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "Switch to &Fullscreen"), "F"));
     243        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Switch to &Fullscreen"), gMS->shortcut(UIMachineShortcuts::FullscreenModeShortcut)));
    243244        setStatusTip(QApplication::translate("UIActionsPool", "Switch between normal and fullscreen mode"));
    244245    }
     
    263264    void retranslateUi()
    264265    {
    265         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "Switch to Seam&less Mode"), "L"));
     266        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Switch to Seam&less Mode"), gMS->shortcut(UIMachineShortcuts::SeamlessModeShortcut)));
    266267        setStatusTip(QApplication::translate("UIActionsPool", "Switch between normal and seamless desktop integration mode"));
    267268    }
     
    286287    void retranslateUi()
    287288    {
    288         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "Switch to &Scale Mode"), "C"));
     289        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Switch to &Scale Mode"), gMS->shortcut(UIMachineShortcuts::ScaleModeShortcut)));
    289290        setStatusTip(QApplication::translate("UIActionsPool", "Switch between normal and scale mode"));
    290291    }
     
    309310    void retranslateUi()
    310311    {
    311         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "Auto-resize &Guest Display"), "G"));
     312        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Auto-resize &Guest Display"), gMS->shortcut(UIMachineShortcuts::GuestAutoresizeShortcut)));
    312313        setStatusTip(QApplication::translate("UIActionsPool", "Automatically resize the guest display when the window is resized (requires Guest Additions)"));
    313314    }
     
    331332    void retranslateUi()
    332333    {
    333         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "&Adjust Window Size"), "A"));
     334        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Adjust Window Size"), gMS->shortcut(UIMachineShortcuts::WindowAdjustShortcut)));
    334335        setStatusTip(QApplication::translate("UIActionsPool", "Adjust window size and position to best fit the guest display"));
    335336    }
     
    373374    void retranslateUi()
    374375    {
    375         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "Disable &Mouse Integration"), "I"));
     376        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Disable &Mouse Integration"), gMS->shortcut(UIMachineShortcuts::MouseIntegrationShortcut)));
    376377        setStatusTip(QApplication::translate("UIActionsPool", "Temporarily disable host mouse pointer integration"));
    377378    }
     
    395396    void retranslateUi()
    396397    {
    397         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "&Insert Ctrl-Alt-Del"), "Del"));
     398        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Insert Ctrl-Alt-Del"), gMS->shortcut(UIMachineShortcuts::TypeCADShortcut)));
    398399        setStatusTip(QApplication::translate("UIActionsPool", "Send the Ctrl-Alt-Del sequence to the virtual machine"));
    399400    }
     
    418419    void retranslateUi()
    419420    {
    420         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "&Insert Ctrl-Alt-Backspace"), "Backspace"));
     421        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Insert Ctrl-Alt-Backspace"), gMS->shortcut(UIMachineShortcuts::TypeCABSShortcut)));
    421422        setStatusTip(QApplication::translate("UIActionsPool", "Send the Ctrl-Alt-Backspace sequence to the virtual machine"));
    422423    }
     
    441442    void retranslateUi()
    442443    {
    443         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "Take &Snapshot..."), "S"));
     444        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Take &Snapshot..."), gMS->shortcut(UIMachineShortcuts::TakeSnapshotShortcut)));
    444445        setStatusTip(QApplication::translate("UIActionsPool", "Take a snapshot of the virtual machine"));
    445446    }
     
    463464    void retranslateUi()
    464465    {
    465         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "Session I&nformation"), "N"));
     466        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Session I&nformation"), gMS->shortcut(UIMachineShortcuts::InformationDialogShortcut)));
    466467        setStatusTip(QApplication::translate("UIActionsPool", "Show Session Information Dialog"));
    467468    }
     
    485486    void retranslateUi()
    486487    {
    487         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "&Pause"), "P"));
     488        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Pause"), gMS->shortcut(UIMachineShortcuts::PauseShortcut)));
    488489        setStatusTip(QApplication::translate("UIActionsPool", "Suspend the execution of the virtual machine"));
    489490    }
     
    507508    void retranslateUi()
    508509    {
    509         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "&Reset"), "R"));
     510        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Reset"), gMS->shortcut(UIMachineShortcuts::ResetShortcut)));
    510511        setStatusTip(QApplication::translate("UIActionsPool", "Reset the virtual machine"));
    511512    }
     
    529530    void retranslateUi()
    530531    {
    531 #ifdef Q_WS_MAC
    532         /* Host+H is Hide on the mac */
    533         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "ACPI Sh&utdown"), "U"));
    534 #else /* Q_WS_MAC */
    535         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "ACPI S&hutdown"), "H"));
    536 #endif /* !Q_WS_MAC */
    537 
     532        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "ACPI Sh&utdown"), gMS->shortcut(UIMachineShortcuts::ShutdownShortcut)));
    538533        setStatusTip(QApplication::translate("UIActionsPool", "Send the ACPI Power Button press event to the virtual machine"));
    539534    }
     
    558553    void retranslateUi()
    559554    {
    560         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "&Close..."), "Q"));
     555        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Close..."), gMS->shortcut(UIMachineShortcuts::CloseShortcut)));
    561556        setStatusTip(QApplication::translate("UIActionsPool", "Close the virtual machine"));
    562557    }
     
    703698    void retranslateUi()
    704699    {
    705         setText(QApplication::translate("UIActionsPool", "&Network Adapters..."));
     700        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Network Adapters..."), gMS->shortcut(UIMachineShortcuts::NetworkAdaptersDialogShortcut)));
    706701        setStatusTip(QApplication::translate("UIActionsPool", "Change the settings of network adapters"));
    707702    }
     
    744739    void retranslateUi()
    745740    {
    746         setText(QApplication::translate("UIActionsPool", "&Shared Folders..."));
     741        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Shared Folders..."), gMS->shortcut(UIMachineShortcuts::SharedFoldersDialogShortcut)));
    747742        setStatusTip(QApplication::translate("UIActionsPool", "Create or modify shared folders"));
    748743    }
     
    767762    void retranslateUi()
    768763    {
    769         setText(QApplication::translate("UIActionsPool", "Enable R&emote Display"));
     764        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Enable R&emote Display"), gMS->shortcut(UIMachineShortcuts::VRDPServerShortcut)));
    770765        setStatusTip(QApplication::translate("UIActionsPool", "Enable remote desktop (RDP) connections to this machine"));
    771766    }
     
    789784    void retranslateUi()
    790785    {
    791         setText(VBoxGlobal::insertKeyToActionText(QApplication::translate("UIActionsPool", "&Install Guest Additions..."), "D"));
     786        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Install Guest Additions..."), gMS->shortcut(UIMachineShortcuts::InstallGuestAdditionsShortcut)));
    792787        setStatusTip(QApplication::translate("UIActionsPool", "Mount the Guest Additions installation image"));
    793788    }
     
    831826    void retranslateUi()
    832827    {
    833         setText(QApplication::translate("UIActionsPool", "&Statistics...", "debug action"));
     828        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Statistics...", "debug action"), gMS->shortcut(UIMachineShortcuts::StatisticWindowShortcut)));
    834829    }
    835830};
     
    851846    void retranslateUi()
    852847    {
    853         setText(QApplication::translate("UIActionsPool", "&Command Line...", "debug action"));
     848        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "&Command Line...", "debug action"), gMS->shortcut(UIMachineShortcuts::CommandLineWindowShortcut)));
    854849    }
    855850};
     
    871866    void retranslateUi()
    872867    {
    873         setText(QApplication::translate("UIActionsPool", "Enable &Logging...", "debug action"));
     868        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("UIActionsPool", "Enable &Logging...", "debug action"), gMS->shortcut(UIMachineShortcuts::LoggingShortcut)));
    874869    }
    875870};
     
    913908    void retranslateUi()
    914909    {
    915         setShortcut(QKeySequence::HelpContents);
     910        setShortcut(gMS->shortcut(UIMachineShortcuts::HelpShortcut));
    916911        setText(QApplication::translate("VBoxProblemReporter", "&Contents..."));
    917912        setStatusTip(QApplication::translate("VBoxProblemReporter", "Show the online help contents"));
     
    936931    void retranslateUi()
    937932    {
    938         setText(QApplication::translate("VBoxProblemReporter", "&VirtualBox Web Site..."));
     933        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("VBoxProblemReporter", "&VirtualBox Web Site..."), gMS->shortcut(UIMachineShortcuts::WebShortcut)));
    939934        setStatusTip(QApplication::translate("VBoxProblemReporter", "Open the browser and go to the VirtualBox product web site"));
    940935    }
     
    958953    void retranslateUi()
    959954    {
    960         setText(QApplication::translate("VBoxProblemReporter", "&Reset All Warnings"));
     955        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("VBoxProblemReporter", "&Reset All Warnings"), gMS->shortcut(UIMachineShortcuts::ResetWarningsShortcut)));
    961956        setStatusTip(QApplication::translate("VBoxProblemReporter", "Go back to showing all suppressed warnings and messages"));
    962957    }
     
    983978    void retranslateUi()
    984979    {
    985         setText(QApplication::translate("VBoxProblemReporter", "R&egister VirtualBox..."));
     980        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("VBoxProblemReporter", "R&egister VirtualBox..."), gMS->shortcut(UIMachineShortcuts::RegisterShortcut)));
    986981        setStatusTip(QApplication::translate("VBoxProblemReporter", "Open VirtualBox registration form"));
    987982    }
     
    10071002    void retranslateUi()
    10081003    {
    1009         setText(QApplication::translate("VBoxProblemReporter", "C&heck for Updates..."));
     1004        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("VBoxProblemReporter", "C&heck for Updates..."), gMS->shortcut(UIMachineShortcuts::UpdateShortcut)));
    10101005        setStatusTip(QApplication::translate("VBoxProblemReporter", "Check for a new VirtualBox version"));
    10111006    }
     
    10301025    void retranslateUi()
    10311026    {
    1032         setText(QApplication::translate("VBoxProblemReporter", "&About VirtualBox..."));
     1027        setText(vboxGlobal().insertKeyToActionText(QApplication::translate("VBoxProblemReporter", "&About VirtualBox..."), gMS->shortcut(UIMachineShortcuts::AboutShortcut)));
    10331028        setStatusTip(QApplication::translate("VBoxProblemReporter", "Show a dialog with product information"));
    10341029    }
     
    12981293                 * menu data posted along with the event will remain valid in
    12991294                 * the event handler, at least until the main window is closed. */
    1300                 QApplication::postEvent(this, new ActivateActionEvent(pAction));
     1295//                QApplication::postEvent(this, new ActivateActionEvent(pAction));
    13011296                return true;
    13021297            }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp

    r35555 r35634  
    3838#include "VBoxVMLogViewer.h"
    3939#include "QIFileDialog.h"
     40#include "UISelectorShortcuts.h"
    4041#include "UIDesktopServices.h"
    4142#include "UIGlobalSettingsExtension.h" /* extension pack installation */
     
    12021203
    12031204    mFileMediaMgrAction->setText(tr("&Virtual Media Manager..."));
    1204     mFileMediaMgrAction->setShortcut(QKeySequence("Ctrl+D"));
     1205    mFileMediaMgrAction->setShortcut(gSS->keySequence(UISelectorShortcuts::VirtualMediaManagerShortcut));
    12051206    mFileMediaMgrAction->setStatusTip(tr("Display the Virtual Media Manager dialog"));
    12061207
    12071208    mFileApplianceImportAction->setText(tr("&Import Appliance..."));
    1208     mFileApplianceImportAction->setShortcut(QKeySequence("Ctrl+I"));
     1209    mFileApplianceImportAction->setShortcut(gSS->keySequence(UISelectorShortcuts::ImportApplianceShortcut));
    12091210    mFileApplianceImportAction->setStatusTip(tr("Import an appliance into VirtualBox"));
    12101211
    12111212    mFileApplianceExportAction->setText(tr("&Export Appliance..."));
    1212     mFileApplianceExportAction->setShortcut(QKeySequence("Ctrl+E"));
     1213    mFileApplianceExportAction->setShortcut(gSS->keySequence(UISelectorShortcuts::ExportApplianceShortcut));
    12131214    mFileApplianceExportAction->setStatusTip(tr("Export one or more VirtualBox virtual machines as an appliance"));
    12141215
    1215 #ifdef Q_WS_MAC
    1216     /*
    1217      * Macification: Getting the right menu as application preference menu item.
    1218      *
    1219      * QMenuBar::isCommand() in qmenubar_mac.cpp doesn't recognize "Setting"(s)
    1220      * unless it's in the first position. So, we use the Mac term here to make
    1221      * sure we get picked instead of the VM settings.
    1222      *
    1223      * Now, since both QMenuBar and we translate these strings, it's going to
    1224      * be really interesting to see how this plays on non-english systems...
    1225      */
    12261216    mFileSettingsAction->setText(tr("&Preferences...", "global settings"));
    1227 #else
    1228     /*
    1229      * ...and on other platforms we use "Preferences" as well. The #ifdef is
    1230      * left because of the possible localization problems on Mac we first need
    1231      * to figure out.
    1232      */
    1233     mFileSettingsAction->setText(tr("&Preferences...", "global settings"));
    1234 #endif
    1235     mFileSettingsAction->setShortcut(QKeySequence("Ctrl+G"));
     1217    mFileSettingsAction->setShortcut(gSS->keySequence(UISelectorShortcuts::PreferencesShortcut));
    12361218    mFileSettingsAction->setStatusTip(tr("Display the global settings dialog"));
    12371219
    12381220    mFileExitAction->setText(tr("E&xit"));
    1239     mFileExitAction->setShortcut(QKeySequence("Ctrl+Q"));
     1221    mFileExitAction->setShortcut(gSS->keySequence(UISelectorShortcuts::ExitShortcut));
    12401222    mFileExitAction->setStatusTip(tr("Close application"));
    12411223
    12421224    mVmNewAction->setText(tr("&New..."));
    1243     mVmNewAction->setShortcut(QKeySequence("Ctrl+N"));
     1225    mVmNewAction->setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut));
    12441226    mVmNewAction->setStatusTip(tr("Create a new virtual machine"));
    12451227    mVmNewAction->setToolTip(mVmNewAction->text().remove('&').remove('.') +
    1246         QString("(%1)").arg(mVmNewAction->shortcut().toString()));
     1228        (mVmNewAction->shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(mVmNewAction->shortcut().toString())));
    12471229
    12481230    mVmAddAction->setText(tr("&Add..."));
    1249     mVmAddAction->setShortcut(QKeySequence("Ctrl+A"));
     1231    mVmAddAction->setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut));
    12501232    mVmAddAction->setStatusTip(tr("Add an existing virtual machine"));
    1251     mVmAddAction->setToolTip(mVmAddAction->text().remove('&').remove('.') +
    1252         QString("(%1)").arg(mVmAddAction->shortcut().toString()));
    12531233
    12541234    mVmConfigAction->setText(tr("&Settings..."));
    1255     mVmConfigAction->setShortcut(QKeySequence("Ctrl+S"));
     1235    mVmConfigAction->setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut));
    12561236    mVmConfigAction->setStatusTip(tr("Configure the selected virtual machine"));
    12571237    mVmConfigAction->setToolTip(mVmConfigAction->text().remove('&').remove('.') +
    1258         QString("(%1)").arg(mVmConfigAction->shortcut().toString()));
     1238        (mVmConfigAction->shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(mVmConfigAction->shortcut().toString())));
    12591239
    12601240    mVmDeleteAction->setText(tr("&Remove"));
    1261     mVmDeleteAction->setShortcut(QKeySequence("Ctrl+R"));
     1241    mVmDeleteAction->setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut));
    12621242    mVmDeleteAction->setStatusTip(tr("Remove the selected virtual machine"));
    12631243
     
    12651245
    12661246    mVmDiscardAction->setText(tr("D&iscard"));
     1247    mVmDiscardAction->setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut));
    12671248    mVmDiscardAction->setStatusTip(
    12681249        tr("Discard the saved state of the selected virtual machine"));
     1250    mVmDiscardAction->setToolTip(mVmDiscardAction->text().remove('&').remove('.') +
     1251        (mVmDiscardAction->shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(mVmDiscardAction->shortcut().toString())));
    12691252
    12701253    mVmPauseAction->setText(tr("&Pause"));
     
    12731256
    12741257    mVmRefreshAction->setText(tr("Re&fresh"));
     1258    mVmRefreshAction->setShortcut(gSS->keySequence(UISelectorShortcuts::RefreshVMShortcut));
    12751259    mVmRefreshAction->setStatusTip(
    12761260        tr("Refresh the accessibility state of the selected virtual machine"));
     
    12781262    mVmShowLogsAction->setText(tr("Show &Log..."));
    12791263    mVmShowLogsAction->setIconText(tr("Log", "icon text"));
    1280     mVmShowLogsAction->setShortcut(QKeySequence("Ctrl+L"));
     1264    mVmShowLogsAction->setShortcut(gSS->keySequence(UISelectorShortcuts::ShowVMLogShortcut));
    12811265    mVmShowLogsAction->setStatusTip(
    12821266        tr("Show the log files of the selected virtual machine"));
     
    12981282    mVmCreateShortcut->setStatusTip(tr("Creates an Shortcut file to the VirtualBox Machine Definition file on your Desktop."));
    12991283#endif
     1284    mVmOpenInFileManagerAction->setShortcut(gSS->keySequence(UISelectorShortcuts::ShowVMInFileManagerShortcut));
     1285    mVmCreateShortcut->setShortcut(gSS->keySequence(UISelectorShortcuts::CreateVMAliasShortcut));
    13001286
    13011287    mHelpActions.retranslateUi();
     
    13751361        {
    13761362            mVmStartAction->setText(tr("S&tart"));
     1363            mVmStartAction->setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
     1364            mVmStartAction->setToolTip(mVmStartAction->text().remove('&').remove('.') +
     1365                  (mVmStartAction->shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(mVmStartAction->shortcut().toString())));
    13771366#ifdef QT_MAC_USE_COCOA
    13781367            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    13901379        {
    13911380            mVmStartAction->setText(tr("S&how"));
     1381            mVmStartAction->setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
     1382            mVmStartAction->setToolTip(mVmStartAction->text().remove('&').remove('.') +
     1383                  (mVmStartAction->shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(mVmStartAction->shortcut().toString())));
    13921384#ifdef QT_MAC_USE_COCOA
    13931385            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    14091401        {
    14101402            mVmPauseAction->setText(tr("R&esume"));
    1411             mVmPauseAction->setShortcut(QKeySequence("Ctrl+P"));
     1403            mVmPauseAction->setShortcut(gSS->keySequence(UISelectorShortcuts::PauseVMShortcut));
    14121404            mVmPauseAction->setStatusTip(
    14131405                tr("Resume the execution of the virtual machine"));
     
    14191411        {
    14201412            mVmPauseAction->setText(tr("&Pause"));
    1421             mVmPauseAction->setShortcut(QKeySequence("Ctrl+P"));
     1413            mVmPauseAction->setShortcut(gSS->keySequence(UISelectorShortcuts::PauseVMShortcut));
    14221414            mVmPauseAction->setStatusTip(
    14231415                tr("Suspend the execution of the virtual machine"));
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