Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-28 20:46:14 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-28 20:46:14 +0400
commitaa44603146e87f29f08cee2abab7e0ddd89222c5 (patch)
treedf7c7a0f0ecec9317c0350584a83644d9517c40c /source/blender/editors/space_file/fsmenu.c
parent74e4ad20c9e8d19f85aaa2995652e3f65bdfc0c9 (diff)
2.5: File browser
* Side panels now use list widgets. * Enabled theme colors for side panel. * Add button in bookmarks panel. * Operator panel title now uses operator name. * For unix, added / to system, and home and desktop to bookmarks. * For opening fileselect with filter, cleaned up the code a bit, adding WM_operator_properties_filesel instead of duplicating code. * Also added filter for all operators calling fileselect, only image and file open did it before. * Hide . files by default, and also hide files ending with ~. * Added back .. (but not .) in the file list, I really missed this. * File highlight now only happens when you're actually over a file, instead staying after you move the mouse away. * Fix some redraw/refresh issues.
Diffstat (limited to 'source/blender/editors/space_file/fsmenu.c')
-rw-r--r--source/blender/editors/space_file/fsmenu.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index c67a9e7a0d5..9d80dd7273a 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -34,9 +34,12 @@
#include "MEM_guardedalloc.h"
+#include "DNA_space_types.h" /* FILE_MAX */
+
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BLI_dynstr.h"
+#include "BLI_string.h"
#ifdef WIN32
#include <windows.h> /* need to include windows.h so _WIN32_IE is defined */
@@ -245,7 +248,7 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename)
FSMenuCategory category = FS_CATEGORY_BOOKMARKS;
FILE *fp;
- #ifdef WIN32
+#ifdef WIN32
/* Add the drive names to the listing */
{
__int64 tmp;
@@ -272,8 +275,7 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename)
SHGetSpecialFolderPath(0, folder, CSIDL_DESKTOPDIRECTORY, 0);
fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, folder, 1, 0);
}
-#endif
-
+#else
#ifdef __APPLE__
{
OSErr err=noErr;
@@ -293,6 +295,22 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename)
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0);
}
}
+#else
+ /* unix */
+ {
+ char dir[FILE_MAXDIR];
+ char *home= BLI_gethome();
+
+ fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, "/", 1, 0);
+
+ if(home) {
+ BLI_snprintf(dir, FILE_MAXDIR, "%s/", home);
+ fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, dir, 1, 0);
+ BLI_snprintf(dir, FILE_MAXDIR, "%s/Desktop/", home);
+ fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, dir, 1, 0);
+ }
+ }
+#endif
#endif
fp = fopen(filename, "r");