From 27f1611d3dadd48f3eddad4885469f1d09d9d818 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Tue, 12 Dec 2023 14:50:02 +0100 Subject: [PATCH] Use bultin url opener --- addons/io_hubs_addon/debugger.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/addons/io_hubs_addon/debugger.py b/addons/io_hubs_addon/debugger.py index 78740130..df825d30 100644 --- a/addons/io_hubs_addon/debugger.py +++ b/addons/io_hubs_addon/debugger.py @@ -476,20 +476,6 @@ def draw(self, context: Context): text=f'{update_mode}') -class OpenUrl(bpy.types.Operator): - bl_idname = "hubs.open_url" - bl_label = "Open URL" - bl_description = "Open URL" - bl_options = {'REGISTER', 'UNDO'} - - url: bpy.props.StringProperty() - - def execute(self, context): - import webbrowser - webbrowser.open(self.url) - return {'FINISHED'} - - class HUBS_PT_ToolsSceneDebuggerPanel(bpy.types.Panel): bl_idname = "HUBS_PT_ToolsSceneDebuggerPanel" bl_space_type = 'VIEW_3D' @@ -565,7 +551,7 @@ def draw(self, context): col.prop(context.scene.hubs_scene_debugger_room_create_prefs, "debug_local_scene") col = row.column() - op = col.operator(OpenUrl.bl_idname, text="", icon="HELP") + op = col.operator("wm.url_open", text="", icon="HELP") op.url = ROOM_FLAGS_DOC_URL else: @@ -804,7 +790,6 @@ def register(): bpy.utils.register_class(HubsSceneDebuggerRoomRemove) bpy.utils.register_class(HUBS_UL_ToolsSceneDebuggerServers) bpy.utils.register_class(HUBS_UL_ToolsSceneDebuggerRooms) - bpy.utils.register_class(OpenUrl) bpy.types.Scene.hubs_scene_debugger_room_create_prefs = bpy.props.PointerProperty( type=HubsSceneDebuggerRoomCreatePrefs) @@ -837,7 +822,6 @@ def unregister(): bpy.utils.unregister_class(HubsSceneDebuggerRoomRemove) bpy.utils.unregister_class(HubsSceneDebuggerPrefs) bpy.utils.unregister_class(HubsUrl) - bpy.utils.unregister_class(OpenUrl) del bpy.types.Scene.hubs_scene_debugger_room_create_prefs del bpy.types.Scene.hubs_scene_debugger_room_export_prefs