### Godot version

v4.1.stable.official [970459615]

### System information

Windows 10

### Issue description

When changing the `file_mode` of `FileDialog` from "Open File" to "Save File" via code the "Save" button keeps disabled until a file or folder is selected if the "Open" button was disabled before.

Basically the button activity has to be updated when `file_mode` is changed. I have made the change already but the last time I opened an PR without an issue some people requested I open one. So here you are!

### Steps to reproduce

- Open the MRP and start it
- click anywere to open the dialog
- after 10 seconds the dialog changes file_mode
- if the button is disabled before the change it is as well after it

### Minimal reproduction project

[file_dialogue_test.zip](https://github.com/godotengine/godot/files/11991311/file_dialogue_test.zip)

message->hide();
	message->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
	message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
	message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
	tree->add_child(message);
	file_box = memnew(HBoxContainer);
	file_box->add_child(memnew(Label(RTR("File:"))));
	file = memnew(LineEdit);
	file->set_structured_text_bidi_override(TextServer::STRUCTURED_TEXT_FILE);
	file->set_stretch_ratio(4);
	file->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	file_box->add_child(file);
	filter = memnew(OptionButton);
	filter->set_stretch_ratio(3);
	filter->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	filter->set_clip_text(true); 
	file_box->add_child(filter);
	vbox->add_child(file_box);
	dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES);
	_update_drives();
	connect("confirmed", callable_mp(this, &FileDialog::_action_pressed));
	tree->connect("multi_selected", callable_mp(this, &FileDialog::_tree_multi_selected), CONNECT_DEFERRED);
	tree->connect("cell_selected", callable_mp(this, &FileDialog::_tree_selected), CONNECT_DEFERRED);
	tree->connect("item_activated", callable_mp(this, &FileDialog::_tree_item_activated));
	tree->connect("nothing_selected", callable_mp(this, &FileDialog::deselect_all));
	dir->connect("text_submitted", callable_mp(this, &FileDialog::_dir_submitted));
	file->connect("text_submitted", callable_mp(this, &FileDialog::_file_submitted));
	filter->connect("item_selected", callable_mp(this, &FileDialog::_filter_selected));
	confirm_save = memnew(ConfirmationDialog);
	add_child(confirm_save, false, INTERNAL_MODE_FRONT);