Commit Graph

156 Commits

Author SHA1 Message Date
973f95fa9d Fix T40157: Loading movies larger than 4GB in size fails
Issue was caused by _wstat returning EOVERFLOW error because
of file size didn't fit into stat structure which was using
long datatype.

The idea of this patch is to use _wstat64 and _stat64 structure
which is capable storing 64bit file sizes.

Made it a typedef for stat structure used by BLI_stat function
in order to make code easier to follow and avoid ifdefs all
over the place.

Additionally solved issue with BLI_exists which was wrongly
returning False in cases destination file is larger then 4GB.
2014-05-28 23:21:39 +06:00
d303556afb Code cleanup: remove file handling headers where they arent needed 2014-05-02 05:37:11 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
1815225faa Blender Font (BLF): add length argument to string width/height functions
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
2013-12-02 21:10:07 +11:00
77719bfd06 File Browser: autocomplete keeps focus in the file field when entering a folder.
There is a bunch of internal refactoring going on too:
* No longer use operators to handle these directory and file fields, only makes
  things more complicated than they should be.
* Handle autocomplete partial/full match deeper in the UI code
* Directory field still does not keep focus, that's for another time to fix,
  you can already do pretty quick keyboard only navigation with the file field.

Reviewed By: elubie

Differential Revision: http://developer.blender.org/D29
2013-11-29 17:49:01 +01:00
9c5fb7b2e7 Fix T37485: autocomplete while appending and autocomplete folder behaviour.
This adds functionality to tab-autocomplete folders in the file browser file
field, and the ability to autocomplete .blend files and their sub folders while
linking. If only one match of a blend or a folder is found, it is opened, which
applies to wildcards in the file field now.

Reviewed By: elubie, brecht

Differential Revision: http://developer.blender.org/D20
2013-11-22 14:48:46 +01:00
035d86402b Fix: tab completing a filepath name in file browsers asks to create a new
directory if name was not fully matched

When hitting tab to complete a directory name in the filepath field in the
filebrowser Blender shows a "create new directory?" popup, if the beginning
of directory name typed in the field matches many entries. For example if you
have directories in the open directory called "test123" and "test456", typing
"te", tab would complete up to "test", but ask to create a new folder with the
name "test".

This patch unsets the boolean storing the info about changing filepath if the
folder with the completed name does not exist.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D10
2013-11-19 16:42:50 +01:00
8bdb1f6155 Get rid of madness about fnmatch: BLI_fnmatch did not do the OS checks, they had to be done in every file using fnmatch (autoexec.c did not, wonder how it could work under unix???).
Thanks to Brecht for noting this!
2013-08-27 18:29:30 +00:00
c0d67d26aa no remove double property lookups in ED_fileselect_set_params and redundant NULL check in file_main_area_draw. 2013-08-26 06:54:05 +00:00
40d4dfaba8 Fix #35824: finding missing files not working correct for filepaths with special
characters on Windows.

