104 |
/* convert callsign to uppercase */ |
/* convert callsign to uppercase */ |
105 |
void |
void |
106 |
on_callentry_insert_text (GtkEditable * editable, gchar * new_text, |
on_callentry_insert_text (GtkEditable * editable, gchar * new_text, |
107 |
gint new_text_length, gint * position, |
gint new_text_length, gpointer position, gpointer user_data) |
|
gpointer user_data) |
|
108 |
{ |
{ |
109 |
gint i; |
gint i; |
110 |
gchar *result = g_new (gchar, new_text_length); |
gchar *result = g_new (gchar, new_text_length); |
112 |
for (i = 0; i < new_text_length; i++) |
for (i = 0; i < new_text_length; i++) |
113 |
result[i] = islower (new_text[i]) ? toupper (new_text[i]) : new_text[i]; |
result[i] = islower (new_text[i]) ? toupper (new_text[i]) : new_text[i]; |
114 |
|
|
115 |
/* insert the new callsign and block changed and insert_text, so we don't call this twice */ |
/* insert the new callsign and block insert_text, so we don't call this twice */ |
116 |
gtk_signal_handler_block_by_func (GTK_OBJECT (editable), |
g_signal_handlers_block_by_func (GTK_OBJECT (editable), |
117 |
GTK_SIGNAL_FUNC |
on_callentry_insert_text, user_data); |
|
(on_callentry_insert_text), user_data); |
|
|
gtk_signal_handler_block_by_func (GTK_OBJECT (editable), |
|
|
GTK_SIGNAL_FUNC (on_callentry_changed), |
|
|
user_data); |
|
118 |
gtk_editable_insert_text (editable, result, new_text_length, position); |
gtk_editable_insert_text (editable, result, new_text_length, position); |
119 |
gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable), |
g_signal_handlers_unblock_by_func (GTK_OBJECT (editable), |
120 |
GTK_SIGNAL_FUNC (on_callentry_changed), |
on_callentry_insert_text, user_data); |
121 |
user_data); |
g_signal_stop_emission_by_name (GTK_OBJECT (editable), "insert_text"); |
|
gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable), |
|
|
GTK_SIGNAL_FUNC |
|
|
(on_callentry_insert_text), user_data); |
|
|
gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text"); |
|
122 |
g_free (result); |
g_free (result); |
123 |
} |
} |
124 |
|
|
125 |
static void |
static void |
126 |
updateb4dialog_and_typeaheadfind (gchar * callsign) |
updateb4dialog_and_typeaheadfind (gchar * callsign) |
127 |
{ |
{ |
128 |
GtkWidget *b4clist, *remarksvbox, *remarksentry, *namehbox, *nameentry, |
GtkWidget *b4treeview, *remarksvbox, *remarksentry, *namehbox, *nameentry, |
129 |
*qthhbox, *qthentry, *locatorhbox, *locatorentry; |
*qthhbox, *qthentry, *locatorhbox, *locatorentry; |
130 |
guint i, j, row; |
guint i, j; |
131 |
logtype *logwindow; |
logtype *logw; |
132 |
gchar *logcallsign, **b4 = NULL, *temp; |
gchar *logcallsign, **b4 = NULL, *temp; |
133 |
gboolean found = FALSE; |
gboolean found = FALSE, valid = FALSE; |
134 |
|
GtkTreeIter iter, b4iter; |
135 |
b4clist = lookup_widget (b4dialog, "b4clist"); |
GtkTreeModel *model, *b4model = NULL; |
136 |
if (GTK_WIDGET_VISIBLE (b4dialog)) |
GtkTreeViewColumn *column; |
|
gtk_clist_clear (GTK_CLIST (b4clist)); |
|
137 |
|
|
138 |
if (GTK_WIDGET_VISIBLE (b4dialog)) |
if (GTK_WIDGET_VISIBLE (b4dialog)) |
139 |
{ |
{ |
140 |
b4 = g_new0 (gchar *, 19); |
/* clear the list */ |
141 |
for (j = 0; j < 19; j++) |
b4treeview = lookup_widget (b4dialog, "b4treeview"); |
142 |
|
b4model = gtk_tree_view_get_model (GTK_TREE_VIEW (b4treeview)); |
143 |
|
gtk_tree_store_clear (GTK_TREE_STORE (b4model)); |
144 |
|
|
145 |
|
if (strlen(callsign) < 2) return; /* for responsiveness */ |
146 |
|
|
147 |
|
b4 = g_new0 (gchar *, QSO_FIELDS + 1); |
148 |
|
for (j = 0; j < QSO_FIELDS + 1; j++) |
149 |
b4[j] = g_new0 (gchar, 100); |
b4[j] = g_new0 (gchar, 100); |
150 |
} |
} |
151 |
|
|
152 |
if (GTK_WIDGET_VISIBLE (b4dialog) || preferences.typeaheadfind == 1) |
/* search all logs, if there is a match display it */ |
153 |
|
if (GTK_WIDGET_VISIBLE (b4dialog)|| preferences.typeaheadfind == 1) |
154 |
{ |
{ |
155 |
for (i = 0; i < g_list_length (logwindowlist); i++) |
for (i = 0; i < g_list_length (logwindowlist); i++) |
156 |
{ /* in all logs */ |
{ |
157 |
logwindow = g_list_nth_data (logwindowlist, i); |
logw = g_list_nth_data (logwindowlist, i); |
158 |
for (row = 0; row < logwindow->qsos; row++) |
model = gtk_tree_view_get_model (GTK_TREE_VIEW(logw->treeview)); |
159 |
{ /* get callsign and compare to current callsign entry */ |
valid = gtk_tree_model_get_iter_first (model, &iter); |
160 |
gtk_clist_get_text (GTK_CLIST (logwindow->clist), |
while (valid) |
161 |
row, CALL, &logcallsign); |
{ |
162 |
if (preferences.typeaheadfind == 1 && !found && |
gtk_tree_model_get (model, &iter, CALL, &logcallsign, -1); |
163 |
!g_strcasecmp (callsign, logcallsign)) |
if (preferences.typeaheadfind == 1 && !found && |
164 |
{ /* type ahead find */ |
!g_ascii_strcasecmp (callsign, logcallsign)) |
165 |
namehbox = lookup_widget(mainwindow, "namehbox"); |
{ /* type ahead find */ |
166 |
if (GTK_WIDGET_VISIBLE (namehbox)) |
namehbox = lookup_widget(mainwindow, "namehbox"); |
167 |
{ |
if (GTK_WIDGET_VISIBLE (namehbox)) |
168 |
nameentry = lookup_widget(mainwindow, "nameentry"); |
{ |
169 |
gtk_clist_get_text (GTK_CLIST (logwindow->clist), row, NAME, &temp); |
nameentry = lookup_widget(mainwindow, "nameentry"); |
170 |
gtk_entry_set_text (GTK_ENTRY (nameentry), temp); |
gtk_tree_model_get (model, &iter, NAME, &temp, -1); |
171 |
} |
gtk_entry_set_text (GTK_ENTRY (nameentry), temp); |
|
qthhbox = lookup_widget(mainwindow, "qthhbox"); |
|
|
if (GTK_WIDGET_VISIBLE (qthhbox)) |
|
|
{ |
|
|
qthentry = lookup_widget(mainwindow, "qthentry"); |
|
|
gtk_clist_get_text (GTK_CLIST (logwindow->clist), row, QTH, &temp); |
|
|
gtk_entry_set_text (GTK_ENTRY (qthentry), temp); |
|
|
} |
|
|
locatorhbox = lookup_widget(mainwindow, "locatorhbox"); |
|
|
if (GTK_WIDGET_VISIBLE (locatorhbox)) |
|
|
{ |
|
|
locatorentry = lookup_widget(mainwindow, "locatorentry"); |
|
|
gtk_clist_get_text (GTK_CLIST (logwindow->clist), row, LOCATOR, &temp); |
|
|
gtk_entry_set_text (GTK_ENTRY (locatorentry), temp); |
|
|
} |
|
|
remarksvbox = lookup_widget(mainwindow, "remarksvbox"); |
|
|
if (!g_strcasecmp (preferences.defaultremarks, "?") && GTK_WIDGET_VISIBLE (remarksvbox)) |
|
|
{ |
|
|
remarksentry = lookup_widget(mainwindow, "remarksentry"); |
|
|
gtk_clist_get_text (GTK_CLIST (logwindow->clist), row, REMARKS, &temp); |
|
|
gtk_entry_set_text (GTK_ENTRY (remarksentry), temp); |
|
|
} |
|
|
found = TRUE; /* lookup only once */ |
|
172 |
} |
} |
173 |
if (GTK_WIDGET_VISIBLE (b4dialog) |
qthhbox = lookup_widget(mainwindow, "qthhbox"); |
174 |
&& !g_strncasecmp (callsign, logcallsign, strlen (callsign))) |
if (GTK_WIDGET_VISIBLE (qthhbox)) |
175 |
{ /* worked b4 */ |
{ |
176 |
b4[0] = g_strdup (logwindow->logname); |
qthentry = lookup_widget(mainwindow, "qthentry"); |
177 |
for (j = 0; j < 18; j++) |
gtk_tree_model_get (model, &iter, QTH, &temp, -1); |
178 |
{ |
gtk_entry_set_text (GTK_ENTRY (qthentry), temp); |
179 |
gtk_clist_get_text (GTK_CLIST (logwindow->clist), row, |
} |
180 |
j, &temp); |
locatorhbox = lookup_widget(mainwindow, "locatorhbox"); |
181 |
b4[j + 1] = g_strdup (temp); |
if (GTK_WIDGET_VISIBLE (locatorhbox)) |
182 |
} |
{ |
183 |
gtk_clist_append (GTK_CLIST (b4clist), b4); |
locatorentry = lookup_widget(mainwindow, "locatorentry"); |
184 |
} |
gtk_tree_model_get (model, &iter, LOCATOR, &temp, -1); |
185 |
} |
gtk_entry_set_text (GTK_ENTRY (locatorentry), temp); |
186 |
|
} |
187 |
|
remarksvbox = lookup_widget(mainwindow, "remarksvbox"); |
188 |
|
if (!g_ascii_strcasecmp (preferences.defaultremarks, "?") |
189 |
|
&& GTK_WIDGET_VISIBLE (remarksvbox)) |
190 |
|
{ |
191 |
|
remarksentry = lookup_widget(mainwindow, "remarksentry"); |
192 |
|
gtk_tree_model_get (model, &iter, REMARKS, &temp, -1); |
193 |
|
gtk_entry_set_text (GTK_ENTRY (remarksentry), temp); |
194 |
|
} |
195 |
|
found = TRUE; /* lookup only once */ |
196 |
|
} |
197 |
|
if (GTK_WIDGET_VISIBLE (b4dialog) && |
198 |
|
!g_ascii_strncasecmp (callsign, logcallsign, strlen (callsign))) |
199 |
|
{ /* worked b4 */ |
200 |
|
b4[0] = g_strdup (logw->logname); |
201 |
|
for (j = 0; j < QSO_FIELDS; j++) |
202 |
|
{ |
203 |
|
column = gtk_tree_view_get_column (GTK_TREE_VIEW(logw->treeview), j); |
204 |
|
if (gtk_tree_view_column_get_visible (column)) |
205 |
|
gtk_tree_model_get (model, &iter, j, &b4[j+1], -1); |
206 |
|
else b4[j+1] = g_strdup(""); |
207 |
|
} |
208 |
|
gtk_tree_store_prepend (GTK_TREE_STORE(b4model), &b4iter, NULL); |
209 |
|
for (j = 0; j < QSO_FIELDS + 1; j++) |
210 |
|
if (strlen(b4[j]) > 0) /* for responsiveness */ |
211 |
|
gtk_tree_store_set (GTK_TREE_STORE(b4model), &b4iter, j, b4[j], -1); |
212 |
|
} |
213 |
|
valid = gtk_tree_model_iter_next (model, &iter); |
214 |
|
} |
215 |
} |
} |
216 |
} |
} |
217 |
|
|
218 |
if (GTK_WIDGET_VISIBLE (b4dialog)) |
if (GTK_WIDGET_VISIBLE (b4dialog)) |
219 |
{ |
{ |
220 |
for (j = 0; j < 19; j++) |
for (j = 0; j < QSO_FIELDS + 1; j++) |
221 |
g_free (b4[j]); |
g_free (b4[j]); |
222 |
g_free (b4); |
g_free (b4); |
223 |
} |
} |
224 |
} |
} |
225 |
|
|
226 |
|
|
227 |
void |
void |
228 |
on_callentry_changed (GtkEditable * editable, gpointer user_data) |
on_callentry_changed (GtkEditable * editable, gpointer user_data) |
229 |
{ |
{ |
234 |
updatedxccframe (call); |
updatedxccframe (call); |
235 |
updateb4dialog_and_typeaheadfind (call); |
updateb4dialog_and_typeaheadfind (call); |
236 |
|
|
237 |
/* twpsk support */ |
/* twpsk support, if no IPC ID yet, create one */ |
238 |
if (state.shmid == -1) /* if no IPC ID yet, create one */ |
if (state.shmid == -1) |
239 |
{ |
{ |
240 |
if ((state.shmid = shmget (KEY, SHMSIZE, IPC_CREAT | 0600)) < 0) |
if ((state.shmid = shmget (KEY, SHMSIZE, IPC_CREAT | 0600)) < 0) |
241 |
{ |
{ |
304 |
GString *digits = g_string_new ("");; |
GString *digits = g_string_new ("");; |
305 |
|
|
306 |
entry = lookup_widget (mainwindow, "bandentry"); |
entry = lookup_widget (mainwindow, "bandentry"); |
307 |
if (g_strcasecmp (preferences.defaultmhz, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
308 |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmhz); |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmhz); |
309 |
else |
else |
310 |
{ |
{ |
311 |
if (state.rigfrequency != 0) |
if (state.rigfrequency != 0) |
312 |
{ |
{ |
313 |
if (preferences.round == 0) |
if (preferences.round == 0) |
314 |
g_string_sprintf (digits, "%Ld", state.rigfrequency); |
g_string_printf (digits, "%Ld", state.rigfrequency); |
315 |
else |
else |
316 |
g_string_sprintf (digits, "%Ld", |
g_string_printf (digits, "%Ld", |
317 |
(long long) rintl (state.rigfrequency / |
(long long) rintl (state.rigfrequency / |
318 |
pow (10, |
pow (10, |
319 |
preferences.round))); |
preferences.round))); |
324 |
} |
} |
325 |
else |
else |
326 |
{ |
{ |
327 |
g_string_sprintf (digits, "UNKNOWN"); |
g_string_printf (digits, "UNKNOWN"); |
328 |
} |
} |
329 |
gtk_entry_set_text (GTK_ENTRY (entry), digits->str); |
gtk_entry_set_text (GTK_ENTRY (entry), digits->str); |
330 |
g_string_free (digits, TRUE); |
g_string_free (digits, TRUE); |
338 |
gchar *mode; |
gchar *mode; |
339 |
|
|
340 |
entry = lookup_widget (mainwindow, "modeentry"); |
entry = lookup_widget (mainwindow, "modeentry"); |
341 |
if (g_strcasecmp (preferences.defaultmode, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmode, "?")) |
342 |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode); |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultmode); |
343 |
else |
else |
344 |
{ |
{ |
354 |
GtkWidget *entry; |
GtkWidget *entry; |
355 |
|
|
356 |
entry = lookup_widget (mainwindow, "rstentry"); |
entry = lookup_widget (mainwindow, "rstentry"); |
357 |
if (g_strcasecmp (preferences.defaulttxrst, "?")) |
if (g_ascii_strcasecmp (preferences.defaulttxrst, "?")) |
358 |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaulttxrst); |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaulttxrst); |
359 |
else if (state.rigrst != 0) |
else if (state.rigrst != 0) |
360 |
gtk_entry_set_text (GTK_ENTRY (entry), state.rigrst); |
gtk_entry_set_text (GTK_ENTRY (entry), state.rigrst); |
369 |
gchar *rigpower; |
gchar *rigpower; |
370 |
|
|
371 |
entry = lookup_widget (mainwindow, "powerentry"); |
entry = lookup_widget (mainwindow, "powerentry"); |
372 |
if (g_strcasecmp (preferences.defaultpower, "?")) |
if (g_ascii_strcasecmp (preferences.defaultpower, "?")) |
373 |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultpower); |
gtk_entry_set_text (GTK_ENTRY (entry), preferences.defaultpower); |
374 |
else if (state.rigpower != 0) |
else if (state.rigpower != 0) |
375 |
{ |
{ |
382 |
} |
} |
383 |
#endif |
#endif |
384 |
|
|
|
/* right click with mouse button */ |
|
|
gboolean |
|
|
on_qsoframeeventbox_button_press_event (GtkWidget * widget, |
|
|
GdkEventButton * event, |
|
|
gpointer user_data) |
|
|
{ |
|
|
if (event->button != 1) |
|
|
{ |
|
|
gtk_menu_popup (GTK_MENU (create_qsoframemenu ()), NULL, NULL, NULL, |
|
|
NULL, 1, 0); |
|
|
return TRUE; |
|
|
} |
|
|
return FALSE; |
|
|
} |
|
385 |
|
|
386 |
/* POP-UP MENU: clear all the fields in the qso frame */ |
/* POP-UP MENU: clear all the fields in the qso frame */ |
387 |
|
|
388 |
void |
void |
389 |
on_clearframe_activate (GtkMenuItem * menuitem, gpointer user_data) |
on_clearframe_activate (GtkMenuItem * menuitem, gpointer user_data) |
390 |
{ |
{ |
392 |
*remarksentry, *modeentry, *bandentry, *incheckbutton, *outcheckbutton, |
*remarksentry, *modeentry, *bandentry, *incheckbutton, *outcheckbutton, |
393 |
*endentry, *powerentry, *nameentry, *qthentry, *locatorentry, |
*endentry, *powerentry, *nameentry, *qthentry, *locatorentry, |
394 |
*unknownentry1, *unknownentry2, *modeoptionmenu, *bandoptionmenu, |
*unknownentry1, *unknownentry2, *modeoptionmenu, *bandoptionmenu, |
395 |
*qsoframe, *locatorframe, *datebutton; |
*qsoframe, *locatorframe, *datebutton, *framelabel; |
|
gchar *frametext; |
|
396 |
logtype *logwindow; |
logtype *logwindow; |
397 |
gint i; |
gint i; |
398 |
|
GtkTreeIter selected; |
399 |
|
GtkTreeModel *model; |
400 |
|
|
401 |
dateentry = lookup_widget (mainwindow, "dateentry"); |
dateentry = lookup_widget (mainwindow, "dateentry"); |
402 |
gmtentry = lookup_widget (mainwindow, "gmtentry"); |
gmtentry = lookup_widget (mainwindow, "gmtentry"); |
421 |
for (i = 0; i < g_list_length (logwindowlist); i++) |
for (i = 0; i < g_list_length (logwindowlist); i++) |
422 |
{ |
{ |
423 |
logwindow = g_list_nth_data (logwindowlist, i); |
logwindow = g_list_nth_data (logwindowlist, i); |
424 |
while (GTK_CLIST (logwindow->clist)->selection) |
if (gtk_tree_selection_get_selected |
425 |
gtk_clist_unselect_all (GTK_CLIST (logwindow->clist)); |
(gtk_tree_view_get_selection (GTK_TREE_VIEW(logwindow->treeview)), |
426 |
|
&model, &selected)) |
427 |
|
gtk_tree_selection_unselect_all (gtk_tree_view_get_selection |
428 |
|
(GTK_TREE_VIEW (logwindow->treeview))); |
429 |
} |
} |
430 |
datebutton = lookup_widget (mainwindow, "datebutton"); |
datebutton = lookup_widget (mainwindow, "datebutton"); |
431 |
gtk_widget_grab_focus (datebutton); |
gtk_widget_grab_focus (datebutton); |
451 |
gtk_editable_delete_text (GTK_EDITABLE (unknownentry2), 0, -1); |
gtk_editable_delete_text (GTK_EDITABLE (unknownentry2), 0, -1); |
452 |
|
|
453 |
qsoframe = lookup_widget (mainwindow, "qsoframe"); |
qsoframe = lookup_widget (mainwindow, "qsoframe"); |
454 |
frametext = g_strdup_printf (_("New QSO")); |
framelabel = gtk_frame_get_label_widget (GTK_FRAME(qsoframe)); |
455 |
gtk_frame_set_label (GTK_FRAME (qsoframe), frametext); |
gtk_label_set_text (GTK_LABEL (framelabel), _("New QSO")); |
|
g_free (frametext); |
|
456 |
|
|
457 |
locatorframe = lookup_widget (mainwindow, "locatorframe"); |
locatorframe = lookup_widget (mainwindow, "locatorframe"); |
458 |
if (GTK_WIDGET_VISIBLE (locatorframe)) |
if (GTK_WIDGET_VISIBLE (locatorframe)) |
459 |
{ |
{ |
460 |
frametext = g_strdup_printf (_("Locator")); |
locatorframe = lookup_widget (mainwindow, "locatorframe"); |
461 |
gtk_frame_set_label (GTK_FRAME (locatorframe), frametext); |
framelabel = gtk_frame_get_label_widget (GTK_FRAME(qsoframe)); |
462 |
g_free (frametext); |
gtk_label_set_text (GTK_LABEL (framelabel), _("Locator")); |
463 |
} |
} |
464 |
} |
} |
465 |
|
|
477 |
|
|
478 |
datebutton = lookup_widget (mainwindow, "datebutton"); |
datebutton = lookup_widget (mainwindow, "datebutton"); |
479 |
gmtbutton = lookup_widget (mainwindow, "gmtbutton"); |
gmtbutton = lookup_widget (mainwindow, "gmtbutton"); |
480 |
gtk_signal_emit_by_name (GTK_OBJECT (datebutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (datebutton), "clicked"); |
481 |
gtk_signal_emit_by_name (GTK_OBJECT (gmtbutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (gmtbutton), "clicked"); |
482 |
endhbox = lookup_widget (mainwindow, "endhbox"); |
endhbox = lookup_widget (mainwindow, "endhbox"); |
483 |
if (GTK_WIDGET_VISIBLE (endhbox)) |
if (GTK_WIDGET_VISIBLE (endhbox)) |
484 |
{ |
{ |
485 |
endbutton = lookup_widget (mainwindow, "endbutton"); |
endbutton = lookup_widget (mainwindow, "endbutton"); |
486 |
gtk_signal_emit_by_name (GTK_OBJECT (endbutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (endbutton), "clicked"); |
487 |
} |
} |
488 |
#if WANT_HAMLIB |
#if WANT_HAMLIB |
489 |
if (preferences.hamlib > 0) |
if (preferences.hamlib > 0) |
491 |
mhzbutton = lookup_widget (mainwindow, "mhzbutton"); |
mhzbutton = lookup_widget (mainwindow, "mhzbutton"); |
492 |
modebutton = lookup_widget (mainwindow, "modebutton"); |
modebutton = lookup_widget (mainwindow, "modebutton"); |
493 |
rstbutton = lookup_widget (mainwindow, "rstbutton"); |
rstbutton = lookup_widget (mainwindow, "rstbutton"); |
494 |
gtk_signal_emit_by_name (GTK_OBJECT (mhzbutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (mhzbutton), "clicked"); |
495 |
gtk_signal_emit_by_name (GTK_OBJECT (modebutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (modebutton), "clicked"); |
496 |
gtk_signal_emit_by_name (GTK_OBJECT (rstbutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (rstbutton), "clicked"); |
497 |
powerhbox = lookup_widget (mainwindow, "powerhbox"); |
powerhbox = lookup_widget (mainwindow, "powerhbox"); |
498 |
if (GTK_WIDGET_VISIBLE (powerhbox)) |
if (GTK_WIDGET_VISIBLE (powerhbox)) |
499 |
{ |
{ |
500 |
powerbutton = lookup_widget (mainwindow, "powerbutton"); |
powerbutton = lookup_widget (mainwindow, "powerbutton"); |
501 |
gtk_signal_emit_by_name (GTK_OBJECT (powerbutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (powerbutton), "clicked"); |
502 |
} |
} |
503 |
} |
} |
504 |
#else |
#else |
505 |
/* set defaults */ |
/* set defaults */ |
506 |
if (g_strcasecmp (preferences.defaultmhz, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
507 |
{ |
{ |
508 |
bandentry = lookup_widget (mainwindow, "bandentry"); |
bandentry = lookup_widget (mainwindow, "bandentry"); |
509 |
gtk_entry_set_text (GTK_ENTRY (bandentry), preferences.defaultmhz); |
gtk_entry_set_text (GTK_ENTRY (bandentry), preferences.defaultmhz); |
510 |
} |
} |
511 |
if (g_strcasecmp (preferences.defaultmode, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmode, "?")) |
512 |
{ |
{ |
513 |
modeentry = lookup_widget (mainwindow, "modeentry"); |
modeentry = lookup_widget (mainwindow, "modeentry"); |
514 |
gtk_entry_set_text (GTK_ENTRY (modeentry), preferences.defaultmode); |
gtk_entry_set_text (GTK_ENTRY (modeentry), preferences.defaultmode); |
515 |
} |
} |
516 |
if (g_strcasecmp (preferences.defaulttxrst, "?")) |
if (g_ascii_strcasecmp (preferences.defaulttxrst, "?")) |
517 |
{ |
{ |
518 |
rstentry = lookup_widget (mainwindow, "rstentry"); |
rstentry = lookup_widget (mainwindow, "rstentry"); |
519 |
gtk_entry_set_text (GTK_ENTRY (rstentry), preferences.defaulttxrst); |
gtk_entry_set_text (GTK_ENTRY (rstentry), preferences.defaulttxrst); |
520 |
} |
} |
521 |
powerhbox = lookup_widget (mainwindow, "powerhbox"); |
powerhbox = lookup_widget (mainwindow, "powerhbox"); |
522 |
if (GTK_WIDGET_VISIBLE (powerhbox) |
if (GTK_WIDGET_VISIBLE (powerhbox) |
523 |
&& g_strcasecmp (preferences.defaultpower, "?")) |
&& g_ascii_strcasecmp (preferences.defaultpower, "?")) |
524 |
{ |
{ |
525 |
powerentry = lookup_widget (mainwindow, "powerentry"); |
powerentry = lookup_widget (mainwindow, "powerentry"); |
526 |
gtk_entry_set_text (GTK_ENTRY (powerentry), preferences.defaultpower); |
gtk_entry_set_text (GTK_ENTRY (powerentry), preferences.defaultpower); |
528 |
#endif |
#endif |
529 |
|
|
530 |
/* set defaults */ |
/* set defaults */ |
531 |
if (g_strcasecmp (preferences.defaultrxrst, "?")) |
if (g_ascii_strcasecmp (preferences.defaultrxrst, "?")) |
532 |
{ |
{ |
533 |
myrstentry = lookup_widget (mainwindow, "myrstentry"); |
myrstentry = lookup_widget (mainwindow, "myrstentry"); |
534 |
gtk_entry_set_text (GTK_ENTRY (myrstentry), preferences.defaultrxrst); |
gtk_entry_set_text (GTK_ENTRY (myrstentry), preferences.defaultrxrst); |
535 |
} |
} |
536 |
unknown1hbox = lookup_widget (mainwindow, "unknown1hbox"); |
unknown1hbox = lookup_widget (mainwindow, "unknown1hbox"); |
537 |
if (GTK_WIDGET_VISIBLE (unknown1hbox) |
if (GTK_WIDGET_VISIBLE (unknown1hbox) |
538 |
&& g_strcasecmp (preferences.defaultfreefield1, "?")) |
&& g_ascii_strcasecmp (preferences.defaultfreefield1, "?")) |
539 |
{ |
{ |
540 |
unknownentry1 = lookup_widget (mainwindow, "unknownentry1"); |
unknownentry1 = lookup_widget (mainwindow, "unknownentry1"); |
541 |
gtk_entry_set_text (GTK_ENTRY (unknownentry1), |
gtk_entry_set_text (GTK_ENTRY (unknownentry1), |
543 |
} |
} |
544 |
unknown2hbox = lookup_widget (mainwindow, "unknown2hbox"); |
unknown2hbox = lookup_widget (mainwindow, "unknown2hbox"); |
545 |
if (GTK_WIDGET_VISIBLE (unknown2hbox) |
if (GTK_WIDGET_VISIBLE (unknown2hbox) |
546 |
&& g_strcasecmp (preferences.defaultfreefield2, "?")) |
&& g_ascii_strcasecmp (preferences.defaultfreefield2, "?")) |
547 |
{ |
{ |
548 |
unknownentry2 = lookup_widget (mainwindow, "unknownentry2"); |
unknownentry2 = lookup_widget (mainwindow, "unknownentry2"); |
549 |
gtk_entry_set_text (GTK_ENTRY (unknownentry2), |
gtk_entry_set_text (GTK_ENTRY (unknownentry2), |
551 |
} |
} |
552 |
remarksvbox = lookup_widget (mainwindow, "remarksvbox"); |
remarksvbox = lookup_widget (mainwindow, "remarksvbox"); |
553 |
if (GTK_WIDGET_VISIBLE (remarksvbox) |
if (GTK_WIDGET_VISIBLE (remarksvbox) |
554 |
&& g_strcasecmp (preferences.defaultremarks, "?")) |
&& g_ascii_strcasecmp (preferences.defaultremarks, "?")) |
555 |
{ |
{ |
556 |
remarksentry = lookup_widget (mainwindow, "remarksentry"); |
remarksentry = lookup_widget (mainwindow, "remarksentry"); |
557 |
gtk_entry_set_text (GTK_ENTRY (remarksentry), |
gtk_entry_set_text (GTK_ENTRY (remarksentry), |