Commit Graph

754 Commits

Author SHA1 Message Date
Bastien Montagne 98e3694c39 Fix T43817: issue with non-utf8 encodings in Windows paths, again...
We need to use 'W' widechar variants of win funcs and convert wchar to utf8-encoded bytes
in those cases, sigh...

Note: theoritical fix only, need org reporter to test it...
2015-02-26 11:27:58 +01:00
Campbell Barton 5721863805 RNA: pass only 0/1 to RNA_property_boolean_set 2015-02-19 12:33:14 +11:00
Bastien Montagne 55fd389a70 New filebrowser bookmarks: Some minor fix/optimization from latest coverity report. 2015-02-18 13:18:04 +01:00
Bastien Montagne e089b0e911 Amend to previous own Fix T43684: only use hack on WIN32, and use case-insensitive comparison.
Thanks to Campbell for the headup.
2015-02-17 21:10:08 +01:00
Bastien Montagne 21a2b73a1e Fix T43684 (again!): Mighty Windows thinks it’s perfectly sensible to block everyone during 5 seconds for a mere stat() call on "A:\" path...
For now, just always consider those floppy entries ("A:\" and "B:\") as valid... sigh.
2015-02-17 19:13:22 +01:00
Bastien Montagne 9b845359a6 Quick fix/hack for too small 'operator' panel in filebrowser
Real issue is that temp area used to draw modal filebrowser is never saved,
so non of UI 'edits' (like UIList resize, regions resize, panels reorder, etc.)
are ever saved. Should be addressed, but no time for that currently.
2015-02-17 15:18:02 +01:00
Campbell Barton 4bb331dfd5 RNA API: reuse property lookups 2015-02-17 13:13:59 +11:00
Campbell Barton 070f516b52 Fix FileSel globbing including dirs & ".." 2015-02-17 12:01:47 +11:00
Campbell Barton 8cb4011220 Revert "Fix file size not drawn using Link/Append"
This reverts commit 4ca4f04c75.

Was running an fs-stat on redraw, on every file! (every mouse motion!).
Could become very slow on network-fs

also caused crash (T43631)
2015-02-17 11:36:41 +11:00
Campbell Barton 1e00e87e3a FileSpace selection didn't call op.check sometimes
(de)select all & globbing didnt run operators check callback.

D867 by @igel with edits
2015-02-17 08:54:25 +11:00
Bastien Montagne 0dfdca6d13 Fix T43684: File Browser is unusable on Windows Machines (do not BLI_is_dir() in draw loop!)
Did not had any issue on linux, but looks like on some windows can slow things as Hell.
Or maybe just the presence of some network FS?

Anyway, not a good idea, so now fsmenu entries' valid status is stored and only evaluated
on startup (reading of bookmarks & co) and when opening file browser (refresh, like
for system bookmarks).
2015-02-16 15:58:57 +01:00
Bastien Montagne 1c64543aef Cleanup of SpaceFile, from asset-experiments branch mostly.
Helps keeping diff with branch relevant and clean...
2015-02-15 16:35:42 +01:00
Bastien Montagne f1ee11fcca Fix for previous commit, sorry for the noise. 2015-02-15 15:55:13 +01:00
Bastien Montagne b9ffd70960 FileBrowser Bookmarks: fix issue with invalid bookmarks.
Reported by maxon through IRC, thanks.

Invalid (inexistant) bookmarks would not be selectable, hence not removable.

First, made invalid bookmarks grayed out in lists, so that user knows when there are some.

Then, added a new 'cleanup' operator that removes all invalid bookmarks.

This solution may not be completely satisfaying, but should do the work for now.
I do not want to add back those ugly 'X' delete buttons for each entry in list,
so better solution would be to make UIList able to select several items at once...
2015-02-11 17:13:16 +01:00
Bastien Montagne 8668006519 Fix crasher in own UIList bookmarks commit.
Immediate crash in merged asset-experiments branch, no idea why it did not show in master too?
2015-02-11 11:16:32 +01:00
Bastien Montagne 9e2abbc9ba FileBrowser: Editable Bookmarks.
Bookmarks are now editable (i.e. you can rename them, and reorder them).
They are also listed in regular UILists, so you can filter/sort them as usual too.

Also, FileBrowser 'T' side area is changed to something similar to 3DView one,
in this case because we need op panel to remain at the bottom, and later because
we'll more than likely need tabs here!

Thanks to Campbell and Sergey for reviews.

Differential Revision: https://developer.blender.org/D1093
2015-02-11 00:09:45 +01:00
julianeisel 4ca4f04c75 Fix file size not drawn using Link/Append
For linking/appending, .blends get the type S_IFDIR added which prevents
the size from being drawn. BLI_is_dir gets the type from the OS so it's
better suited for this case.

Reported by @sergey.
2015-02-09 22:06:45 +01:00
Bastien Montagne 9c90c559fe SpaceFile: rework filelist_find, was looping way too much. 2015-02-09 10:10:20 +01:00
Bastien Montagne 7bc6fbf158 Cleanup: current/parent paths: add helpers in BLI_path_utils.
Also, avoid calling ugly strcmp with '.' or '..', making direct char checks is
much cheaper here!
2015-01-26 16:59:24 +01:00
Bastien Montagne fca515838e Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
Campbell Barton 09eec627ed UI: cleanup UI_fontstyle_string_width, UI_draw_string
Both were maked as temp, but used often.

Now pass uiFontStyle to both, rename UI_draw_string to UI_fontstyle_draw_simple,
since its a variant of UI_fontstyle_draw that skips shadow, align... etc.
2015-01-20 15:50:20 +11:00
Campbell Barton 0996ee3bb8 Fix: Don't show filesel buttons when no operators running 2015-01-13 02:08:26 +11:00
Campbell Barton 848c00f7e7 cleanup: de-duplicate code 2015-01-07 12:08:54 +11:00
Campbell Barton 77c926933b cleanup: warnings 2015-01-06 19:09:56 +11:00
Bastien Montagne 89b654dc56 FileBrowser: small tweak to new search feature: clear that string when changing dir.
In 99% of cases, you do not want to keep the same filter when changing dir,
and having to reset it by hand is *very* annoying!
2015-01-05 12:23:41 +01:00
Bastien Montagne a08c5e1183 Partial fix for T43113: Filebrowser: Empty folders do not contain go back arrow.
Do not allow going into un-readable directories at all.
Note we might want to reflect that 'state' in UI for users too, but that will be
for later.

Also, not quite sure this fix the windows case, will have to start my VM... :/
2015-01-04 17:57:39 +01:00
Bastien Montagne 026cb6bdeb FileBrowser: Cleanup: rename some (really ugly) enum names. 2015-01-04 12:04:47 +01:00
julianeisel 555c1d6a63 Fix T43114: File Browser - don't highlight '..' while using border select 2015-01-04 02:36:42 +01:00
Bastien Montagne dcc5997527 FileBrowser: add search field in header bar.
Not much to add, pretty straightforward...
2015-01-03 21:55:16 +01:00
Bastien Montagne b137f06d7e Cleanup: rename 'filelist' BLI funcs to consistent naming.
Also, add an optional callback to `BLI_filelist_free()` to allow freein
void poin if needed (consistency with `BLI_filelist_duplicate()`...).
2015-01-03 12:41:36 +01:00
Bastien Montagne 4bdd4aa633 SpaceFile: Cleanup: fix stupid indices in filelist_from_main()
Dead code (currently), but still...
2015-01-01 11:11:37 +01:00
Bastien Montagne 46bce66805 SpaceFile: Tweak thumbnail to avoid restarting the job needlessly. 2015-01-01 11:11:37 +01:00
Bastien Montagne 950f2c84a3 SpaceFile: Refactor sorting and filtering of filelist.
New code shall be more easy to maintain and extend.
Sorting is now handled quite the same as filtering, and all filtering parameters
are now packed into a sub-struct to help extending it later.

Also done some optimizations in filelist refresh, and sorting/filtering area.
Now we should avoid re-sorting and re-filtering too often, also removed
calls to those in read_xxx funcs.

Note thumbnail job is still started basically on each call to `file_refresh()`,
will be addressed in next commit.
2015-01-01 11:11:37 +01:00
Bastien Montagne d8bb30d87e SpaceFile: Filelist: reorder a bit things, also cleanup some unused and pure-private funcs. 2015-01-01 11:11:37 +01:00
julianeisel 76b4fad6db Fix T42879: File Browser - disable selecting ".." entry (Parent Directory) 2014-12-24 19:51:42 +01:00
Bastien Montagne cf15147053 Cleanup: minor int->bool cleanup. 2014-12-04 11:18:27 +01:00
Campbell Barton bcbbc66795 Cleanup: unused headers 2014-11-28 15:52:30 +01:00
Campbell Barton 43fa4baa6c Refactor: BLI_path_util (part 2)
Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util
2014-11-23 18:55:52 +01:00
Campbell Barton 6308c16675 Refactor: BLI_path_util (split out app directory access)
This module is intended for path manipulation functions
but had utility functions added to access various directories.
2014-11-23 18:42:18 +01:00
Jens Verwiebe ed52706d35 Just 2 comments cleaned 2014-11-16 17:12:49 +01:00
Campbell Barton 9cc51d8ea2 UI: cleanup odd string-width check 2014-11-11 18:40:08 +01:00
Campbell Barton 5c6e333780 UI Refactor T41640
Make the UI API more consistent and reduce confusion with some naming.

mainly:
- API function calls
- enum values

some internal static functions have been left for now
2014-11-10 23:06:54 +01:00
julianeisel bd401d9517 Fix T42498: Disable Renaming for Read-Only Files in File Browser 2014-11-10 20:32:17 +01:00
julianeisel a91888206f Fix T42497: Enlarge rename text field in File Browser
To ensure there's space for more than a few characters in the rename text fields of the File Browser, we now use a width relative to the column width (for all display modes).

Includes some edits from @campbellbarton - thanks for this!
2014-11-06 17:45:32 +01:00
Jens Verwiebe 355b70c360 Fix indetation in last commit 2014-11-03 15:06:46 +01:00
Jens Verwiebe 9e4229e0ad OSX/fsmenu: fix compiling on older gcc reported by Mike S 2014-11-03 15:05:48 +01:00
Campbell Barton 9231150577 Cleanup: redundant cast 2014-10-13 15:51:31 +02:00
Campbell Barton 9f18e4f0eb Cleanup: tabs
Set your editor to tabs for all C/C++!
2014-10-09 17:12:50 +02:00
Jens Verwiebe 5c829d2c4e OSX: fsmenu cleanup 2014-10-08 12:48:46 +02:00
Jens Verwiebe 05e26297bf OSX: adapt fs_menue to modern entries handling 2014-10-07 23:45:09 +02:00