Skip to content

Commit

Permalink
Added promo message
Browse files Browse the repository at this point in the history
  • Loading branch information
altmany committed Dec 15, 2019
1 parent 926fbe8 commit d3b181a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@
% 06/08/19: Remove warning message about obsolete JavaFrame in R2019b
% 30/10/19: Fixed issue #261: added support for exporting uifigures and uiaxes (thanks to idea by @MarvinILA)
% 12/12/19: Added warning in case user requested anti-aliased output on an aliased HG2 figure (issue #292)
% 15/12/19: Added promo message
%}

if nargout
Expand All @@ -303,6 +304,22 @@
drawnow;
pause(0.05); % this solves timing issues with Java Swing's EDT (http://undocumentedmatlab.com/blog/solving-a-matlab-hang-problem)

% Display promo (just once!)
persistent promo
if isempty(promo)
msg = 'If you need expert assistance with Matlab, consider my professional consulting/training services';
website = 'https://UndocumentedMatlab.com';
msg = [msg ' (' website ')'];
if ~isdeployed
link = ['<a href="' website];
msg = regexprep(msg,website,[link '">$0</a>']);
msg = regexprep(msg,{'consulting','training'},[link '/$0">$0</a>']);
end
%warning('YMA:findjobj:promo',msg);
disp(['[' 8 msg ']' 8]);
promo = true;
end

% Parse the input arguments
fig = get(0, 'CurrentFigure');
[fig, options] = parse_args(nargout, fig, varargin{:});
Expand Down

0 comments on commit d3b181a

Please sign in to comment.