### 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)

Vector<String> list;
	TreeItem *item = tree->get_root();
	item = tree->get_next_selected(item);
	while (item) {
		list.push_back(dir_access->get_current_dir().path_join(item->get_text(0)));
		item = tree->get_next_selected(item);
	}
	return list;
}
void FileDialog::update_dir() {
	if (root_prefix.is_empty()) {
		dir->set_text(dir_access->get_current_dir(false));
	} else {
		dir->set_text(dir_access->get_current_dir(false).trim_prefix(root_prefix).trim_prefix("/"));
	}
	if (drives->is_visible()) {
		if (dir_access->get_current_dir().is_network_share_path()) {
			_update_drives(false);
			drives->add_item(RTR("Network"));
			drives->set_item_disabled(-1, true);
			drives->select(drives->get_item_count() - 1);
		} else {
			drives->select(dir_access->get_current_drive());
		}
	}
	
	deselect_all();
}
void FileDialog::_dir_submitted(String p_dir) {