diff options
author | julianeisel <julian_eisel@web.de> | 2015-01-19 03:01:23 +0300 |
---|---|---|
committer | julianeisel <julian_eisel@web.de> | 2015-01-19 03:01:23 +0300 |
commit | ffe56536f1050717b133883cba29d63fff8d9e00 (patch) | |
tree | 5f9ba6037c6381506e53c299d1012d50f7e7b5a8 /source | |
parent | 90b569745960ef78e2f20bb8b826dba8b52adee3 (diff) |
Outliner: Make alphabetical sorting optional
A new option to the Outliner's View menu is added to enable/disable sorting of items.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 7 |
3 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 4aa36da594b..f1a7a982c26 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1311,7 +1311,10 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb) TreeElement *te; TreeStoreElem *tselem; int totelem = 0; - + + if (soops->flag & SO_SKIP_SORTING) + return; + te = lb->last; if (te == NULL) return; tselem = TREESTORE(te); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index f65cef1a0d1..44eb873642f 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -273,6 +273,7 @@ typedef enum eSpaceOutliner_Flag { SO_NEWSELECTED = (1 << 1), SO_HIDE_RESTRICTCOLS = (1 << 2), SO_HIDE_KEYINGSETINFO = (1 << 3), + SO_SKIP_SORTING = (1 << 4), } eSpaceOutliner_Flag; /* SpaceOops->outlinevis */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index af0e69cdc3e..6fea135b035 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1593,7 +1593,12 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE); RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); - + + prop = RNA_def_property(srna, "sort_alphabetically", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_SKIP_SORTING); + RNA_def_property_ui_text(prop, "Sort Alphabetically", "Sort items alphabetically"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); + prop = RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS); RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column"); |