diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-14 05:23:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-14 05:37:07 +0300 |
commit | 9c9081d9ef5bf97b39f316d68651f7e72266ac5d (patch) | |
tree | db408338842281594a9c61e0b3e757620e547553 /release | |
parent | 34da7f8fddcae003aa9740ba304e624b0154e4d8 (diff) |
Preferences: file menu item to temporarily load factory settings
It's common to load factory settings as a test without wanting to
overwrite your own settings on exit.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index cb949560936..6da08a15db1 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -172,6 +172,7 @@ class TOPBAR_MT_file(Menu): def draw(self, context): layout = self.layout + prefs = context.preferences layout.operator_context = 'INVOKE_AREA' layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW') @@ -195,20 +196,26 @@ class TOPBAR_MT_file(Menu): layout.operator_context = 'INVOKE_AREA' if any(bpy.utils.app_template_paths()): - app_template = context.preferences.app_template + app_template = prefs.app_template else: app_template = None if app_template: layout.label(text=bpy.path.display_name(app_template, has_ext=False)) - layout.operator("wm.save_homefile") - layout.operator( + + layout.operator("wm.save_homefile") + props = layout.operator("wm.read_factory_settings") + if app_template: + props.app_template = app_template + + if prefs.use_preferences_save: + props = layout.operator( "wm.read_factory_settings", - text="Load Factory Settings", - ).app_template = app_template - else: - layout.operator("wm.save_homefile") - layout.operator("wm.read_factory_settings") + text="Load Factory Settings (Temporary)" + ) + if app_template: + props.app_template = app_template + props.use_temporary_preferences = True layout.separator() |