Exemplo n.º 1
0
static void do_file_buttons(bContext *C, void *UNUSED(arg), int event)
{
	switch (event) {
		case B_FS_FILENAME:
			file_filename_exec(C, NULL);
			break;
		case B_FS_DIRNAME:
			file_directory_exec(C, NULL);
			break;
	}
}
Exemplo n.º 2
0
static int file_directory_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
	SpaceFile *sfile= CTX_wm_space_file(C);

	if(sfile->params) {
		file_expand_directory(C);
		
		if (!BLI_exists(sfile->params->dir)) {
			return WM_operator_confirm_message(C, op, "Create new directory?");
		} 

		return file_directory_exec(C, op);
	}

	return OPERATOR_CANCELLED;
}