feat: 完成账号桌面快捷方式
- 新增 chrome.create_shortcut 使用 PowerShell WScript.Shell 生成 .lnk - 快捷方式参数复用 Chrome 启动参数,包含调试端口、allow-origins 和账号 user-data-dir - 在账号服务层和 Tab④ 增加快捷方式入口,不包含密码或密钥 - 补充 chrome/accounts/gui 测试并同步任务、API、路由、当前状态和进度文档
This commit is contained in:
+16
@@ -208,6 +208,7 @@ if QT_IMPORT_ERROR is None:
|
||||
self.delete_button = QPushButton("删除")
|
||||
self.launch_button = QPushButton("启动登录")
|
||||
self.check_button = QPushButton("检测登录")
|
||||
self.shortcut_button = QPushButton("快捷方式")
|
||||
|
||||
toolbar = QHBoxLayout()
|
||||
for button in (
|
||||
@@ -216,6 +217,7 @@ if QT_IMPORT_ERROR is None:
|
||||
self.delete_button,
|
||||
self.launch_button,
|
||||
self.check_button,
|
||||
self.shortcut_button,
|
||||
):
|
||||
toolbar.addWidget(button)
|
||||
toolbar.addStretch(1)
|
||||
@@ -233,6 +235,7 @@ if QT_IMPORT_ERROR is None:
|
||||
self.delete_button.clicked.connect(self.delete_account)
|
||||
self.launch_button.clicked.connect(self.launch_login)
|
||||
self.check_button.clicked.connect(self.check_login)
|
||||
self.shortcut_button.clicked.connect(self.create_shortcut)
|
||||
self.table.itemSelectionChanged.connect(self._update_button_state)
|
||||
self.table.doubleClicked.connect(self.edit_account)
|
||||
|
||||
@@ -258,6 +261,7 @@ if QT_IMPORT_ERROR is None:
|
||||
self.delete_button,
|
||||
self.launch_button,
|
||||
self.check_button,
|
||||
self.shortcut_button,
|
||||
):
|
||||
button.setEnabled(has_selection)
|
||||
|
||||
@@ -419,6 +423,18 @@ if QT_IMPORT_ERROR is None:
|
||||
self.refresh_accounts()
|
||||
self._set_status(f"登录检测失败:{error}")
|
||||
|
||||
def create_shortcut(self, checked=False):
|
||||
account = self._selected_account()
|
||||
if account is None:
|
||||
return
|
||||
try:
|
||||
shortcut_path = accounts.create_shortcut(account, config=self.config)
|
||||
except Exception as exc:
|
||||
self._show_error(exc)
|
||||
return
|
||||
self._set_status(f"快捷方式已生成:{shortcut_path}")
|
||||
QMessageBox.information(self, "账号管理", f"快捷方式已生成:\n{shortcut_path}")
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
"""Main application window with the fixed five-tab workflow."""
|
||||
|
||||
Reference in New Issue
Block a user