Changeset 51380 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 23, 2014 5:54:07 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93889
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcutPool.cpp
r51038 r51380 60 60 UIShortcutPool* UIShortcutPool::m_pInstance = 0; 61 61 62 const QString UIShortcutPool::m_strShortcutKeyTemplate = QString("%1/%2"); 62 const QString UIShortcutPool::m_sstrShortcutKeyTemplate = QString("%1/%2"); 63 const QString UIShortcutPool::m_sstrShortcutKeyTemplateRuntime = m_sstrShortcutKeyTemplate.arg(GUI_Input_MachineShortcuts); 63 64 64 65 UIShortcutPool* UIShortcutPool::instance() … … 96 97 { 97 98 /* Compose shortcut key: */ 98 const QString strShortcutKey(m_s trShortcutKeyTemplate.arg(pActionPool->shortcutsExtraDataID(),99 pAction->shortcutExtraDataID()));99 const QString strShortcutKey(m_sstrShortcutKeyTemplate.arg(pActionPool->shortcutsExtraDataID(), 100 pAction->shortcutExtraDataID())); 100 101 /* Return existing if any: */ 101 102 if (m_shortcuts.contains(strShortcutKey)) … … 112 113 { 113 114 /* Return if present, autocreate if necessary: */ 114 return shortcut(m_s trShortcutKeyTemplate.arg(strPoolID, strActionID));115 return shortcut(m_sstrShortcutKeyTemplate.arg(strPoolID, strActionID)); 115 116 } 116 117 … … 141 142 142 143 /* Compose shortcut key: */ 143 const QString strShortcutKey = m_s trShortcutKeyTemplate.arg(pActionPool->shortcutsExtraDataID(),144 pAction->shortcutExtraDataID());144 const QString strShortcutKey = m_sstrShortcutKeyTemplate.arg(pActionPool->shortcutsExtraDataID(), 145 pAction->shortcutExtraDataID()); 145 146 /* If shortcut key is already known: */ 146 147 if (m_shortcuts.contains(strShortcutKey)) … … 227 228 } 228 229 230 void UIShortcutPool::retranslateUi() 231 { 232 /* Translate own defaults: */ 233 m_shortcuts[m_sstrShortcutKeyTemplateRuntime.arg("PopupMenu")] 234 .setDescription(QApplication::translate("UIActionPool", "Popup Menu")); 235 } 236 229 237 void UIShortcutPool::loadDefaults() 230 238 { 231 /* Runtime shortcut key template: */232 const QString strRuntimeShortcutKeyTemplate(m_strShortcutKeyTemplate.arg(GUI_Input_MachineShortcuts));233 239 /* Default shortcut for the Runtime Popup Menu invokation: */ 234 m_shortcuts.insert(strRuntimeShortcutKeyTemplate.arg("PopupMenu"), 235 UIShortcut(QApplication::translate("UIActionPool", "Popup Menu"), QString("Home"), QString("Home"))); 240 m_shortcuts.insert(m_sstrShortcutKeyTemplateRuntime.arg("PopupMenu"), 241 UIShortcut(QApplication::translate("UIActionPool", "Popup Menu"), 242 QString("Home"), QString("Home"))); 236 243 } 237 244 … … 247 254 { 248 255 /* Compose shortcut key template: */ 249 const QString strShortcutKeyTemplate(m_s trShortcutKeyTemplate.arg(strPoolExtraDataID));256 const QString strShortcutKeyTemplate(m_sstrShortcutKeyTemplate.arg(strPoolExtraDataID)); 250 257 /* Iterate over all the overrides: */ 251 258 const QStringList overrides = vboxGlobal().virtualBox().GetExtraDataStringList(strPoolExtraDataID); … … 295 302 { 296 303 /* Compose shortcut prefix: */ 297 const QString strShortcutPrefix(m_s trShortcutKeyTemplate.arg(strPoolExtraDataID, QString()));304 const QString strShortcutPrefix(m_sstrShortcutKeyTemplate.arg(strPoolExtraDataID, QString())); 298 305 /* Populate the list of all the known overrides: */ 299 306 QStringList overrides; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcutPool.h
r44733 r51380 25 25 /* GUI includes: */ 26 26 #include "VBoxGlobal.h" 27 #include "QIWithRetranslateUI.h" 27 28 28 29 /* Forward declarations: */ … … 73 74 74 75 /* Singleton shortcut pool: */ 75 class UIShortcutPool : public Q Object76 class UIShortcutPool : public QIWithRetranslateUI3<QObject> 76 77 { 77 78 Q_OBJECT; … … 118 119 void cleanup() {} 119 120 121 /** Translation handler. */ 122 void retranslateUi(); 123 120 124 /* Helpers: Shortcuts stuff: */ 121 125 void loadDefaults(); … … 130 134 /* Variables: */ 131 135 static UIShortcutPool *m_pInstance; 132 static const QString m_strShortcutKeyTemplate; 136 /** Shortcut key template. */ 137 static const QString m_sstrShortcutKeyTemplate; 138 /** Shortcut key template for Runtime UI. */ 139 static const QString m_sstrShortcutKeyTemplateRuntime; 133 140 QMap<QString, UIShortcut> m_shortcuts; 134 141 };
Note:
See TracChangeset
for help on using the changeset viewer.