don't display relative paths button when loading files.

this was silly anyway since it always gave an error.
This commit is contained in:
Campbell Barton 2008-01-18 23:31:18 +00:00
parent 4ffd8d2a28
commit 31f14862f7
5 changed files with 17 additions and 10 deletions

@ -421,7 +421,7 @@ typedef struct SpaceImaSel {
/* filesel types */
#define FILE_UNIX 8
#define FILE_BLENDER 8
#define FILE_BLENDER 8 /* dont display relative paths */
#define FILE_SPECIAL 9
#define FILE_LOADLIB 1

@ -195,7 +195,7 @@ static void activate_imageselect_(int type, char *title, char *file, short *menu
simasel->files = BIF_filelist_new();
}
if(G.relbase_valid && BLI_convertstringcode(name, G.sce, G.scene->r.cfra))
if(G.relbase_valid && U.flag & USER_RELPATHS && type != FILE_BLENDER)
simasel->flag |= FILE_STRINGCODE;
else
simasel->flag &= ~FILE_STRINGCODE;

@ -1192,7 +1192,7 @@ static void activate_fileselect_(int type, char *title, char *file, short *menup
/* sfile->act is used for databrowse: double names of library objects */
sfile->act= -1;
if(G.relbase_valid && U.flag & USER_RELPATHS)
if(G.relbase_valid && U.flag & USER_RELPATHS && type != FILE_BLENDER)
sfile->flag |= FILE_STRINGCODE;
else
sfile->flag &= ~FILE_STRINGCODE;

@ -136,10 +136,13 @@ void file_buttons(void)
uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Hides dot files");
uiBlockEndAlign(block);
uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
xco+=90;
if(sfile->type==FILE_BLENDER) {
xco+=20;
} else {
uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
xco+=90;
}
if(sfile->type==FILE_LOADLIB) {
uiBlockBeginAlign(block);
uiDefButBitS(block, TOGN, FILE_LINK, B_REDR, "Append", xco+=XIC,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Copies selected data into current project");

@ -181,9 +181,13 @@ void imasel_buttons(void)
uiBlockEndAlign(block);
}
}
uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
xco+=90;
if(simasel->type==FILE_BLENDER) {
xco+=20;
} else {
uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
xco+=90;
}
if(simasel->type==FILE_LOADLIB) {
uiBlockBeginAlign(block);