== filebrowser ==

Bringing back missing feature: Create new directory by typing a not existing name into the directory button.

Note: Small issue still with autocomplete -> if typing the new directory directly after autocomplete, it doesn't execute the operator yet.

Also fixed some minor compile/cleanup issues with warning about signed/unsigned comparison and missing header.
This commit is contained in:
2010-11-06 16:09:12 +00:00
parent a1c7cccae4
commit dcda17b3b3
8 changed files with 115 additions and 10 deletions

View File

@@ -2634,6 +2634,35 @@ uiBut *ui_def_but_operator(uiBlock *block, int type, char *opname, int opcontext
return but;
}
uiBut *ui_def_but_operator_text(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{
uiBut *but;
wmOperatorType *ot;
ot= WM_operatortype_find(opname, 0);
if(!str) {
if(ot) str= ot->name;
else str= opname;
}
if ((!tip || tip[0]=='\0') && ot && ot->description) {
tip= ot->description;
}
but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
but->optype= ot;
but->opcontext= opcontext;
if(!ot) {
but->flag |= UI_BUT_DISABLED;
but->lock = 1;
but->lockstr = "";
}
return but;
}
uiBut *uiDefBut(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{
uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
@@ -2805,6 +2834,16 @@ uiBut *uiDefButO(uiBlock *block, int type, char *opname, int opcontext, char *st
return but;
}
uiBut *uiDefButTextO(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{
uiBut *but= ui_def_but_operator_text(block, type, opname, opcontext, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
if(but)
ui_check_but(but);
return but;
}
/* if a1==1.0 then a2 is an extra icon blending factor (alpha 0.0 - 1.0) */
uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{