Cleanup: minor changes to the splash "Quick Setup"

No functional changes.

- Remove unnecessary variable declarations.
- Declare wm & prefs at the function beginning
  to prevent noisy patches in case they're used elsewhere in the future.
- Correct invalid comment.
This commit is contained in:
Campbell Barton
2024-05-20 12:48:54 +10:00
parent 85e5f38279
commit e0b043d076

View File

@@ -3222,6 +3222,10 @@ class WM_MT_splash_quick_setup(Menu):
def draw(self, context):
layout = self.layout
wm = context.window_manager
prefs = context.preferences
layout.operator_context = 'EXEC_DEFAULT'
old_version = bpy.types.PREFERENCES_OT_copy_prev.previous_version()
@@ -3257,7 +3261,6 @@ class WM_MT_splash_quick_setup(Menu):
# Languages.
if bpy.app.build_options.international:
prefs = context.preferences
col.prop(prefs.view, "language")
# Themes.
@@ -3270,7 +3273,6 @@ class WM_MT_splash_quick_setup(Menu):
col.separator()
# Shortcuts.
wm = context.window_manager
kc = wm.keyconfigs.active
kc_prefs = kc.preferences
@@ -3280,15 +3282,13 @@ class WM_MT_splash_quick_setup(Menu):
text = "Blender"
sub.menu("USERPREF_MT_keyconfigs", text=text)
has_select_mouse = hasattr(kc_prefs, "select_mouse")
if has_select_mouse:
if hasattr(kc_prefs, "select_mouse"):
col.row().prop(kc_prefs, "select_mouse", text="Mouse Select", expand=True)
has_spacebar_action = hasattr(kc_prefs, "spacebar_action")
if has_spacebar_action:
if hasattr(kc_prefs, "spacebar_action"):
col.row().prop(kc_prefs, "spacebar_action", text="Spacebar Action")
# Themes.
# Save Preferences.
sub = col.column()
sub.separator(factor=2)