summaryrefslogtreecommitdiff
path: root/editor/settings_config_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/settings_config_dialog.cpp')
-rw-r--r--editor/settings_config_dialog.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index 537c9ac6b8..d6756b2bb3 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -94,8 +94,9 @@ void EditorSettingsDialog::popup_edit_settings() {
set_process_unhandled_input(true);
// Restore valid window bounds or pop up at default size.
- if (EditorSettings::get_singleton()->has_setting("interface/dialogs/editor_settings_bounds")) {
- popup(EditorSettings::get_singleton()->get("interface/dialogs/editor_settings_bounds"));
+ Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "editor_settings", Rect2());
+ if (saved_size != Rect2()) {
+ popup(saved_size);
} else {
Size2 popup_size = Size2(900, 700) * editor_get_scale();
@@ -132,7 +133,7 @@ void EditorSettingsDialog::_notification(int p_what) {
_update_icons();
} break;
case NOTIFICATION_POPUP_HIDE: {
- EditorSettings::get_singleton()->set("interface/dialogs/editor_settings_bounds", get_rect());
+ EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "editor_settings", get_rect());
set_process_unhandled_input(false);
} break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
@@ -186,7 +187,7 @@ void EditorSettingsDialog::_update_icons() {
restart_close_button->set_icon(get_icon("Close", "EditorIcons"));
restart_container->add_style_override("panel", get_stylebox("bg", "Tree"));
restart_icon->set_texture(get_icon("StatusWarning", "EditorIcons"));
- restart_label->add_color_override("font_color", get_color("error_color", "Editor"));
+ restart_label->add_color_override("font_color", get_color("warning_color", "Editor"));
}
void EditorSettingsDialog::_update_shortcuts() {
@@ -281,7 +282,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
if (!sc.is_valid())
return; //pointless, there is nothing
- undo_redo->create_action("Erase Shortcut");
+ undo_redo->create_action(TTR("Erase Shortcut"));
undo_redo->add_do_method(sc.ptr(), "set_shortcut", Ref<InputEvent>());
undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut());
undo_redo->add_do_method(this, "_update_shortcuts");
@@ -295,7 +296,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
Ref<InputEvent> original = sc->get_meta("original");
- undo_redo->create_action("Restore Shortcut");
+ undo_redo->create_action(TTR("Restore Shortcut"));
undo_redo->add_do_method(sc.ptr(), "set_shortcut", original);
undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut());
undo_redo->add_do_method(this, "_update_shortcuts");
@@ -343,7 +344,7 @@ void EditorSettingsDialog::_press_a_key_confirm() {
Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(shortcut_configured);
- undo_redo->create_action("Change Shortcut '" + shortcut_configured + "'");
+ undo_redo->create_action(TTR("Change Shortcut") + " '" + shortcut_configured + "'");
undo_redo->add_do_method(sc.ptr(), "set_shortcut", ie);
undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut());
undo_redo->add_do_method(this, "_update_shortcuts");
@@ -374,7 +375,8 @@ void EditorSettingsDialog::_focus_current_search_box() {
}
void EditorSettingsDialog::_editor_restart() {
- EditorNode::get_singleton()->save_all_scenes_and_restart();
+ EditorNode::get_singleton()->save_all_scenes();
+ EditorNode::get_singleton()->restart_editor();
}
void EditorSettingsDialog::_editor_restart_request() {