Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
matlab-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dóra Kocsis
matlab-gui
Commits
9eb7853c
Verified
Commit
9eb7853c
authored
6 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
clean up close project function
parent
73424c9a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gui_close_project.m
+10
-37
10 additions, 37 deletions
src/gui_close_project.m
with
10 additions
and
37 deletions
src/gui_close_project.m
+
10
−
37
View file @
9eb7853c
...
@@ -28,13 +28,12 @@ function gui_close_project()
...
@@ -28,13 +28,12 @@ function gui_close_project()
% You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global
project_info
model_settings
;
global
project_info
global
M_
options_
oo_
estim_params_
bayestopt_
dataset_
dataset_info
estimation_info
ys0_
ex0_
;
gui_tools
.
project_log_entry
(
'Project Close'
,
sprintf
(
'project_name=%s; project_folder=%s'
,
project_info
.
project_name
,
project_info
.
project_folder
));
gui_tools
.
project_log_entry
(
'Project Close'
,
sprintf
(
'project_name=%s; project_folder=%s'
,
project_info
.
project_name
,
project_info
.
project_folder
));
if
project_info
.
modified
if
project_info
.
modified
answer
=
questdlg
(
sprintf
(
'Do you want to save changes to project
%s?'
,
project_info
.
project_name
),
'DynareGUI'
,
'Yes'
,
'No'
,
'Cancel'
,
'Yes'
);
answer
=
questdlg
(
[
'Do you want to save changes to project
'
project_info
.
project_name
'?'
],
'DynareGUI'
,
'Yes'
,
'No'
,
'Cancel'
,
'Yes'
);
if
strcmp
(
answer
,
'Yes'
)
if
strcmp
(
answer
,
'Yes'
)
gui_tools
.
save_project
();
gui_tools
.
save_project
();
elseif
strcmp
(
answer
,
'Cancel'
)
elseif
strcmp
(
answer
,
'Cancel'
)
...
@@ -45,52 +44,26 @@ end
...
@@ -45,52 +44,26 @@ end
%close all opened tabs
%close all opened tabs
gui_tabs
.
close_all
();
gui_tabs
.
close_all
();
project_info
=
struct
();
clearvars
-
global
model_settings
=
struct
();
clear_persistent_variables
(
fileparts
(
which
(
'dynare'
)),
false
)
M_
=
struct
();
options_
=
struct
();
oo_
=
struct
();
if
exist
(
'estim_params_'
,
'var'
)
==
1
estim_params_
=
struct
();
end
if
exist
(
'bayestopt_'
,
'var'
)
==
1
bayestopt_
=
struct
();
end
if
exist
(
'dataset_'
,
'var'
)
==
1
dataset_
=
struct
();
end
if
exist
(
'dataset_info'
,
'var'
)
==
1
dataset_info
=
struct
();
end
if
exist
(
'estimation_info'
,
'var'
)
==
1
estimation_info
=
struct
();
end
if
exist
(
'ys0_'
,
'var'
)
==
1
ys0_
=
struct
();
end
if
exist
(
'ex0_'
,
'var'
)
==
1
ex0_
=
struct
();
end
%disable menu options
%disable menu options
gui_set_menus
(
false
);
gui_set_menus
(
false
);
% remove appdata
% remove appdata
if
(
~
isempty
(
getappdata
(
0
,
'estimation'
))
)
if
~
isempty
(
getappdata
(
0
,
'estimation'
))
rmappdata
(
0
,
'estimation'
);
rmappdata
(
0
,
'estimation'
);
end
end
if
(
~
isempty
(
getappdata
(
0
,
'stoch_simul'
))
)
if
~
isempty
(
getappdata
(
0
,
'stoch_simul'
))
rmappdata
(
0
,
'stoch_simul'
);
rmappdata
(
0
,
'stoch_simul'
);
end
end
if
(
~
isempty
(
getappdata
(
0
,
'estim_params'
))
)
if
~
isempty
(
getappdata
(
0
,
'estim_params'
))
rmappdata
(
0
,
'estim_params'
);
rmappdata
(
0
,
'estim_params'
);
end
end
if
(
~
isempty
(
getappdata
(
0
,
'varobs'
))
)
if
~
isempty
(
getappdata
(
0
,
'varobs'
))
rmappdata
(
0
,
'varobs'
);
rmappdata
(
0
,
'varobs'
);
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment