Skip to content
Browse files

[Input] Use new Joystick settings when Enabling/Disabling joystick

  • Loading branch information...
1 parent 5102dc2 commit de5f9c4640cb1774cd24c3b2565ccac208a2cd66 @Karlson2k committed Oct 2, 2012
Showing with 7 additions and 3 deletions.
  1. +3 −1 xbmc/Application.cpp
  2. +4 −2 xbmc/settings/GUIWindowSettingsCategory.cpp
View
4 xbmc/Application.cpp
@@ -176,6 +176,7 @@
#include "peripherals/Peripherals.h"
#include "peripherals/dialogs/GUIDialogPeripheralManager.h"
#include "peripherals/dialogs/GUIDialogPeripheralSettings.h"
+#include "peripherals/devices/PeripheralImon.h"
// Windows includes
#include "guilib/GUIWindowManager.h"
@@ -1417,7 +1418,8 @@ bool CApplication::Initialize()
ResetScreenSaver();
#ifdef HAS_SDL_JOYSTICK
- g_Joystick.SetEnabled(g_guiSettings.GetBool("input.enablejoystick"));
+ g_Joystick.SetEnabled(g_guiSettings.GetBool("input.enablejoystick") &&
+ (CPeripheralImon::GetCountOfImonsConflictWithDInput() == 0 || !g_guiSettings.GetBool("input.disablejoystickwithimon")) );
#endif
return true;
View
6 xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -84,6 +84,7 @@
#include "network/Zeroconf.h"
#include "peripherals/Peripherals.h"
#include "peripherals/dialogs/GUIDialogPeripheralManager.h"
+#include "peripherals/devices/PeripheralImon.h"
#ifdef _WIN32
#include "WIN32Util.h"
@@ -1432,10 +1433,11 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
{
g_Mouse.SetEnabled(g_guiSettings.GetBool("input.enablemouse"));
}
- else if (strSetting.Equals("input.enablejoystick"))
+ else if (strSetting.Equals("input.enablejoystick") || strSetting.Equals("input.disablejoystickwithimon"))
{
#if defined(HAS_SDL_JOYSTICK)
- g_Joystick.SetEnabled(g_guiSettings.GetBool("input.enablejoystick"));
+ g_Joystick.SetEnabled(g_guiSettings.GetBool("input.enablejoystick")
+ && (CPeripheralImon::GetCountOfImonsConflictWithDInput() == 0 || !g_guiSettings.GetBool("input.disablejoystickwithimon")) );
#endif
}
else if (strSetting.Equals("videoscreen.screen"))

0 comments on commit de5f9c4

Please sign in to comment.
Something went wrong with that request. Please try again.