mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Signals: Port more uses of connect_compat
Those were problematic as they call a method of their parent class, but callable_mp does not allow that unless it's public. To solve it, we declare a local class that calls the parent class' method, which now needs to be protected to be accessible in the derived class.
This commit is contained in:
parent
b8f08b42e7
commit
09a6a2d8f8
19 changed files with 79 additions and 41 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue