Aufgrund eines Versionsupdates wird GitLab am 17.02. zwischen 10:30 und 11:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to a version upgrade, GitLab won't be accessible at 17.02. between 10:30 and 11:00 a.m.

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

% <ITA-Toolbox>
Johannes Klein's avatar
Johannes Klein committed
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
typo  
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'
Johannes Klein's avatar
Johannes Klein committed
24
            fprintf(2,'You accepted the ITA-Toolbox license agreement\n');
25
        case 'no'
Johannes Klein's avatar
Johannes Klein committed
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
Johannes Klein's avatar
Johannes Klein committed
32
ita_preferences('license',true);