remove duplicated operator bim.open_webbrowser

it did exactly the same as bim.open_uri
This commit is contained in:
Andrej730
2024-07-26 12:02:07 +05:00
parent 9684e21d93
commit be7661a83b
3 changed files with 3 additions and 17 deletions
@@ -98,7 +98,6 @@ classes = [
operator.AddIfcFile, operator.AddIfcFile,
operator.BIM_OT_add_section_plane, operator.BIM_OT_add_section_plane,
operator.BIM_OT_delete_object, operator.BIM_OT_delete_object,
operator.BIM_OT_open_webbrowser,
operator.BIM_OT_remove_section_plane, operator.BIM_OT_remove_section_plane,
operator.BIM_OT_select_object, operator.BIM_OT_select_object,
operator.BIM_OT_show_description, operator.BIM_OT_show_description,
+2 -15
View File
@@ -83,6 +83,7 @@ class SwitchTab(bpy.types.Operator):
class OpenUri(bpy.types.Operator): class OpenUri(bpy.types.Operator):
bl_idname = "bim.open_uri" bl_idname = "bim.open_uri"
bl_label = "Open URI" bl_label = "Open URI"
bl_description = "Open the URL in your Web Browser"
uri: bpy.props.StringProperty() uri: bpy.props.StringProperty()
def execute(self, context): def execute(self, context):
@@ -811,20 +812,6 @@ class RemoveIfcFile(bpy.types.Operator):
return {"FINISHED"} return {"FINISHED"}
class BIM_OT_open_webbrowser(bpy.types.Operator):
bl_idname = "bim.open_webbrowser"
bl_description = "Open the URL in your Web Browser"
bl_label = "Open URL"
url: bpy.props.StringProperty()
def execute(self, context):
import webbrowser
webbrowser.open(self.url)
return {"FINISHED"}
class FetchObjectPassport(bpy.types.Operator): class FetchObjectPassport(bpy.types.Operator):
bl_idname = "bim.fetch_object_passport" bl_idname = "bim.fetch_object_passport"
bl_label = "Fetch Object Passport" bl_label = "Fetch Object Passport"
@@ -986,7 +973,7 @@ class BIM_OT_show_description(bpy.types.Operator):
for line in wrapper.wrap(self.attr_name + " : " + self.description): for line in wrapper.wrap(self.attr_name + " : " + self.description):
layout.label(text=line) layout.label(text=line)
if self.url: if self.url:
url_op = layout.operator("bim.open_webbrowser", icon="URL", text="Online IFC Documentation") url_op = layout.operator("bim.open_uri", icon="URL", text="Online IFC Documentation")
url_op.url = self.url url_op.url = self.url
@classmethod @classmethod
+1 -1
View File
@@ -1110,5 +1110,5 @@ def draw_custom_context_menu(self, context):
url = docs.get("spec_url", "") url = docs.get("spec_url", "")
if url: if url:
layout.separator() layout.separator()
url_op = layout.operator("bim.open_webbrowser", icon="URL", text="Online IFC Documentation") url_op = layout.operator("bim.open_uri", icon="URL", text="Online IFC Documentation")
url_op.url = url url_op.url = url