diff options
author | Trent Nelson <trent.a.b.nelson@gmail.com> | 2014-02-11 11:28:02 -0700 |
---|---|---|
committer | Trent Nelson <trent.a.b.nelson@gmail.com> | 2014-02-11 11:28:02 -0700 |
commit | 73371a9942056088a282f2e8704198278c96dd6c (patch) | |
tree | f37c36917a168932531eeaf5f83e927a9085a40e | |
parent | 8ffac13defac1ecc2cb4ca33a1cee372e87c61ba (diff) | |
parent | abca7fe398ba5192f46b10e0ec06c90079d49b2e (diff) |
Merge pull request #4173 from Montellese/settings_fixes
Two settings related fixes
-rw-r--r-- | system/settings/settings.xml | 3 | ||||
-rw-r--r-- | xbmc/network/WakeOnAccess.cpp | 8 | ||||
-rw-r--r-- | xbmc/network/WakeOnAccess.h | 2 | ||||
-rw-r--r-- | xbmc/profiles/ProfilesManager.cpp | 4 | ||||
-rw-r--r-- | xbmc/profiles/ProfilesManager.h | 2 | ||||
-rw-r--r-- | xbmc/settings/AdvancedSettings.cpp | 11 | ||||
-rw-r--r-- | xbmc/settings/lib/ISettingsHandler.h | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 7f07b3d625..45e81678f2 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -2702,9 +2702,8 @@ <category id="masterlock" label="12360" help="36395"> <access>CheckMasterLock</access> <group id="1"> - <setting id="masterlock.lockcode" type="string" label="20100" help="36396"> + <setting id="masterlock.lockcode" type="action" label="20100" help="36396"> <level>2</level> - <default>-</default> <control type="button" format="action"> <hidevalue>true</hidevalue> </control> diff --git a/xbmc/network/WakeOnAccess.cpp b/xbmc/network/WakeOnAccess.cpp index bbcf2867b3..446c7e3e54 100644 --- a/xbmc/network/WakeOnAccess.cpp +++ b/xbmc/network/WakeOnAccess.cpp @@ -635,18 +635,16 @@ void CWakeOnAccess::OnSettingsLoaded() LoadFromXML(); } -void CWakeOnAccess::OnSettingsSaved() const +void CWakeOnAccess::OnSettingsSaved() { bool enabled = CSettings::Get().GetBool("powermanagement.wakeonaccess"); if (enabled != IsEnabled()) { - CWakeOnAccess& woa = CWakeOnAccess::Get(); - - woa.SetEnabled(enabled); + SetEnabled(enabled); if (enabled) - woa.QueueMACDiscoveryForAllRemotes(); + QueueMACDiscoveryForAllRemotes(); } } diff --git a/xbmc/network/WakeOnAccess.h b/xbmc/network/WakeOnAccess.h index ccd81a4c3b..ca61c02768 100644 --- a/xbmc/network/WakeOnAccess.h +++ b/xbmc/network/WakeOnAccess.h @@ -35,7 +35,7 @@ public: virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job); virtual void OnSettingsLoaded(); - virtual void OnSettingsSaved() const; + virtual void OnSettingsSaved(); // struct to keep per host settings struct WakeUpEntry diff --git a/xbmc/profiles/ProfilesManager.cpp b/xbmc/profiles/ProfilesManager.cpp index 12421a215b..2b4cf630bd 100644 --- a/xbmc/profiles/ProfilesManager.cpp +++ b/xbmc/profiles/ProfilesManager.cpp @@ -96,10 +96,10 @@ void CProfilesManager::OnSettingsLoaded() CDirectory::Create(URIUtils::AddFileToFolder(strDir,"mixed")); } -bool CProfilesManager::OnSettingsSaved() +void CProfilesManager::OnSettingsSaved() { // save mastercode - return Save(); + Save(); } void CProfilesManager::OnSettingsCleared() diff --git a/xbmc/profiles/ProfilesManager.h b/xbmc/profiles/ProfilesManager.h index 5c12c4f582..ccaee55574 100644 --- a/xbmc/profiles/ProfilesManager.h +++ b/xbmc/profiles/ProfilesManager.h @@ -33,7 +33,7 @@ public: static CProfilesManager& Get(); virtual void OnSettingsLoaded(); - virtual bool OnSettingsSaved(); + virtual void OnSettingsSaved(); virtual void OnSettingsCleared(); bool Load(); diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index 41d45e2f67..e21d21e3b9 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -834,11 +834,14 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) { // read the loglevel setting, so set the setting advanced to hide it in GUI // as altering it will do nothing - we don't write to advancedsettings.xml XMLUtils::GetInt(pRootElement, "loglevel", m_logLevelHint, LOG_LEVEL_NONE, LOG_LEVEL_MAX); - CSettingBool *setting = (CSettingBool *)CSettings::Get().GetSetting("debug.showloginfo"); - if (setting != NULL) + const char* hide = pElement->Attribute("hide"); + if (hide == NULL || strnicmp("false", hide, 4) != 0) { - const char* hide; - if (!((hide = pElement->Attribute("hide")) && strnicmp("false", hide, 4) == 0)) + CSetting *setting = CSettings::Get().GetSetting("debug.showloginfo"); + if (setting != NULL) + setting->SetVisible(false); + setting = CSettings::Get().GetSetting("debug.setextraloglevel"); + if (setting != NULL) setting->SetVisible(false); } g_advancedSettings.m_logLevel = std::max(g_advancedSettings.m_logLevel, g_advancedSettings.m_logLevelHint); diff --git a/xbmc/settings/lib/ISettingsHandler.h b/xbmc/settings/lib/ISettingsHandler.h index b31d88be4f..3f144c3ac0 100644 --- a/xbmc/settings/lib/ISettingsHandler.h +++ b/xbmc/settings/lib/ISettingsHandler.h @@ -52,7 +52,7 @@ public: This callback can be used to trigger saving other settings. */ - virtual void OnSettingsSaved() const { } + virtual void OnSettingsSaved() { } /*! \brief Setting values have been unloaded. |