From 53b25ec08c902d68fe285a93044ed589740e95ef Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 13 Sep 2023 15:38:18 +0200 Subject: [PATCH] display devices used for communication on UI --- src/x48.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/x48.c b/src/x48.c index 5002f3f..ae4d955 100644 --- a/src/x48.c +++ b/src/x48.c @@ -2551,15 +2551,26 @@ static int button_release_all( void ) { } void ShowConnections() { - fprintf( stderr, "wire_name: %s\n", wire_name ); - fprintf( stderr, "ir_name: %s\n", ir_name ); + if (verbose) { + fprintf( stderr, "wire_name: %s\n", wire_name ); + fprintf( stderr, "ir_name: %s\n", ir_name ); + } - /* if (wire_name) */ - /* SDLDrawSmallString(10, 10, wire_name, strlen( wire_name ), - * 0xffffffff, 0x00000000 ); */ - /* if (ir_name) */ - /* SDLDrawSmallString(10, 20, ir_name, strlen( ir_name ), 0xffffffff, - * 0x00000000 ); */ + char text[1024]; + if (wire_name) { + strcat( text, "wire: " ); + strcat( text, wire_name ); + } + if (ir_name) { + if (strlen(text) > 0) + strcat( text, " | " ); + + strcat( text, "ir: " ); + strcat( text, ir_name ); + } + + if (strlen(text) > 0) + stringColor( sdlwindow, 10, 240, text, 0xffffffff ); } int get_ui_event( void ) {