update design bl
This commit is contained in:
parent
8f3b6eb411
commit
28a920cd94
@ -16,6 +16,7 @@ from PySide6.QtWidgets import (
|
|||||||
|
|
||||||
import build_info
|
import build_info
|
||||||
from services.bluetooth_service import BluetoothService, BluetoothDevice
|
from services.bluetooth_service import BluetoothService, BluetoothDevice
|
||||||
|
from ui.confirm_dialog import ConfirmDialog
|
||||||
|
|
||||||
|
|
||||||
class BluetoothDeviceCard(QFrame):
|
class BluetoothDeviceCard(QFrame):
|
||||||
@ -245,6 +246,18 @@ class BluetoothScreen(QWidget):
|
|||||||
|
|
||||||
def _remove_device(self, mac: str):
|
def _remove_device(self, mac: str):
|
||||||
"""Удалить устройство из списка сопряженных."""
|
"""Удалить устройство из списка сопряженных."""
|
||||||
|
device = self._cards.get(mac)
|
||||||
|
if not device:
|
||||||
|
return
|
||||||
|
|
||||||
|
name = device._device.name if device._device.name else mac
|
||||||
|
dialog = ConfirmDialog(
|
||||||
|
"Подтверждение",
|
||||||
|
f"Удалить устройство \"{name}\" из списка сопряженных?",
|
||||||
|
"Удалить",
|
||||||
|
ok_object_name="ConfirmOkDanger",
|
||||||
|
)
|
||||||
|
if dialog.exec() == ConfirmDialog.Accepted:
|
||||||
success = self._bt_service.remove_device(mac)
|
success = self._bt_service.remove_device(mac)
|
||||||
if success:
|
if success:
|
||||||
self.status.setText(f"Статус: устройство {mac} удалено")
|
self.status.setText(f"Статус: устройство {mac} удалено")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user