diff options
Diffstat (limited to 'editor/connections_dialog.cpp')
-rw-r--r-- | editor/connections_dialog.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 6fdd9563fb..bfa9081af2 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -34,6 +34,7 @@ #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_undo_redo_manager.h" #include "editor/scene_tree_dock.h" #include "plugins/script_editor_plugin.h" @@ -229,9 +230,8 @@ void ConnectDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { bind_editor->edit(cdbinds); + } break; - [[fallthrough]]; - } case NOTIFICATION_THEME_CHANGED: { for (int i = 0; i < type_list->get_item_count(); i++) { String type_name = Variant::get_type_name((Variant::Type)type_list->get_item_id(i)); @@ -459,7 +459,7 @@ ConnectDialog::ConnectDialog() { vbc_right->add_margin_child(TTR("Extra Call Arguments:"), bind_editor, true); unbind_count = memnew(SpinBox); - unbind_count->set_tooltip(TTR("Allows to drop arguments sent by signal emitter.")); + unbind_count->set_tooltip_text(TTR("Allows to drop arguments sent by signal emitter.")); unbind_count->connect("value_changed", callable_mp(this, &ConnectDialog::_unbind_count_changed)); vbc_right->add_margin_child(TTR("Unbind Signal Arguments:"), unbind_count); @@ -480,13 +480,13 @@ ConnectDialog::ConnectDialog() { deferred = memnew(CheckBox); deferred->set_h_size_flags(0); deferred->set_text(TTR("Deferred")); - deferred->set_tooltip(TTR("Defers the signal, storing it in a queue and only firing it at idle time.")); + deferred->set_tooltip_text(TTR("Defers the signal, storing it in a queue and only firing it at idle time.")); vbc_right->add_child(deferred); oneshot = memnew(CheckBox); oneshot->set_h_size_flags(0); oneshot->set_text(TTR("Oneshot")); - oneshot->set_tooltip(TTR("Disconnects the signal after its first emission.")); + oneshot->set_tooltip_text(TTR("Disconnects the signal after its first emission.")); vbc_right->add_child(oneshot); cdbinds = memnew(ConnectDialogBinds); @@ -839,6 +839,9 @@ void ConnectionsDock::_handle_signal_menu_option(int p_option) { disconnect_all_dialog->set_text(vformat(TTR("Are you sure you want to remove all connections from the \"%s\" signal?"), signal_name)); disconnect_all_dialog->popup_centered(); } break; + case COPY_NAME: { + DisplayServer::get_singleton()->clipboard_set(item->get_metadata(0).operator Dictionary()["name"]); + } break; } } @@ -909,7 +912,6 @@ void ConnectionsDock::_connect_pressed() { void ConnectionsDock::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); } break; @@ -924,6 +926,10 @@ void ConnectionsDock::_bind_methods() { ClassDB::bind_method("update_tree", &ConnectionsDock::update_tree); } +void ConnectionsDock::set_undo_redo(Ref<EditorUndoRedoManager> p_undo_redo) { + undo_redo = p_undo_redo; +} + void ConnectionsDock::set_node(Node *p_node) { selected_node = p_node; update_tree(); @@ -1159,6 +1165,7 @@ ConnectionsDock::ConnectionsDock() { signal_menu->connect("id_pressed", callable_mp(this, &ConnectionsDock::_handle_signal_menu_option)); signal_menu->add_item(TTR("Connect..."), CONNECT); signal_menu->add_item(TTR("Disconnect All"), DISCONNECT_ALL); + signal_menu->add_item(TTR("Copy Name"), COPY_NAME); slot_menu = memnew(PopupMenu); add_child(slot_menu); |