h
This commit is contained in:
@@ -8,6 +8,8 @@ from textual.screen import ModalScreen
|
||||
from textual.widgets import Static, Button, Checkbox, ListView, ListItem
|
||||
from textual import work
|
||||
from rich.text import Text
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
@@ -121,7 +123,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
# Stop propagation so parent handlers (ConfigModal) don't react.
|
||||
event.stop()
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to stop ListView.Selected event propagation")
|
||||
|
||||
def _set_status(self, text: str) -> None:
|
||||
if self._status_widget:
|
||||
@@ -137,6 +139,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
any_selected = True
|
||||
break
|
||||
except Exception:
|
||||
logger.exception("Error querying checkbox in MatrixRoomPicker; skipping")
|
||||
continue
|
||||
if self._save_button:
|
||||
self._save_button.disabled = not any_selected
|
||||
@@ -214,7 +217,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
cb = self.query_one(f"#{checkbox_id}", Checkbox)
|
||||
cb.value = True
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to set checkbox value in MatrixRoomPicker")
|
||||
if self._save_button:
|
||||
self._save_button.disabled = False
|
||||
elif event.button.id == "matrix-room-clear":
|
||||
@@ -223,7 +226,7 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
cb = self.query_one(f"#{checkbox_id}", Checkbox)
|
||||
cb.value = False
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to set checkbox value to False in MatrixRoomPicker")
|
||||
if self._save_button:
|
||||
self._save_button.disabled = True
|
||||
elif event.button.id == "matrix-room-save":
|
||||
@@ -234,5 +237,5 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
if cb.value and room_id:
|
||||
selected.append(room_id)
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to read checkbox state for '%s' while saving MatrixRoomPicker selection", checkbox_id)
|
||||
self.dismiss(selected)
|
||||
|
||||
Reference in New Issue
Block a user