Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/wm.py
| Show First 20 Lines • Show All 1,703 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| layout.separator() | layout.separator() | ||||
| split = layout.split() | split = layout.split() | ||||
| col1 = split.column() | col1 = split.column() | ||||
| sub = col1.row() | sub = col1.row() | ||||
| sub.operator_context = 'INVOKE_DEFAULT' | sub.operator_context = 'INVOKE_DEFAULT' | ||||
| sub.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') | props = sub.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') | ||||
| props.display_file_selector = True | |||||
| col1.operator("wm.recover_last_session", icon='RECOVER_LAST') | col1.operator("wm.recover_last_session", icon='RECOVER_LAST') | ||||
| col2 = split.column() | col2 = split.column() | ||||
| if found_recent: | if found_recent: | ||||
| col2.operator( | col2.operator( | ||||
| "wm.url_open", text="Release Notes", icon='URL', | "wm.url_open", text="Release Notes", icon='URL', | ||||
| ).url = "https://www.blender.org/download/releases/%d-%d/" % bpy.app.version[:2] | ).url = "https://www.blender.org/download/releases/%d-%d/" % bpy.app.version[:2] | ||||
| col2.operator( | col2.operator( | ||||
| Show All 22 Lines | def invoke(self, context, _event): | ||||
| context.window_manager.popup_menu(self.draw_menu, title=bpy.path.basename(self.filepath), icon='QUESTION') | context.window_manager.popup_menu(self.draw_menu, title=bpy.path.basename(self.filepath), icon='QUESTION') | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| def draw_menu(self, menu, _context): | def draw_menu(self, menu, _context): | ||||
| layout = menu.layout | layout = menu.layout | ||||
| col = layout.column() | col = layout.column() | ||||
| col.operator_context = 'EXEC_DEFAULT' | col.operator_context = 'EXEC_DEFAULT' | ||||
| col.operator("wm.open_mainfile", text="Open", icon='FILE_FOLDER').filepath = self.filepath | props = col.operator("wm.open_mainfile", text="Open", icon='FILE_FOLDER') | ||||
| props.filepath = self.filepath | |||||
| props.display_file_selector = False | |||||
| layout.separator() | layout.separator() | ||||
| col = layout.column() | col = layout.column() | ||||
| col.operator_context = 'INVOKE_DEFAULT' | col.operator_context = 'INVOKE_DEFAULT' | ||||
| col.operator("wm.link", text="Link...", icon='LINK_BLEND').filepath = self.filepath | col.operator("wm.link", text="Link...", icon='LINK_BLEND').filepath = self.filepath | ||||
| col.operator("wm.append", text="Append...", icon='APPEND_BLEND').filepath = self.filepath | col.operator("wm.append", text="Append...", icon='APPEND_BLEND').filepath = self.filepath | ||||
| Show All 37 Lines | |||||