61 |
extern GList *logwindowlist; |
extern GList *logwindowlist; |
62 |
extern preferencestype preferences; |
extern preferencestype preferences; |
63 |
extern GList *logwindowlist; |
extern GList *logwindowlist; |
64 |
|
extern gchar **bandsplit; |
65 |
|
extern gchar **modesplit; |
66 |
|
|
67 |
/* QSO FRAME */ |
/* QSO FRAME */ |
68 |
/* get current date and fill in the dateentry */ |
/* get current date and fill in the dateentry */ |
307 |
void |
void |
308 |
on_mhzbutton_clicked (GtkButton * button, gpointer user_data) |
on_mhzbutton_clicked (GtkButton * button, gpointer user_data) |
309 |
{ |
{ |
310 |
GtkWidget *entry; |
GtkWidget *entry, *bandoptionmenu; |
311 |
GString *digits = g_string_new (""); |
GString *digits = g_string_new (""); |
312 |
|
gchar *bandcopy; |
313 |
|
guint bandindex = 0; |
314 |
|
|
315 |
entry = lookup_widget (mainwindow, "bandentry"); |
entry = lookup_widget (mainwindow, "bandentry"); |
316 |
|
bandoptionmenu = lookup_widget (mainwindow, "bandoptionmenu"); |
317 |
|
|
318 |
|
/* set optionmenu and entry to the default */ |
319 |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
320 |
|
{ |
321 |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmhz); |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmhz); |
322 |
|
if (strlen (preferences.defaultmhz) <= 2) |
323 |
|
bandcopy = g_strdup (preferences.defaultmhz); |
324 |
|
else |
325 |
|
bandcopy = finddot (preferences.defaultmhz); |
326 |
|
for (;;) |
327 |
|
{ |
328 |
|
if (!bandsplit[bandindex]) |
329 |
|
break; |
330 |
|
if (g_ascii_strcasecmp (bandcopy, bandsplit[bandindex]) == 0) |
331 |
|
{ |
332 |
|
gtk_option_menu_set_history (GTK_OPTION_MENU(bandoptionmenu), |
333 |
|
bandindex); |
334 |
|
break; |
335 |
|
} |
336 |
|
bandindex++; |
337 |
|
} |
338 |
|
g_free (bandcopy); |
339 |
|
} |
340 |
else |
else |
341 |
{ |
{ |
342 |
if (state.rigfrequency != 0) |
if (state.rigfrequency != 0) |
363 |
void |
void |
364 |
on_modebutton_clicked (GtkButton * button, gpointer user_data) |
on_modebutton_clicked (GtkButton * button, gpointer user_data) |
365 |
{ |
{ |
366 |
GtkWidget *entry; |
GtkWidget *entry, *modeoptionmenu; |
367 |
gchar *mode; |
gchar *mode; |
368 |
|
guint modeindex = 0; |
369 |
|
|
370 |
entry = lookup_widget (mainwindow, "modeentry"); |
entry = lookup_widget (mainwindow, "modeentry"); |
371 |
|
modeoptionmenu = lookup_widget (mainwindow, "modeoptionmenu"); |
372 |
|
|
373 |
if (g_ascii_strcasecmp (preferences.defaultmode, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmode, "?")) |
374 |
|
{ |
375 |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode); |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode); |
376 |
|
for (;;) |
377 |
|
{ |
378 |
|
if (!modesplit[modeindex]) |
379 |
|
break; |
380 |
|
if (g_ascii_strcasecmp (preferences.defaultmode, modesplit[modeindex]) == 0) |
381 |
|
{ |
382 |
|
gtk_option_menu_set_history (GTK_OPTION_MENU (modeoptionmenu), |
383 |
|
modeindex); |
384 |
|
break; |
385 |
|
} |
386 |
|
modeindex++; |
387 |
|
} |
388 |
|
} |
389 |
else |
else |
390 |
{ |
{ |
391 |
mode = rigmode (state.rigmode); |
mode = rigmode (state.rigmode); |