Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2738 from Montellese/fix_videoscreen_settings

settings: move dependency handling into CSettingsManager and fix videoscreen settings
  • Loading branch information...
commit 9ac3e4c18bb9b3ea95d26d923022b39c558ec209 2 parents 95b23de + c3be62c
@Montellese Montellese authored
Showing with 420 additions and 296 deletions.
  1. +5 −1 system/settings/settings.xml
  2. +0 −3  xbmc/Application.cpp
  3. +1 −0  xbmc/GUIPassword.cpp
  4. +1 −0  xbmc/LangInfo.cpp
  5. +1 −0  xbmc/addons/Skin.cpp
  6. +1 −1  xbmc/cores/AudioEngine/AEFactory.cpp
  7. +1 −0  xbmc/epg/EpgContainer.cpp
  8. +1 −0  xbmc/guilib/GUIAudioManager.cpp
  9. +1 −1  xbmc/guilib/GraphicContext.cpp
  10. +1 −0  xbmc/input/SDLJoystick.cpp
  11. +0 −1  xbmc/interfaces/Builtins.cpp
  12. +1 −0  xbmc/linux/LinuxTimezone.cpp
  13. +1 −0  xbmc/network/NetworkServices.cpp
  14. +1 −0  xbmc/osx/XBMCHelper.cpp
  15. +1 −1  xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp
  16. +1 −0  xbmc/powermanagement/PowerManager.cpp
  17. +1 −0  xbmc/pvr/PVRManager.cpp
  18. +1 −0  xbmc/pvr/channels/PVRChannelGroup.cpp
  19. +1 −0  xbmc/settings/AdvancedSettings.cpp
  20. +37 −15 xbmc/settings/DisplaySettings.cpp
  21. +2 −0  xbmc/settings/DisplaySettings.h
  22. +11 −0 xbmc/settings/ISettingCallback.h
  23. +127 −2 xbmc/settings/Setting.cpp
  24. +23 −5 xbmc/settings/Setting.h
  25. +0 −15 xbmc/settings/Settings.cpp
  26. +1 −34 xbmc/settings/Settings.h
  27. +80 −1 xbmc/settings/SettingsManager.cpp
  28. +4 −6 xbmc/settings/SettingsManager.h
  29. +102 −67 xbmc/settings/windows/GUIControlSettings.cpp
  30. +3 −13 xbmc/settings/windows/GUIControlSettings.h
  31. +6 −125 xbmc/settings/windows/GUIWindowSettingsCategory.cpp
  32. +1 −5 xbmc/settings/windows/GUIWindowSettingsCategory.h
  33. +1 −0  xbmc/utils/Weather.cpp
  34. +1 −0  xbmc/windowing/WinSystem.cpp
