Changeset 66571 in vbox
- Timestamp:
- Apr 14, 2017 12:39:44 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
-
VBoxGlobalSettings.cpp (modified) (4 diffs)
-
VBoxGlobalSettings.h (modified) (3 diffs)
-
extradata/UIExtraDataDefs.cpp (modified) (1 diff)
-
extradata/UIExtraDataDefs.h (modified) (1 diff)
-
extradata/UIExtraDataManager.cpp (modified) (3 diffs)
-
extradata/UIExtraDataManager.h (modified) (2 diffs)
-
runtime/UIKeyboardHandler.cpp (modified) (2 diffs)
-
runtime/UIKeyboardHandler.h (modified) (2 diffs)
-
runtime/UISession.cpp (modified) (1 diff)
-
settings/global/UIGlobalSettingsInput.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.cpp
r66569 r66571 51 51 { 52 52 /* default settings */ 53 #if defined(VBOX_WS_X11) && defined(DEBUG)54 autoCapture = false;55 #else56 autoCapture = true;57 #endif58 53 guiFeatures = QString::null; 59 54 languageId = QString::null; … … 66 61 VBoxGlobalSettingsData::VBoxGlobalSettingsData (const VBoxGlobalSettingsData &that) 67 62 { 68 autoCapture = that.autoCapture;69 63 guiFeatures = that.guiFeatures; 70 64 languageId = that.languageId; … … 82 76 { 83 77 return this == &that || 84 (autoCapture == that.autoCapture && 85 guiFeatures == that.guiFeatures && 78 (guiFeatures == that.guiFeatures && 86 79 languageId == that.languageId && 87 80 maxGuestRes == that.maxGuestRes && … … 110 103 gPropertyMap[] = 111 104 { 112 { "GUI/Input/AutoCapture", "autoCapture", "true|false", true },113 105 { "GUI/Customizations", "guiFeatures", "\\S+", true }, 114 106 { "GUI/LanguageID", "languageId", gVBoxLangIDRegExp, true }, -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.h
r66569 r66571 37 37 private: 38 38 39 bool autoCapture;40 39 QString guiFeatures; 41 40 QString languageId; … … 53 52 { 54 53 Q_OBJECT 55 Q_PROPERTY (bool autoCapture READ autoCapture WRITE setAutoCapture)56 54 Q_PROPERTY (QString guiFeatures READ guiFeatures WRITE setGuiFeatures) 57 55 Q_PROPERTY (QString languageId READ languageId WRITE setLanguageId) … … 73 71 74 72 // Properties 75 76 bool autoCapture() const { return data()->autoCapture; }77 void setAutoCapture (bool aAutoCapture)78 {79 mData()->autoCapture = aAutoCapture;80 resetError();81 }82 73 83 74 QString guiFeatures() const { return data()->guiFeatures; } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r66569 r66571 55 55 const char* UIExtraDataDefs::GUI_Input_MachineShortcuts = "GUI/Input/MachineShortcuts"; 56 56 const char* UIExtraDataDefs::GUI_Input_HostKeyCombination = "GUI/Input/HostKeyCombination"; 57 const char* UIExtraDataDefs::GUI_Input_AutoCapture = "GUI/Input/AutoCapture"; 57 58 58 59 /* Settings: Storage: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r66569 r66571 85 85 /** Holds Runtime UI host-key combination. */ 86 86 extern const char* GUI_Input_HostKeyCombination; 87 /** Holds whether Runtime UI auto-capture is enabled. */ 88 extern const char* GUI_Input_AutoCapture; 87 89 /** @} */ 88 90 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r66570 r66571 2357 2357 #endif 2358 2358 } 2359 /* Return host- combo: */2359 /* Return host-key combination: */ 2360 2360 return strHostCombo; 2361 2361 } … … 2378 2378 return extraDataStringList(GUI_Input_MachineShortcuts); 2379 2379 return QStringList(); 2380 } 2381 2382 bool UIExtraDataManager::autoCaptureEnabled() 2383 { 2384 /* Prepare auto-capture flag: */ 2385 bool fAutoCapture = true /* indifferently */; 2386 /* Acquire whether the auto-capture is restricted: */ 2387 QString strAutoCapture = extraDataString(GUI_Input_AutoCapture); 2388 /* Invent some sane default if it's empty: */ 2389 if (strAutoCapture.isEmpty()) 2390 { 2391 #if defined(VBOX_WS_X11) && defined(DEBUG) 2392 fAutoCapture = false; 2393 #else 2394 fAutoCapture = true; 2395 #endif 2396 } 2397 /* 'True' unless feature restricted: */ 2398 else 2399 fAutoCapture = !isFeatureRestricted(GUI_Input_AutoCapture); 2400 /* Return auto-capture flag: */ 2401 return fAutoCapture; 2402 } 2403 2404 void UIExtraDataManager::setAutoCaptureEnabled(bool fEnabled) 2405 { 2406 /* Store actual feature state, whether it is "true" or "false", 2407 * because absent state means default, different on various hosts: */ 2408 setExtraDataString(GUI_Input_AutoCapture, toFeatureState(fEnabled)); 2380 2409 } 2381 2410 … … 4230 4259 } 4231 4260 4261 QString UIExtraDataManager::toFeatureState(bool fState) 4262 { 4263 return fState ? QString("true") : QString("false"); 4264 } 4265 4232 4266 QString UIExtraDataManager::toFeatureAllowed(bool fAllowed) 4233 4267 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r66569 r66571 202 202 /** Returns shortcut overrides for shortcut-pool with @a strPoolExtraDataID. */ 203 203 QStringList shortcutOverrides(const QString &strPoolExtraDataID); 204 205 /** Returns whether the Runtime UI auto-capture is enabled. */ 206 bool autoCaptureEnabled(); 207 /** Defines whether the Runtime UI auto-capture is @a fEnabled. */ 208 void setAutoCaptureEnabled(bool fEnabled); 204 209 /** @} */ 205 210 … … 619 624 bool isFeatureRestricted(const QString &strKey, const QString &strID = GlobalID); 620 625 626 /** Translates bool flag into QString value. */ 627 QString toFeatureState(bool fState); 621 628 /** Translates bool flag into 'allowed' value. */ 622 629 QString toFeatureAllowed(bool fAllowed); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r66569 r66571 1544 1544 , m_pMachineLogic(pMachineLogic) 1545 1545 , m_iKeyboardCaptureViewIndex(-1) 1546 , m_globalSettings(vboxGlobal().settings())1547 1546 , m_fIsKeyboardCaptured(false) 1548 1547 , m_bIsHostComboPressed(false) … … 2476 2475 bool UIKeyboardHandler::autoCaptureSetGlobally() 2477 2476 { 2478 return m_globalSettings.autoCapture() && !m_fDebuggerActive;2477 return gEDataManager->autoCaptureEnabled() && !m_fDebuggerActive; 2479 2478 } 2480 2479 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h
r66389 r66571 37 37 /* Forward declarations: */ 38 38 class QWidget; 39 class VBoxGlobalSettings;40 39 class UIActionPool; 41 40 class UISession; … … 212 211 /* Other keyboard variables: */ 213 212 int m_iKeyboardCaptureViewIndex; 214 const VBoxGlobalSettings &m_globalSettings;215 213 216 214 uint8_t m_pressedKeys[128]; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r65795 r66571 167 167 168 168 /* Notify user about mouse&keyboard auto-capturing: */ 169 if ( vboxGlobal().settings().autoCapture())169 if (gEDataManager->autoCaptureEnabled()) 170 170 popupCenter().remindAboutAutoCapture(machineLogic()->activeMachineWindow()); 171 171 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
r66569 r66571 36 36 # include "UIShortcutPool.h" 37 37 # include "UIExtraDataManager.h" 38 # include "VBoxGlobalSettings.h"39 38 40 39 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 906 905 shortcut.defaultSequence().toString(QKeySequence::NativeText)); 907 906 } 908 oldInputData.setAutoCapture( m_settings.autoCapture());907 oldInputData.setAutoCapture(gEDataManager->autoCaptureEnabled()); 909 908 910 909 /* Cache old input data: */ … … 972 971 /* Save other new things from the cache: */ 973 972 if (m_pCache->data().autoCapture() != m_pCache->base().autoCapture()) 974 m_settings.setAutoCapture(m_pCache->data().autoCapture());973 gEDataManager->setAutoCaptureEnabled(m_pCache->data().autoCapture()); 975 974 } 976 975
Note:
See TracChangeset
for help on using the changeset viewer.

