From 60cfeed0fe682a7195192c64704652900fda8456 Mon Sep 17 00:00:00 2001 From: Jacques Grelet <Jacques.grelet@ird.fr> Date: Tue, 15 Jan 2019 10:53:04 +0100 Subject: [PATCH] add a dialog box to donwload the m_map toolbox if it is not installed --- ReleaseNotes.md | 1 + tsg_util/plot_map.m | 14 +++++++------- tsgqc.m | 21 ++++++++++++++++++++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 5700acd..35c4773 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -4,6 +4,7 @@ Contact: <jacques.grelet@ird.fr> ## v1.50RC2 (2019-01-11) ++ add a dialog box to donwload the m_map toolbox if it is not installed + fix issue #12, resolve a bug with all print menus with Matlab version prior 8.4 (R2014). Menu print and Print preview are disable for these versions and saveas was replaced by screencapture function from "undocumented Matlab" web site. + add version date on the main TSQGQC figure + fix issue #11, improve print menu diff --git a/tsg_util/plot_map.m b/tsg_util/plot_map.m index 95c6298..71ae3cb 100644 --- a/tsg_util/plot_map.m +++ b/tsg_util/plot_map.m @@ -104,7 +104,7 @@ if ~isempty( ind ) % selected % ----------------------------------------------------------------- if strcmp(get(hdl_pushtool_climato, 'state'), 'on') - + % display debug infos if DEBUGGING fprintf(1, 'Plot climato on map:\n'); @@ -152,9 +152,9 @@ if ~isempty( ind ) switch tsg.preference.map.climatology case 'pcolor' % mask climato range uipanel on map - set(findobj('tag', 'TAG_MAP_CLIMATO_UIPANEL'),'Visible', 'off'); + set(findobj('tag', 'TAG_MAP_CLIMATO_UIPANEL'),'Visible', 'off'); % resize map panel for axes - set(findobj('tag', 'TAG_MAP_CLIMATO_AXES'),'Position',[0, 0, 1, 1]) + set(findobj('tag', 'TAG_MAP_CLIMATO_AXES'),'Position',[0, 0, 1, 1]) % We shift half a grid point dx = mean(diff(lon)); dy = mean(diff(lat)); @@ -177,7 +177,7 @@ if ~isempty( ind ) case 'none' colorbar('off'); % mask climato range uipanel on map - set(findobj('tag', 'TAG_MAP_CLIMATO_UIPANEL'),'Visible', 'off'); + set(findobj('tag', 'TAG_MAP_CLIMATO_UIPANEL'),'Visible', 'off'); % resize map panel for axes set(findobj('tag', 'TAG_MAP_CLIMATO_AXES'),'Position',[0, 0, 1, 1]) end @@ -205,7 +205,7 @@ if ~isempty( ind ) m_gshhs_l('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); else s = load('world_l.mat'); - end + end case 3 % Intermediate-resolution coast lines @@ -214,7 +214,7 @@ if ~isempty( ind ) m_gshhs_i('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); else s = load('world_i.mat'); - end + end case 4 % High-resolution coast lines @@ -223,7 +223,7 @@ if ~isempty( ind ) m_gshhs_h('patch',[.7 .7 .7], 'TAG', 'TAG_PLOT4_LINE_COAST'); else s = load('world_h.mat'); - end + end otherwise tsg.preference.map.resolution = 1; diff --git a/tsgqc.m b/tsgqc.m index 419a5a8..e75a846 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -54,7 +54,7 @@ global DEFAULT_PATH_FILE % ------------------------------------------------------------------- VERSION = 1.50; % -> 1.44 CHAR_VERSION = '1.50RC2'; -DATE_VERSION = '01/14/2019'; +DATE_VERSION = '01/15/2019'; % netcdf file version, see DATA FORMAT TSG document: % CORTSG_format_gosud.doc @@ -207,6 +207,25 @@ if ~isempty(hMainFig) end +% check if m_map toolbox is installed +% ----------------------------------- +if ~exist('m_lldist.m','file') + + % show dialog box when m_map toolbox is missing + % ----------------------------------------------- + message = sprintf(['Sorry, but you do not seem to have the m_map Toolbox.\n',... + 'Do you want install it ?']); + reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes'); + if strcmpi(reply, 'No') + % User said No, so exit. + return + else + % User said Yes, go to m_map download page + web('https://www.eoas.ubc.ca/~rich/map.html'); + return + end +end + % Create and then hide the GUI as it is being constructed. % -------------------------------------------------------- hMainFig = figure(... -- GitLab