62 |
extern GList *logwindowlist; |
extern GList *logwindowlist; |
63 |
extern preferencestype preferences; |
extern preferencestype preferences; |
64 |
extern GList *logwindowlist; |
extern GList *logwindowlist; |
|
extern gchar **bandsplit; |
|
|
extern gchar **modesplit; |
|
65 |
|
|
66 |
/* QSO FRAME */ |
/* QSO FRAME */ |
67 |
/* get current date and fill in the dateentry */ |
/* get current date and fill in the dateentry */ |
328 |
{ |
{ |
329 |
GtkWidget *entry, *bandoptionmenu; |
GtkWidget *entry, *bandoptionmenu; |
330 |
GString *digits = g_string_new (""); |
GString *digits = g_string_new (""); |
331 |
gchar *bandcopy; |
gchar *bandcopy, **bandsplit; |
332 |
guint bandindex = 0; |
guint bandindex = 0; |
333 |
|
|
334 |
entry = lookup_widget (mainwindow, "bandentry"); |
entry = lookup_widget (mainwindow, "bandentry"); |
335 |
bandoptionmenu = lookup_widget (mainwindow, "bandoptionmenu"); |
bandoptionmenu = lookup_widget (mainwindow, "bandoptionmenu"); |
336 |
|
bandsplit = g_strsplit (preferences.bands, ",", 0); |
337 |
|
|
338 |
/* set optionmenu and entry to the default */ |
/* set optionmenu and entry to the default */ |
339 |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
357 |
} |
} |
358 |
g_free (bandcopy); |
g_free (bandcopy); |
359 |
} |
} |
360 |
else |
else /* there is no default */ |
361 |
{ |
{ |
362 |
if (state.rigfrequency != 0) |
if (state.rigfrequency != 0) |
363 |
{ |
{ |
375 |
{ |
{ |
376 |
g_string_printf (digits, "UNKNOWN"); |
g_string_printf (digits, "UNKNOWN"); |
377 |
} |
} |
378 |
|
/* set entry and optionmenu */ |
379 |
gtk_entry_set_text (GTK_ENTRY (entry), digits->str); |
gtk_entry_set_text (GTK_ENTRY (entry), digits->str); |
380 |
|
if (strlen (digits->str) <= 2) |
381 |
|
bandcopy = g_strdup (digits->str); |
382 |
|
else |
383 |
|
bandcopy = finddot (digits->str); |
384 |
|
for (;;) |
385 |
|
{ |
386 |
|
if (!bandsplit[bandindex]) |
387 |
|
break; |
388 |
|
if (g_ascii_strcasecmp (bandcopy, bandsplit[bandindex]) == 0) |
389 |
|
{ |
390 |
|
gtk_option_menu_set_history (GTK_OPTION_MENU |
391 |
|
(bandoptionmenu), bandindex); |
392 |
|
break; |
393 |
|
} |
394 |
|
bandindex++; |
395 |
|
} |
396 |
|
g_free (bandcopy); |
397 |
|
|
398 |
g_string_free (digits, TRUE); |
g_string_free (digits, TRUE); |
399 |
} |
} |
400 |
} |
} |
403 |
on_modebutton_clicked (GtkButton * button, gpointer user_data) |
on_modebutton_clicked (GtkButton * button, gpointer user_data) |
404 |
{ |
{ |
405 |
GtkWidget *entry, *modeoptionmenu; |
GtkWidget *entry, *modeoptionmenu; |
406 |
gchar *mode; |
gchar *mode, **modesplit; |
407 |
guint modeindex = 0; |
guint modeindex = 0; |
408 |
|
|
409 |
entry = lookup_widget (mainwindow, "modeentry"); |
entry = lookup_widget (mainwindow, "modeentry"); |
410 |
modeoptionmenu = lookup_widget (mainwindow, "modeoptionmenu"); |
modeoptionmenu = lookup_widget (mainwindow, "modeoptionmenu"); |
411 |
|
modesplit = g_strsplit (preferences.modes, ",", 0); |
412 |
|
|
413 |
|
/* use default */ |
414 |
if (g_ascii_strcasecmp (preferences.defaultmode, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmode, "?")) |
415 |
{ |
{ |
416 |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode); |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode); |
427 |
modeindex++; |
modeindex++; |
428 |
} |
} |
429 |
} |
} |
430 |
else |
else /* NO default */ |
431 |
|
{ |
432 |
|
mode = rigmode (state.rigmode); |
433 |
|
gtk_entry_set_text (GTK_ENTRY (entry), mode); |
434 |
|
for (;;) |
435 |
{ |
{ |
436 |
mode = rigmode (state.rigmode); |
if (!modesplit[modeindex]) |
437 |
gtk_entry_set_text (GTK_ENTRY (entry), mode); |
break; |
438 |
g_free (mode); |
if (g_ascii_strcasecmp (mode, modesplit[modeindex]) == 0) |
439 |
|
{ |
440 |
|
gtk_option_menu_set_history (GTK_OPTION_MENU (modeoptionmenu), |
441 |
|
modeindex); |
442 |
|
break; |
443 |
|
} |
444 |
|
modeindex++; |
445 |
} |
} |
446 |
|
g_free (mode); |
447 |
|
} |
448 |
} |
} |
449 |
|
|
450 |
void |
void |