@@ -8,6 +8,7 @@ module AppSettings {
88 const colorValues = [16711680 , 11141120 , 16733440 , 16755200 , 65280 , 43520 , 43775 , 255 , 11141375 , 16711935 ];
99 const colorNames = [:Red , :DarkRed , :Orange , :Yellow , :Green , :DarkGreen , :Blue , :DarkBlue , :Purple , :Pink ];
1010 const configurationNames = [:Primary , :Secondary , :Tertiary ];
11+ const configurationNameValues = [" CN1" , " CN2" , " CN3" ];
1112 const configurationValues = [1 , 2 , 3 ];
1213 const settingValues = [" IL" , " AC" , " CC" ];
1314
@@ -38,7 +39,7 @@ module AppSettings {
3839 Menu2 .addItem (new WatchUi .MenuItem (Rez .Strings .AC , (colorIndex < 0 ? null : Rez .Strings [colorNames [colorIndex ]]), 1 , null ));
3940 // Current configuration
4041 var configurationIndex = configurationValues .indexOf ((Properties .getValue (" CC" )));
41- Menu2 .addItem (new WatchUi .MenuItem (Rez .Strings .CC , (configurationIndex < 0 ? null : Rez . Strings [ configurationNames [ configurationIndex ]] ), 2 , null ));
42+ Menu2 .addItem (new WatchUi .MenuItem (Rez .Strings .CC , (configurationIndex < 0 ? null : Properties . getValue ( configurationNameValues [ configurationIndex ]) ), 2 , null ));
4243 }
4344
4445 public function onSelect (index , menuItem ) {
@@ -50,8 +51,8 @@ module AppSettings {
5051 Application .getApp ().onSettingsChanged ();
5152 } else {
5253 openSubMenu (index == 1
53- ? new ListMenu (" Color" , key , menuItem , colorValues , colorNames )
54- : new ListMenu (" Configuration" , key , menuItem , configurationValues , configurationNames ));
54+ ? new ListMenu (" Color" , key , menuItem , colorValues , colorNames , null )
55+ : new ListMenu (" Configuration" , key , menuItem , configurationValues , configurationNames , configurationNameValues ));
5556 }
5657 }
5758 }
@@ -62,19 +63,21 @@ module AppSettings {
6263 private var _key;
6364 private var _values;
6465 private var _names;
66+ private var _nameKeys;
6567
66- public function initialize (title , key , menuItem , values , names ) {
68+ public function initialize (title , key , menuItem , values , names , nameKeys ) {
6769 BaseMenu .initialize ();
6870 Menu2 .setTitle (title );
6971 _key = key ;
7072 _menuItem = menuItem .weak ();
7173 _values = values ;
7274 _names = names ;
73- var currentValue = Properties . getValue ( key ) ;
75+ _nameKeys = nameKeys ;
7476 for (var i = 0 ; i < values .size (); i ++ ) {
7577 var value = values [i ];
76- var name = names [i ];
77- Menu .addItem (new WatchUi .MenuItem (Rez .Strings [name ], null , value , null ));
78+ var name = nameKeys != null ? Properties .getValue (nameKeys [i ]) : null ;
79+ name = name == null ? Rez .Strings [names [i ]] : name ;
80+ Menu .addItem (new WatchUi .MenuItem (name , null , value , null ));
7881 }
7982 }
8083
@@ -91,7 +94,9 @@ module AppSettings {
9194 // Set parent sub label
9295 var index = _values .indexOf (newValue );
9396 if (_menuItem .stillAlive () && index >= 0 ) {
94- _menuItem .get ().setSubLabel (Rez .Strings [_names [index ]]);
97+ var name = _nameKeys != null ? Properties .getValue (_nameKeys [index ]) : null ;
98+ name = name == null ? Rez .Strings [_names [index ]] : name ;
99+ _menuItem .get ().setSubLabel (name );
95100 }
96101
97102 close ();
0 commit comments