Commit 87f8961a authored by sstucker's avatar sstucker
Browse files

1.21.5

--Added settings dropdown menu  --Checking for updates can be disabled from settings dropdown menu
parent 96f0c978
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ On
% Last Checked For Update
12-Mar-1998 17:03:23

% Update Refused
0
% Check For Updates
on

% END
−1.82 KiB (79.3 KiB)

File changed.

No diff preview for this file type.

+28 −0
Original line number Diff line number Diff line
@@ -57,6 +57,10 @@ end
positionGUI(hFig, 0.15, 0.05, 0.80, 0.90)
setGuiFonts(hFig);

% Set checkForUpdates checkbox based on config setting
cfg = ConfigFileClass();
handles.menuItemUpdateCheck.Checked = cfg.GetValue('Check For Updates');

% Get rid of the useless "might be unsused" warnings for GUI callbacks
checkboxPlotHRF_Callback([]);
checkboxApplyProcStreamEditToAll_Callback([]);
@@ -1474,3 +1478,27 @@ if isempty(out.datatype)
end
maingui.dataTree.currElem.ExportMeanHRF(out.trange);



% --------------------------------------------------------------------
function menuItemUpdateCheck_Callback(hObject, eventdata, handles)
% hObject    handle to menuItemUpdateCheck (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
cfg = ConfigFileClass();
if (strcmp(hObject.Checked,'on'))
    hObject.Checked = 'off';
    cfg.SetValue('Check For Updates','off');
else
    hObject.Checked = 'on';
    cfg.SetValue('Check For Updates','on');
end
cfg.Save();
cfg.Close();


% --------------------------------------------------------------------
function SettingsMenu_Callback(hObject, eventdata, handles)
% hObject    handle to SettingsMenu (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
+45 −39
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@ function checkForHomerUpdates()
    
    cfg = ConfigFileClass();
    
    % If user has Check For Updates enabled
    if (strcmp(cfg.GetValue('Check For Updates'),'on'))

        % If it has been a week since Homer checked for an update
        if (datetime - cfg.GetValue('Last Checked For Update') > duration(168,0,0))

@@ -50,11 +53,14 @@ function checkForHomerUpdates()

            end

        pause(1);
            pause(1);  % To ensure <script> is run
            close(wb);
            cfg.Save();
        cfg.Close();

        end
    
    end
    
    cfg.Close();
    
end
 No newline at end of file

Utils/setpaths.m

deleted100644 → 0
+0 −50
Original line number Diff line number Diff line
function setpaths(options)

%
% USAGE: 
%
%   setpaths
%   setpaths(1)
%   setpaths(0)
%

currpaths = regexp(path, pathsep, 'split');

p = genpath('.');
newpaths = regexp(p, pathsep, 'split');

% Parse arguments
if ~exist('options','var')
    options = 1;
end



for ii=1:length(newpaths)
    if isempty(newpaths{ii})
        continue;
    end
    
    p = fullpath(newpaths{ii}, 'native');
    if p(end)==filesep
        p(end)='';
    end
    
    if exist(p, 'dir') ~= 7
        continue;
    end
    
    if options
        if ismember(p, currpaths)
            continue;
        end
        addpath(p, '-end')
    else
        if ~ismember(p, currpaths)
            continue;
        end
        rmpath(p)
    end
end