Outliner: Remove User Preferences

This was introduced to the outliner when we had no User Preference
window back in 2.5x. Right now it makes no sense to keep this around.

But how about addon user preferences:
* They belong in the user preference window under the addon.

How about the user preferences themselves:
* You find them in the user preference window.

And templates?
* Why are they here in the first place?

After talking to Pablo Vazquez (who in turn poked Sergey Sharybin) we found
it reasonable to get rid of this. If it turns out that we were wrong we
revert this.

As for leaving this exposed as a debug option (as suggested on IRC) I would say
no, please. This end up polluting the code and never cleaned up in the end.
(this was specific talking about templates).

Technical note: I left the functions in outliner still hanging around.
While I used UNUSED_FUNCTION for one of them, for the other one I had to use:
`#if 0` because the function was calling itself, which would fail to build if
I used UNUSED_FUNCTION.
This commit is contained in:
Dalai Felinto 2018-01-19 15:44:26 -02:00
parent d9858d5897
commit efe1af3d11
Notes: blender-bot 2023-02-14 11:07:28 +01:00
Referenced by commit 8fa19e1950, Fix: Data-Blocks view in Outliner no longer displayed property values, making it semi-useless
8 changed files with 11 additions and 29 deletions

View File

@ -138,7 +138,7 @@ class OUTLINER_MT_view(Menu):
space = context.space_data
if space.display_mode not in {'DATABLOCKS', 'USER_PREFERENCES'}:
if space.display_mode != 'DATABLOCKS':
layout.prop(space, "use_sort_alpha")
layout.prop(space, "show_restrict_columns")
layout.separator()

View File

@ -2458,8 +2458,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
SO_GROUPS,
SO_LIBRARIES,
SO_SEQUENCE,
SO_DATABLOCKS,
SO_USERDEF))
SO_DATABLOCKS))
{
so->outlinevis = SO_SCENES;
}

View File

@ -903,7 +903,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
SO_LIBRARIES,
SO_SEQUENCE,
SO_DATABLOCKS,
SO_USERDEF,
SO_ID_ORPHANS,
SO_VIEW_LAYER,
SO_COLLECTIONS))

View File

@ -671,7 +671,7 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOops *soops
}
}
static void outliner_draw_rnacols(ARegion *ar, int sizex)
static void UNUSED_FUNCTION(outliner_draw_rnacols)(ARegion *ar, int sizex)
{
View2D *v2d = &ar->v2d;
@ -697,6 +697,7 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex)
immUnbindProgram();
}
#if 0
static void outliner_draw_rnabuts(uiBlock *block, ARegion *ar, SpaceOops *soops, int sizex, ListBase *lb)
{
TreeElement *te;
@ -741,6 +742,7 @@ static void outliner_draw_rnabuts(uiBlock *block, ARegion *ar, SpaceOops *soops,
UI_block_emboss_set(block, UI_EMBOSS);
}
#endif
static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, TreeElement *te)
{
@ -1788,7 +1790,7 @@ static void outliner_draw_tree(
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // only once
if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
if (soops->outlinevis == SO_DATABLOCKS) {
/* struct marks */
starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET;
outliner_draw_struct_marks(ar, soops, &soops->tree, &starty);
@ -1911,7 +1913,7 @@ void draw_outliner(const bContext *C)
/* get extents of data */
outliner_height(soops, &soops->tree, &sizey);
if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
if (soops->outlinevis == SO_DATABLOCKS) {
/* RNA has two columns:
* - column 1 is (max_width + OL_RNA_COL_SPACEX) or
* (OL_RNA_COL_X), whichever is wider...
@ -1958,13 +1960,8 @@ void draw_outliner(const bContext *C)
outliner_back(ar);
block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
outliner_draw_tree((bContext *)C, block, scene, view_layer, ar, soops, has_restrict_icons, &te_edit);
if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
/* draw rna buttons */
outliner_draw_rnacols(ar, sizex_rna);
outliner_draw_rnabuts(block, ar, soops, sizex_rna, &soops->tree);
}
else if ((soops->outlinevis == SO_ID_ORPHANS) && has_restrict_icons) {
if ((soops->outlinevis == SO_ID_ORPHANS) && has_restrict_icons) {
/* draw user toggle columns */
outliner_draw_restrictcols(ar);
outliner_draw_userbuts(block, ar, soops, &soops->tree);

View File

@ -1005,7 +1005,7 @@ static bool outliner_item_is_co_within_close_toggle(TreeElement *te, float view_
static bool outliner_is_co_within_restrict_columns(const SpaceOops *soops, const ARegion *ar, float view_co_x)
{
return (!ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF) &&
return ((soops->outlinevis != SO_DATABLOCKS) &&
!(soops->flag & SO_HIDE_RESTRICTCOLS) &&
(view_co_x > ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX));
}

View File

@ -2292,18 +2292,6 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa
tselem->flag &= ~TSE_CLOSED;
}
}
else if (soops->outlinevis == SO_USERDEF) {
PointerRNA userdefptr;
RNA_pointer_create(NULL, &RNA_UserPreferences, &U, &userdefptr);
ten = outliner_add_element(soops, &soops->tree, (void *)&userdefptr, NULL, TSE_RNA_STRUCT, -1);
if (show_opened) {
tselem = TREESTORE(ten);
tselem->flag &= ~TSE_CLOSED;
}
}
else if (soops->outlinevis == SO_ID_ORPHANS) {
outliner_add_orphaned_datablocks(mainvar, soops);
}

View File

@ -342,7 +342,7 @@ typedef enum eSpaceOutliner_Mode {
/* SO_VERSE_MS = 9, */ /* deprecated! */
SO_SEQUENCE = 10,
SO_DATABLOCKS = 11,
SO_USERDEF = 12,
/* SO_USERDEF = 12, */ /* deprecated! */
/* SO_KEYMAP = 13, */ /* deprecated! */
SO_ID_ORPHANS = 14,
SO_VIEW_LAYER = 15,

View File

@ -2109,7 +2109,6 @@ static void rna_def_space_outliner(BlenderRNA *brna)
{SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence data-blocks"},
{SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"},
{SO_DATABLOCKS, "DATABLOCKS", 0, "Data-Blocks", "Display all raw data-blocks"},
{SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display user preference data"},
{SO_ID_ORPHANS, "ORPHAN_DATA", 0, "Orphan Data",
"Display data-blocks which are unused and/or will be lost when the file is reloaded"},
{0, NULL, 0, NULL, NULL}