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)
This commit is contained in:
Campbell Barton 2018-01-12 12:30:58 +11:00
parent 322f0223d0
commit ff4c9d69ee
6 changed files with 30 additions and 16 deletions

View File

@ -313,13 +313,14 @@ class USERPREF_PT_interface(Panel):
sub.prop(view, "pie_menu_threshold")
sub.prop(view, "pie_menu_confirm")
col.separator()
col.separator()
col.separator()
col.label(text="Screen:")
col.prop(view, "show_layout_ui")
col.prop(view, "show_splash")
col.separator()
col.label(text="App Template:")
col.label(text="Options intended for use with app-templates only.")
col.prop(view, "show_layout_ui")
class USERPREF_PT_edit(Panel):

View File

@ -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

View File

@ -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);

View File

@ -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;
}

View File

@ -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 {

View File

@ -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);