/[xlog]/xlog/src/callbacks_mainwindow_qsoframe.c
ViewVC logotype

Diff of /xlog/src/callbacks_mainwindow_qsoframe.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pa4tu, Wed Nov 24 19:02:37 2004 UTC revision 1.4 by pa4tu, Thu Dec 9 13:41:55 2004 UTC
# Line 65  extern statetype state; Line 65  extern statetype state;
65  extern GList *logwindowlist;  extern GList *logwindowlist;
66  extern preferencestype preferences;  extern preferencestype preferences;
67  extern GList *logwindowlist;  extern GList *logwindowlist;
 extern gchar **bandsplit, **modesplit;  
68    
69  /* QSO FRAME */  /* QSO FRAME */
70  /* get current date and fill in the dateentry */  /* get current date and fill in the dateentry */
# Line 293  on_mhzbutton_clicked (GtkButton * button Line 292  on_mhzbutton_clicked (GtkButton * button
292  {  {
293          GtkWidget *entry, *bandoptionmenu;          GtkWidget *entry, *bandoptionmenu;
294          GString *digits = g_string_new ("");          GString *digits = g_string_new ("");
295          gchar *bandcopy;          gchar *bandcopy, **bandspl;
296          guint bandindex = 0;          guint bandindex = 0;
297    
298          entry = lookup_widget (mainwindow, "bandentry");          entry = lookup_widget (mainwindow, "bandentry");
299          bandoptionmenu = lookup_widget (mainwindow, "bandoptionmenu");          bandoptionmenu = lookup_widget (mainwindow, "bandoptionmenu");
300          bandsplit = g_strsplit (preferences.bands, ",", 0);          bandspl = g_strsplit (preferences.bands, ",", 0);
301                    
302          /* set optionmenu and entry to the default */          /* set optionmenu and entry to the default */
303          if (g_ascii_strcasecmp (preferences.defaultmhz, "?"))          if (g_ascii_strcasecmp (preferences.defaultmhz, "?"))
# Line 310  on_mhzbutton_clicked (GtkButton * button Line 309  on_mhzbutton_clicked (GtkButton * button
309                          bandcopy = finddot (preferences.defaultmhz);                          bandcopy = finddot (preferences.defaultmhz);
310                  for (;;)                  for (;;)
311                  {                  {
312                          if (!bandsplit[bandindex])                          if (!bandspl[bandindex])
313                                  break;                                  break;
314                          if (g_ascii_strcasecmp (bandcopy, bandsplit[bandindex]) == 0)                          if (g_ascii_strcasecmp (bandcopy, bandspl[bandindex]) == 0)
315                          {                          {
316                                  gtk_combo_box_set_active (GTK_COMBO_BOX(bandoptionmenu),                                  gtk_combo_box_set_active (GTK_COMBO_BOX(bandoptionmenu),
317                                          bandindex);                                          bandindex);
# Line 336  on_mhzbutton_clicked (GtkButton * button Line 335  on_mhzbutton_clicked (GtkButton * button
335                          bandcopy = finddot (digits->str);                          bandcopy = finddot (digits->str);
336                  for (;;)                  for (;;)
337                          {                          {
338                                  if (!bandsplit[bandindex])                                  if (!bandspl[bandindex])
339                                          break;                                          break;
340                                  if (g_ascii_strcasecmp (bandcopy, bandsplit[bandindex]) == 0)                                  if (g_ascii_strcasecmp (bandcopy, bandspl[bandindex]) == 0)
341                                          {                                          {
342                                                  gtk_combo_box_set_active (GTK_COMBO_BOX                                                  gtk_combo_box_set_active (GTK_COMBO_BOX
343                                                          (bandoptionmenu), bandindex);                                                          (bandoptionmenu), bandindex);
# Line 349  on_mhzbutton_clicked (GtkButton * button Line 348  on_mhzbutton_clicked (GtkButton * button
348                  g_free (bandcopy);                  g_free (bandcopy);
349                  g_string_free (digits, TRUE);                  g_string_free (digits, TRUE);
350          }          }
351            g_strfreev (bandspl);
352  }  }
353    
354  void  void
355  on_modebutton_clicked (GtkButton * button, gpointer user_data)  on_modebutton_clicked (GtkButton * button, gpointer user_data)
356  {  {
357          GtkWidget *entry, *modeoptionmenu;          GtkWidget *entry, *modeoptionmenu;
358          gchar *mode;          gchar *mode, **modespl;
359          guint modeindex = 0;          guint modeindex = 0;
360    
361          entry = lookup_widget (mainwindow, "modeentry");          entry = lookup_widget (mainwindow, "modeentry");
362          modeoptionmenu = lookup_widget (mainwindow, "modeoptionmenu");          modeoptionmenu = lookup_widget (mainwindow, "modeoptionmenu");
363          modesplit = g_strsplit (preferences.modes, ",", 0);          modespl = g_strsplit (preferences.modes, ",", 0);
364    
365          /* use default */          /* use default */
366          if (g_ascii_strcasecmp (preferences.defaultmode, "?"))          if (g_ascii_strcasecmp (preferences.defaultmode, "?"))
# Line 368  on_modebutton_clicked (GtkButton * butto Line 368  on_modebutton_clicked (GtkButton * butto
368                  gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode);                  gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode);
369                  for (;;)                  for (;;)
370                  {                  {
371                          if (!modesplit[modeindex])                          if (!modespl[modeindex])
372                                  break;                                  break;
373                          if (g_ascii_strcasecmp (preferences.defaultmode, modesplit[modeindex]) == 0)                          if (g_ascii_strcasecmp (preferences.defaultmode, modespl[modeindex]) == 0)
374                          {                          {
375                                  gtk_combo_box_set_active(GTK_COMBO_BOX (modeoptionmenu),                                  gtk_combo_box_set_active(GTK_COMBO_BOX (modeoptionmenu),
376                                          modeindex);                                          modeindex);
# Line 385  on_modebutton_clicked (GtkButton * butto Line 385  on_modebutton_clicked (GtkButton * butto
385                  gtk_entry_set_text (GTK_ENTRY (entry), mode);                  gtk_entry_set_text (GTK_ENTRY (entry), mode);
386                  for (;;)                  for (;;)
387                  {                  {
388                          if (!modesplit[modeindex])                          if (!modespl[modeindex])
389                                  break;                                  break;
390                          if (g_ascii_strcasecmp (mode, modesplit[modeindex]) == 0)                          if (g_ascii_strcasecmp (mode, modespl[modeindex]) == 0)
391                          {                          {
392                                  gtk_combo_box_set_active (GTK_COMBO_BOX (modeoptionmenu),                                  gtk_combo_box_set_active (GTK_COMBO_BOX (modeoptionmenu),
393                                          modeindex);                                          modeindex);
# Line 397  on_modebutton_clicked (GtkButton * butto Line 397  on_modebutton_clicked (GtkButton * butto
397                  }                  }
398                  g_free (mode);                  g_free (mode);
399          }          }
400            g_strfreev (modespl);
401  }  }
402    
403  void  void

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26