Age | Commit message (Collapse) | Author |
|
* Avoid direct access to `SpaceFile.params`, use a getter instead. This matters
because once the asset-browser changes are in, there will be an alternative
selection parameter object. The getter can return the correct one.
* Rename the function to ensure the parameters. The old name
`ED_fileselect_get_params()` wasn't a mere getter, it would create the
parameters if necessary. Now we have an actual getter, so better be clear.
* In some instances, I replaced the old "get" function with the new mere
getter. So the ensure logic is called less often. However, in these cases we
should be able to assume the selection parameters were created already as
part of the editor creation routine.
The term "active" in the new function names may seem a bit odd in the current
context, but that is a preparation for the Asset Browser merge as well. Like
said, there will be two file selection parameter objects in the space.
|
|
`WM_operator_properties_filesel()` allows C operators to set a display or sort
type for the File Browser to use. But the File Browser would always override
that because of an invalid `_is_set()` check. (The operators don't actually set
the value, they only set the property's default value.)
The only operator affected by this is "Recover Auto Save". It is supposed to
show a vertical list ordered chronologically. It used settings from the
previous File Browser usage before this patch.
Operators using the File Browser should generally use
`FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not
to. See comments at their definition.
----
This makes it so operators that set a different display or sort type
don't change the sort or display type for the next File Browser operation.
So using "Recover Auto Save" entirely isolates display and sort type from other
operations.
Differential Revision: https://developer.blender.org/D8598
Reviewed by: Bastien Montagne
|
|
|
|
Corrects 34 miscellaneous misspelled words.
Differential Revision: https://developer.blender.org/D9248
Reviewed by Campbell Barton
|
|
Follow our code style guide by using C-comments for text descriptions.
|
|
Cleanup old tracker task format to the new. e.g: [#34039] to T34039
Ref D8718
|
|
|
|
Support setting bookmarks even when the file browser
isn't the active space.
|
|
|
|
Regression in e4a50e3f47de1.
|
|
Clicking on the column header is supposed to enable sorting by this
column, or switch the sort order if already enabled.
The double-click event would be blocked by the `file.execute()`
operator, which is not supposed to act if the user clicked outside the
file list.
|
|
After changes in rBc606044157a3, mouse press events would be blocked by
the selection operator. This only worked by chance before.
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors` module.
No functional changes.
|
|
Regression in e8ab0137f8766
|
|
Adds support for Windows Shell Links (shortcuts) to the File Browser. Extended Mac Alias usage. Better visualization of linked items.
Differential Revision: https://developer.blender.org/D7380
Reviewed by Campbell Barton
|
|
Use BLI_path_ prefix, more consistent names:
BLI_parent_dir -> BLI_path_parent_dir
BLI_parent_dir_until_exists -> BLI_path_parent_dir_until_exists
BLI_ensure_filename -> BLI_path_filename_ensure
BLI_first_slash -> BLI_path_slash_find
BLI_last_slash -> BLI_path_slash_rfind
BLI_add_slash -> BLI_path_slash_ensure
BLI_del_slash -> BLI_path_slash_rstrip
BLI_path_native_slash -> BLI_path_slash_native
Rename 'cleanup' to 'normalize', similar to Python's `os.path.normpath`.
BLI_cleanup_path -> BLI_path_normalize
BLI_cleanup_dir -> BLI_path_normalize_dir
BLI_cleanup_unc -> BLI_path_normalize_unc
BLI_cleanup_unc16 -> BLI_path_normalize_unc16
Clarify naming for extracting, creating numbered paths:
BLI_stringenc -> BLI_path_sequence_encode
BLI_stringdec -> BLI_path_sequence_decode
Part of T74506 proposal.
|
|
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432.
Now the area and region naming conventions should be less confusing.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
|
|
Continuation of b2ee1770d4c3, now non-single word variables are also
renamed.
Part of T74432.
Also ran clang-format on affected files.
|
|
|
|
This adds support for macOS aliases in addition to symlinks. It also adds
support for hidden, readonly and system file attributes.
Contributed by Ankit (ankitm) with modifications by me.
Differential Revision: https://developer.blender.org/D6679
|
|
|
|
|
|
Owner of filelisting job was changed, without proper update of all
access/usages of that owner to reach the job, leading to failure of
timer removal from the WM, and attempt to double-free the job...
Caused by rB2c4dfbb00246ff.
|
|
file-selector
In these cases the file selectors directory is already expanded.
|
|
Use 'BLI_join_dirfile' for joining paths that don't need to expand '//'.
|
|
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
|
|
Part of https://developer.blender.org/T74429.
There's a chance that this causes some issues becaue in some cases we
change from getting the window from context to getting it from somewhere
else.
|
|
|
|
This patch refactors arrow keys navigation to move properties and enum
to generic ED_select_utils.h and property to
WM_operator_properties_select_walk_direction()
No functional change
Reviewed By: Julian Eisel
Differential Revision: https://developer.blender.org/D4771
|
|
Reviewers: Severin, brecht
Differential Revision: https://developer.blender.org/D6941
|
|
Wasn't checking if there actually is a selection.
|
|
Allows each File Browser list item in Volumes and System to use individual icons.
Differential Revision: https://developer.blender.org/D5802
Reviewed by Julian Eisel
|
|
This diff allows to delete directories in the file browser. The commit https://developer.blender.org/rB8825250f5a85c0c16e74ed144dd2b4a7d752042f did not include this feature.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D6083
|
|
Stupid mistake in 5edfde58fe60.
|
|
Previously, we used Ctrl+Click for renaming, but since that shortcut is
now consistently used to add items to the selection, we can't use that.
In other cases we switched to F2 now, so it makes sense for the File
Browser too.
Further, AFAIK renaming was only possible through the context menu,
which makes it hard to discover in the right click select keymap (have
to press W).
Note that I had to do some internal changes to ensure the context menu
always acts on the clicked/hovered item, while the shortcut operates on
the active item. William and I agreed that this is likely the behavior
expected by most users.
|
|
In Blender 2.7 delete would permanently delete files, now this function is back
but using more standard behavior.
This patch includes code contributed by Kris (Metricity).
Differential Revision: https://developer.blender.org/D4585
|
|
E.g. entering the file path field and then pressing enter without any
change would call an unneccesary directory change, causing flickering.
So the main point of this is to avoid flickering.
Without this the text field could also be used to refresh the file list,
but for that we have a proper button.
|
|
For the default keymap we were only using the regular toolshelf
operator, doing this for the industry compatible keymap too now (we
could even remove it there, we don't use it in other editors).
Since we "now" have proper operators for toggling regions, this specific
one is totally redundant.
|
|
So far the file browser code had some lazy creation for the tool region,
even though it should always be there. The only reason I can see for
this is compatiblity. So I simply added versioning code to add the
region in case it's not there. Now we should be able to savely assume
the tool region to be there, whithout any unusual lazy-creation.
|
|
This makes it so that regions only needed when the file browser is
invoked as an operation (e.g. Ctrl+O rather than a regular editor) are
lazy created then, and removed if the file browser is changed into a
regular editor then (e.g. Ctrl+O over regular file browser editor ->
Cancel).
That should remove some troublesome assumptions and makes versioning
redundant.
It also fixes the issue of an empty execute region at the bottom after
cancelling a file operation invoked from a regular file browser editor.
|
|
As per Brecht's suggestion, use the check_existing property to control
visibility of the '+' and '-' icons. It is typically set for save
operations.
Adds another FileSelectParams flag (to avoid duplicated propertie
lookups) and removes the recently introduced
FileSelectParams.action_type again.
Fixes T69881.
|
|
For the default and industry compatible keymap, clicking on empty space
in the file browser will deselect all files.
Also makes selection use same operator description we use for other
select operators.
|
|
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
|
|
The failing assert was there before the recent file browser design
overhaul. Might have been in there for quite a while in fact.
Auto-creation in this case means that the file path would be created if
a non-existent path was entered in the file browser path button.
|
|
This confirmation prompt was there earlier, we removed the prompts for
creating new directories all together, but in this case it's reasonable.
Without it, it's simply too easy to create new directories by accident.
|
|
E.g. box selecting wouldn't allow selecting the first file.
Work selection and shift/ctrl selection had similar issues.
Code assumed that the first item was the '..' parent item and manually
removed it from the selection. I could just remove this special
handling, but instead I made the behavior more dynamic. So the file list
checks if the '..' item is there and only then applies special
treatment.
That way we can easily bring the '..' item back or make it optional if
wanted.
|
|
Code assumed the '..' was there, which isn't the case any more. Just
early exiting for empty directories is fine.
|
|
This is a general redesign of the File Browser GUI and interaction
methods. For screenshots, check patch D5601.
Main changes in short:
* File Browser as floating window
* New layout of regions
* Popovers for view and filter options
* Vertical list view with interactive column header
* New and updated icons
* Keymap consistency fixes
* Many tweaks and fixes to the drawing of views
----
General:
* The file browser now opens as temporary floating window. It closes on
Esc. The header is hidden then.
* When the file browser is opened as regular editor, the header remains
visible.
* All file browser regions are now defined in Python (the button
layout).
* Adjusted related operator UI names.
Keymap:
Keymap is now consistent with other list-based views in Blender, such as
the Outliner.
* Left click to select, double-click to open
* Right-click context menus
* Shift-click to fill selection
* Ctrl-click to extend selection
Operator options:
These previously overlapped with the source list, which caused numerous
issues with resizing and presenting many settings in a small panel area.
It was also generally inconsistent with Blender.
* Moved to new sidebar, which can easily be shown or hidden using a
prominent Options toggle.
* IO operators have new layouts to match this new sidebar, using
sub-panels. This will have to be committed separately (Add-on
repository).
* If operators want to show the options by default, they have the option
to do so (see `WM_FILESEL_SHOW_PROPS`, `hide_props_region`), otherwise
they are hidden by default.
General Layout:
The layout has been changed to be simpler, more standard, and fits
better in with Blender 2.8.
* More conventional layout (file path at top, file name at the bottom,
execute/cancel buttons in bottom right).
* Use of popovers to group controls, and allow for more descriptive
naming.
* Search box is always live now, just like Outliner.
Views:
* Date Modified column combines both date and time, also uses user
friendly strings for recent dates (i.e. "Yesterday", "Today").
* Details columns (file size, modification date/time) are now toggleable
for all display types, they are not hardcoded per display type.
* File sizes now show as B, KB, MB, ... rather than B, KiB, MiB, … They
are now also calculated using base 10 of course.
* Option to sort in inverse order.
Vertical List View:
* This view now used a much simpler single vertical list with columns
for information.
* Users can click on the headers of these columns to order by that
category, and click again to reverse the ordering.
Icons:
* Updated icons by Jendrzych, with better centering.
* Files and folders have new icons in Icon view.
* Both files and folders have reworked superimposed icons that show
users the file/folder type.
* 3D file documents correctly use the 3d file icon, which was unused
previously.
* Workspaces now show their icon on Link/Append - also when listed in
the Outliner.
Minor Python-API breakage:
* `bpy.types.FileSelectParams.display_type`: `LIST_SHORT` and
`LIST_LONG` are replaced by `LIST_VERTICAL` and `LIST_HORIZONTAL`.
Removes the feature where directories would automatically be created if
they are entered into the file path text button, but don't exist. We
were not sure if users use it enough to keep it. We can definitely bring
it back.
----
//Combined effort by @billreynish, @harley, @jendrzych, my university
colleague Brian Meisenheimer and myself.//
Differential Revision: https://developer.blender.org/D5601
Reviewers: Brecht, Bastien
|
|
T68035 by @luzpaz
|
|
|