2025-12-01
This commit is contained in:
@@ -17,10 +17,12 @@
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
import webbrowser
|
||||
import bpy
|
||||
|
||||
from bpy.types import Operator
|
||||
from bpy.props import (
|
||||
IntProperty,
|
||||
BoolProperty,
|
||||
StringProperty)
|
||||
|
||||
from ..modules.poliigon_core.multilingual import _t
|
||||
@@ -45,6 +47,7 @@ class POLIIGON_OT_link(Operator):
|
||||
tooltip: StringProperty(options={"HIDDEN"}) # noqa: F821
|
||||
asset_id: IntProperty(options={"HIDDEN"}) # noqa: F821
|
||||
mode: StringProperty(options={"HIDDEN"}) # noqa: F821
|
||||
confirm_popup: BoolProperty(options={"HIDDEN"}) # noqa: F821
|
||||
|
||||
@staticmethod
|
||||
def init_context(addon_version: str) -> None:
|
||||
@@ -61,6 +64,11 @@ class POLIIGON_OT_link(Operator):
|
||||
def execute(self, context):
|
||||
global cTB
|
||||
|
||||
if self.confirm_popup:
|
||||
self._confirmation_popup()
|
||||
self.confirm_popup = False
|
||||
return {"FINISHED"}
|
||||
|
||||
notice = cTB.notify.get_top_notice(do_signal_view=False)
|
||||
if self.mode.startswith("notify") and notice is not None:
|
||||
cTB.notify.clicked_notice(notice)
|
||||
@@ -90,6 +98,9 @@ class POLIIGON_OT_link(Operator):
|
||||
elif self.mode == "subscribe_banner":
|
||||
cTB.upgrade_manager.emit_signal(clicked=True)
|
||||
cTB._api.open_poliigon_link("subscribe", env_name=cTB._env.env_name)
|
||||
elif self.mode == "signup":
|
||||
# Open the signup URL but don't update UI or set login_in_progress flag
|
||||
cTB._api.open_poliigon_link(self.mode, env_name=cTB._env.env_name)
|
||||
elif self.mode in cTB._api._url_paths:
|
||||
cTB._api.open_poliigon_link(self.mode, env_name=cTB._env.env_name)
|
||||
elif self.mode.startswith("https:"):
|
||||
@@ -102,3 +113,8 @@ class POLIIGON_OT_link(Operator):
|
||||
if notice is not None:
|
||||
cTB.notify.dismiss_notice(notice)
|
||||
return {"FINISHED"}
|
||||
|
||||
def _confirmation_popup(self):
|
||||
bpy.ops.poliigon.popup_message("INVOKE_DEFAULT",
|
||||
message_body=_t("Open Addon Help in browser?"),
|
||||
message_url=self.mode)
|
||||
|
||||
Reference in New Issue
Block a user