File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Source/Contrib/ContentManager Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,15 @@ public ContentManagerGUI()
7676 ContentManager = new ContentManager ( Settings . Folders ) ;
7777
7878 // add unit settings to ContentInfo static class; only considering explict setting or system setting
79- ContentInfo . IsMetric = Settings . Units == "Metric" || ( Settings . Units == "Automatic" && System . Globalization . RegionInfo . CurrentRegion . IsMetric ) || ( Settings . Units == "Route" && System . Globalization . RegionInfo . CurrentRegion . IsMetric ) ;
80- ContentInfo . IsUK = Settings . Units == "UK" ;
79+ if ( Settings . Units == "Metric" ) { ContentInfo . IsMetric = true ; }
80+ else if ( Settings . Units == "UK" ) { ContentInfo . IsUK = true ; }
81+ else // setting is Automatic or Route
82+ {
83+ ContentInfo . IsMetric = System . Globalization . RegionInfo . CurrentRegion . IsMetric ;
84+ // special cases
85+ if ( System . Globalization . RegionInfo . CurrentRegion . Name == "UK" ) { ContentInfo . IsUK = true ; }
86+ else if ( System . Globalization . RegionInfo . CurrentRegion . Name == "CA" ) { ContentInfo . IsMetric = false ; } // Canada is metric, but RRs use imperial US
87+ }
8188
8289 // Start off the tree with the Content Manager itself at the root and expand to show packages.
8390 treeViewContent . Nodes . Add ( CreateContentNode ( ContentManager ) ) ;
You can’t perform that action at this time.
0 commit comments