summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/connections_dialog.cpp14
-rw-r--r--editor/connections_dialog.h2
-rw-r--r--editor/create_dialog.cpp6
-rw-r--r--editor/create_dialog.h1
-rw-r--r--editor/editor_dir_dialog.cpp6
-rw-r--r--editor/editor_dir_dialog.h1
-rw-r--r--editor/editor_sub_scene.cpp6
-rw-r--r--editor/editor_sub_scene.h1
-rw-r--r--editor/project_export.cpp5
-rw-r--r--editor/property_selector.cpp6
-rw-r--r--editor/property_selector.h10
11 files changed, 43 insertions, 15 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 8cce5fe197..304d6d1ea9 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -134,10 +134,17 @@ void ConnectDialog::ok_pressed() {
}
void ConnectDialog::_cancel_pressed() {
-
hide();
}
+void ConnectDialog::_item_activated() {
+ _ok_pressed(); // From AcceptDialog.
+}
+
+void ConnectDialog::_text_entered(const String &p_text) {
+ _ok_pressed(); // From AcceptDialog.
+}
+
/*
* Called each time a target node is selected within the target node tree.
*/
@@ -386,7 +393,7 @@ ConnectDialog::ConnectDialog() {
tree = memnew(SceneTreeEditor(false));
tree->set_connecting_signal(true);
- tree->get_scene_tree()->connect_compat("item_activated", this, "_ok");
+ tree->get_scene_tree()->connect("item_activated", callable_mp(this, &ConnectDialog::_item_activated));
tree->connect("node_selected", callable_mp(this, &ConnectDialog::_tree_node_selected));
tree->set_connect_to_script_mode(true);
@@ -445,7 +452,7 @@ ConnectDialog::ConnectDialog() {
dst_method = memnew(LineEdit);
dst_method->set_h_size_flags(SIZE_EXPAND_FILL);
- dst_method->connect_compat("text_entered", this, "_builtin_text_entered");
+ dst_method->connect("text_entered", callable_mp(this, &ConnectDialog::_text_entered));
dstm_hb->add_child(dst_method);
advanced = memnew(CheckButton);
@@ -861,7 +868,6 @@ void ConnectionsDock::_notification(int p_what) {
void ConnectionsDock::_bind_methods() {
- ClassDB::bind_method("_close", &ConnectionsDock::_close);
ClassDB::bind_method("update_tree", &ConnectionsDock::update_tree);
}
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index a4ed68b44e..988a8a1271 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -105,6 +105,8 @@ private:
void ok_pressed();
void _cancel_pressed();
+ void _item_activated();
+ void _text_entered(const String &_text);
void _tree_node_selected();
void _add_bind();
void _remove_bind();
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 4e3658acd8..bb59ddad46 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -561,6 +561,10 @@ void CreateDialog::_item_selected() {
get_ok()->set_disabled(false);
}
+void CreateDialog::_hide_requested() {
+ _closed(); // From WindowDialog.
+}
+
void CreateDialog::_favorite_toggled() {
TreeItem *item = search_options->get_selected();
@@ -804,7 +808,7 @@ CreateDialog::CreateDialog() {
help_bit = memnew(EditorHelpBit);
vbc->add_margin_child(TTR("Description:"), help_bit);
- help_bit->connect_compat("request_hide", this, "_closed");
+ help_bit->connect("request_hide", callable_mp(this, &CreateDialog::_hide_requested));
type_blacklist.insert("PluginScript"); // PluginScript must be initialized before use, which is not possible here
type_blacklist.insert("ScriptCreateDialog"); // This is an exposed editor Node that doesn't have an Editor prefix.
diff --git a/editor/create_dialog.h b/editor/create_dialog.h
index a807e50f65..f2e2eb1b04 100644
--- a/editor/create_dialog.h
+++ b/editor/create_dialog.h
@@ -60,6 +60,7 @@ class CreateDialog : public ConfirmationDialog {
Set<StringName> type_blacklist;
void _item_selected();
+ void _hide_requested();
void _update_search();
void _update_favorite_list();
diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp
index 867d72e014..20fe349ef6 100644
--- a/editor/editor_dir_dialog.cpp
+++ b/editor/editor_dir_dialog.cpp
@@ -121,6 +121,10 @@ void EditorDirDialog::_item_collapsed(Object *p_item) {
opened_paths.insert(item->get_metadata(0));
}
+void EditorDirDialog::_item_activated() {
+ _ok_pressed(); // From AcceptDialog.
+}
+
void EditorDirDialog::ok_pressed() {
TreeItem *ti = tree->get_selected();
@@ -182,7 +186,7 @@ EditorDirDialog::EditorDirDialog() {
tree = memnew(Tree);
add_child(tree);
- tree->connect_compat("item_activated", this, "_ok");
+ tree->connect("item_activated", callable_mp(this, &EditorDirDialog::_item_activated));
makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel(), "makedir");
makedir->connect("pressed", callable_mp(this, &EditorDirDialog::_make_dir));
diff --git a/editor/editor_dir_dialog.h b/editor/editor_dir_dialog.h
index 44f6683034..2233dbbeee 100644
--- a/editor/editor_dir_dialog.h
+++ b/editor/editor_dir_dialog.h
@@ -50,6 +50,7 @@ class EditorDirDialog : public ConfirmationDialog {
bool updating;
void _item_collapsed(Object *p_item);
+ void _item_activated();
void _update_dir(TreeItem *p_item, EditorFileSystemDirectory *p_dir, const String &p_select_path = String());
void _make_dir();
diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp
index f5ae7811f8..3ebd8f0475 100644
--- a/editor/editor_sub_scene.cpp
+++ b/editor/editor_sub_scene.cpp
@@ -131,6 +131,10 @@ void EditorSubScene::_item_multi_selected(Object *p_object, int p_cell, bool p_s
}
}
+void EditorSubScene::_item_activated() {
+ _ok_pressed(); // From AcceptDialog.
+}
+
void EditorSubScene::_remove_selection_child(Node *p_node) {
if (p_node->get_child_count() > 0) {
for (int i = 0; i < p_node->get_child_count(); i++) {
@@ -251,7 +255,7 @@ EditorSubScene::EditorSubScene() {
//tree->connect("nothing_selected", this, "_deselect_items");
tree->connect("cell_selected", callable_mp(this, &EditorSubScene::_selected_changed));
- tree->connect_compat("item_activated", this, "_ok", make_binds(), CONNECT_DEFERRED);
+ tree->connect("item_activated", callable_mp(this, &EditorSubScene::_item_activated), make_binds(), CONNECT_DEFERRED);
file_dialog = memnew(EditorFileDialog);
List<String> extensions;
diff --git a/editor/editor_sub_scene.h b/editor/editor_sub_scene.h
index 8205db25d7..5c3b4377d4 100644
--- a/editor/editor_sub_scene.h
+++ b/editor/editor_sub_scene.h
@@ -50,6 +50,7 @@ class EditorSubScene : public ConfirmationDialog {
void _fill_tree(Node *p_node, TreeItem *p_parent);
void _selected_changed();
void _item_multi_selected(Object *p_object, int p_cell, bool p_selected);
+ void _item_activated();
void _remove_selection_child(Node *p_node);
void _reown(Node *p_node, List<Node *> *p_to_reown);
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 979108e6dd..37b959c78a 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -945,7 +945,10 @@ void ProjectExportDialog::_export_project() {
}
}
- // Ensure that signal is connected if previous attempt left it disconnected with _validate_export_path
+ // Ensure that signal is connected if previous attempt left it disconnected
+ // with _validate_export_path.
+ // FIXME: This is a hack, we should instead change EditorFileDialog to allow
+ // disabling validation by the "text_entered" signal.
if (!export_project->get_line_edit()->is_connected_compat("text_entered", export_project, "_file_entered")) {
export_project->get_ok()->set_disabled(false);
export_project->get_line_edit()->connect_compat("text_entered", export_project, "_file_entered");
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 23a0a8485b..9f49ffcd28 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -389,6 +389,10 @@ void PropertySelector::_item_selected() {
help_bit->set_text(text);
}
+void PropertySelector::_hide_requested() {
+ _closed(); // From WindowDialog.
+}
+
void PropertySelector::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
@@ -568,5 +572,5 @@ PropertySelector::PropertySelector() {
help_bit = memnew(EditorHelpBit);
vbc->add_margin_child(TTR("Description:"), help_bit);
- help_bit->connect_compat("request_hide", this, "_closed");
+ help_bit->connect("request_hide", callable_mp(this, &PropertySelector::_hide_requested));
}
diff --git a/editor/property_selector.h b/editor/property_selector.h
index 8a190189ff..f579c0404c 100644
--- a/editor/property_selector.h
+++ b/editor/property_selector.h
@@ -41,12 +41,12 @@ class PropertySelector : public ConfirmationDialog {
LineEdit *search_box;
Tree *search_options;
- void _update_search();
-
+ void _text_changed(const String &p_newtext);
void _sbox_input(const Ref<InputEvent> &p_ie);
-
+ void _update_search();
void _confirmed();
- void _text_changed(const String &p_newtext);
+ void _item_selected();
+ void _hide_requested();
EditorHelpBit *help_bit;
@@ -58,8 +58,6 @@ class PropertySelector : public ConfirmationDialog {
Object *instance;
bool virtuals_only;
- void _item_selected();
-
Vector<Variant::Type> type_filter;
protected: