38 |
extern statetype state; |
extern statetype state; |
39 |
extern preferencestype preferences; |
extern preferencestype preferences; |
40 |
extern GList *logwindowlist; |
extern GList *logwindowlist; |
|
extern gchar **modesplit, **bandsplit; |
|
41 |
|
|
42 |
/* a row is selected, update the qso frame */ |
/* a row is selected, update the qso frame */ |
43 |
void |
void |
48 |
*incheckbutton, *powerentry, *nameentry, *qthentry, *locatorentry, |
*incheckbutton, *powerentry, *nameentry, *qthentry, *locatorentry, |
49 |
*unknownentry1, *unknownentry2, *modeoptionmenu, *bandoptionmenu, |
*unknownentry1, *unknownentry2, *modeoptionmenu, *bandoptionmenu, |
50 |
*qsoframe, *framelabel; |
*qsoframe, *framelabel; |
51 |
gchar *frametext, *bandcopy, *entry; |
gchar *frametext, *bandcopy, *entry, **bandspl, **modespl; |
52 |
guint i, page, bandindex = 0, modeindex = 0; |
guint i, page, bandindex = 0, modeindex = 0; |
53 |
GtkTreeModel *model; |
GtkTreeModel *model; |
54 |
GtkTreeIter iter; |
GtkTreeIter iter; |
109 |
gtk_tree_model_get (model, &iter, BAND, &entry, -1); |
gtk_tree_model_get (model, &iter, BAND, &entry, -1); |
110 |
gtk_entry_set_text (GTK_ENTRY (bandentry), entry); |
gtk_entry_set_text (GTK_ENTRY (bandentry), entry); |
111 |
|
|
112 |
bandsplit = g_strsplit (preferences.bands, ",", 0); |
bandspl = g_strsplit (preferences.bands, ",", 0); |
113 |
if (strlen (entry) <= 2) |
if (strlen (entry) <= 2) |
114 |
bandcopy = g_strdup (entry); |
bandcopy = g_strdup (entry); |
115 |
else |
else |
116 |
bandcopy = g_strdup(finddot (entry)); |
bandcopy = g_strdup(finddot (entry)); |
117 |
|
|
118 |
for (;;) |
for (;;) |
119 |
{ |
{ |
120 |
if (!bandsplit[bandindex]) |
if (!bandspl[bandindex]) |
121 |
break; |
break; |
122 |
if (g_ascii_strcasecmp (bandcopy, bandsplit[bandindex]) == 0) |
if (g_ascii_strcasecmp (bandcopy, bandspl[bandindex]) == 0) |
123 |
{ |
{ |
124 |
gtk_combo_box_set_active (GTK_COMBO_BOX (bandoptionmenu), |
gtk_combo_box_set_active (GTK_COMBO_BOX (bandoptionmenu), |
125 |
bandindex); |
bandindex); |
128 |
bandindex++; |
bandindex++; |
129 |
} |
} |
130 |
g_free (bandcopy); |
g_free (bandcopy); |
131 |
|
g_strfreev (bandspl); |
132 |
|
|
133 |
/* update modeoptionmenu and entry */ |
/* update modeoptionmenu and entry */ |
134 |
gtk_tree_model_get (model, &iter, MODE, &entry, -1); |
gtk_tree_model_get (model, &iter, MODE, &entry, -1); |
135 |
gtk_entry_set_text (GTK_ENTRY (modeentry), entry); |
gtk_entry_set_text (GTK_ENTRY (modeentry), entry); |
136 |
|
|
137 |
modesplit = g_strsplit (preferences.modes, ",", 0); |
modespl = g_strsplit (preferences.modes, ",", 0); |
138 |
for (;;) |
for (;;) |
139 |
{ |
{ |
140 |
if (!modesplit[modeindex]) |
if (!modespl[modeindex]) |
141 |
break; |
break; |
142 |
if (g_ascii_strcasecmp (entry, modesplit[modeindex]) == 0) |
if (g_ascii_strcasecmp (entry, modespl[modeindex]) == 0) |
143 |
{ |
{ |
144 |
gtk_combo_box_set_active (GTK_COMBO_BOX (modeoptionmenu), |
gtk_combo_box_set_active (GTK_COMBO_BOX (modeoptionmenu), |
145 |
modeindex); |
modeindex); |
147 |
} |
} |
148 |
modeindex++; |
modeindex++; |
149 |
} |
} |
150 |
|
g_strfreev (modespl); |
151 |
|
|
152 |
gtk_tree_model_get (model, &iter, POWER, &entry, -1); |
gtk_tree_model_get (model, &iter, POWER, &entry, -1); |
153 |
gtk_entry_set_text (GTK_ENTRY (powerentry), entry); |
gtk_entry_set_text (GTK_ENTRY (powerentry), entry); |