feat(gui): improve status scope dialogs

This commit is contained in:
chengma
2026-07-18 17:23:22 +08:00
parent 89f1b085dc
commit 7538009f94
8 changed files with 218 additions and 62 deletions
+17 -22
View File
@@ -750,30 +750,25 @@ class CollectTab(QWidget):
thread.start()
def _choose_collect_scope(self):
box = QMessageBox(self)
box.setIcon(QMessageBox.Question)
box.setWindowTitle("选择采集范围")
box.setText("请选择本轮要采集的商品范围。")
box.setInformativeText(
"程序会逐个打开商品详情页检测状态并保存结果。"
"采集所有状态商品包含未上架、审核中和状态未知商品,"
"可能增加采集时间,但本步骤不消耗 AI 点数。"
box = ProductStatusScopeDialog(
title="选择采集范围",
text="请选择本轮要采集的商品范围。",
informative_text=(
"程序会逐个打开商品详情页检测状态并保存结果。"
"采集所有状态商品包含未上架、审核中和状态未知商品,"
"可能增加采集时间,但本步骤不消耗 AI 点数。"
),
normal_text="只采集状态正常的商品",
all_text="采集所有状态的商品",
normal_value=product_status.COLLECT_SCOPE_NORMAL_ONLY,
all_value=product_status.COLLECT_SCOPE_ALL,
normal_object_name="collectNormalOnlyButton",
all_object_name="collectAllStatusesButton",
cancel_object_name="collectScopeCancelButton",
parent=self,
)
normal_button = box.addButton("只采集状态正常的商品", QMessageBox.AcceptRole)
normal_button.setObjectName("collectNormalOnlyButton")
all_button = box.addButton("采集所有状态的商品", QMessageBox.DestructiveRole)
all_button.setObjectName("collectAllStatusesButton")
all_button.setStyleSheet("color: #cf222e; font-weight: 600;")
cancel_button = box.addButton("取消", QMessageBox.RejectRole)
cancel_button.setObjectName("collectScopeCancelButton")
box.setDefaultButton(normal_button)
box.setEscapeButton(cancel_button)
box.exec()
if box.clickedButton() is normal_button:
return product_status.COLLECT_SCOPE_NORMAL_ONLY
if box.clickedButton() is all_button:
return product_status.COLLECT_SCOPE_ALL
return None
return box.choice()
def stop_collect(self, checked=False):
if self.collect_worker is not None: