Skip to content

Commit

Permalink
Use bultin url opener
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Dec 12, 2023
1 parent d44cc83 commit 27f1611
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions addons/io_hubs_addon/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 27f1611

Please sign in to comment.