210 |
|
|
211 |
#if WANT_HAMLIB |
#if WANT_HAMLIB |
212 |
/* check if hamlib has changed */ |
/* check if hamlib has changed */ |
213 |
static gboolean hamlib_changed ( gint hamlibwidgets, gchar *radio, gchar *device, |
static gboolean hamlib_changed (gint hamlibwidgets, gchar *radio, gchar *device, |
214 |
gint polltime, gchar *rigconf) |
gint polltime, gchar *rigconf) |
215 |
{ |
{ |
216 |
|
|
217 |
if ((preferences.hamlib == 0) && (hamlibwidgets > 0)) |
if ((preferences.hamlib == 0) && (hamlibwidgets > 0)) |
218 |
return TRUE; |
return TRUE; |
|
else if ((preferences.hamlib == 0) && (hamlibwidgets == 0)) |
|
|
return FALSE; |
|
219 |
else if (g_ascii_strcasecmp (preferences.rigconf, rigconf)) |
else if (g_ascii_strcasecmp (preferences.rigconf, rigconf)) |
220 |
return TRUE; |
return TRUE; |
221 |
else if (g_ascii_strcasecmp (preferences.radio, radio)) |
else if (g_ascii_strcasecmp (preferences.radio, radio)) |
445 |
(GTK_EDITABLE (GTK_BIN(devicecombo)->child), 0, -1); |
(GTK_EDITABLE (GTK_BIN(devicecombo)->child), 0, -1); |
446 |
digits = gtk_editable_get_chars |
digits = gtk_editable_get_chars |
447 |
(GTK_EDITABLE (GTK_BIN(digitscombo)->child), 0, -1); |
(GTK_EDITABLE (GTK_BIN(digitscombo)->child), 0, -1); |
448 |
|
if (pollingyes) |
449 |
|
pollstr = gtk_editable_get_chars |
450 |
|
(GTK_EDITABLE (GTK_BIN(pollcombo)->child), 0, -1); |
451 |
|
else |
452 |
|
pollstr = g_strdup ("0"); |
453 |
|
rigconf = gtk_editable_get_chars (GTK_EDITABLE (rigsetconfentry), 0, -1); |
454 |
|
if (strlen(rigconf) == 0) rigconf = g_strdup ("?"); |
455 |
|
|
|
pollstr = g_strdup ("0"); |
|
456 |
if (hamlibyes) |
if (hamlibyes) |
|
{ |
|
|
if (pollingyes) |
|
|
pollstr = gtk_editable_get_chars |
|
|
(GTK_EDITABLE (GTK_BIN(pollcombo)->child), 0, -1); |
|
|
rigconf = gtk_editable_get_chars (GTK_EDITABLE (rigsetconfentry), 0, -1); |
|
|
if ( strlen(rigconf) == 0 ) |
|
|
rigconf = g_strdup ("?"); |
|
457 |
hamlibwidgets = whichhamlibwidgets (frequencyyesno, smeteryesno); |
hamlibwidgets = whichhamlibwidgets (frequencyyesno, smeteryesno); |
|
if (smeteryesno) |
|
|
sethamlibwidgets (hamlibwidgets, TRUE); |
|
|
else |
|
|
sethamlibwidgets (hamlibwidgets, FALSE); |
|
|
} |
|
458 |
else |
else |
459 |
hamlibwidgets = 0; |
hamlibwidgets = 0; |
460 |
|
|
461 |
|
if (smeteryesno) |
462 |
|
sethamlibwidgets (hamlibwidgets, TRUE); |
463 |
|
else |
464 |
|
sethamlibwidgets (hamlibwidgets, FALSE); |
465 |
|
|
466 |
|
/* hamlib should be started or restarted because settings have changed */ |
467 |
if (hamlib_changed (hamlibwidgets, radio, device, atoi(pollstr), rigconf)) |
if (hamlib_changed (hamlibwidgets, radio, device, atoi(pollstr), rigconf)) |
468 |
{ |
{ |
469 |
if (preferences.hamlib > 0) stop_hamlib (); |
if (preferences.hamlib > 0) stop_hamlib (); |
470 |
preferences.rigconf = g_strdup (rigconf); |
preferences.rigconf = g_strdup (rigconf); |
471 |
hamlibresult = start_hamlib (radio, device, RIG_DEBUG_NONE, atoi (pollstr)); |
hamlibresult = start_hamlib (radio, device, RIG_DEBUG_NONE, atoi (pollstr)); |
472 |
if (hamlibresult) |
preferences.radio = g_strdup (radio); |
473 |
{ |
preferences.device = g_strdup (device); |
474 |
preferences.radio = g_strdup (radio); |
preferences.polltime = atoi (pollstr); |
475 |
preferences.device = g_strdup (device); |
preferences.round = atoi (digits); |
|
preferences.polltime = atoi (pollstr); |
|
|
} |
|
476 |
} |
} |
477 |
else |
else |
478 |
{ |
{ |
487 |
preferences.polltime = 0; |
preferences.polltime = 0; |
488 |
} |
} |
489 |
} |
} |
|
preferences.round = atoi (digits); |
|
490 |
preferences.hamlib = hamlibwidgets; |
preferences.hamlib = hamlibwidgets; |
491 |
|
|
492 |
|
g_free (digits); |
493 |
|
g_free (pollstr); |
494 |
|
g_free (radio); |
495 |
|
g_free (device); |
496 |
|
g_free (rigconf); |
497 |
#endif |
#endif |
498 |
|
|
499 |
/* clock */ |
/* clock */ |