feat: 增加认证更新配置与自动检查 (#94)

This commit is contained in:
chengma
2026-08-10 14:31:44 +08:00
parent 48bbe1cc2c
commit dc375ff2af
14 changed files with 727 additions and 107 deletions
+21 -1
View File
@@ -16,6 +16,7 @@ from PyQt5.QtWidgets import (
QFormLayout,
QHeaderView,
QHBoxLayout,
QLineEdit,
QSizePolicy,
QVBoxLayout,
QWidget,
@@ -210,6 +211,7 @@ class SettingsPage(QWidget):
admin_gateway=None,
android_device_service=None,
update_service=None,
update_credential_store=None,
):
super().__init__(parent)
self.setObjectName("settingsPage")
@@ -224,6 +226,7 @@ class SettingsPage(QWidget):
admin_gateway=admin_gateway,
android_device_service=android_device_service,
update_service=update_service,
update_credential_store=update_credential_store,
)
def _build_ui(self) -> None:
@@ -301,10 +304,20 @@ class SettingsPage(QWidget):
)
self.updateManifestUrlInput.setClearButtonEnabled(True)
self.updateManifestUrlInput.setAccessibleName("在线更新清单地址")
self.updateUsernameInput = LineEdit(self)
self.updateUsernameInput.setClearButtonEnabled(True)
self.updateUsernameInput.setAccessibleName("在线更新账号")
self.updatePasswordInput = LineEdit(self)
self.updatePasswordInput.setEchoMode(QLineEdit.Password)
self.updatePasswordInput.setClearButtonEnabled(True)
self.updatePasswordInput.setAccessibleName("在线更新密码")
self.updatePasswordInput.setPlaceholderText("请输入密码")
self.updateSaveButton = PushButton(FIF.SAVE, "保存", self)
self.updateSaveButton.setAccessibleName("安全保存在线更新设置")
self.updateCheckButton = PushButton(FIF.UPDATE, "检查更新", self)
self.updateCheckButton.setAccessibleName("检查并下载软件更新")
self.updateStatusLabel = CaptionLabel(
"尚未检查;请填写 HTTPS 更新清单地址", self
"尚未保存更新账号和密码", self
)
self.updateStatusLabel.setAccessibleName("软件更新状态")
self.updateStatusLabel.setWordWrap(True)
@@ -424,13 +437,20 @@ class SettingsPage(QWidget):
form.setVerticalSpacing(12)
versionLabel = CaptionLabel("当前版本", card)
manifestLabel = CaptionLabel("清单地址", card)
usernameLabel = CaptionLabel("账号", card)
passwordLabel = CaptionLabel("密码", card)
manifestLabel.setBuddy(self.updateManifestUrlInput)
usernameLabel.setBuddy(self.updateUsernameInput)
passwordLabel.setBuddy(self.updatePasswordInput)
form.addRow(versionLabel, self.currentVersionLabel)
form.addRow(manifestLabel, self.updateManifestUrlInput)
form.addRow(usernameLabel, self.updateUsernameInput)
form.addRow(passwordLabel, self.updatePasswordInput)
layout.addLayout(form)
commandLayout = QHBoxLayout()
commandLayout.addStretch(1)
commandLayout.addWidget(self.updateSaveButton)
commandLayout.addWidget(self.updateCheckButton)
layout.addLayout(commandLayout)
return card