View
6 system/settings/settings.xml
@@ -1842,7 +1842,11 @@
<constraints>
<options>screens</options>
</constraints>
- <control type="spinner" format="string" delayed="true" />
+ <control type="spinner" format="string" delayed="true">
+ <dependencies>
+ <dependency type="update" setting="videoscreen.screenmode" />
+ </dependencies>
+ </control>
</setting>
<setting id="videoscreen.resolution" type="integer" label="169" help="36352">
<level>0</level>
View
3  xbmc/Application.cpp
@@ -505,10 +505,7 @@ bool CApplication::OnEvent(XBMC_Event& newEvent)
// when fullscreen, remain fullscreen and resize to the dimensions of the new screen
RESOLUTION newRes = (RESOLUTION) g_Windowing.DesktopResolution(g_Windowing.GetCurrentScreen());
if (newRes != g_graphicsContext.GetVideoResolution())
- {
CDisplaySettings::Get().SetCurrentResolution(newRes, true);
- g_graphicsContext.SetVideoResolution(newRes);
- }
}
else
#endif
View
1  xbmc/GUIPassword.cpp
@@ -30,6 +30,7 @@
#include "profiles/dialogs/GUIDialogProfileSettings.h"
#include "Util.h"
#include "settings/MediaSourceSettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "guilib/GUIWindowManager.h"
#include "FileItem.h"
View
1  xbmc/LangInfo.cpp
@@ -27,6 +27,7 @@
#include "guilib/LocalizeStrings.h"
#include "pvr/PVRManager.h"
#include "settings/AdvancedSettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "utils/CharsetConverter.h"
#include "utils/log.h"
View
1  xbmc/addons/Skin.cpp
@@ -25,6 +25,7 @@
#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "guilib/WindowIDs.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "utils/URIUtils.h"
#include "utils/log.h"
View
2  xbmc/cores/AudioEngine/AEFactory.cpp
@@ -343,7 +343,7 @@ void CAEFactory::SettingOptionsAudioDevicesFillerGeneral(const CSetting *setting
firstDevice = sink->second;
#if defined(TARGET_DARWIN)
- list.push_back(StringSettingOption(sink->first, sink->first));
+ list.push_back(std::make_pair(sink->first, sink->first));
#else
list.push_back(std::make_pair(sink->first, sink->second));
#endif
View
1  xbmc/epg/EpgContainer.cpp
@@ -21,6 +21,7 @@
#include "Application.h"
#include "threads/SingleLock.h"
#include "settings/AdvancedSettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "dialogs/GUIDialogExtendedProgressBar.h"
#include "dialogs/GUIDialogProgress.h"
View
1  xbmc/guilib/GUIAudioManager.cpp
@@ -22,6 +22,7 @@
#include "GUIAudioManager.h"
#include "Key.h"
#include "input/ButtonTranslator.h"
+#include "settings/Setting.h"
#include "threads/SingleLock.h"
#include "utils/URIUtils.h"
#include "utils/XBMCTinyXML.h"
View
2  xbmc/guilib/GraphicContext.cpp
@@ -25,6 +25,7 @@
#include "ApplicationMessenger.h"
#include "settings/AdvancedSettings.h"
#include "settings/DisplaySettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "cores/VideoRenderers/RenderManager.h"
#include "windowing/WindowingFactory.h"
@@ -857,7 +858,6 @@ bool CGraphicContext::ToggleFullScreenRoot ()
#endif
}
- SetVideoResolution(newRes);
CDisplaySettings::Get().SetCurrentResolution(uiRes, true);
return m_bFullScreenRoot;
View
1  xbmc/input/SDLJoystick.cpp
@@ -23,6 +23,7 @@
#include "ButtonTranslator.h"
#include "peripherals/devices/PeripheralImon.h"
#include "settings/AdvancedSettings.h"
+#include "settings/Setting.h"
#include "utils/log.h"
#include <math.h>
View
1  xbmc/interfaces/Builtins.cpp
@@ -473,7 +473,6 @@ int CBuiltins::Execute(const CStdString& execString)
if (g_graphicsContext.IsValidResolution(res))
{
CDisplaySettings::Get().SetCurrentResolution(res, true);
- g_graphicsContext.SetVideoResolution(res);
g_application.ReloadSkin();
}
}
View
1  xbmc/linux/LinuxTimezone.cpp
@@ -35,6 +35,7 @@
#include "Util.h"
#include "XBDateTime.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
using namespace std;
View
1  xbmc/network/NetworkServices.cpp
@@ -74,6 +74,7 @@
#endif
#include "settings/AdvancedSettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "utils/log.h"
#include "utils/RssManager.h"
View
1  xbmc/osx/XBMCHelper.cpp
@@ -32,6 +32,7 @@
#include "dialogs/GUIDialogYesNo.h"
#include "utils/log.h"
#include "system.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "utils/SystemInfo.h"
View
2  xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp
@@ -106,7 +106,7 @@ void CGUIDialogPeripheralSettings::CreateSettings()
{
m_intTextSettings.insert(make_pair(CStdString(intSetting->GetId()), intSetting->GetValue()));
vector<pair<int, int> > entries;
- SettingOptions::const_iterator entriesItr = intSetting->GetOptions().begin();
+ StaticIntegerSettingOptions::const_iterator entriesItr = intSetting->GetOptions().begin();
while (entriesItr != intSetting->GetOptions().end())
{
entries.push_back(make_pair(entriesItr->first, entriesItr->second));
View
1  xbmc/powermanagement/PowerManager.cpp
@@ -23,6 +23,7 @@
#include "Application.h"
#include "cores/AudioEngine/AEFactory.h"
#include "input/KeyboardStat.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "windowing/WindowingFactory.h"
#include "utils/log.h"
View
1  xbmc/pvr/PVRManager.cpp
@@ -32,6 +32,7 @@
#include "music/tags/MusicInfoTag.h"
#include "settings/AdvancedSettings.h"
#include "settings/MediaSettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "threads/SingleLock.h"
#include "windows/GUIWindowPVR.h"
View
1  xbmc/pvr/channels/PVRChannelGroup.cpp
@@ -24,6 +24,7 @@
*/
#include "settings/AdvancedSettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "guilib/GUIWindowManager.h"
#include "dialogs/GUIDialogYesNo.h"
View
1  xbmc/settings/AdvancedSettings.cpp
@@ -28,6 +28,7 @@
#include "utils/LangCodeExpander.h"
#include "LangInfo.h"
#include "profiles/ProfilesManager.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "utils/StringUtils.h"
#include "utils/SystemInfo.h"
View
52 xbmc/settings/DisplaySettings.cpp
@@ -27,6 +27,7 @@
#include "guilib/gui3d.h"
#include "guilib/LocalizeStrings.h"
#include "settings/AdvancedSettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "threads/SingleLock.h"
#include "utils/log.h"
@@ -204,6 +205,7 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting)
if (m_ignoreSettingChanging.find(make_pair(settingId, true)) == m_ignoreSettingChanging.end())
{
RESOLUTION newRes = RES_DESKTOP;
+ DisplayMode oldDisplayMode = GetCurrentDisplayMode();
if (settingId == "videoscreen.resolution")
newRes = (RESOLUTION)((CSettingInt*)setting)->GetValue();
else if (settingId == "videoscreen.screen")
@@ -221,28 +223,30 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting)
SetCurrentResolution(newRes, save);
g_graphicsContext.SetVideoResolution(newRes);
- // check if this setting is temporarily blocked from showing the dialog
- if (m_ignoreSettingChanging.find(make_pair(settingId, false)) == m_ignoreSettingChanging.end())
+ // check if the old or the new resolution was/is windowed
+ // in which case we don't show any prompt to the user
+ if (newRes != RES_WINDOW && oldDisplayMode != DM_WINDOWED)
{
- bool cancelled = false;
- if (!CGUIDialogYesNo::ShowAndGetInput(13110, 13111, 20022, 20022, -1, -1, cancelled, 10000))
+ // check if this setting is temporarily blocked from showing the dialog
+ if (newRes != RES_WINDOW &&
+ m_ignoreSettingChanging.find(make_pair(settingId, false)) == m_ignoreSettingChanging.end())
{
- // we need to ignore the next OnSettingChanging() call for
- // the same setting which is executed to broadcast that
- // changing the setting has failed
- m_ignoreSettingChanging.insert(make_pair(settingId, false));
- return false;
+ bool cancelled = false;
+ if (!CGUIDialogYesNo::ShowAndGetInput(13110, 13111, 20022, 20022, -1, -1, cancelled, 10000))
+ {
+ // we need to ignore the next OnSettingChanging() call for
+ // the same setting which is executed to broadcast that
+ // changing the setting has failed
+ m_ignoreSettingChanging.insert(make_pair(settingId, false));
+ return false;
+ }
}
+ else
+ m_ignoreSettingChanging.erase(make_pair(settingId, false));
}
- else
- m_ignoreSettingChanging.erase(make_pair(settingId, false));
if (settingId == "videoscreen.screen")
- {
m_ignoreSettingChanging.insert(make_pair("videoscreen.resolution", true));
- if (CSettings::Get().GetSetting("videoscreen.screenmode")->IsVisible())
- m_ignoreSettingChanging.insert(make_pair("videoscreen.screenmode", true));
- }
}
else
m_ignoreSettingChanging.erase(make_pair(settingId, true));
@@ -412,6 +416,14 @@ void CDisplaySettings::UpdateCalibrations()
}
}
+DisplayMode CDisplaySettings::GetCurrentDisplayMode() const
+{
+ if (GetCurrentResolution() == RES_WINDOW)
+ return DM_WINDOWED;
+
+ return GetCurrentResolutionInfo().iScreen;
+}
+
RESOLUTION CDisplaySettings::GetResolutionFromString(const std::string &strResolution)
{
if (strResolution == "DESKTOP")
@@ -570,6 +582,16 @@ void CDisplaySettings::SettingOptionsScreensFiller(const CSetting *setting, std:
int screen = CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP + idx).iScreen;
list.push_back(make_pair(StringUtils::Format(g_localizeStrings.Get(241), screen + 1), screen));
}
+
+ RESOLUTION res = CDisplaySettings::Get().GetDisplayResolution();
+
+ if (res == RES_WINDOW)
+ current = DM_WINDOWED;
+ else
+ {
+ RESOLUTION_INFO resInfo = CDisplaySettings::Get().GetResolutionInfo(res);
+ current = resInfo.iScreen;
+ }
}
void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int &current)
View
2  xbmc/settings/DisplaySettings.h
@@ -99,6 +99,8 @@ class CDisplaySettings : public ISettingCallback, public ISubSettings,
CDisplaySettings const& operator=(CDisplaySettings const&);
virtual ~CDisplaySettings();
+ DisplayMode GetCurrentDisplayMode() const;
+
static RESOLUTION GetResolutionFromString(const std::string &strResolution);
static std::string GetStringFromResolution(RESOLUTION resolution, float refreshrate = 0.0f);
static RESOLUTION GetResolutionForScreen();
View
11 xbmc/settings/ISettingCallback.h
@@ -73,4 +73,15 @@ class ISettingCallback
\return True if the setting has been successfully updated otherwise false
*/
virtual bool OnSettingUpdate(CSetting* &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) { return false; }
+
+ /*!
+ \brief The given property of the given setting has changed
+
+ This callback is triggered when a property (e.g. enabled or the list of
+ dynamic options) has changed.
+
+ \param setting The setting which has a changed property
+ \param propertyName The string representation of the changed property
+ */
+ virtual void OnSettingPropertyChanged(const CSetting *setting, const char *propertyName) { }
};
View
129 xbmc/settings/Setting.cpp
@@ -21,6 +21,7 @@
#include <sstream>
#include "Setting.h"
+#include "SettingsManager.h"
#include "threads/SingleLock.h"
#include "utils/log.h"
#include "utils/StringUtils.h"
@@ -143,6 +144,24 @@ bool CSetting::Deserialize(const TiXmlNode *node, bool update /* = false */)
return true;
}
+bool CSetting::IsEnabled() const
+{
+ bool enabled = true;
+ for (SettingDependencies::const_iterator depIt = m_dependencies.begin(); depIt != m_dependencies.end(); ++depIt)
+ {
+ if (depIt->GetType() != SettingDependencyTypeEnable)
+ continue;
+
+ if (!depIt->Check())
+ {
+ enabled = false;
+ break;
+ }
+ }
+
+ return enabled;
+}
+
bool CSetting::OnSettingChanging(const CSetting *setting)
{
if (m_callback == NULL)
@@ -175,6 +194,14 @@ bool CSetting::OnSettingUpdate(CSetting* &setting, const char *oldSettingId, con
return m_callback->OnSettingUpdate(setting, oldSettingId, oldSettingNode);
}
+void CSetting::OnSettingPropertyChanged(const CSetting *setting, const char *propertyName)
+{
+ if (m_callback == NULL)
+ return;
+
+ m_callback->OnSettingPropertyChanged(setting, propertyName);
+}
+
void CSetting::Copy(const CSetting &setting)
{
SetVisible(setting.IsVisible());
@@ -378,7 +405,7 @@ CSettingInt::CSettingInt(const std::string &id, int label, int value, int minimu
m_control.SetAttributes(SettingControlAttributeNone);
}
-CSettingInt::CSettingInt(const std::string &id, int label, int value, const SettingOptions &options, CSettingsManager *settingsManager /* = NULL */)
+CSettingInt::CSettingInt(const std::string &id, int label, int value, const StaticIntegerSettingOptions &options, CSettingsManager *settingsManager /* = NULL */)
: CSetting(id, settingsManager),
m_value(value), m_default(value),
m_min(0), m_step(1), m_max(0),
@@ -511,7 +538,7 @@ bool CSettingInt::CheckValidity(int value) const
{
//if the setting is an std::map, check if we got a valid value before assigning it
bool ok = false;
- for (SettingOptions::const_iterator it = m_options.begin(); it != m_options.end(); it++)
+ for (StaticIntegerSettingOptions::const_iterator it = m_options.begin(); it != m_options.end(); it++)
{
if (it->second == value)
{
@@ -569,6 +596,55 @@ void CSettingInt::SetDefault(int value)
m_value = m_default;
}
+SettingOptionsType CSettingInt::GetOptionsType() const
+{
+ if (!m_options.empty())
+ return SettingOptionsTypeStatic;
+ if (!m_optionsFiller.empty())
+ return SettingOptionsTypeDynamic;
+
+ return SettingOptionsTypeNone;
+}
+
+DynamicIntegerSettingOptions CSettingInt::UpdateDynamicOptions()
+{
+ DynamicIntegerSettingOptions options;
+ if (m_optionsFiller.empty() || m_settingsManager == NULL)
+ return options;
+
+ IntegerSettingOptionsFiller filler = (IntegerSettingOptionsFiller)m_settingsManager->GetSettingOptionsFiller(this);
+ if (filler == NULL)
+ return options;
+
+ int bestMatchingValue = m_value;
+ filler(this, options, bestMatchingValue);
+
+ if (bestMatchingValue != m_value)
+ SetValue(bestMatchingValue);
+
+ bool changed = m_dynamicOptions.size() != options.size();
+ if (!changed)
+ {
+ for (size_t index = 0; index < options.size(); index++)
+ {
+ if (options[index].first.compare(m_dynamicOptions[index].first) != 0 ||
+ options[index].second != m_dynamicOptions[index].second)
+ {
+ changed = true;
+ break;
+ }
+ }
+ }
+
+ if (changed)
+ {
+ m_dynamicOptions = options;
+ OnSettingPropertyChanged(this, "options");
+ }
+
+ return options;
+}
+
void CSettingInt::copy(const CSettingInt &setting)
{
CSetting::Copy(setting);
@@ -881,6 +957,55 @@ void CSettingString::SetDefault(const std::string &value)
m_value = m_default;
}
+SettingOptionsType CSettingString::GetOptionsType() const
+{
+ if (!m_optionsFiller.empty())
+ return SettingOptionsTypeDynamic;
+
+ return SettingOptionsTypeNone;
+}
+
+DynamicStringSettingOptions CSettingString::UpdateDynamicOptions()
+{
+ DynamicStringSettingOptions options;
+ if (m_optionsFiller.empty() || m_settingsManager == NULL)
+ return options;
+
+ StringSettingOptionsFiller filler = (StringSettingOptionsFiller)m_settingsManager->GetSettingOptionsFiller(this);
+ if (filler == NULL)
+ return options;
+
+ std::string bestMatchingValue = m_value;
+ filler(this, options, bestMatchingValue);
+
+ bool updated = false;
+ if (bestMatchingValue != m_value)
+ updated = SetValue(bestMatchingValue);
+
+ // check if the list of items has changed
+ bool changed = m_dynamicOptions.size() != options.size();
+ if (!changed)
+ {
+ for (size_t index = 0; index < options.size(); index++)
+ {
+ if (options[index].first.compare(m_dynamicOptions[index].first) != 0 ||
+ options[index].second.compare(m_dynamicOptions[index].second) != 0)
+ {
+ changed = true;
+ break;
+ }
+ }
+ }
+
+ if (changed)
+ {
+ m_dynamicOptions = options;
+ OnSettingPropertyChanged(this, "options");
+ }
+
+ return options;
+}
+
void CSettingString::copy(const CSettingString &setting)
{
CSetting::Copy(setting);
View
28 xbmc/settings/Setting.h
@@ -56,8 +56,18 @@ typedef enum {
SettingLevelInternal
} SettingLevel;
-typedef std::pair<int, int> SettingOption;
-typedef std::vector<SettingOption> SettingOptions;
+typedef enum {
+ SettingOptionsTypeNone = 0,
+ SettingOptionsTypeStatic,
+ SettingOptionsTypeDynamic
+} SettingOptionsType;
+
+typedef std::pair<int, int> StaticIntegerSettingOption;
+typedef std::vector<StaticIntegerSettingOption> StaticIntegerSettingOptions;
+typedef std::pair<std::string, int> DynamicIntegerSettingOption;
+typedef std::vector<DynamicIntegerSettingOption> DynamicIntegerSettingOptions;
+typedef std::pair<std::string, std::string> DynamicStringSettingOption;
+typedef std::vector<DynamicStringSettingOption> DynamicStringSettingOptions;
/*!
\ingroup settings
@@ -83,6 +93,7 @@ class CSetting : public ISetting,
int GetLabel() const { return m_label; }
int GetHelp() const { return m_help; }
+ bool IsEnabled() const;
SettingLevel GetLevel() const { return m_level; }
const CSettingControl& GetControl() const { return m_control; }
const SettingDependencies& GetDependencies() const { return m_dependencies; }
@@ -95,6 +106,7 @@ class CSetting : public ISetting,
virtual void OnSettingChanged(const CSetting *setting);
virtual void OnSettingAction(const CSetting *setting);
virtual bool OnSettingUpdate(CSetting* &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode);
+ virtual void OnSettingPropertyChanged(const CSetting *setting, const char *propertyName);
void Copy(const CSetting &setting);
@@ -158,7 +170,7 @@ class CSettingInt : public CSetting
CSettingInt(const std::string &id, const CSettingInt &setting);
CSettingInt(const std::string &id, int label, int value, int minimum, int step, int maximum, int format, int minimumLabel, CSettingsManager *settingsManager = NULL);
CSettingInt(const std::string &id, int label, int value, int minimum, int step, int maximum, const std::string &format, CSettingsManager *settingsManager = NULL);
- CSettingInt(const std::string &id, int label, int value, const SettingOptions &options, CSettingsManager *settingsManager = NULL);
+ CSettingInt(const std::string &id, int label, int value, const StaticIntegerSettingOptions &options, CSettingsManager *settingsManager = NULL);
virtual ~CSettingInt() { }
virtual bool Deserialize(const TiXmlNode *node, bool update = false);
@@ -183,8 +195,10 @@ class CSettingInt : public CSetting
int GetFormat() const { return m_format; }
int GetMinimumLabel() const { return m_labelMin; }
const std::string& GetFormatString() const { return m_strFormat; }
- const SettingOptions& GetOptions() const { return m_options; }
+ SettingOptionsType GetOptionsType() const;
+ const StaticIntegerSettingOptions& GetOptions() const { return m_options; }
const std::string& GetOptionsFiller() const { return m_optionsFiller; }
+ DynamicIntegerSettingOptions UpdateDynamicOptions();
private:
void copy(const CSettingInt &setting);
@@ -198,8 +212,9 @@ class CSettingInt : public CSetting
int m_format;
int m_labelMin;
std::string m_strFormat;
- SettingOptions m_options;
+ StaticIntegerSettingOptions m_options;
std::string m_optionsFiller;
+ DynamicIntegerSettingOptions m_dynamicOptions;
};
/*!
@@ -275,7 +290,9 @@ class CSettingString : public CSetting
virtual bool AllowEmpty() const { return m_allowEmpty; }
virtual int GetHeading() const { return m_heading; }
+ SettingOptionsType GetOptionsType() const;
const std::string& GetOptionsFiller() const { return m_optionsFiller; }
+ DynamicStringSettingOptions UpdateDynamicOptions();
protected:
virtual void copy(const CSettingString &setting);
@@ -285,6 +302,7 @@ class CSettingString : public CSetting
bool m_allowEmpty;
int m_heading;
std::string m_optionsFiller;
+ DynamicStringSettingOptions m_dynamicOptions;
};
/*!
View
15 xbmc/settings/Settings.cpp
@@ -457,21 +457,6 @@ CSettingSection* CSettings::GetSection(const std::string &section) const
return m_settingsManager->GetSection(section);
}
-SettingDependencyMap CSettings::GetDependencies(const std::string &id) const
-{
- return m_settingsManager->GetDependencies(id);
-}
-
-SettingDependencyMap CSettings::GetDependencies(const CSetting *setting) const
-{
- return m_settingsManager->GetDependencies(setting);
-}
-
-void* CSettings::GetSettingOptionsFiller(const CSetting *setting)
-{
- return m_settingsManager->GetSettingOptionsFiller(setting);
-}
-
bool CSettings::GetBool(const std::string &id) const
{
return m_settingsManager->GetBool(id);
View
35 xbmc/settings/Settings.h
@@ -24,9 +24,9 @@
#include "settings/ISettingCallback.h"
#include "settings/ISettingCreator.h"
-#include "settings/Setting.h"
#include "threads/CriticalSection.h"
+class CSetting;
class CSettingSection;
class CSettingsManager;
class TiXmlElement;
@@ -152,39 +152,6 @@ class CSettings : public ISettingCreator
\return Setting section with the given identifier or NULL if the identifier is unknown
*/
CSettingSection* GetSection(const std::string &section) const;
- /*!
- \brief Gets a map of settings (and their dependencies) which depend on
- the setting with the given identifier.
-
- It is important to note that the returned dependencies are not the
- dependencies of the setting with the given identifier but the settings
- (and their dependencies) which depend on the setting with the given
- identifier.
-
- \param id Setting identifier
- \return Map of settings (and their dependencies) which depend on the setting with the given identifier
- */
- SettingDependencyMap GetDependencies(const std::string &id) const;
- /*!
- \brief Gets a map of settings (and their dependencies) which depend on
- the given setting.
-
- It is important to note that the returned dependencies are not the
- dependencies of the given setting but the settings (and their dependencies)
- which depend on the given setting.
-
- \param setting Setting object
- \return Map of settings (and their dependencies) which depend on the given setting
- */
- SettingDependencyMap GetDependencies(const CSetting *setting) const;
- /*!
- \brief Gets the implementation of the setting options filler used by the
- given setting.
-
- \param setting Setting object
- \return Implementation of the setting options filler (either IntegerSettingOptionsFiller or StringSettingOptionsFiller)
- */
- void* GetSettingOptionsFiller(const CSetting *setting);
/*!
\brief Gets the boolean value of the setting with the given identifier.
View
81 xbmc/settings/SettingsManager.cpp
@@ -132,7 +132,19 @@ bool CSettingsManager::Initialize(const TiXmlElement *root)
if (setting == m_settings.end())
continue;
- setting->second.dependencies[itSettingDep->first].push_back(*depIt);
+ bool newDep = true;
+ SettingDependencies &settingDeps = setting->second.dependencies[itSettingDep->first];
+ for (SettingDependencies::const_iterator itDeps = settingDeps.begin(); itDeps != settingDeps.end(); ++itDeps)
+ {
+ if (itDeps->GetType() == depIt->GetType())
+ {
+ newDep = false;
+ break;
+ }
+ }
+
+ if (newDep)
+ settingDeps.push_back(*depIt);
}
}
}
@@ -665,6 +677,14 @@ void CSettingsManager::OnSettingChanged(const CSetting *setting)
callback != settingData.callbacks.end();
callback++)
(*callback)->OnSettingChanged(setting);
+
+ // now handle any settings which depend on the changed setting
+ const SettingDependencyMap& deps = GetDependencies(setting);
+ for (SettingDependencyMap::const_iterator depsIt = deps.begin(); depsIt != deps.end(); depsIt++)
+ {
+ for (SettingDependencies::const_iterator depIt = depsIt->second.begin(); depIt != depsIt->second.end(); depIt++)
+ UpdateSettingByDependency(depsIt->first, *depIt);
+ }
}
void CSettingsManager::OnSettingAction(const CSetting *setting)
@@ -710,6 +730,26 @@ bool CSettingsManager::OnSettingUpdate(CSetting* &setting, const char *oldSettin
return ret;
}
+void CSettingsManager::OnSettingPropertyChanged(const CSetting *setting, const char *propertyName)
+{
+ CSingleLock lock(m_critical);
+ if (!m_loaded || setting == NULL)
+ return;
+
+ SettingMap::const_iterator settingIt = m_settings.find(setting->GetId());
+ if (settingIt == m_settings.end())
+ return;
+
+ Setting settingData = settingIt->second;
+ // now that we have a copy of the setting's data, we can leave the lock
+ lock.Leave();
+
+ for (CallbackSet::iterator callback = settingData.callbacks.begin();
+ callback != settingData.callbacks.end();
+ callback++)
+ (*callback)->OnSettingPropertyChanged(setting, propertyName);
+}
+
CSetting* CSettingsManager::CreateSetting(const std::string &settingType, const std::string &settingId, CSettingsManager *settingsManager /* = NULL */) const
{
if (StringUtils::EqualsNoCase(settingType, "boolean"))
@@ -871,6 +911,45 @@ bool CSettingsManager::UpdateSetting(const TiXmlNode *node, CSetting *setting, c
return updated;
}
+void CSettingsManager::UpdateSettingByDependency(const std::string &settingId, const CSettingDependency &dependency)
+{
+ CSetting *setting = GetSetting(settingId);
+ if (setting == NULL)
+ return;
+
+ switch (dependency.GetType())
+ {
+ case SettingDependencyTypeEnable:
+ // just trigger the property changed callback and a call to
+ // CSetting::IsEnabled() will automatically determine the new
+ // enabled state
+ OnSettingPropertyChanged(setting, "enabled");
+ break;
+
+ case SettingDependencyTypeUpdate:
+ {
+ SettingType type = (SettingType)setting->GetType();
+ if (type == SettingTypeInteger)
+ {
+ CSettingInt *settingInt = ((CSettingInt*)setting);
+ if (settingInt->GetOptionsType() == SettingOptionsTypeDynamic)
+ settingInt->UpdateDynamicOptions();
+ }
+ else if (type == SettingTypeString)
+ {
+ CSettingString *settingString = ((CSettingString*)setting);
+ if (settingString->GetOptionsType() == SettingOptionsTypeDynamic)
+ settingString->UpdateDynamicOptions();
+ }
+ break;
+ }
+
+ case SettingDependencyTypeNone:
+ default:
+ break;
+ }
+}
+
void CSettingsManager::RegisterSettingOptionsFiller(const std::string &identifier, void *filler, SettingOptionsFillerType type)
{
SettingOptionsFillerMap::const_iterator it = m_optionsFillers.find(identifier);
View
10 xbmc/settings/SettingsManager.h
@@ -38,12 +38,8 @@ class CSettingUpdate;
class TiXmlElement;
class TiXmlNode;
-typedef std::pair<std::string, int> IntegerSettingOption;
-typedef std::pair<std::string, std::string> StringSettingOption;
-typedef std::vector<IntegerSettingOption> IntegerSettingOptions;
-typedef std::vector<StringSettingOption> StringSettingOptions;
-typedef void (*IntegerSettingOptionsFiller)(const CSetting *setting, IntegerSettingOptions &list, int &current);
-typedef void (*StringSettingOptionsFiller)(const CSetting *setting, StringSettingOptions &list, std::string &current);
+typedef void (*IntegerSettingOptionsFiller)(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int &current);
+typedef void (*StringSettingOptionsFiller)(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current);
/*!
\ingroup settings
@@ -353,6 +349,7 @@ class CSettingsManager : public ISettingCreator, private ISettingCallback,
virtual void OnSettingChanged(const CSetting *setting);
virtual void OnSettingAction(const CSetting *setting);
virtual bool OnSettingUpdate(CSetting* &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode);
+ virtual void OnSettingPropertyChanged(const CSetting *setting, const char *propertyName);
// implementation of ISettingsHandler
virtual bool OnSettingsLoading();
@@ -370,6 +367,7 @@ class CSettingsManager : public ISettingCreator, private ISettingCallback,
bool LoadSetting(const TiXmlNode *node, CSetting *setting);
bool UpdateSettings(const TiXmlNode *root);
bool UpdateSetting(const TiXmlNode *node, CSetting *setting, const CSettingUpdate& update);
+ void UpdateSettingByDependency(const std::string &settingId, const CSettingDependency &dependency);
typedef enum {
SettingOptionsFillerTypeNone = 0,
View
169 xbmc/settings/windows/GUIControlSettings.cpp
@@ -44,7 +44,11 @@ CGUIControlBaseSetting::CGUIControlBaseSetting(int id, CSetting *pSetting)
m_id = id;
m_pSetting = pSetting;
m_delayed = false;
- m_enabled = true;
+}
+
+bool CGUIControlBaseSetting::IsEnabled() const
+{
+ return m_pSetting != NULL && m_pSetting->IsEnabled();
}
void CGUIControlBaseSetting::Update()
@@ -86,60 +90,7 @@ CGUIControlSpinExSetting::CGUIControlSpinExSetting(CGUISpinControlEx *pSpin, int
m_pSpin = pSpin;
m_pSpin->SetID(id);
- switch (pSetting->GetControl().GetFormat())
- {
- case SettingControlFormatNumber:
- {
- CSettingNumber *pSettingNumber = (CSettingNumber *)pSetting;
- m_pSpin->SetType(SPIN_CONTROL_TYPE_FLOAT);
- m_pSpin->SetFloatRange((float)pSettingNumber->GetMinimum(), (float)pSettingNumber->GetMaximum());
- m_pSpin->SetFloatInterval((float)pSettingNumber->GetStep());
- break;
- }
-
- case SettingControlFormatInteger:
- case SettingControlFormatString:
- {
- m_pSpin->SetType(SPIN_CONTROL_TYPE_TEXT);
- m_pSpin->Clear();
-
- if (pSetting->GetType() == SettingTypeInteger)
- {
- CSettingInt *pSettingInt = (CSettingInt *)pSetting;
-
- const SettingOptions& options = pSettingInt->GetOptions();
- if (!options.empty())
- {
- for (SettingOptions::const_iterator it = options.begin(); it != options.end(); it++)
- m_pSpin->AddLabel(g_localizeStrings.Get(it->first), it->second);
- m_pSpin->SetValue(pSettingInt->GetValue());
- }
- else
- {
- std::string strLabel;
- int i = pSettingInt->GetMinimum();
- if (pSettingInt->GetMinimumLabel() > -1)
- {
- strLabel = g_localizeStrings.Get(pSettingInt->GetMinimumLabel());
- m_pSpin->AddLabel(strLabel, pSettingInt->GetMinimum());
- i += pSettingInt->GetStep();
- }
- for (; i <= pSettingInt->GetMaximum(); i += pSettingInt->GetStep())
- {
- if (pSettingInt->GetFormat() > -1)
- strLabel = StringUtils::Format(g_localizeStrings.Get(pSettingInt->GetFormat()).c_str(), i);
- else
- strLabel = StringUtils::Format(pSettingInt->GetFormatString().c_str(), i);
- m_pSpin->AddLabel(strLabel, i);
- }
- }
- }
- break;
- }
-
- default:
- break;
- }
+ FillControl();
}
CGUIControlSpinExSetting::~CGUIControlSpinExSetting()
@@ -176,27 +127,111 @@ void CGUIControlSpinExSetting::Update()
CGUIControlBaseSetting::Update();
- switch (m_pSetting->GetType())
+ FillControl();
+
+ // disable the spinner if it has less than two items
+ if (!m_pSpin->IsDisabled() && (m_pSpin->GetMaximum() - m_pSpin->GetMinimum()) == 0)
+ m_pSpin->SetEnabled(false);
+}
+
+void CGUIControlSpinExSetting::FillControl()
+{
+ m_pSpin->Clear();
+
+ switch (m_pSetting->GetControl().GetFormat())
{
- case SettingTypeInteger:
- m_pSpin->SetValue(((CSettingInt *)m_pSetting)->GetValue());
+ case SettingControlFormatNumber:
+ {
+ CSettingNumber *pSettingNumber = (CSettingNumber *)m_pSetting;
+ m_pSpin->SetType(SPIN_CONTROL_TYPE_FLOAT);
+ m_pSpin->SetFloatRange((float)pSettingNumber->GetMinimum(), (float)pSettingNumber->GetMaximum());
+ m_pSpin->SetFloatInterval((float)pSettingNumber->GetStep());
+
+ m_pSpin->SetFloatValue((float)pSettingNumber->GetValue());
break;
+ }
- case SettingTypeNumber:
- m_pSpin->SetFloatValue((float)((CSettingNumber *)m_pSetting)->GetValue());
+ case SettingControlFormatInteger:
+ {
+ m_pSpin->SetType(SPIN_CONTROL_TYPE_TEXT);
+ FillIntegerSettingControl();
break;
-
- case SettingTypeString:
- m_pSpin->SetStringValue(((CSettingString *)m_pSetting)->GetValue());
+ }
+
+ case SettingControlFormatString:
+ {
+ m_pSpin->SetType(SPIN_CONTROL_TYPE_TEXT);
+
+ if (m_pSetting->GetType() == SettingTypeInteger)
+ FillIntegerSettingControl();
+ else if (m_pSetting->GetType() == SettingTypeString)
+ {
+ CSettingString *pSettingString = (CSettingString *)m_pSetting;
+ if (pSettingString->GetOptionsType() == SettingOptionsTypeDynamic)
+ {
+ DynamicStringSettingOptions options = pSettingString->UpdateDynamicOptions();
+ for (std::vector< std::pair<std::string, std::string> >::const_iterator option = options.begin(); option != options.end(); option++)
+ m_pSpin->AddLabel(option->first, option->second);
+
+ m_pSpin->SetStringValue(pSettingString->GetValue());
+ }
+ }
break;
-
+ }
+
default:
break;
}
+}
- // disable the spinner if it has less than two items
- if (!m_pSpin->IsDisabled() && (m_pSpin->GetMaximum() - m_pSpin->GetMinimum()) == 0)
- m_pSpin->SetEnabled(false);
+void CGUIControlSpinExSetting::FillIntegerSettingControl()
+{
+ CSettingInt *pSettingInt = (CSettingInt *)m_pSetting;
+ switch (pSettingInt->GetOptionsType())
+ {
+ case SettingOptionsTypeStatic:
+ {
+ const StaticIntegerSettingOptions& options = pSettingInt->GetOptions();
+ for (StaticIntegerSettingOptions::const_iterator it = options.begin(); it != options.end(); it++)
+ m_pSpin->AddLabel(g_localizeStrings.Get(it->first), it->second);
+
+ break;
+ }
+
+ case SettingOptionsTypeDynamic:
+ {
+ DynamicIntegerSettingOptions options = pSettingInt->UpdateDynamicOptions();
+ for (DynamicIntegerSettingOptions::const_iterator option = options.begin(); option != options.end(); option++)
+ m_pSpin->AddLabel(option->first, option->second);
+
+ break;
+ }
+
+ case SettingOptionsTypeNone:
+ default:
+ {
+ std::string strLabel;
+ int i = pSettingInt->GetMinimum();
+ if (pSettingInt->GetMinimumLabel() > -1)
+ {
+ strLabel = g_localizeStrings.Get(pSettingInt->GetMinimumLabel());
+ m_pSpin->AddLabel(strLabel, pSettingInt->GetMinimum());
+ i += pSettingInt->GetStep();
+ }
+ for (; i <= pSettingInt->GetMaximum(); i += pSettingInt->GetStep())
+ {
+ if (pSettingInt->GetFormat() > -1)
+ strLabel = StringUtils::Format(g_localizeStrings.Get(pSettingInt->GetFormat()).c_str(), i);
+ else
+ strLabel = StringUtils::Format(pSettingInt->GetFormatString().c_str(), i);
+ m_pSpin->AddLabel(strLabel, i);
+ }
+
+ break;
+ }
+ }
+
+ m_pSpin->SetValue(pSettingInt->GetValue());
}
CGUIControlButtonSetting::CGUIControlButtonSetting(CGUIButtonControl *pButton, int id, CSetting *pSetting)
View
16 xbmc/settings/windows/GUIControlSettings.h
@@ -58,17 +58,6 @@ class CGUIControlBaseSetting
bool IsDelayed() const { return m_delayed; }
/*!
- \brief Specifies that this setting is enabled or disabled
- This is used for settings which are enabled/disabled based
- on conditions involving other settings and their values.
- It must not be confused with a setting spin control being
- disabled because it contains less than two items.
- \param enabled Whether the setting is enabled or disabled
- \sa IsEnabled()
- */
- void SetEnabled(bool enabled) { m_enabled = enabled; }
-
- /*!
\brief Returns whether this setting is enabled or disabled
This state is independent of the real enabled state of a
setting control but represents the enabled state of the
@@ -76,7 +65,7 @@ class CGUIControlBaseSetting
\return true if the setting is enabled otherwise false
\sa SetEnabled()
*/
- bool IsEnabled() const { return m_enabled; }
+ bool IsEnabled() const;
virtual CGUIControl* GetControl() { return NULL; }
virtual bool OnClick() { return false; }
@@ -86,7 +75,6 @@ class CGUIControlBaseSetting
int m_id;
CSetting* m_pSetting;
bool m_delayed;
- bool m_enabled;
};
class CGUIControlRadioButtonSetting : public CGUIControlBaseSetting
@@ -116,6 +104,8 @@ class CGUIControlSpinExSetting : public CGUIControlBaseSetting
virtual void Update();
virtual void Clear() { m_pSpin = NULL; }
private:
+ void FillControl();
+ void FillIntegerSettingControl();
CGUISpinControlEx *m_pSpin;
};
View
131 xbmc/settings/windows/GUIWindowSettingsCategory.cpp
@@ -519,68 +519,19 @@ void CGUIWindowSettingsCategory::OnSettingChanged(const CSetting *setting)
if (pControl == NULL)
return;
- const SettingDependencyMap& deps = m_settings.GetDependencies(setting->GetId());
- for (SettingDependencyMap::const_iterator depsIt = deps.begin(); depsIt != deps.end(); depsIt++)
- {
- for (SettingDependencies::const_iterator depIt = depsIt->second.begin(); depIt != depsIt->second.end(); depIt++)
- UpdateControl(depsIt->first, *depIt);
- }
-
- // update GUI of the changed setting as the change could have been triggered by something else
pControl->Update();
}
-void CGUIWindowSettingsCategory::UpdateControl(const std::string &dependingSetting, const CSettingDependency &dependency)
+void CGUIWindowSettingsCategory::OnSettingPropertyChanged(const CSetting *setting, const char *propertyName)
{
- if (dependingSetting.empty())
+ if (setting == NULL || propertyName == NULL)
return;
- BaseSettingControlPtr pControl = GetSettingControl(dependingSetting);
- if (pControl == NULL)
- return;
-
- CSetting *pSetting = pControl->GetSetting();
- if (pSetting == NULL)
+ BaseSettingControlPtr settingControl = GetSettingControl(setting->GetId());
+ if (settingControl == NULL)
return;
- CheckDependency(pControl, dependency);
-
- const SettingDependencyMap& deps = m_settings.GetDependencies(pSetting->GetId());
- for (SettingDependencyMap::const_iterator depsIt = deps.begin(); depsIt != deps.end(); depsIt++)
- {
- for (SettingDependencies::const_iterator depIt = depsIt->second.begin(); depIt != depsIt->second.end(); depIt++)
- UpdateControl(depsIt->first, *depIt);
- }
-
- // update GUI of the changed setting as the change could have been triggered by something else
- pControl->Update();
-}
-
-void CGUIWindowSettingsCategory::CheckDependency(BaseSettingControlPtr pSettingControl, const CSettingDependency &dependency)
-{
- if (pSettingControl == NULL || pSettingControl->GetControl() == NULL)
- return;
-
- CSetting *pSetting = pSettingControl->GetSetting();
- if (pSetting == NULL)
- return;
-
- switch (dependency.GetType())
- {
- case SettingDependencyTypeEnable:
- pSettingControl->SetEnabled(dependency.Check());
- break;
-
- case SettingDependencyTypeUpdate:
- {
- FillControl(pSetting, pSettingControl->GetControl());
- break;
- }
-
- case SettingDependencyTypeNone:
- default:
- break;
- }
+ settingControl->Update();
}
void CGUIWindowSettingsCategory::CreateSettings()
@@ -624,9 +575,7 @@ void CGUIWindowSettingsCategory::CreateSettings()
{
CSetting *pSetting = *settingIt;
settingMap.insert(pSetting->GetId());
- CGUIControl* pControl = AddSetting(pSetting, group->GetWidth(), iControlID);
-
- FillControl(pSetting, pControl);
+ AddSetting(pSetting, group->GetWidth(), iControlID);
}
}
@@ -647,18 +596,6 @@ void CGUIWindowSettingsCategory::UpdateSettings()
if (pSetting == NULL || pControl == NULL)
continue;
- // update the setting's control's state (enabled/disabled etc)
- const SettingDependencies &deps = pSetting->GetDependencies();
- for (SettingDependencies::const_iterator dep = deps.begin(); dep != deps.end(); dep++)
- {
- // don't check "update" dependencies here as all the controls are already
- // setup properly based on the existing values
- if (dep->GetType() == SettingDependencyTypeUpdate)
- continue;
-
- CheckDependency(pSettingControl, *dep);
- }
-
pSettingControl->Update();
}
}
@@ -816,59 +753,3 @@ BaseSettingControlPtr CGUIWindowSettingsCategory::GetSettingControl(int controlI
return m_settingControls[controlId - CONTROL_START_CONTROL];
}
-
-void CGUIWindowSettingsCategory::FillControl(CSetting *pSetting, CGUIControl *pSettingControl)
-{
- void *filler = CSettings::Get().GetSettingOptionsFiller(pSetting);
- if (filler == NULL)
- return;
-
- if (pSetting->GetType() == SettingTypeInteger)
- {
- CSettingInt *pSettingInt = (CSettingInt*)pSetting;
-
- // get the list of options and the current option
- IntegerSettingOptions options;
- int currentOption = pSettingInt->GetValue();
- ((IntegerSettingOptionsFiller)filler)(pSetting, options, currentOption);
-
- // clear the spinner control
- CGUISpinControlEx *pSpinControl = (CGUISpinControlEx *)pSettingControl;
- pSpinControl->Clear();
-
- // fill the spinner control
- for (IntegerSettingOptions::const_iterator option = options.begin(); option != options.end(); option++)
- pSpinControl->AddLabel(option->first, option->second);
-
- // set the current option
- pSpinControl->SetValue(currentOption);
-
- // check if the current setting has changed
- if (currentOption != pSettingInt->GetValue())
- pSettingInt->SetValue(currentOption);
- }
- else if (pSetting->GetType() == SettingTypeString)
- {
- CSettingString *pSettingString = (CSettingString*)pSetting;
-
- // get the list of options and the current option
- StringSettingOptions options;
- std::string currentOption = pSettingString->GetValue();
- ((StringSettingOptionsFiller)filler)(pSetting, options, currentOption);
-
- // clear the spinner control
- CGUISpinControlEx *pSpinControl = (CGUISpinControlEx *)pSettingControl;
- pSpinControl->Clear();
-
- // fill the spinner control
- for (StringSettingOptions::const_iterator option = options.begin(); option != options.end(); option++)
- pSpinControl->AddLabel(option->first, option->second);
-
- // set the current option
- pSpinControl->SetStringValue(currentOption);
-
- // check if the current setting has changed
- if (currentOption.compare(pSettingString->GetValue()) != 0)
- pSettingString->SetValue(currentOption);
- }
-}
View
6 xbmc/settings/windows/GUIWindowSettingsCategory.h
@@ -56,9 +56,7 @@ class CGUIWindowSettingsCategory
virtual void OnTimeout();
virtual void OnSettingChanged(const CSetting *setting);
-
- void UpdateControl(const std::string &dependingSetting, const CSettingDependency &dependency);
- void CheckDependency(BaseSettingControlPtr pSettingControl, const CSettingDependency &dependency);
+ virtual void OnSettingPropertyChanged(const CSetting *setting, const char *propertyName);
void CreateSettings();
void UpdateSettings();
@@ -82,8 +80,6 @@ class CGUIWindowSettingsCategory
CSettingSection* GetSection(int windowID) const;
BaseSettingControlPtr GetSettingControl(const std::string &setting);
BaseSettingControlPtr GetSettingControl(int controlId);
-
- void FillControl(CSetting *pSetting, CGUIControl *pSettingControl);
CSettings& m_settings;
SettingCategoryList m_categories;
View
1  xbmc/utils/Weather.cpp
@@ -28,6 +28,7 @@
#include "Temperature.h"
#include "network/Network.h"
#include "Application.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
#include "guilib/GUIWindowManager.h"
#include "GUIUserMessages.h"
View
1  xbmc/windowing/WinSystem.cpp
@@ -21,6 +21,7 @@
#include "WinSystem.h"
#include "guilib/GraphicContext.h"
#include "settings/DisplaySettings.h"
+#include "settings/Setting.h"
#include "settings/Settings.h"
using namespace std;
Please sign in to comment.
Something went wrong with that request. Please try again.