- Timestamp:
- Jun 10, 2014 6:21:10 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r51595 r51596 949 949 } 950 950 951 bool UIExtraDataManager::hidLedsSyncState(const QString &strID) const 952 { 953 /* 'True' unless feature restricted: */ 954 return !isFeatureRestricted(GUI_HidLedsSync, strID); 955 } 956 951 957 void UIExtraDataManager::sltExtraDataChange(QString strMachineID, QString strKey, QString strValue) 952 958 { … … 982 988 /* HID LEDs sync state changed (allowed if not restricted)? */ 983 989 if (strKey == GUI_HidLedsSync) 984 emit sigH IDLedsSyncStateChange(!isFeatureRestricted(strKey));990 emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, strMachineID)); 985 991 #ifdef Q_WS_MAC 986 992 /* 'Dock icon' appearance changed (allowed if not restricted)? */ 987 993 else if ( strKey == GUI_RealtimeDockIconUpdateEnabled 988 994 || strKey == GUI_RealtimeDockIconUpdateMonitor) 989 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey ));995 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID)); 990 996 #endif /* Q_WS_MAC */ 991 997 } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51595 r51596 56 56 void sigRuntimeUIShortcutChange(); 57 57 58 /** Notifies about HID LED syncstate change. */59 void sigH IDLedsSyncStateChange(bool fEnabled);58 /** Notifies about HID LEDs synchronization state change. */ 59 void sigHidLedsSyncStateChange(bool fEnabled); 60 60 61 61 #ifdef RT_OS_DARWIN … … 274 274 bool passCADtoGuest(const QString &strID) const; 275 275 276 /** Returns whether VM should perform HID LEDs synchronization. */ 277 bool hidLedsSyncState(const QString &strID) const; 278 276 279 private slots: 277 280 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r51565 r51596 189 189 sltAdditionsStateChanged(); 190 190 sltMouseCapabilityChanged(); 191 sltSwitchKeyboardLedsToGuestLeds();192 191 193 192 #ifdef VBOX_WITH_DEBUGGER_GUI … … 196 195 #endif /* VBOX_WITH_DEBUGGER_GUI */ 197 196 197 /* Load settings: */ 198 loadSettings(); 199 198 200 /* Retranslate logic part: */ 199 201 retranslateUi(); … … 202 204 void UIMachineLogic::cleanup() 203 205 { 204 /* Deinitialization: */205 s ltSwitchKeyboardLedsToPreviousLeds();206 /* Save settings: */ 207 saveSettings(); 206 208 207 209 #ifdef VBOX_WITH_DEBUGGER_GUI … … 527 529 void UIMachineLogic::sltHidLedsSyncStateChanged(bool fEnabled) 528 530 { 529 m_ isHidLedsSyncEnabled = fEnabled;531 m_fIsHidLedsSyncEnabled = fEnabled; 530 532 } 531 533 … … 642 644 #endif /* Q_WS_MAC */ 643 645 , m_pHostLedsState(NULL) 644 , m_isHidLedsSyncEnabled(false) 645 { 646 /* Setup HID LEDs synchronization. */ 647 #if defined(Q_WS_MAC) || defined(Q_WS_WIN) 648 /* Read initial extradata value. */ 649 QString strHidLedsSyncSettings = session().GetMachine().GetExtraData(GUI_HidLedsSync); 650 651 /* If extra data GUI/HidLedsSync is not present in VM config or set 652 * to 1 then sync is enabled. Otherwise, it is disabled. */ 653 if (strHidLedsSyncSettings.isEmpty() || strHidLedsSyncSettings == "1") 654 m_isHidLedsSyncEnabled = true; 655 else 656 m_isHidLedsSyncEnabled = false; 657 658 /* Subscribe to GUI_HidLedsSync extradata changes in order to 659 * be able to enable or disable feature dynamically. */ 660 connect(gEDataManager, SIGNAL(sigHIDLedsSyncStateChange(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool))); 661 #else 662 m_isHidLedsSyncEnabled = false; 663 #endif 646 , m_fIsHidLedsSyncEnabled(false) 647 { 664 648 } 665 649 … … 1084 1068 #endif /* VBOX_WITH_DEBUGGER_GUI */ 1085 1069 1070 void UIMachineLogic::loadSettings() 1071 { 1072 #if defined(Q_WS_MAC) || defined(Q_WS_WIN) 1073 /* Read cached extra-data value: */ 1074 m_fIsHidLedsSyncEnabled = gEDataManager->hidLedsSyncState(vboxGlobal().managedVMUuid()); 1075 /* Subscribe to extra-data changes to be able to enable/disable feature dynamically: */ 1076 connect(gEDataManager, SIGNAL(sigHidLedsSyncStateChange(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool))); 1077 #endif /* Q_WS_MAC || Q_WS_WIN */ 1078 /* HID LEDs sync initialization: */ 1079 sltSwitchKeyboardLedsToGuestLeds(); 1080 } 1081 1082 void UIMachineLogic::saveSettings() 1083 { 1084 /* HID LEDs sync deinitialization: */ 1085 sltSwitchKeyboardLedsToPreviousLeds(); 1086 } 1087 1086 1088 #ifdef VBOX_WITH_DEBUGGER_GUI 1087 1089 void UIMachineLogic::cleanupDebugger() -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r51398 r51596 98 98 virtual void notifyAbout3DOverlayVisibilityChange(bool fVisible); 99 99 100 /** Performs HID LEDs sync. */101 bool isHidLedsSyncEnabled() { return m_isHidLedsSyncEnabled; };100 /** Returns whether VM should perform HID LEDs synchronization. */ 101 bool isHidLedsSyncEnabled() const { return m_fIsHidLedsSyncEnabled; } 102 102 103 103 protected slots: … … 166 166 virtual void prepareDebugger(); 167 167 #endif /* VBOX_WITH_DEBUGGER_GUI */ 168 virtual void loadSettings(); 168 169 169 170 /* Cleanup helpers: */ 171 virtual void saveSettings(); 170 172 #ifdef VBOX_WITH_DEBUGGER_GUI 171 173 virtual void cleanupDebugger(); … … 297 299 298 300 void *m_pHostLedsState; 299 bool m_isHidLedsSyncEnabled; 301 302 /** Holds whether VM should perform HID LEDs synchronization. */ 303 bool m_fIsHidLedsSyncEnabled; 300 304 301 305 /* Friend classes: */
Note:
See TracChangeset
for help on using the changeset viewer.