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:
authorThomas Dinges <blender@dingto.org>2010-05-31 15:38:13 +0400
committerThomas Dinges <blender@dingto.org>2010-05-31 15:38:13 +0400
commitccda04131a7e1a8d6d011e6d3453979b540f5d52 (patch)
treef88344fe7d605f87464d0e7d19def19d020fe87a
parentbff5410504c5bfe9ab898f22cba9a7519cba53c9 (diff)
Python Open Link operator.
* Unified some code for Opening an URL to use only one operator: WM_OT_url_open * Removed the HELP_OT_url operators.
-rw-r--r--release/scripts/op/wm.py2
-rw-r--r--release/scripts/ui/space_info.py88
-rw-r--r--release/scripts/ui/space_userpref.py20
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c10
4 files changed, 17 insertions, 103 deletions
diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py
index af72c96a412..0d204ce72ae 100644
--- a/release/scripts/op/wm.py
+++ b/release/scripts/op/wm.py
@@ -418,7 +418,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
class WM_OT_url_open(bpy.types.Operator):
- "Open the Blender Wiki in the Webbrowser"
+ "Open a website in the Webbrowser"
bl_idname = "wm.url_open"
bl_label = ""
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py
index 3ffe10ffeac..62db983b87e 100644
--- a/release/scripts/ui/space_info.py
+++ b/release/scripts/ui/space_info.py
@@ -310,19 +310,19 @@ class INFO_MT_help(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.operator("help.manual", icon='HELP')
- layout.operator("help.release_logs", icon='URL')
+ layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual'
+ layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-250/'
layout.separator()
- layout.operator("help.blender_website", icon='URL')
- layout.operator("help.blender_eshop", icon='URL')
- layout.operator("help.developer_community", icon='URL')
- layout.operator("help.user_community", icon='URL')
+ layout.operator("wm.url_open", text="Blender Website", icon='URL').url = 'http://www.blender.org/'
+ layout.operator("wm.url_open", text="Blender e-Shop", icon='URL').url = 'http://www.blender.org/e-shop'
+ layout.operator("wm.url_open", text="Developer Community", icon='URL').url = 'http://www.blender.org/community/get-involved/'
+ layout.operator("wm.url_open", text="User Community", icon='URL').url = 'http://www.blender.org/community/user-community/'
layout.separator()
- layout.operator("help.report_bug", icon='URL')
+ layout.operator("wm.url_open", text="Report a Bug", icon='URL').url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
layout.separator()
- layout.operator("help.python_api", icon='URL')
+ layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = 'http://www.blender.org/documentation/250PythonDoc/contents.html'
layout.operator("help.operator_cheat_sheet")
layout.separator()
layout.operator("wm.splash")
@@ -331,70 +331,6 @@ class INFO_MT_help(bpy.types.Menu):
# Help operators
-class HelpOperator(bpy.types.Operator):
-
- def execute(self, context):
- import webbrowser
- webbrowser.open(self._url)
- return {'FINISHED'}
-
-
-class HELP_OT_manual(HelpOperator):
- '''The Blender Wiki manual'''
- bl_idname = "help.manual"
- bl_label = "Manual"
- _url = 'http://wiki.blender.org/index.php/Doc:Manual'
-
-
-class HELP_OT_release_logs(HelpOperator):
- '''Information about the changes in this version of Blender'''
- bl_idname = "help.release_logs"
- bl_label = "Release Log"
- _url = 'http://www.blender.org/development/release-logs/blender-250/'
-
-
-class HELP_OT_blender_website(HelpOperator):
- '''The official Blender website'''
- bl_idname = "help.blender_website"
- bl_label = "Blender Website"
- _url = 'http://www.blender.org/'
-
-
-class HELP_OT_blender_eshop(HelpOperator):
- '''Buy official Blender resources and merchandise online'''
- bl_idname = "help.blender_eshop"
- bl_label = "Blender e-Shop"
- _url = 'http://www.blender.org/e-shop'
-
-
-class HELP_OT_developer_community(HelpOperator):
- '''Get involved with Blender development'''
- bl_idname = "help.developer_community"
- bl_label = "Developer Community"
- _url = 'http://www.blender.org/community/get-involved/'
-
-
-class HELP_OT_user_community(HelpOperator):
- '''Get involved with other Blender users'''
- bl_idname = "help.user_community"
- bl_label = "User Community"
- _url = 'http://www.blender.org/community/user-community/'
-
-
-class HELP_OT_report_bug(HelpOperator):
- '''Report a bug in the Blender bug tracker'''
- bl_idname = "help.report_bug"
- bl_label = "Report a Bug"
- _url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
-
-
-class HELP_OT_python_api(HelpOperator):
- '''Reference for operator and data Python API'''
- bl_idname = "help.python_api"
- bl_label = "Python API Reference"
- _url = 'http://www.blender.org/documentation/250PythonDoc/contents.html'
-
-
class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
bl_idname = "help.operator_cheat_sheet"
bl_label = "Operator Cheat Sheet (new textblock)"
@@ -435,14 +371,6 @@ classes = [
INFO_MT_render,
INFO_MT_help,
- HELP_OT_manual,
- HELP_OT_release_logs,
- HELP_OT_blender_website,
- HELP_OT_blender_eshop,
- HELP_OT_developer_community,
- HELP_OT_user_community,
- HELP_OT_report_bug,
- HELP_OT_python_api,
HELP_OT_operator_cheat_sheet]
diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py
index 1a8c1f04d6a..d0d91c2accf 100644
--- a/release/scripts/ui/space_userpref.py
+++ b/release/scripts/ui/space_userpref.py
@@ -1224,9 +1224,9 @@ class USERPREF_PT_addons(bpy.types.Panel):
split = column.row().split(percentage=0.15)
split.label(text="Internet:")
if info["wiki_url"]:
- split.operator("wm.addon_links", text="Link to the Wiki").link = info["wiki_url"]
+ split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"]
if info["tracker_url"]:
- split.operator("wm.addon_links", text="Report a Bug").link = info["tracker_url"]
+ split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"]
if info["wiki_url"] and info["tracker_url"]:
split.separator()
@@ -1421,19 +1421,6 @@ class WM_OT_addon_expand(bpy.types.Operator):
return {'FINISHED'}
-class WM_OT_addon_links(bpy.types.Operator):
- "Open a website in the webbrowser"
- bl_idname = "wm.addon_links"
- bl_label = ""
-
- link = StringProperty(name="Link", description="Link to open")
-
- def execute(self, context):
- import webbrowser
- webbrowser.open(self.properties.link)
- return {'FINISHED'}
-
-
classes = [
USERPREF_HT_header,
USERPREF_PT_tabs,
@@ -1451,8 +1438,7 @@ classes = [
WM_OT_addon_enable,
WM_OT_addon_disable,
WM_OT_addon_install,
- WM_OT_addon_expand,
- WM_OT_addon_links]
+ WM_OT_addon_expand]
def register():
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index de748d204ff..d4094c57a84 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1202,11 +1202,11 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
split = uiLayoutSplit(layout, 0, 0);
col = uiLayoutColumn(split, 0);
uiItemL(col, "Links", 0);
- uiItemO(col, NULL, ICON_URL, "HELP_OT_release_logs");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_manual");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_blender_website");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_user_community");
- uiItemO(col, NULL, ICON_URL, "HELP_OT_python_api");
+ uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-250/");
+ uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:Manual");
+ uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/");
+ uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community/");
+ uiItemStringO(col, "Python API Reference", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/documentation/250PythonDoc/contents.html");
uiItemL(col, "", 0);
col = uiLayoutColumn(split, 0);