コード例 #1
0
static int file_operator_poll(bContext *C)
{
	int poll = ED_operator_file_active(C);
	SpaceFile *sfile = CTX_wm_space_file(C);

	if (!sfile || !sfile->op) poll = 0;

	return poll;
}
コード例 #2
0
ファイル: file_ops.c プロジェクト: OldBrunet/BGERTPS
static int file_rename_poll(bContext *C)
{
	int poll = ED_operator_file_active(C);
	SpaceFile *sfile= CTX_wm_space_file(C);

	if (sfile && sfile->params) {
		if (sfile->params->active_file < 0) { 
			poll= 0;
		} else {
			char dir[FILE_MAX], group[FILE_MAX];	
			if (filelist_islibrary(sfile->files, dir, group)) poll= 0;
		}
	}
	else
		poll= 0;
	return poll;
}
コード例 #3
0
ファイル: file_ops.c プロジェクト: OldBrunet/BGERTPS
static int file_delete_poll(bContext *C)
{
	int poll = ED_operator_file_active(C);
	SpaceFile *sfile= CTX_wm_space_file(C);
	struct direntry* file;

	if (sfile && sfile->params) {
		if (sfile->params->active_file < 0) { 
			poll= 0;
		} else {
			char dir[FILE_MAX], group[FILE_MAX];	
			if (filelist_islibrary(sfile->files, dir, group)) poll= 0;
			file = filelist_file(sfile->files, sfile->params->active_file);
			if (file && S_ISDIR(file->type)) poll= 0;
		}
	}
	else
		poll= 0;
		
	return poll;
}
コード例 #4
0
ファイル: file_ops.c プロジェクト: OldBrunet/BGERTPS
/* TODO, directory operator is non-functional while a library is loaded
 * until this is properly supported just disable it. */
static int file_directory_poll(bContext *C)
{
	return ED_operator_file_active(C) && filelist_lib(CTX_wm_space_file(C)->files) == NULL;
}