Changeset 44712 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 15, 2013 1:12:31 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
r44711 r44712 260 260 case UIHotKeyTableSection_Value: return m_filteredShortcuts[iIndex].key == UIHostCombo::hostComboCacheKey() ? 261 261 QVariant::fromValue(UIHostComboWrapper(m_filteredShortcuts[iIndex].currentSequence)) : 262 QVariant::fromValue(UIHotKey(m_filteredShortcuts[iIndex].currentSequence, 262 QVariant::fromValue(UIHotKey(m_type == UIActionPoolType_Runtime ? 263 UIHotKeyType_Simple : UIHotKeyType_WithModifiers, 264 m_filteredShortcuts[iIndex].currentSequence, 263 265 m_filteredShortcuts[iIndex].defaultSequence)); 264 266 default: break; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp
r44682 r44712 103 103 UIHotKeyEditor::UIHotKeyEditor(QWidget *pParent) 104 104 : QIWithRetranslateUI<QWidget>(pParent) 105 , m_fIsModifiersAllowed(false) 105 106 , m_pMainLayout(new QHBoxLayout(this)) 106 107 , m_pLineEdit(new UIHotKeyLineEdit(this)) … … 251 252 void UIHotKeyEditor::fetchModifiersState() 252 253 { 254 /* Make sure modifiers allowed: */ 255 if (!m_fIsModifiersAllowed) 256 return; 257 253 258 /* If full sequence was not yet taken: */ 254 259 if (!m_fSequenceTaken) … … 386 391 void UIHotKeyEditor::setHotKey(const UIHotKey &hotKey) 387 392 { 393 m_fIsModifiersAllowed = hotKey.type() == UIHotKeyType_WithModifiers; 388 394 m_hotKey = hotKey; 389 395 m_pLineEdit->setText(hotKey.sequence()); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h
r44683 r44712 33 33 class UIHotKeyLineEdit; 34 34 35 /* Host key type enumerator: */ 36 enum UIHotKeyType 37 { 38 UIHotKeyType_Simple, 39 UIHotKeyType_WithModifiers 40 }; 41 35 42 /* A string pair wrapper for hot-key sequence: */ 36 43 class UIHotKey … … 39 46 40 47 /* Constructors: */ 41 UIHotKey() {} 42 UIHotKey(const QString &strSequence, 48 UIHotKey() 49 : m_type(UIHotKeyType_Simple) 50 {} 51 UIHotKey(UIHotKeyType type, 52 const QString &strSequence, 43 53 const QString &strDefaultSequence) 44 : m_strSequence(strSequence) 54 : m_type(type) 55 , m_strSequence(strSequence) 45 56 , m_strDefaultSequence(strDefaultSequence) 46 57 {} 47 58 UIHotKey(const UIHotKey &other) 48 : m_strSequence(other.sequence()) 59 : m_type(other.type()) 60 , m_strSequence(other.sequence()) 49 61 , m_strDefaultSequence(other.defaultSequence()) 50 62 {} … … 58 70 } 59 71 60 /* API: Access stuff: */ 72 /* API: Type access stuff: */ 73 UIHotKeyType type() const { return m_type; } 74 75 /* API: Sequence access stuff: */ 61 76 const QString& sequence() const { return m_strSequence; } 62 77 const QString& defaultSequence() const { return m_strDefaultSequence; } … … 66 81 67 82 /* Variables: */ 83 UIHotKeyType m_type; 68 84 QString m_strSequence; 69 85 QString m_strDefaultSequence; … … 117 133 /* Variables: */ 118 134 mutable UIHotKey m_hotKey; 135 mutable bool m_fIsModifiersAllowed; 119 136 QHBoxLayout *m_pMainLayout; 120 137 UIHotKeyLineEdit *m_pLineEdit;
Note:
See TracChangeset
for help on using the changeset viewer.