From 5357bf8d1aa3739cd09d1ed5809c3910e8b70b26 Mon Sep 17 00:00:00 2001 From: c vw Date: Tue, 20 Jul 2021 17:38:32 +0200 Subject: [PATCH] Show restart button, but not with SOAPY --- new_menu.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/new_menu.c b/new_menu.c index ae12557..4da1fbf 100644 --- a/new_menu.c +++ b/new_menu.c @@ -108,7 +108,6 @@ static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer dat return TRUE; } -#ifdef RESTART_BUTTON // // The "Restart" button restarts the protocol // This may help to recover from certain error conditions @@ -133,7 +132,6 @@ static gboolean restart_cb (GtkWidget *widget, GdkEventButton *event, gpointer d } return TRUE; } -#endif static gboolean about_b_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) { cleanup(); @@ -492,15 +490,16 @@ void new_menu() g_signal_connect (close_b, "button-press-event", G_CALLBACK(close_cb), NULL); gtk_grid_attach(GTK_GRID(grid),close_b,0,0,2,1); -#ifdef RESTART_BUTTON // // The "Restart" restarts the protocol // This may help to recover from certain error conditions + // At the moment I do not know how to do this for SOAPY // - GtkWidget *restart_b=gtk_button_new_with_label("Restart"); - g_signal_connect (restart_b, "button-press-event", G_CALLBACK(restart_cb), NULL); - gtk_grid_attach(GTK_GRID(grid),restart_b,2,0,2,1); -#endif + if (protocol != SOAPYSDR_PROTOCOL) { + GtkWidget *restart_b=gtk_button_new_with_label("Restart"); + g_signal_connect (restart_b, "button-press-event", G_CALLBACK(restart_cb), NULL); + gtk_grid_attach(GTK_GRID(grid),restart_b,2,0,2,1); + } GtkWidget *exit_b=gtk_button_new_with_label("Exit piHPSDR"); g_signal_connect (exit_b, "button-press-event", G_CALLBACK(exit_cb), NULL); -- 2.45.2