From: Niki Roo Date: Sat, 25 Apr 2020 13:11:32 +0000 (+0200) Subject: Merge branch 'subtree' X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=commitdiff_plain;h=bc4db23ff5c21d7d4716f9b7f97de73b15a6fc21;hp=-c Merge branch 'subtree' --- bc4db23ff5c21d7d4716f9b7f97de73b15a6fc21 diff --combined src/be/nikiroo/utils/resources/Meta.java index 8ed74dc,fb4d491..fb4d491 --- a/src/be/nikiroo/utils/resources/Meta.java +++ b/src/be/nikiroo/utils/resources/Meta.java @@@ -60,6 -60,16 +60,16 @@@ public @interface Meta * @return what it is */ String description() default ""; + + /** + * This item should be hidden from the user (she will still be able to + * modify it if she opens the file manually). + *

+ * Defaults to FALSE (visible). + * + * @return TRUE if it should stay hidden + */ + boolean hidden() default false; /** * This item is only used as a group, not as an option. diff --combined src/be/nikiroo/utils/resources/MetaInfo.java index 917c210,70c6c43..70c6c43 --- a/src/be/nikiroo/utils/resources/MetaInfo.java +++ b/src/be/nikiroo/utils/resources/MetaInfo.java @@@ -27,6 -27,7 +27,7 @@@ public class MetaInfo private List saveListeners = new ArrayList(); private String name; + private boolean hidden; private String description; private boolean dirty; @@@ -90,6 -91,7 +91,7 @@@ } this.name = name; + this.hidden = meta.hidden(); this.description = description; reload(); @@@ -110,6 -112,16 +112,16 @@@ public String getName() { return name; } + + /** + * This item should be hidden from the user (she will still be able to + * modify it if she opens the file manually). + * + * @return TRUE if it should stay hidden + */ + public boolean isHidden() { + return hidden; + } /** * A description for this item: what it is or does, how to explain that item @@@ -682,8 -694,10 +694,10 @@@ List> shadow = new ArrayList>(); for (E id : type.getEnumConstants()) { MetaInfo info = new MetaInfo(type, bundle, id); - list.add(info); - shadow.add(info); + if (!info.hidden) { + list.add(info); + shadow.add(info); + } } for (int i = 0; i < list.size(); i++) {