Changeset 64263 in vbox
- Timestamp:
- Oct 13, 2016 4:31:37 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111275
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
r64262 r64263 140 140 , m_fAutoCapture(false) 141 141 {} 142 143 /** Returns the shortcuts cache [full access]. */ 144 UIShortcutCache &shortcuts() { return m_shortcuts; } 145 146 /** Defines whether the keyboard auto-capture is @a fEnabled. */ 147 void setAutoCapture(bool fEnabled) { m_fAutoCapture = fEnabled; } 148 /** Returns whether the keyboard auto-capture is enabled. */ 149 bool autoCapture() const { return m_fAutoCapture; } 150 151 private: 142 152 143 153 /** Holds the shortcut cache. */ … … 737 747 738 748 /* Load host-combo shortcut to cache: */ 739 m_pCache-> m_shortcuts<< UIShortcutCacheItem(UIHostCombo::hostComboCacheKey(), tr("Host Key Combination"), m_settings.hostCombo(), QString());749 m_pCache->shortcuts() << UIShortcutCacheItem(UIHostCombo::hostComboCacheKey(), tr("Host Key Combination"), m_settings.hostCombo(), QString()); 740 750 /* Load all other shortcuts to cache: */ 741 751 const QMap<QString, UIShortcut>& shortcuts = gShortcutPool->shortcuts(); … … 744 754 { 745 755 const UIShortcut &shortcut = shortcuts[strShortcutKey]; 746 m_pCache-> m_shortcuts<< UIShortcutCacheItem(strShortcutKey, VBoxGlobal::removeAccelMark(shortcut.description()),747 shortcut.sequence().toString(QKeySequence::NativeText),748 shortcut.defaultSequence().toString(QKeySequence::NativeText));756 m_pCache->shortcuts() << UIShortcutCacheItem(strShortcutKey, VBoxGlobal::removeAccelMark(shortcut.description()), 757 shortcut.sequence().toString(QKeySequence::NativeText), 758 shortcut.defaultSequence().toString(QKeySequence::NativeText)); 749 759 } 750 760 /* Load other things to cache: */ 751 m_pCache-> m_fAutoCapture = m_settings.autoCapture();761 m_pCache->setAutoCapture(m_settings.autoCapture()); 752 762 753 763 /* Upload properties & settings to data: */ … … 760 770 { 761 771 /* Fetch from cache: */ 762 m_pSelectorModel->load(m_pCache-> m_shortcuts);763 m_pMachineModel->load(m_pCache-> m_shortcuts);764 m_pEnableAutoGrabCheckbox->setChecked(m_pCache-> m_fAutoCapture);772 m_pSelectorModel->load(m_pCache->shortcuts()); 773 m_pMachineModel->load(m_pCache->shortcuts()); 774 m_pEnableAutoGrabCheckbox->setChecked(m_pCache->autoCapture()); 765 775 766 776 /* Revalidate: */ … … 773 783 { 774 784 /* Upload to cache: */ 775 m_pSelectorModel->save(m_pCache-> m_shortcuts);776 m_pMachineModel->save(m_pCache-> m_shortcuts);777 m_pCache-> m_fAutoCapture = m_pEnableAutoGrabCheckbox->isChecked();785 m_pSelectorModel->save(m_pCache->shortcuts()); 786 m_pMachineModel->save(m_pCache->shortcuts()); 787 m_pCache->setAutoCapture(m_pEnableAutoGrabCheckbox->isChecked()); 778 788 } 779 789 … … 787 797 /* Save host-combo shortcut from cache: */ 788 798 UIShortcutCacheItem fakeHostComboItem(UIHostCombo::hostComboCacheKey(), QString(), QString(), QString()); 789 int iIndexOfHostComboItem = m_pCache-> m_shortcuts.indexOf(fakeHostComboItem);799 int iIndexOfHostComboItem = m_pCache->shortcuts().indexOf(fakeHostComboItem); 790 800 if (iIndexOfHostComboItem != -1) 791 m_settings.setHostCombo(m_pCache-> m_shortcuts[iIndexOfHostComboItem].currentSequence());801 m_settings.setHostCombo(m_pCache->shortcuts()[iIndexOfHostComboItem].currentSequence()); 792 802 /* Iterate over cached shortcuts: */ 793 803 QMap<QString, QString> sequences; 794 foreach (const UIShortcutCacheItem &item, m_pCache-> m_shortcuts)804 foreach (const UIShortcutCacheItem &item, m_pCache->shortcuts()) 795 805 sequences.insert(item.key(), item.currentSequence()); 796 806 /* Save shortcut sequences from cache: */ 797 807 gShortcutPool->setOverrides(sequences); 798 808 /* Save other things from cache: */ 799 m_settings.setAutoCapture(m_pCache-> m_fAutoCapture);809 m_settings.setAutoCapture(m_pCache->autoCapture()); 800 810 801 811 /* Upload properties & settings to data: */
Note:
See TracChangeset
for help on using the changeset viewer.