Changeset 50683 in vbox
- Timestamp:
- Mar 4, 2014 5:13:55 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp
r45374 r50683 96 96 } 97 97 } 98 #ifdef Q_WS_MAC99 98 else if (vboxGlobal().isVMConsoleProcess()) 100 99 { 100 /* Take care about HID LEDs sync */ 101 if (strKey == GUI_HidLedsSync) 102 { 103 /* If extra data GUI/HidLedsSync is not present in VM config or set 104 * to 1 then sync is enabled. Otherwise, it is disabled. */ 105 bool f = (strValue.isEmpty() || strValue == "1") ? true : false; 106 emit sigHidLedsSyncStateChanged(f); 107 } 108 109 #ifdef Q_WS_MAC 101 110 /* Check for the currently running machine */ 102 111 if (strId == vboxGlobal().managedVMUuid()) … … 109 118 } 110 119 } 120 #endif /* Q_WS_MAC */ 111 121 } 112 #endif /* Q_WS_MAC */113 122 } 114 123 … … 118 127 void sigSelectorShortcutsChanged(); 119 128 void sigMachineShortcutsChanged(); 129 void sigHidLedsSyncStateChanged(bool fEnabled); 120 130 #ifdef RT_OS_DARWIN 121 131 void sigPresentationModeChange(bool fEnabled); … … 191 201 Qt::QueuedConnection); 192 202 203 connect(m_pHandler, SIGNAL(sigHidLedsSyncStateChanged(bool)), 204 this, SIGNAL(sigHidLedsSyncStateChanged(bool)), 205 Qt::QueuedConnection); 206 193 207 #ifdef Q_WS_MAC 194 208 connect(m_pHandler, SIGNAL(sigPresentationModeChange(bool)), -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.h
r45374 r50683 39 39 void sigSelectorShortcutsChanged(); 40 40 void sigMachineShortcutsChanged(); 41 void sigHidLedsSyncStateChanged(bool fEnabled); 41 42 #ifdef RT_OS_DARWIN 42 43 void sigPresentationModeChange(bool fEnabled); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r50191 r50683 1214 1214 { 1215 1215 /* Check if the guest has the same view on the modifier keys 1216 * (NumLock, CapsLock, ScrollLock) as the X server. 1217 * If not, send KeyPress events to synchronize the state: */ 1218 #if !defined(Q_WS_MAC) && !defined(Q_WS_WIN) 1219 if (fFlags & KeyPressed) 1220 fixModifierState(pCodes, puCodesCount); 1216 * (NumLock, CapsLock, ScrollLock) as the X server. */ 1217 #if !defined(Q_WS_MAC) 1218 /* If there is no HID LEDs sync enabled or supported 1219 * we should re-sync keyboard LEDs and state following this way. */ 1220 if (!machineLogic()->isHidLedsSyncEnabled()) 1221 if (fFlags & KeyPressed) 1222 fixModifierState(pCodes, puCodesCount); 1221 1223 #endif 1222 1224 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r50631 r50683 56 56 #include "UIModalWindowManager.h" 57 57 #include "UIMedium.h" 58 #include "UIExtraDataEventHandler.h" 58 59 #ifdef Q_WS_MAC 59 60 # include "DockIconPreview.h" … … 535 536 } 536 537 538 void UIMachineLogic::sltHidLedsSyncStateChanged(bool fEnabled) 539 { 540 m_isHidLedsSyncEnabled = fEnabled; 541 } 542 537 543 void UIMachineLogic::sltKeyboardLedsChanged() 538 544 { … … 647 653 #endif /* Q_WS_MAC */ 648 654 , m_pHostLedsState(NULL) 649 { 655 , m_isHidLedsSyncEnabled(false) 656 { 657 /* Setup HID LEDs synchronization. */ 658 #if defined(Q_WS_MAC) || defined(Q_WS_WIN) 659 /* Read initial extradata value. */ 660 QString strHidLedsSyncSettings = session().GetMachine().GetExtraData(GUI_HidLedsSync); 661 662 /* If extra data GUI/HidLedsSync is not present in VM config or set 663 * to 1 then sync is enabled. Otherwise, it is disabled. */ 664 if (strHidLedsSyncSettings.isEmpty() || strHidLedsSyncSettings == "1") 665 m_isHidLedsSyncEnabled = true; 666 else 667 m_isHidLedsSyncEnabled = false; 668 669 /* Subscribe to GUI_HidLedsSync extradata changes in order to 670 * be able to enable or disable feature dynamically. */ 671 connect(gEDataEvents, SIGNAL(sigHidLedsSyncStateChanged(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool))); 672 #else 673 m_isHidLedsSyncEnabled = false; 674 #endif 650 675 } 651 676 … … 718 743 pAction->setText(gpConverter->toString(pAction->data().value<KDragAndDropMode>())); 719 744 } 720 }721 722 bool UIMachineLogic::isHidLedsSyncEnabled()723 {724 /** If extra data GUI/HidLedsSync is not present in VM config or set to 1 then sync is enabled. Otherwise, it is disabled. */725 QString strHidLedsSyncSettings = session().GetMachine().GetExtraData(GUI_HidLedsSync);726 if (strHidLedsSyncSettings.isEmpty() || strHidLedsSyncSettings == "1")727 return true;728 729 return false;730 745 } 731 746 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r50490 r50683 99 99 100 100 /** Performs HID LEDs sync. */ 101 bool isHidLedsSyncEnabled() ;101 bool isHidLedsSyncEnabled() { return m_isHidLedsSyncEnabled; }; 102 102 103 103 protected slots: … … 245 245 246 246 /* Handlers: Keyboard LEDs sync logic: */ 247 void sltHidLedsSyncStateChanged(bool fEnabled); 247 248 void sltSwitchKeyboardLedsToGuestLeds(); 248 249 void sltSwitchKeyboardLedsToPreviousLeds(); … … 290 291 291 292 void *m_pHostLedsState; 293 bool m_isHidLedsSyncEnabled; 292 294 293 295 /* Friend classes: */
Note:
See TracChangeset
for help on using the changeset viewer.