summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-01-06 11:58:03 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-01-06 11:58:03 +0100
commit820770e2e04b20bce8e5219b03a594d611d44c7c (patch)
tree5a2b5a51a20aacf0d4ae52751af3b9d878257111 /tools/editor/editor_node.cpp
parent78e5bc8e9a6588eaa4d95be18e28175706a2c06c (diff)
parentfc17ec04fcb014bd156fdf1234e29650a679d352 (diff)
Merge pull request #3187 from neikeq/fix_3186
Fix editor layout saving
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index bdfab50e15..11343d6346 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -1454,8 +1454,13 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK && err!=ERR_FILE_NOT_FOUND) {
- return; //no config
+
+ if (err==ERR_CANT_OPEN) {
+ config.instance(); // new config
+ } else if (err!=OK) {
+ confirm_error->set_text("Error trying to save layout!");
+ confirm_error->popup_centered_minsize();
+ return;
}
_save_docks_to_config(config, p_file);
@@ -1480,11 +1485,8 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK) {
- return; //no config
- }
- if (!config->has_section(p_file)) {
+ if (err!=OK || !config->has_section(p_file)) {
confirm_error->set_text("Layout name not found!");
confirm_error->popup_centered_minsize();
return;