Skip to content

Commit

Permalink
Update taskInfo GUI
Browse files Browse the repository at this point in the history
parse multiple authors and references and links in GUI
  • Loading branch information
cll008 committed Nov 18, 2021
1 parent 37dd411 commit f1db66e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pop_taskinfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,8 @@ function okCB(src,event)
gInfo.(objs(i).Tag) = tmp;
case 'TaskName' % no space allowed for task name
gInfo.(objs(i).Tag) = strrep(objs(i).String,' ','');
case 'Authors'
case {'Authors', 'ReferencesAndLinks'}
gInfo.(objs(i).Tag) = split(objs(i).String, ', ');
case 'ReferencesAndLinks'
gInfo.(objs(i).Tag) = {objs(i).String};
case 'PowerLineFrequency'
tInfo.(objs(i).Tag) = str2double(objs(i).String{objs(i).Value});
case {'SoftwareFilters', 'HardwareFilters'}
Expand Down Expand Up @@ -261,8 +259,9 @@ function preFill()
if strcmp(objs(i).Style, 'popupmenu') % dropdown
objs(i).Value = find(strcmp(objs(i).String, prevgInfo.(objs(i).Tag))); % set position of dropdown menu to the appropriate string
else
if iscell(prevgInfo.(objs(i).Tag))
objs(i).String = prevgInfo.(objs(i).Tag){1}; % e.g., Authors & ReferencesAndLinks
if iscell(prevgInfo.(objs(i).Tag)) %e.g., Authors & ReferencesAndLinks
tmp = sprintf('%s, ', prevgInfo.(objs(i).Tag){:}); % unpack multiple entries
objs(i).String = tmp(1:end-2); % remove trailing comma and space
else
objs(i).String = prevgInfo.(objs(i).Tag);
end
Expand Down

0 comments on commit f1db66e

Please sign in to comment.