def _display_confirmation_message(self, new_mode, app):
"""
Display a popup message to confirm the mode switch.
"""
text = "Switching to " + new_mode + " mode will end current stream."
messagebox = Gtk.MessageDialog(
buttons=Gtk.ButtonsType.OK_CANCEL,
message_type=Gtk.MessageType.WARNING,
message_format=text
)
messagebox.set_title("Confirmation")
try:
response = messagebox.run()
if response == Gtk.ResponseType.OK:
application = app()
finally:
messagebox.destroy()
return application
评论列表
文章目录