view m-toolbox/classes/@LTPDAprefs/loadPrefs.m @ 46:ca0b8d4dcdb6
database-connection-manager
Fix
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Tue, 06 Dec 2011 19:07:27 +0100 (2011-12-06)
parents
4be5f7a5316f
children
line source
+ − % LOADPREFS a static method which loads the preferences from a XML file.
+ − %
+ − % Call: LTPDAprefs.loadPrefs()
+ − %
+ − % Parameters:
+ − % -
+ − %
+ − % Version:
+ − % $Id: loadPrefs.m,v 1.3 2011/04/27 12:45:49 hewitson Exp $
+ − %
+ −
+ − function loadPrefs(varargin)
+ − v = ver('LTPDA');
+ − nv = utils.helper.ver2num(v(1).Version);
+ − prefs = mpipeline.ltpdapreferences.LTPDAPreferences.loadFromDisk(LTPDAprefs.preffile, nv);
+ −
+ − % Version 2.4 drops support for built-in model directories.
+ − if (nv >= 2.04)
+ − % we drop support for 'models' here, so check for non-empty models path
+ − % and warn the user to make an extension
+ − searchPaths = prefs.getModelsPrefs.getSearchPaths;
+ − paths = {};
+ − for kk=0:searchPaths.size-1
+ − paths = [paths {char(searchPaths.get(kk))}];
+ − end
+ − if ~isempty(paths)
+ − message = sprintf('Directories of built-in models are no longer supported. \nPlease make an LTPDA Extension module for your models. \n(See document section "LTPDA Extension Modules").\n');
+ − utils.helper.warnDlg(message, 'Built-in model directories not supported');
+ − prefs.getModelsPrefs.getSearchPaths.clear();
+ − end
+ − end
+ −
+ − setappdata(0, 'LTPDApreferences', prefs);
+ − LTPDAprefs.setApplicationData();
+ − prefs.writeToDisk;
+ − end