Naming settings with css fixes.

pull/2/head
Mark McDowall 12 years ago
parent 10f4dd5a60
commit c345d81c6a

@ -2,9 +2,30 @@
font-size: 25px;
color: #3A87AD;
cursor: default;
vertical-align: text-bottom;
}
.help-checkbox {
margin-top: -20px;
}
.help-inline-checkbox {
float: left;
padding-left: 7px;
padding-top: 3px;
}
.switch {
float: left;
}
/*.control-group {*/
/*border: 1px solid red;*/
/*}*/
/*.control-label {*/
/*border: 1px solid yellow;*/
/*}*/
/*.switch {*/
/*border: 1px solid purple;*/
/*}*/
/*.help-inline, .help-checkbox {*/
/*border: 1px solid #2e8b57;*/
/*}*/

@ -7,7 +7,7 @@
<div class="switch">
<input type="checkbox" name="sortingUseSceneName" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Use the scene name, ignoring all other naming settings"></i>
</span>
</div>
@ -19,7 +19,7 @@
<div class="switch">
<input type="checkbox" name="sortingIncludeSeriesName" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Should filenames contain the series name when renamed?"></i>
</span>
</div>
@ -31,7 +31,7 @@
<div class="switch">
<input type="checkbox" name="sortingIncludeEpisodeTitle" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Should filenames contain the episode name when renamed?"></i>
</span>
</div>
@ -43,7 +43,7 @@
<div class="switch">
<input type="checkbox" name="sortingReplaceSpaces" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Do you want to replace spaces in the filename with periods?"></i>
</span>
</div>
@ -55,7 +55,7 @@
<div class="switch">
<input type="checkbox" name="sortingAppendQuality" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Should filenames have the quality appended to the end?"></i>
</span>
@ -68,7 +68,7 @@
<div class="switch">
<input type="checkbox" name="useSeasonFolder" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Should files be stored in season folders by default? (Applied only when a series is added)"></i>
</span>
@ -139,7 +139,7 @@
<div class="switch">
<input type="checkbox" name="metadataXbmcEnabled" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Enable creating metadata for XBMC"></i>
</span>
</div>
@ -149,9 +149,9 @@
<label class="control-label">Use Banners</label>
<div class="controls">
<div class="switch">
<input type="checkbox" name="metadataUseBanners" />
<input type="checkbox" name="metadataUseBanners" />
</div>
<span class="help-inline help-checkbox">
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Use banners instead of posters?"></i>
</span>
</div>

@ -11,7 +11,7 @@ define([
ui: {
switch: '.switch',
tooltip: '.help-inline i'
tooltip: '[class^="help-inline"] i'
},
onRender: function () {

@ -29,7 +29,7 @@ namespace NzbDrone.Core.Configuration
public Dictionary<String, Object> AllWithDefaults()
{
var dict = new Dictionary<String, Object>();
var dict = new Dictionary<String, Object>(StringComparer.InvariantCultureIgnoreCase);
var type = GetType();
var properties = type.GetProperties();
@ -545,6 +545,7 @@ namespace NzbDrone.Core.Configuration
{
EnsureCache();
key = key.ToLowerInvariant();
string dbValue;
if (_cache.TryGetValue(key, out dbValue) && dbValue != null && !String.IsNullOrEmpty(dbValue))
@ -571,6 +572,8 @@ namespace NzbDrone.Core.Configuration
public void SetValue(string key, string value)
{
key = key.ToLowerInvariant();
if (String.IsNullOrEmpty(key))
throw new ArgumentOutOfRangeException("key");
if (value == null)
@ -595,17 +598,17 @@ namespace NzbDrone.Core.Configuration
public void SaveValues(Dictionary<string, object> configValues)
{
//Todo: make this not suck - we need the pascal case of the key
//Todo: Can we batch save this without savig default values? Or do we care?
var allWithDefaults = AllWithDefaults();
foreach(var configValue in configValues)
{
object currentValue;
allWithDefaults.TryGetValue(configValue.Key, out currentValue);
if (currentValue == null) continue;
var equal = configValue.Value.ToString().Equals(currentValue.ToString());
if (!configValue.Equals(currentValue))
if (!equal)
SetValue(configValue.Key, configValue.Value.ToString());
}
}

Loading…
Cancel
Save