Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-08-20 15:00:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-08-20 16:44:18 +0300
commit61ff578eab16ab627415e06c2a81b339d4be0f99 (patch)
tree6de272ee530948ab5782ec826215642f4a65b097 /release/scripts/startup/bl_ui/space_topbar.py
parente6a81ad61ed60384762ef4f28d62bbad65bc8814 (diff)
UI: add URL presets
This adds a url-preset operator to simplify opening re-usable links. - Standard websites have their own tool-tip. - De-duplicate logic to get URL's that include version information. - Reporting bugs no longer needs to have all information included in the URL. D5498 by @luisbg with edits.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_topbar.py')
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py32
1 files changed, 6 insertions, 26 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index f735e7b770f..d0ad9a8f31e 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -344,18 +344,12 @@ class TOPBAR_MT_app_about(Menu):
def draw(self, _context):
layout = self.layout
- layout.operator(
- "wm.url_open", text="Release Notes", icon='URL',
- ).url = "https://www.blender.org/download/releases/%d-%d/" % bpy.app.version[:2]
+ layout.operator("wm.url_open_preset", text="Release Notes", icon='URL').type = 'RELEASE_NOTES'
layout.separator()
- layout.operator(
- "wm.url_open", text="Blender Website", icon='URL',
- ).url = "https://www.blender.org/"
- layout.operator(
- "wm.url_open", text="Credits", icon='URL',
- ).url = "https://www.blender.org/about/credits/"
+ layout.operator("wm.url_open_preset", text="Blender Website", icon='URL').type = 'BLENDER'
+ layout.operator("wm.url_open", text="Credits", icon='URL').type = 'CREDITS'
layout.separator()
@@ -370,9 +364,7 @@ class TOPBAR_MT_app_support(Menu):
def draw(self, _context):
layout = self.layout
- layout.operator(
- "wm.url_open", text="Development Fund", icon='FUND',
- ).url = "https://fund.blender.org"
+ layout.operator("wm.url_open_preset", text="Development Fund", icon='FUND').type = 'FUND'
layout.separator()
@@ -565,23 +557,13 @@ class TOPBAR_MT_help(Menu):
bl_label = "Help"
def draw(self, context):
- # If 'url_prefill_from_blender' becomes slow it could be made into a separate operator
- # to avoid constructing the bug report just to show this menu.
- from bl_ui_utils.bug_report_url import url_prefill_from_blender
-
layout = self.layout
show_developer = context.preferences.view.show_developer_ui
- if bpy.app.version_cycle in {'rc', 'release'}:
- manual_version = '%d.%d' % bpy.app.version[:2]
- else:
- manual_version = 'dev'
+ layout.operator("wm.url_open_preset", text="Manual", icon='HELP',).type = 'MANUAL'
layout.operator(
- "wm.url_open", text="Manual", icon='HELP',
- ).url = "https://docs.blender.org/manual/en/" + manual_version + "/"
- layout.operator(
"wm.url_open", text="Tutorials", icon='URL',
).url = "https://www.blender.org/tutorials"
layout.operator(
@@ -612,9 +594,7 @@ class TOPBAR_MT_help(Menu):
layout.separator()
- layout.operator(
- "wm.url_open", text="Report a Bug", icon='URL',
- ).url = url_prefill_from_blender()
+ layout.operator("wm.url_open_preset", text="Report a Bug", icon='URL').type = 'BUG'
layout.separator()