Пример #1
0
void EditorFileDialog::_item_dc_selected(int p_item) {


	int current = p_item;
	if (current<0 || current>=item_list->get_item_count())
		return;

	Dictionary d=item_list->get_item_metadata(current);

	if (d["dir"]) {

		//print_line("change dir: "+String(d["name"]));
		dir_access->change_dir(d["name"]);
		if (mode==MODE_OPEN_FILE || mode==MODE_OPEN_FILES || mode==MODE_OPEN_DIR || MODE_OPEN_ANY)
			file->set_text("");
		call_deferred("_update_file_list");
		call_deferred("_update_dir");

		_push_history();


	} else {

		_action_pressed();
	}
}
Пример #2
0
void FileDialog::_tree_item_activated() {

	TreeItem *ti = tree->get_selected();
	if (!ti)
		return;

	Dictionary d = ti->get_metadata(0);

	if (d["dir"]) {

		dir_access->change_dir(d["name"]);
		if (mode == MODE_OPEN_FILE || mode == MODE_OPEN_FILES || mode == MODE_OPEN_DIR || mode == MODE_OPEN_ANY)
			file->set_text("");
		call_deferred("_update_file_list");
		call_deferred("_update_dir");
	} else {

		_action_pressed();
	}
}
Пример #3
0
void EditorFileDialog::_item_dc_selected(int p_item) {

	int current = p_item;
	if (current < 0 || current >= item_list->get_item_count())
		return;

	Dictionary d = item_list->get_item_metadata(current);

	if (d["dir"]) {

		dir_access->change_dir(d["name"]);
		call_deferred("_update_file_list");
		call_deferred("_update_dir");

		_push_history();

	} else {

		_action_pressed();
	}
}
Пример #4
0
void FileDialog::_file_entered(const String& p_file) {

	_action_pressed();	
}