Changeset 296 for trunk/src/uvmat.m


Ignore:
Timestamp:
Nov 22, 2011, 1:39:47 PM (9 years ago)
Author:
sommeria
Message:

various

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r295 r296  
    268268 if exist(profil_perso,'file')
    269269      h=load (profil_perso);
    270       if isfield(h,'MenuFile_1')
    271           set(handles.MenuFile_1,'Label',h.MenuFile_1);
    272           set(handles.MenuFile_1_1,'Label',h.MenuFile_1);
    273       end
    274       if isfield(h,'MenuFile_2')
    275           set(handles.MenuFile_2,'Label',h.MenuFile_2);
    276           set(handles.MenuFile_2_1,'Label',h.MenuFile_2);
    277       end
    278       if isfield(h,'MenuFile_3')
    279           set(handles.MenuFile_3,'Label',h.MenuFile_3);
    280           set(handles.MenuFile_3_1,'Label',h.MenuFile_3);
    281       end
    282       if isfield(h,'MenuFile_4')
    283           set(handles.MenuFile_4,'Label',h.MenuFile_4);
    284           set(handles.MenuFile_4_1,'Label',h.MenuFile_4);
    285       end
    286       if isfield(h,'MenuFile_5')
    287           set(handles.MenuFile_5,'Label',h.MenuFile_5);
    288           set(handles.MenuFile_5_1,'Label',h.MenuFile_5);
     270      if isfield(h,'MenuFile')
     271          for ifile=1:min(length(h.MenuFile),5)
     272              eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',h.MenuFile{ifile});'])
     273               eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',h.MenuFile{ifile});'])
     274          end
    289275      end
    290276      if isfield(h,'transform_fct') && iscell(h.transform_fct)
     
    312298set(handles.transform_fct,'UserData',fct_handle)% store the list of path in UserData of ACTION
    313299
    314 
    315 
    316300%% case of an input argument for uvmat
    317301testinputfield=0;
     
    446430% display the selected field and related information
    447431display_file_name(hObject, eventdata, handles,fileinput)
    448 
    449 %update list of recent files in the menubar
    450 MenuFile_1=fileinput;
    451 MenuFile_2=get(handles.MenuFile_1,'Label');
    452 MenuFile_3=get(handles.MenuFile_2,'Label');
    453 MenuFile_4=get(handles.MenuFile_3,'Label');
    454 MenuFile_5=get(handles.MenuFile_4,'Label');
    455 set(handles.MenuFile_1,'Label',MenuFile_1)
    456 set(handles.MenuFile_2,'Label',MenuFile_2)
    457 set(handles.MenuFile_3,'Label',MenuFile_3)
    458 set(handles.MenuFile_4,'Label',MenuFile_4)
    459 set(handles.MenuFile_5,'Label',MenuFile_5)
    460 set(handles.MenuFile_1_1,'Label',MenuFile_1)
    461 set(handles.MenuFile_2_1,'Label',MenuFile_2)
    462 set(handles.MenuFile_3_1,'Label',MenuFile_3)
    463 set(handles.MenuFile_4_1,'Label',MenuFile_4)
    464 set(handles.MenuFile_5_1,'Label',MenuFile_5)
    465 dir_perso=prefdir;
    466 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    467 if exist(profil_perso,'file')
    468     save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat
    469 else
    470     txt=ver('MATLAB');
    471     Release=txt.Release;
    472     relnumb=str2double(Release(3:4));
    473     if relnumb >= 14
    474         save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat
    475     else
    476         save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat
    477     end
    478 end
    479432
    480433% -----------------------------------------------------------------------
     
    909862drawnow
    910863set_scan_options(hObject, eventdata, handles)
     864
     865%% update list of recent files in the menubar
     866MenuFile=[{FileName};get(handles.MenuFile_1,'Label');get(handles.MenuFile_2,'Label');...
     867    get(handles.MenuFile_3,'Label');get(handles.MenuFile_4,'Label');get(handles.MenuFile_5,'Label')];
     868   
     869for ifile=1:length(MenuFile)
     870    eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
     871    eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',MenuFile{ifile});'])
     872end
     873dir_perso=prefdir;
     874profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     875if exist(profil_perso,'file')
     876    save (profil_perso,'MenuFile','-append'); %store the file names for future opening of uvmat
     877else
     878    save (profil_perso,'MenuFile','-V6'); %store the file names for future opening of uvmat
     879end
    911880
    912881%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.