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 */ |
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, "?")) |
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); |
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); |
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, "?")) |
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); |
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); |
397 |
} |
} |
398 |
g_free (mode); |
g_free (mode); |
399 |
} |
} |
400 |
|
g_strfreev (modespl); |
401 |
} |
} |
402 |
|
|
403 |
void |
void |