feat: 实现 Client 在线更新与安全回退 (#93)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""设置页事件、ADB 搜索、当前 Client 本地保存和后台登记。
|
||||
"""设置页事件、ADB 搜索、Client 保存登记和软件更新。
|
||||
|
||||
本文件不直接写 SQL。ADB 搜索、SQLite 写入和 Admin HTTP 请求由 Worker 在线程中
|
||||
执行;页面启动时只同步读取少量索引设置,后台结果通过信号返回主线程更新页面。
|
||||
@@ -37,6 +37,7 @@ from .http_admin_gateway import DEFAULT_ADMIN_BASE_URL, HttpAdminGateway
|
||||
from .selected_android_device_service import SelectedAndroidDeviceService
|
||||
from .settings_repository import SettingsRepository
|
||||
from .settings_ui import AndroidDeviceRow
|
||||
from .update_ui_event import UpdateUiEventBinder
|
||||
|
||||
DEVICE_ID_PLACEHOLDER = "待生成"
|
||||
|
||||
@@ -308,6 +309,7 @@ class SettingsPageEventBinder(QObject):
|
||||
settings_repository: Optional[SettingsRepository] = None,
|
||||
admin_gateway: Optional[ClientRegistrationGateway] = None,
|
||||
android_device_service: Optional[AndroidDeviceService] = None,
|
||||
update_service=None,
|
||||
):
|
||||
super().__init__(page)
|
||||
self._page = page
|
||||
@@ -343,6 +345,12 @@ class SettingsPageEventBinder(QObject):
|
||||
)
|
||||
|
||||
repository = settings_repository or SettingsRepository()
|
||||
self.updateEventBinder = UpdateUiEventBinder(
|
||||
page,
|
||||
repository,
|
||||
service=update_service,
|
||||
parent=self,
|
||||
)
|
||||
self._client_service = CurrentClientService(repository)
|
||||
self._selected_android_device_service = SelectedAndroidDeviceService(
|
||||
repository
|
||||
@@ -1147,6 +1155,7 @@ class SettingsPageEventBinder(QObject):
|
||||
if self._closing:
|
||||
return
|
||||
self._closing = True
|
||||
self.updateEventBinder.shutdown()
|
||||
|
||||
worker = self._worker
|
||||
thread = self._thread
|
||||
|
||||
Reference in New Issue
Block a user