]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
small fixes
authorDL1YCF <dl1ycf@darc.de>
Sun, 15 Mar 2020 11:48:30 +0000 (12:48 +0100)
committerDL1YCF <dl1ycf@darc.de>
Sun, 15 Mar 2020 11:48:30 +0000 (12:48 +0100)
band.c
oc_menu.c
radio.c

diff --git a/band.c b/band.c
index d93df5bec0a69bea6bb2eb144e6b160ce685f792..9f3aff9e587f1969ecaa0783814bc6b750392df3 100644 (file)
--- a/band.c
+++ b/band.c
@@ -294,8 +294,8 @@ BAND bands[BANDS+XVTRS] =
      {"3400",&bandstack3400,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,3400000000LL,3410000000LL,0LL,0LL,0},
      {"AIR",&bandstack3400,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,108000000LL,137000000LL,0LL,0LL,0},
 #endif
-     {"GEN",&bandstackGEN,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0LL,0},
      {"WWV",&bandstackWWV,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0LL,0},
+     {"GEN",&bandstackGEN,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0LL,0},
 // XVTRS
      {"",&bandstack_xvtr_0,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0LL,0},
      {"",&bandstack_xvtr_1,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0LL,0},
index 2d2a2dd89a7f4be04da11c2f00aadf2a49501a74..6749ebcbe33ee6f97e9e8807dcf602ae96fd807e 100644 (file)
--- a/oc_menu.c
+++ b/oc_menu.c
@@ -207,7 +207,12 @@ void oc_menu(GtkWidget *parent) {
 
   int row=3;
 
-  for(i=0;i<bands;i++) {
+  //
+  // fused loop. i runs over the following values:
+  // band_gen, 0 ... bands-1, BANDS ... BANDS+XVTRS-1
+  //
+  i=bandGen;
+  for(;;) {
     BAND *band=band_get_band(i);
     if(strlen(band->title)>0) {
       GtkWidget *band_label=gtk_label_new(NULL);
@@ -238,36 +243,14 @@ void oc_menu(GtkWidget *parent) {
       }
       row++;
     }
-  }
-
-  for(i=BANDS;i<BANDS+XVTRS;i++) {
-    BAND *band=band_get_band(i);
-    if(strlen(band->title)>0) {
-      GtkWidget *band_label=gtk_label_new(band->title);
-      //gtk_widget_override_font(band_label, pango_font_description_from_string("Arial 18"));
-      gtk_widget_show(band_label);
-      gtk_grid_attach(GTK_GRID(grid),band_label,0,row,1,1);
-
-      int mask;
-      for(j=1;j<8;j++) {
-        mask=0x01<<(j-1);
-        GtkWidget *oc_rx_b=gtk_check_button_new();
-        //gtk_widget_override_font(oc_rx_b, pango_font_description_from_string("Arial 18"));
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (oc_rx_b), (band->OCrx&mask)==mask);
-        gtk_widget_show(oc_rx_b);
-        gtk_grid_attach(GTK_GRID(grid),oc_rx_b,j,row,1,1);
-        g_signal_connect(oc_rx_b,"toggled",G_CALLBACK(oc_rx_cb),(gpointer)(long)(j+(i<<4)));
-  
-        GtkWidget *oc_tx_b=gtk_check_button_new();
-        //gtk_widget_override_font(oc_tx_b, pango_font_description_from_string("Arial 18"));
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (oc_tx_b), (band->OCtx&mask)==mask);
-        gtk_widget_show(oc_tx_b);
-        gtk_grid_attach(GTK_GRID(grid),oc_tx_b,j+7,row,1,1);
-        g_signal_connect(oc_tx_b,"toggled",G_CALLBACK(oc_tx_cb),(gpointer)(long)(j+(i<<4)));
-
-      }
-      row++;
+    if (i == bandGen) {
+      i=0;
+    } else if (i == bands-1) {
+      i=BANDS;
+    } else {
+      i++;
     }
+    if (i >= BANDS+XVTRS) break;
   }
 
   int mask;
diff --git a/radio.c b/radio.c
index dd31ea83ac62e19b0f25a220a0056a03dec7381f..db675fff0d6bd7fd649754112eac93d1c49da953 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -361,7 +361,7 @@ void reconfigure_radio() {
       zoompan = zoompan_init(display_width,ZOOMPAN_HEIGHT);
       gtk_fixed_put(GTK_FIXED(fixed),zoompan,0,y);
     } else {
-      gtk_fixed_put(GTK_FIXED(fixed),zoompan,0,y);
+      gtk_fixed_move(GTK_FIXED(fixed),zoompan,0,y);
     }
     gtk_widget_show_all(zoompan);
     y+=ZOOMPAN_HEIGHT;