feat(subscription): add membership access preflight
This commit is contained in:
@@ -983,6 +983,7 @@ class GenerateTab(QWidget):
|
||||
title_templates_dir=None,
|
||||
open_accounts_callback=None,
|
||||
refresh_workflow_callback=None,
|
||||
subscription_preflight_callback=None,
|
||||
):
|
||||
super().__init__(parent)
|
||||
self.config = appconfig.load_config(config_path or appconfig.CONFIG_PATH) if config is None else config
|
||||
@@ -995,6 +996,7 @@ class GenerateTab(QWidget):
|
||||
self.status_callback = status_callback
|
||||
self.open_accounts_callback = open_accounts_callback
|
||||
self.refresh_workflow_callback = refresh_workflow_callback
|
||||
self.subscription_preflight_callback = subscription_preflight_callback
|
||||
self.title_prompt_path = title_prompt_path or appconfig.title_prompt_path(self.config)
|
||||
self.cover_prompts_dir = cover_prompts_dir or appconfig.cover_prompts_dir(self.config)
|
||||
self.title_templates_dir = title_templates_dir or appconfig.title_templates_dir(self.config)
|
||||
@@ -1757,6 +1759,8 @@ class GenerateTab(QWidget):
|
||||
if self.generate_thread is not None:
|
||||
self._set_status("AI 生成正在进行...")
|
||||
return
|
||||
if self.subscription_preflight_callback is not None and not self.subscription_preflight_callback("开始 AI 生成"):
|
||||
return
|
||||
if not self._save_generate_mode_setting(show_status=False):
|
||||
return
|
||||
generate_mode = self._current_generate_mode()
|
||||
|
||||
Reference in New Issue
Block a user