Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-01-12 04:30:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-12 04:45:56 +0300
commitff4c9d69ee4bf1764b6f4effa487e29e6c4ab985 (patch)
treeda4d000f8641e4895b16ce35930a7a25c9d0b51b /source
parent322f0223d04ac36ecc72cd01c371234da6de643c (diff)
User Prefs: add new flag for app-template options
For experimental options, outside the scope of typical preferences. While templates are developed we might want to make changes to behavior which aren't fully compatible with typical work-flows. Instead of mixing these options in with current preferences expose separately (we could even force disable them when templates aren't int use)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/blender.c5
-rw-r--r--source/blender/editors/interface/resources.c2
-rw-r--r--source/blender/editors/screen/area.c2
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h14
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c12
5 files changed, 24 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index bc47cfde143..f8a3f134bfb 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -280,7 +280,10 @@ void BKE_blender_userdef_app_template_data_swap(UserDef *userdef_a, UserDef *use
DATA_SWAP(font_path_ui_mono);
DATA_SWAP(keyconfigstr);
- FLAG_SWAP(uiflag, int, USER_LOCK_UI_LAYOUT);
+ DATA_SWAP(app_flag);
+
+ /* We could add others. */
+ FLAG_SWAP(uiflag, int, USER_QUIT_PROMPT);
#undef DATA_SWAP
#undef LIST_SWAP
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 09b0906f134..d12e7cc036b 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2765,7 +2765,7 @@ void init_userdef_do_versions(void)
USER_FLAG_DEPRECATED_6 | USER_FLAG_DEPRECATED_7 |
USER_FLAG_DEPRECATED_9 | USER_FLAG_DEPRECATED_10);
U.uiflag &= ~(
- USER_LOCK_UI_LAYOUT);
+ USER_UIFLAG_DEPRECATED_7);
U.transopts &= ~(
USER_TR_DEPRECATED_2 | USER_TR_DEPRECATED_3 | USER_TR_DEPRECATED_4 |
USER_TR_DEPRECATED_6 | USER_TR_DEPRECATED_7);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index e8dc220667a..fc0922c7b7c 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -666,7 +666,7 @@ static void area_azone_initialize(wmWindow *win, bScreen *screen, ScrArea *sa)
return;
}
- if (U.uiflag & USER_LOCK_UI_LAYOUT) {
+ if (U.app_flag & USER_APP_LOCK_UI_LAYOUT) {
return;
}
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 93fab4da566..3d3e9d1704b 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -461,7 +461,10 @@ typedef struct UserDef {
short wheellinescroll;
int uiflag; /* eUserpref_UI_Flag */
int uiflag2; /* eUserpref_UI_Flag2 */
- int language;
+ /* Experimental flag for app-templates to make changes to behavior
+ * which are outside the scope of typical preferences. */
+ short app_flag;
+ short language;
short userpref, viewzoom;
int mixbufsize;
@@ -670,7 +673,7 @@ typedef enum eUserpref_UI_Flag {
USER_LOCK_CURSOR_ADJUST = (1 << 6),
/* Avoid accidentally adjusting the layout
* (exact behavior may change based on whats considered reasonable to lock down). */
- USER_LOCK_UI_LAYOUT = (1 << 7),
+ USER_UIFLAG_DEPRECATED_7 = (1 << 7),
USER_ALLWINCODECS = (1 << 8),
USER_MENUOPENAUTO = (1 << 9),
USER_ZBUF_CURSOR = (1 << 10),
@@ -703,7 +706,12 @@ typedef enum eUserpref_UI_Flag2 {
USER_REGION_OVERLAP = (1 << 1),
USER_TRACKPAD_NATURAL = (1 << 2),
} eUserpref_UI_Flag2;
-
+
+/* UserDef.app_flag */
+typedef enum eUserpref_APP_Flag {
+ USER_APP_LOCK_UI_LAYOUT = (1 << 0),
+} eUserpref_APP_Flag;
+
/* Auto-Keying mode.
* UserDef.autokey_mode */
typedef enum eAutokey_Mode {
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 3aed3a1edb1..1258febab61 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3395,17 +3395,19 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
- prop = RNA_def_property(srna, "show_layout_ui", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_LOCK_UI_LAYOUT);
- RNA_def_property_ui_text(prop, "Show Layout Widgets", "Show screen layout editing UI");
- RNA_def_property_update(prop, 0, "rna_userdef_update_ui");
prop = RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
RNA_def_property_ui_text(prop, "Show Playback FPS",
"Show the frames per second screen refresh rate, while animation is played back");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-
+
+ /* app flags (use for app-templates) */
+ prop = RNA_def_property(srna, "show_layout_ui", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "app_flag", USER_APP_LOCK_UI_LAYOUT);
+ RNA_def_property_ui_text(prop, "Show Layout Widgets", "Show screen layout editing UI");
+ RNA_def_property_update(prop, 0, "rna_userdef_update_ui");
+
/* menus */
prop = RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);