Replaced some uses of stat() by BLI_stat() to properly handle such filepaths.
2013-06-25 14:48:30 +00:00
9d4cc7885d fix for filesel autocomplete, it had the annoying behavior if you entered in a non-existing name, of executing it and then asking to add the dir. 2013-06-19 11:53:48 +00:00
447e9a4cd5 add option to enable auto-execute scripts, but exclude certain directories. 2013-06-18 18:11:52 +00:00
5c685b7f99 change to r57261, replace BLI_cleanup_dir with BLI_split_dir_part 2013-06-06 23:58:30 +00:00
ed010927c1 Merge branch 'FIX_Previous_Folder' into trunk 2013-06-06 02:13:56 +00:00
88cf1a2bc7 Screen: add exit callback for area and region types, this gets called when
hiding or removing an area or region.
2013-03-15 19:56:29 +00:00
1a9cde8b99 patch [#34103] dir_contents.patch
from Lawrence D'Oliveiro (ldo)

- storage.c: Simplify BLI_dir_contents and make it and its internal subsidiary routines reentrant
- Moved common code for disposal of a struct direntry to new routine BLI_free_filelist in storage.c, and put calls to it in interface_icons.c and filelist.c
- Took out inclusion of BLI_fileops_types.h from BLI_fileops.h and put it explicitly into .c files that need it (which turned out to be only 7 of the 35 files that were including the former)
2013-03-05 03:44:47 +00:00
f44b54d2a7 patch [#34103]
from Lawrence D'Oliveiro (ldo)

More use of bool type, necessitating adding inclusion of BLI_utildefines.h, or moving it up in the inclusion order if it was already included, in various places
- storage.c: make some variables only used in bli_builddir local to that
- storage.c: BLI_file_descriptor_size should allow 0 as a valid file descriptor
- path_util.c: make pointers to non-reentrant storage returned from folder routines const, necessitating making variables holding these returned pointers const elsewhere as well
- path_util.c: BLI_string_to_utf8 closes iconv context in case of conversion error
-  blf_lang.c: fill_locales routine now has its own "languages" local variable to construct paths (was stealing internal storage belonging to BLI_get_folder before)
2013-03-05 03:17:46 +00:00
00cad30349 style cleanup 2013-02-13 05:10:38 +00:00
dcea2800a7 Fix file editor not properly scaling with DPI, this was not implemented yet.
Still todo is high resolution file icons as they look a bit pixelated now.
2013-02-12 17:09:02 +00:00
808c2d840e minor glitch in file selector, when opening with an operator sort wasn't set. 2013-02-07 00:46:53 +00:00
296444e1dc style cleanup: some warnigs & spelling. 2013-02-06 14:02:19 +00:00
ecda79a8b8 == file browser ==
[#33080] Backup icons - further integration
Contributed by Georg Kronthaler, many thanks!

* enables display of correct file icon on splash screen and in Open Recent menu
* exposes filter_backup in the python api
* enables setting BLENDERFILE_BACKUP as active filter in file browser from wm_operators.c (and from .blend in case this setting will be saved in the future)
* adds a comment to slightly misleading function name file_is_blend_backup()
* Updates icon for backup files to be more consistent with icon for .blend files
2012-11-06 20:29:14 +00:00
89b7e22578 == filebrowser ==
PATCH: [#32985] File Browser text file icon does not match text filter icon
Contributed by Georg Kronthaler, many thanks!

* set correct icon for text files and drag&drop
* remove duplicate if for filter_text
* fixed a couple of blanks at the end of line.
2012-10-27 17:47:58 +00:00
db250a48f6 fix [#32855] Obj im and export and the file path and name
file selector now uses previously used settings for operators rather then over riding them with the currently open blend file.
2012-10-24 04:29:35 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
77f47799dd code cleanup: use BLI_RCT_SIZE macro 2012-08-20 23:06:17 +00:00
61469d2e3e code cleanup: remove unneeded 'struct' qualifiers 2012-07-26 22:47:05 +00:00
d58ce290e1 increase file browser title length for multibyte translations and use utf8 copy for it 2012-07-07 14:58:40 +00:00
2c3165fdc0 style cleanup 2012-06-18 13:01:24 +00:00
fe20596f9c == filebrowser ==
fixes:
* Sequence editor not loading file typed in filebrowser file button (reported by Sergey on IRC)
* filename button doesn't match exactly typed in filename

notes:
* file specified in the filename button now gets added to 'files' list, even if not selected
* after matching filename (either by typing in exact match or using wildcards) the first match is assigned to the filename button.
2012-06-17 14:16:26 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
6701933f5c style cleanup 2012-04-21 12:51:47 +00:00
a73d0d3e72 code cleanup: dont include BLI_winstuff.h on non windows systems, also cleanup some defines/includes for windows. 2012-04-15 07:54:07 +00:00
310c0b9f10 Fixed another bunch of i18n bugs (thx to Leon Cheung for spotting them), among which:
* Drag'n'drop translation in Outliner
* "Execute" button in file window
* "Labels" of spacing elements, in multi-column enums
* A glitch with nodes "Value to RGB", they where called "ColorRamp" in node_type_base() call. This is not definitive, though, as it appears that UI node names are determined by this call, while it should be by "defines" in rna_nodetrre_types.h, I guess... Anyway, not good to have such things in two different places!

Also moved default context name under BLF_translation.h, much better to have those all in one place, accessible from whole Blender code!
2012-04-14 15:06:41 +00:00
ab4a2aaf4a style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:38:07 +00:00
a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
44850d6946 Fix #29946: Recover Auto Save defaults to "Short List" View -- Cannot determine dates
Added option display_type to WM_operator_properties_filesel which defines which file
display type (short/list/icons/default) should be used for file browser.

All current operators are using FILE_DEFAULTDISPLAY display type which means display
type will still be calculated based on type of opening file and user preferences
settings. Recover Auto Save operator is now using long display type so file date can
easily be checked now.

Reviewed by Andrea, thanks!
2012-01-24 18:18:51 +00:00
f66f33cefc rename RNA_property_is_set() --> RNA_struct_property_is_set() in preperation to add a second version of the function which takes the property rather then its name. 2012-01-11 16:32:12 +00:00
33b1717d59 fix [#29734] Crash after bpy.ops.file.direrectory_new() 2011-12-31 03:52:07 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
e417e011d5 Code cleanup: file operations merged into single header, some function names
made less cryptic and changed to indicate if they work on files or directories.
2011-10-22 15:35:49 +00:00
74017cb020 header cleanup and typo's 2011-10-22 01:53:35 +00:00
ef218c75ed - add convenience functions BLI_split_dir_part / BLI_split_file_part, which just call BLI_split_dirfile().
- add a fixed value for bprogdir (the dir of bprogname), since it was being used for resource lookups.
2011-10-21 02:13:36 +00:00
317b649bb2 fix for buffer overrun with BLI_split_dirfile(...), was simple to do since many places don't check for filename lengyj of 79 chars which is the limit for the file selector.
Add max dir and file length args.
2011-10-15 03:56:05 +00:00