Replace system-wide iMON setting with per-device setting #1536

Merged
merged 1 commit into from Dec 13, 2012

3 participants

@Karlson2k
Team Kodi member

Addition for #1189
Allow user to set each iMON device as compatible/incompatible with direct input/joystick (this depends on firmware and can't be detected).
When joystick is disabled by iMON presence, disable manual on/off switch in GUI as non-functional (automatic joystick disable have priority over global joystick switch so disabled switch directly indicate disable of joystick).
This way should be clearer for user as user will not try to on/off joystick without any effect.

@opdenkamp
Team Kodi member

yeah missed one thing there. that imon setting can be moved out of guisettings and into the imon class's settings. could you change the PR so it does that instead.

we don't need to bother people with this in guisettings.

@Karlson2k
Team Kodi member

Did you mean move to per-device setting?

@opdenkamp
Team Kodi member

yes please

@opdenkamp opdenkamp was assigned Oct 7, 2012
@opdenkamp
Team Kodi member

the we better make the peripheral have an option to disable joystick support, and make it disable the guisetting if it's not doing that yet, so the values won't be conflicting.

@Karlson2k
Team Kodi member

@opdenkamp Perfect! This is exactly what this PR is doing.
1. Removed global "iMON device" setting
2. Added setting to device to disable joystick (default is ON)
3. If device is present and device setting is ON, than GUI setting for joystick is disabled.

@Karlson2k
Team Kodi member

And thanks to flexible peripheral framework, device setting will appear only on win32 platform.

@Karlson2k
Team Kodi member

@opdenkamp Can I improve it somehow before close of merge window?

@opdenkamp
Team Kodi member

i consider it a fix, but @cptspiff needs to give his ok as the merge window is already closed.
and i'd like to review it properly another time first.

@opdenkamp opdenkamp and 1 other commented on an outdated diff Oct 30, 2012
xbmc/peripherals/devices/PeripheralImon.cpp
@@ -73,19 +74,44 @@ bool CPeripheralImon::InitialiseFeature(const PeripheralFeature feature)
return CPeripheralHID::InitialiseFeature(feature);
}
+void CPeripheralImon::AddSetting(const CStdString &strKey, const CSetting *setting)
+{
+#if !defined(TARGET_WINDOWS)
+ if (strKey.compare("disable_winjoystick")!=0)
+#endif // !TARGET_WINDOWS
+ CPeripheralHID::AddSetting(strKey, setting);
+}
+
+void CPeripheralImon::OnSettingChanged(const CStdString &strChangedSetting)
+{
+ if (strChangedSetting.compare("disable_winjoystick")==0)
+ {
+#if defined(TARGET_WINDOWS)
@opdenkamp
Team Kodi member
opdenkamp added a line comment Oct 30, 2012

do we need this ifdef? m_ImonConflictsWithDInput should never be true on other platforms?
also, please name it m_bImonConflictsWithDInput

@Karlson2k
Team Kodi member
Karlson2k added a line comment Dec 4, 2012

I'll remove this ifdef.
Moreover, there are no "disable_winjoystick" on other platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Karlson2k
Team Kodi member

@opdenkamp Done + rebased.

@Karlson2k
Team Kodi member

@opdenkamp As strings are already translated, should I pick other string ID?

@opdenkamp
Team Kodi member

@alanwww1 does transifex handle changed strings?

@Karlson2k
Team Kodi member

@opdenkamp Besides translated strings, is all other code OK?

@opdenkamp
Team Kodi member

yeah fine with me

@Karlson2k
Team Kodi member

@opdenkamp Nice!
May be it's faster and better to pick other ID for string?

@opdenkamp
Team Kodi member

yeah please do

@Karlson2k
Team Kodi member

@opdenkamp Done.

@opdenkamp
Team Kodi member

ok with me so over to @davilla: removes the change in guisettings that was done for this, but i fine with me too if it needs to wait until .1

@davilla davilla was assigned Dec 13, 2012
@davilla

does this fix an existing problem or issue ?

@opdenkamp
Team Kodi member

the settings changes between eden and now for this thing could be confusing for users. this make it a setting per device (if you're using an imon device on windows). so yeah, it fixes an issue

@Karlson2k
Team Kodi member

@davilla This is a fix for iMON/joystick fix (PR #1189).
If someone have two sets of iMON devices: one with buggy firmware and another with proper firmware, than with this fix it's possible to run single installation of XBMC on both hardware sets. But it's definitely rare situation.
And, as @opdenkamp pointed, settings introduced in #1189 (post-Eden) could confuse users.

@davilla davilla merged commit 6671312 into xbmc:master Dec 13, 2012
@Karlson2k Karlson2k deleted the Karlson2k:Imon_addition_01 branch Oct 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment