Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/wm.py
| Show All 12 Lines | from bpy.props import ( | ||||
| EnumProperty, | EnumProperty, | ||||
| FloatProperty, | FloatProperty, | ||||
| IntProperty, | IntProperty, | ||||
| StringProperty, | StringProperty, | ||||
| IntVectorProperty, | IntVectorProperty, | ||||
| FloatVectorProperty, | FloatVectorProperty, | ||||
| ) | ) | ||||
| from bpy.app.translations import pgettext_iface as iface_ | from bpy.app.translations import pgettext_iface as iface_ | ||||
| from bpy.app.translations import pgettext_tip as tip_ | |||||
| def _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs): | def _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs): | ||||
| # Use the same logic as auto-completing in the Python console to expand the data-path. | # Use the same logic as auto-completing in the Python console to expand the data-path. | ||||
| from bl_console_utils.autocomplete import intellisense | from bl_console_utils.autocomplete import intellisense | ||||
| context_prefix = "context." | context_prefix = "context." | ||||
| line = context_prefix + edit_text | line = context_prefix + edit_text | ||||
| cursor = len(line) | cursor = len(line) | ||||
| ▲ Show 20 Lines • Show All 1,026 Lines • ▼ Show 20 Lines | class WM_OT_url_open_preset(Operator): | ||||
| def _url_from_api(self, _context): | def _url_from_api(self, _context): | ||||
| return "https://docs.blender.org/api/%d.%d/" % bpy.app.version[:2] | return "https://docs.blender.org/api/%d.%d/" % bpy.app.version[:2] | ||||
| # This list is: (enum_item, url) pairs. | # This list is: (enum_item, url) pairs. | ||||
| # Allow dynamically extending. | # Allow dynamically extending. | ||||
| preset_items = [ | preset_items = [ | ||||
| # Dynamic URL's. | # Dynamic URL's. | ||||
| (('BUG', "Bug", | (('BUG', iface_("Bug"), | ||||
| "Report a bug with pre-filled version information"), | tip_("Report a bug with pre-filled version information")), | ||||
| _url_from_bug), | _url_from_bug), | ||||
| (('BUG_ADDON', "Add-on Bug", | (('BUG_ADDON', iface_("Add-on Bug"), | ||||
| "Report a bug in an add-on"), | tip_("Report a bug in an add-on")), | ||||
| _url_from_bug_addon), | _url_from_bug_addon), | ||||
| (('RELEASE_NOTES', "Release Notes", | (('RELEASE_NOTES', iface_("Release Notes"), | ||||
| "Read about what's new in this version of Blender"), | tip_("Read about what's new in this version of Blender")), | ||||
| _url_from_release_notes), | _url_from_release_notes), | ||||
| (('MANUAL', "User Manual", | (('MANUAL', iface_("User Manual"), | ||||
| "The reference manual for this version of Blender"), | tip_("The reference manual for this version of Blender")), | ||||
| _url_from_manual), | _url_from_manual), | ||||
| (('API', "Python API Reference", | (('API', iface_("Python API Reference"), | ||||
| "The API reference manual for this version of Blender"), | tip_("The API reference manual for this version of Blender")), | ||||
| _url_from_api), | _url_from_api), | ||||
| # Static URL's. | # Static URL's. | ||||
| (('FUND', "Development Fund", | (('FUND', iface_("Development Fund"), | ||||
| "The donation program to support maintenance and improvements"), | tip_("The donation program to support maintenance and improvements")), | ||||
| "https://fund.blender.org"), | "https://fund.blender.org"), | ||||
| (('BLENDER', "blender.org", | (('BLENDER', iface_("blender.org"), | ||||
| "Blender's official web-site"), | tip_("Blender's official web-site")), | ||||
| "https://www.blender.org"), | "https://www.blender.org"), | ||||
| (('CREDITS', "Credits", | (('CREDITS', iface_("Credits"), | ||||
| "Lists committers to Blender's source code"), | tip_("Lists committers to Blender's source code")), | ||||
| "https://www.blender.org/about/credits/"), | "https://www.blender.org/about/credits/"), | ||||
| ] | ] | ||||
| def execute(self, context): | def execute(self, context): | ||||
| url = None | url = None | ||||
| type = self.type | type = self.type | ||||
| for (item_id, _, _), url in self.preset_items: | for (item_id, _, _), url in self.preset_items: | ||||
| if item_id == type: | if item_id == type: | ||||
| ▲ Show 20 Lines • Show All 2,126 Lines • Show Last 20 Lines | |||||