Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/wm.py
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| self._data_update(context) | self._data_update(context) | ||||
| if not self.actions: | if not self.actions: | ||||
| self.actions.add() | self.actions.add() | ||||
| wm = context.window_manager | wm = context.window_manager | ||||
| return wm.invoke_props_dialog(self, width=400) | return wm.invoke_props_dialog(self, width=400) | ||||
| class WM_MT_splash(Menu): | class WM_MT_splash_quick_setup(Menu): | ||||
| bl_label = "Splash" | bl_label = "Quick Setup" | ||||
| def draw_setup(self, context): | def draw(self, context): | ||||
| wm = context.window_manager | wm = context.window_manager | ||||
| # prefs = context.preferences | # prefs = context.preferences | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator_context = 'EXEC_DEFAULT' | layout.operator_context = 'EXEC_DEFAULT' | ||||
| layout.label(text="Quick Setup") | layout.label(text="Quick Setup") | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| else: | else: | ||||
| sub.label() | sub.label() | ||||
| sub.label() | sub.label() | ||||
| sub.operator("wm.save_userpref", text="Next") | sub.operator("wm.save_userpref", text="Next") | ||||
| layout.separator() | layout.separator() | ||||
| layout.separator() | layout.separator() | ||||
| def draw(self, context): | |||||
| # Draw setup screen if no preferences have been saved yet. | |||||
| import os | |||||
| userconfig_path = bpy.utils.user_resource('CONFIG') | class WM_MT_splash(Menu): | ||||
| userdef_path = os.path.join(userconfig_path, "userpref.blend") | bl_label = "Splash" | ||||
| if not os.path.isfile(userdef_path): | |||||
| self.draw_setup(context) | |||||
| return | |||||
| # Pass | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator_context = 'EXEC_DEFAULT' | layout.operator_context = 'EXEC_DEFAULT' | ||||
| layout.emboss = 'PULLDOWN_MENU' | layout.emboss = 'PULLDOWN_MENU' | ||||
| split = layout.split() | split = layout.split() | ||||
| # Templates | # Templates | ||||
| col1 = split.column() | col1 = split.column() | ||||
| ▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | |||||
| WM_OT_url_open_preset, | WM_OT_url_open_preset, | ||||
| WM_OT_tool_set_by_id, | WM_OT_tool_set_by_id, | ||||
| WM_OT_tool_set_by_index, | WM_OT_tool_set_by_index, | ||||
| WM_OT_toolbar, | WM_OT_toolbar, | ||||
| WM_OT_toolbar_fallback_pie, | WM_OT_toolbar_fallback_pie, | ||||
| WM_OT_toolbar_prompt, | WM_OT_toolbar_prompt, | ||||
| BatchRenameAction, | BatchRenameAction, | ||||
| WM_OT_batch_rename, | WM_OT_batch_rename, | ||||
| WM_MT_splash_quick_setup, | |||||
| WM_MT_splash, | WM_MT_splash, | ||||
| WM_MT_splash_about, | WM_MT_splash_about, | ||||
| ) | ) | ||||
| Context not available. | |||||