update design bl
This commit is contained in:
parent
6d96edbdfc
commit
2c8977a532
@ -254,15 +254,18 @@ class BluetoothScreen(QWidget):
|
||||
if card.is_busy():
|
||||
return
|
||||
|
||||
# Блокируем все карточки
|
||||
# Сначала обновляем UI (через таймер чтобы Qt успел отрисовать)
|
||||
self._set_all_cards_busy(True)
|
||||
card.set_busy(True, "Подключение...")
|
||||
|
||||
def do_connect():
|
||||
success = self._bt_service.connect_device(mac)
|
||||
if not success:
|
||||
self.status.setText(f"Статус: ошибка ({self._bt_service.last_error})")
|
||||
self._settings.setValue("bluetooth/last_mac", mac)
|
||||
QTimer.singleShot(300, lambda: self._finish_action(mac))
|
||||
QTimer.singleShot(500, lambda: self._finish_action(mac))
|
||||
|
||||
QTimer.singleShot(0, do_connect)
|
||||
|
||||
def _disconnect_device(self, mac: str):
|
||||
"""Отключить устройство по MAC."""
|
||||
@ -272,16 +275,19 @@ class BluetoothScreen(QWidget):
|
||||
if card.is_busy():
|
||||
return
|
||||
|
||||
# Блокируем все карточки
|
||||
# Сначала обновляем UI (через таймер чтобы Qt успел отрисовать)
|
||||
self._set_all_cards_busy(True)
|
||||
card.set_busy(True, "Отключение...")
|
||||
|
||||
def do_disconnect():
|
||||
success = self._bt_service.disconnect_device(mac)
|
||||
if not success:
|
||||
self.status.setText(f"Статус: ошибка ({self._bt_service.last_error})")
|
||||
else:
|
||||
self.status.setText(f"Статус: отключено от {mac}")
|
||||
QTimer.singleShot(300, lambda: self._finish_action(mac))
|
||||
QTimer.singleShot(500, lambda: self._finish_action(mac))
|
||||
|
||||
QTimer.singleShot(0, do_disconnect)
|
||||
|
||||
def _remove_device(self, mac: str):
|
||||
"""Удалить устройство из списка сопряженных."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user