Skip to content

Commit

Permalink
Merge pull request #511 from bachlab/507-dependencies-do-not-work-on-…
Browse files Browse the repository at this point in the history
…batch-in-60-works-fine-in-511

fix UI issue
  • Loading branch information
teddychao authored Aug 11, 2023
2 parents f207530 + 0fe7aff commit b6d5a8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 39 deletions.
16 changes: 8 additions & 8 deletions src/ext/matlabbatch/cfg_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%
% See also: GUIDE, GUIDATA, GUIHANDLES
%
% This code is part of a batch job configuration system for MATLAB. See
% This code is part of a batch job configuration system for MATLAB. See
% help matlabbatch
% for a general overview.
%_______________________________________________________________________
Expand Down Expand Up @@ -309,7 +309,7 @@ function local_showjob(obj,cjob)
set(findobj(handles.cfg_ui,'-regexp', 'Tag','.*File(Run)|(RunSerial)$'),'Enable','on');
else
set(findobj(handles.cfg_ui,'-regexp', 'Tag','.*File(Run)|(RunSerial)$'),'Enable','off');
end
end
local_showmod(obj);

% --------------------------------------------------------------------
Expand Down Expand Up @@ -378,7 +378,7 @@ function local_showvaledit(obj)
ciid = {udmodlist.cjob udmodlist.id{cmod} udmodule.id{citem}};
end;
contents = cellfun(@(c)subsref(c, substruct('{}',{citem})), udmodule.contents, 'UniformOutput', false);
sout = cat(2, udmodlist.sout(1:cmod-1));
sout = cat(2, udmodlist.sout{1:cmod-1});
cfg_ui_util('showvaledit', fig, ciid, contents, sout, dflag, [], @()local_valedit_update(obj));
drawnow;

Expand Down Expand Up @@ -564,7 +564,7 @@ function cfg_ui_CloseRequestFcn(hObject, eventdata, handles)
end;

% --- Outputs from this function are returned to the command line.
function varargout = cfg_ui_OutputFcn(hObject, eventdata, handles)
function varargout = cfg_ui_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
Expand Down Expand Up @@ -612,7 +612,7 @@ function MenuFileLoad_Callback(hObject, eventdata, handles)
catch
l = lasterror;
errordlg(l.message,'Error loading job', 'modal');
end
end
set(handles.modlist, 'userdata', udmodlist);
set(handles.module, 'userdata', []);
local_showjob(hObject);
Expand Down Expand Up @@ -815,7 +815,7 @@ function MenuViewUpdateView_Callback(hObject, eventdata, handles)

% This function seems to be called on startup without guidata - do nothing
% there
if ~isempty(handles)
if ~isempty(handles)
local_setmenu(handles.cfg_ui, [], @local_AddMod, true);
udmodlist = get(handles.modlist,'Userdata');
if isstruct(udmodlist)
Expand Down Expand Up @@ -872,7 +872,7 @@ function MenuViewShowCode_Callback(hObject, eventdata, handles)
ctxt = uicontrol('Parent',fg, 'Style','listbox', 'Units','normalized', 'Position',[0 0 1 1], 'FontName','FixedWidth','Tag',[mfilename 'ShowCodeList']);
else
figure(fg);
ctxt = findobj(fg,'Tag',[mfilename 'ShowCodeList']);
ctxt = findobj(fg,'Tag',[mfilename 'ShowCodeList']);
end
um = uicontextmenu;
um1 = uimenu('Label','Copy', 'Callback',@(ob,ev)local_ShowCode_Copy(ob,ev,ctxt), 'Parent',um);
Expand Down Expand Up @@ -1044,7 +1044,7 @@ function MenuFileMultiBatch_Callback(hObject, eventdata, handles)

udmodlist = get(handles.modlist,'userdata');
cjob = udmodlist.cjob;
if cfg_util('isjob_id', cjob)
if cfg_util('isjob_id', cjob)
njob = cfg_util('clonejob', cjob);
cfg_ui_multibatch(njob);
end
Expand Down
35 changes: 4 additions & 31 deletions src/ext/matlabbatch/cfg_ui_util.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
% module or data summary. It also handles all value display and editing for
% a particular item.
%
% This code is part of a batch job configuration system for MATLAB. See
% This code is part of a batch job configuration system for MATLAB. See
% help matlabbatch
% for a general overview.
%_______________________________________________________________________
Expand Down Expand Up @@ -102,21 +102,12 @@
case {'showitem'}
% [contents, namestr, datastr] = cfg_ui_util('showitem', ciid, dflag)
[ciid, dflag] = deal(varargin{1:2});
if isstruct(ciid)
[id, stop, contents] = ...
cfg_util('listmod', ciid(:),...
cfg_findspec({{'hidden',false}}), ...
cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ...
{'name','val','labels','values','class','level', ...
'all_set','all_set_item','num','preview'});
else
[id, stop, contents] = ...
[id, stop, contents] = ...
cfg_util('listmod', ciid{:},...
cfg_findspec({{'hidden',false}}), ...
cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ...
{'name','val','labels','values','class','level', ...
'all_set','all_set_item','num','preview'});
end
contents = cellfun(@(c)subsref(c, substruct('{}',{1})), contents, 'UniformOutput', false);
[namestr, datastr] = cfg_ui_util('showitemstr', contents, dflag);
varargout{1} = contents;
Expand All @@ -125,39 +116,21 @@
case {'showmod'}
% [id, namestr, datastr, contents] = cfg_ui_util('showmod', cmid, dflag)
[cmid, dflag] = deal(varargin{1:2});
if isstruct(cmid)
[id, stop, contents] = ...
cfg_util('listmod', cmid(:), [],...
cfg_findspec({{'hidden',false}}), ...
cfg_tropts({{'hidden', true}},1,Inf,1,Inf,dflag), ...
{'name','val','labels','values','class','level', ...
'all_set','all_set_item','num','preview'});
else
[id, stop, contents] = ...
[id, stop, contents] = ...
cfg_util('listmod', cmid{:}, [],...
cfg_findspec({{'hidden',false}}), ...
cfg_tropts({{'hidden', true}},1,Inf,1,Inf,dflag), ...
{'name','val','labels','values','class','level', ...
'all_set','all_set_item','num','preview'});
end
if isempty(id) || ~cfg_util('isitem_mod_id', id{1})
% Module not found without hidden flag
% Try to list top level entry of module anyway, but not module items.
if isstruct(cmid)
[id, stop, contents] = ...
cfg_util('listmod', cmid(:), [],...
cfg_findspec({}), ...
cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ...
{'name','val','labels','values','class','level', ...
'all_set','all_set_item','preview'});
else
[id, stop, contents] = ...
[id, stop, contents] = ...
cfg_util('listmod', cmid{:}, [],...
cfg_findspec({}), ...
cfg_tropts({{'hidden', true}},1,1,1,1,dflag), ...
{'name','val','labels','values','class','level', ...
'all_set','all_set_item','preview'});
end
end;
namestr = cell(1,numel(id));
datastr = cell(1,numel(id));
Expand Down

0 comments on commit b6d5a8d

Please sign in to comment.