Mercurial > hg > ltpda
comparison m-toolbox/classes/@LTPDAprefs/loadPrefs.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children | 4be5f7a5316f |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % LOADPREFS a static method which loads the preferences from a XML file. | |
2 % | |
3 % Call: LTPDAprefs.loadPrefs() | |
4 % | |
5 % Parameters: | |
6 % - | |
7 % | |
8 % Version: | |
9 % $Id: loadPrefs.m,v 1.3 2011/04/27 12:45:49 hewitson Exp $ | |
10 % | |
11 | |
12 function loadPrefs(varargin) | |
13 fprintf('Loading LTPDA preferences from %s ...\n', LTPDAprefs.preffile); | |
14 v = ver('LTPDA'); | |
15 nv = utils.helper.ver2num(v(1).Version); | |
16 prefs = mpipeline.ltpdapreferences.LTPDAPreferences.loadFromDisk(LTPDAprefs.preffile, nv); | |
17 | |
18 % Version 2.4 drops support for built-in model directories. | |
19 if (nv >= 2.04) | |
20 % we drop support for 'models' here, so check for non-empty models path | |
21 % and warn the user to make an extension | |
22 searchPaths = prefs.getModelsPrefs.getSearchPaths; | |
23 paths = {}; | |
24 for kk=0:searchPaths.size-1 | |
25 paths = [paths {char(searchPaths.get(kk))}]; | |
26 end | |
27 if ~isempty(paths) | |
28 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'); | |
29 utils.helper.warnDlg(message, 'Built-in model directories not supported'); | |
30 prefs.getModelsPrefs.getSearchPaths.clear(); | |
31 end | |
32 end | |
33 | |
34 setappdata(0, 'LTPDApreferences', prefs); | |
35 LTPDAprefs.setApplicationData(); | |
36 prefs.writeToDisk; | |
37 end |