From: c vw <dl1ycf@darc.de>
Date: Wed, 24 Feb 2021 14:25:34 +0000 (+0100)
Subject: Maintain cw_keyer_internal variable even if not compiled with LOCALCW
X-Git-Url: https://git.rkrishnan.org/components/specifications/frontends/flags?a=commitdiff_plain;h=e54156f2b4802ea4d0ad78f28d8271454be8e0e1;p=pihpsdr.git

Maintain cw_keyer_internal variable even if not compiled with LOCALCW
---

diff --git a/cw_menu.c b/cw_menu.c
index bc00e21..335f66a 100644
--- a/cw_menu.c
+++ b/cw_menu.c
@@ -33,7 +33,9 @@
 #include "receiver.h"
 #include "new_protocol.h"
 #include "old_protocol.h"
+#ifdef LOCALCW
 #include "iambic.h"
+#endif
 #include "ext.h"
 
 static GtkWidget *parent_window=NULL;
@@ -276,13 +278,17 @@ void cw_menu(GtkWidget *parent) {
   gtk_grid_attach(GTK_GRID(grid),cw_keyer_weight_b,1,9,1,1);
   g_signal_connect(cw_keyer_weight_b,"value_changed",G_CALLBACK(cw_keyer_weight_value_changed_cb),NULL);
 
-#ifdef LOCALCW
+//
+// With the advent of MIDI keyers, this check-box is needed even if not compiled
+// with LOCALCW
+//
   GtkWidget *cw_keyer_internal_b=gtk_check_button_new_with_label("CW handled in Radio");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cw_keyer_internal_b), cw_keyer_internal);
   gtk_widget_show(cw_keyer_internal_b);
   gtk_grid_attach(GTK_GRID(grid),cw_keyer_internal_b,0,10,1,1);
   g_signal_connect(cw_keyer_internal_b,"toggled",G_CALLBACK(cw_keyer_internal_cb),NULL);
 
+#ifdef LOCALCW
   GtkWidget *cw_keyer_spacing_b=gtk_check_button_new_with_label("CW enforce letter spacing");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cw_keyer_spacing_b), cw_keyer_spacing);
   gtk_widget_show(cw_keyer_spacing_b);
diff --git a/radio.c b/radio.c
index b7090a6..501cb1c 100644
--- a/radio.c
+++ b/radio.c
@@ -1973,10 +1973,8 @@ g_print("radioRestoreState: %s\n",property_path);
     if(value) cw_keyer_weight=atoi(value);
     value=getProperty("cw_keyer_spacing");
     if(value) cw_keyer_spacing=atoi(value);
-#ifdef LOCALCW
     value=getProperty("cw_keyer_internal");
     if(value) cw_keyer_internal=atoi(value);
-#endif
     value=getProperty("cw_keyer_sidetone_volume");
     if(value) cw_keyer_sidetone_volume=atoi(value);
     value=getProperty("cw_keyer_ptt_delay");