function load_settings(){
  var setScheme = false;
  try{
    settings = require("Storage").readJSON(PREFERENCE_FILE);
    if(settings != null){
      console.log("loaded:" + JSON.stringify(settings));
      if(settings.color_scheme != null){
        set_colorscheme(settings.color_scheme);
        setScheme = true;
      }
      if(settings.date_format != null){
        set_dateformat(settings.date_format);
      }
    } else {
      console.log("no settings to load");
    }
  } catch(e){
    console.log("failed to load settings:" + e);
  }
  // just set up as default
  if (!setScheme)
    setColorScheme(color_schemes[color_scheme_index]);
}
/**
 * Called on startup to set the watch to the last preference settings
 */
Called on startup to set the watch to the last preference settings
Called on startup to set the watch to the last preference settings
function load_settings(){
  var setScheme = false;
  try{
    settings = require("Storage").readJSON(PREFERENCE_FILE);
    if(settings != null){
      console.log("loaded:" + JSON.stringify(settings));
      if(settings.color_scheme != null){
        set_colorscheme(settings.color_scheme);
        setScheme = true;
      }
      if(settings.date_format != null){
        set_dateformat(settings.date_format);
      }
    } else {
      console.log("no settings to load");
    }
  } catch(e){
    console.log("failed to load settings:" + e);
  }
  if (!setScheme)
    setColorScheme(color_schemes[color_scheme_index]);
}
function load_settings ( ) { var setScheme = false ; try { settings = require ( "Storage" ) . readJSON ( PREFERENCE_FILE ) ; if ( settings != null ) { console . log ( "loaded:" + JSON . stringify ( settings ) ) ; if ( settings . color_scheme != null ) { set_colorscheme ( settings . color_scheme ) ; setScheme = true ; } if ( settings . date_format != null ) { set_dateformat ( settings . date_format ) ; } } else { console . log ( "no settings to load" ) ; } } catch ( e ) { console . log ( "failed to load settings:" + e ) ; } if ( ! setScheme ) setColorScheme ( color_schemes [ color_scheme_index ] ) ; }
Called on startup to set the watch to the last preference settings
Called on startup to set the watch to the last preference settings
// just set up as default