fix: strip newlines

This commit is contained in:
aclist 2025-12-09 13:03:52 +09:00
parent 005288371b
commit c6034bc6b9

View File

@ -866,13 +866,14 @@ def spawn_dialog(msg: str, mode: Popup) -> bool:
dialog = GenericDialog(msg, mode)
response = dialog.run()
dialog.destroy()
clean_msg = msg.replace("\n", " ")
match response:
case Gtk.ResponseType.OK:
logger.info(f"User confirmed dialog with message '{msg}'")
logger.info(f"User confirmed dialog with message '{clean_msg}'")
return False
case Gtk.ResponseType.CANCEL | Gtk.ResponseType.DELETE_EVENT:
logger.info(f"User aborted dialog with message '{msg}'")
logger.info(f"User aborted dialog with message '{clean_msg}'")
return True
return False