ita_toolbox_license.m 1.29 KB
Newer Older
1 2 3
%% Show the license and its location;

% <ITA-Toolbox>
4 5
% This file is part of the ITA-Toolbox. Some rights reserved.
% You can find the license for this m-file in the license.txt file in the ITA-Toolbox folder.
6 7 8 9 10 11 12 13
% </ITA-Toolbox>


fid = fopen([ita_toolbox_path filesep 'license.txt']);
funcTemplate = fread(fid, 'uint8=>char')';
disp(funcTemplate(1:end-1))
fclose(fid);
fprintf(2,'********************************************************************************\n')
14
disp(['*** The license can be found at ' ita_toolbox_path filesep 'license.txt ***' ])
15 16 17 18 19
fprintf(2,'********************************************************************************\n')

%% ask
if usejava('desktop') %Only if jvm available (non_cluster)
    commandwindow();
Mueller-Trapet's avatar
Mueller-Trapet committed
20
    choice = questdlg('Do you agree to the terms of the license agreement? The complete license ("license.txt") can be found in the root directory of the ITA-Toolbox.','License Agreement - ITA-Toolbox:', ...
21 22 23
        'Yes','No','No');
    switch lower(choice)
        case 'yes'
24
            fprintf(2,'You accepted the ITA-Toolbox license agreement\n');
25
        case 'no'
26
            fprintf(2,'You did NOT accept to the ITA-Toolbox license agreement\n');
27 28 29 30 31
            error('License Agreement not accepted.')
    end
end

%% set accepted flag in preferences
32
ita_preferences('license',true);