don't display relative paths button when loading files.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 18 Jan 2008 23:31:18 +0000 (23:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 18 Jan 2008 23:31:18 +0000 (23:31 +0000)
this was silly anyway since it always gave an error.

source/blender/makesdna/DNA_space_types.h
source/blender/src/editimasel.c
source/blender/src/filesel.c
source/blender/src/header_filesel.c
source/blender/src/header_imasel.c

index 2250e6e43abad9ad90b5584baf6dd0e57315ac3a..569a6ffc8aa96d6d74f86ea0c5eb06b596638bd8 100644 (file)
@@ -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
index cf6a86917b79f5f62a253095434203b120286440..ed630af20885dd5110939eebc5fcdde7499d9e66 100644 (file)
@@ -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;
index 33f0fe5788e37af5eda71e452413201de9b6f417..8a9b5b4d2b826e77bd327b589f45758c915cef7c 100644 (file)
@@ -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;
index 999fa2733afd348ba50c2cdea32028f35be1cd46..7591a6e7e2117c54f724b8b9505a112a2586560b 100644 (file)
@@ -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");
index 3968cff4757bf42151589c57c5051c0923707de3..bd09416e1ba44223793c685b029c22514322481e 100644 (file)
@@ -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);