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

if (mode == FILE_MODE_OPEN_FILES) {
		TreeItem *ti = tree->get_next_selected(nullptr);
		String fbase = dir_access->get_current_dir();
		Vector<String> files;
		while (ti) {
			files.push_back(fbase.path_join(ti->get_text(0)));
			ti = tree->get_next_selected(ti);
		}
		if (files.size()) {
			emit_signal(SNAME("files_selected"), files);
			hide();
		}
		return;
	}
	String file_text = file->get_text();
	String f = file_text.is_absolute_path() ? file_text : dir_access->get_current_dir().path_join(file_text);
	if ((mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_FILE) && dir_access->file_exists(f)) {
		emit_signal(SNAME("file_selected"), f);
		hide();
	} else if (mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_DIR) {
		String path = dir_access->get_current_dir();
		path = path.replace("\\", "/");
		TreeItem *item = tree->get_selected();
		if (item) {
			Dictionary d = item->get_metadata(0);
			if (d["dir"] && d["name"] != "..") {
				path = path.path_join(d["name"]);