From: c vw <dl1ycf@darc.de>
Date: Thu, 25 Nov 2021 08:26:58 +0000 (+0100)
Subject: BSTK menu: button labels change if bandstack changes.
X-Git-Url: https://git.rkrishnan.org/%5B/simplejson/%22file://%22doc.html/%22?a=commitdiff_plain;h=13494b9d539e0c2837c8ef069fb930d79ba18665;p=pihpsdr.git

BSTK menu: button labels change if bandstack changes.
---

diff --git a/bandstack_menu.c b/bandstack_menu.c
index 19152df..262eb78 100644
--- a/bandstack_menu.c
+++ b/bandstack_menu.c
@@ -60,6 +60,17 @@ static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_d
 
 static gboolean bandstack_select_cb (GtkWidget *widget, gpointer        data) {
   int b=GPOINTER_TO_UINT(data);
+
+  if (active_receiver->id == 0) {
+    //
+    // vfo_bandstack_changed() calls vfo_save_bandstack(), so the frequency/mode
+    // of the previous "current" bandstack will be overwritten with the
+    // current frequency/mode, which should be reflected by the button text.
+    //
+    char label[32];
+    snprintf(label,32,"%lld %s",vfo[0].frequency,mode_string[vfo[0].mode]);
+    gtk_button_set_label(GTK_BUTTON(last_bandstack), label);
+  }
   set_button_text_color(last_bandstack,"black");
   last_bandstack=widget;
   set_button_text_color(last_bandstack,"orange");