48 |
|
|
49 |
extern GtkWidget *mainwindow; |
extern GtkWidget *mainwindow; |
50 |
extern GtkWidget *mainnotebook; |
extern GtkWidget *mainnotebook; |
51 |
|
extern GtkWidget *keyerwindow; |
52 |
extern preferencestype preferences; |
extern preferencestype preferences; |
53 |
extern GList *logwindowlist; |
extern GList *logwindowlist; |
54 |
|
|
194 |
GtkWidget *datebutton, *gmtbutton, *endbutton, *endhbox, |
GtkWidget *datebutton, *gmtbutton, *endbutton, *endhbox, |
195 |
*myrstentry, *unknown1hbox, *unknown2hbox, *unknownentry1, *unknownentry2, |
*myrstentry, *unknown1hbox, *unknown2hbox, *unknownentry1, *unknownentry2, |
196 |
*remarksvbox, *remarksentry, *bandentry, *modeentry, *rstentry, *powerhbox, |
*remarksvbox, *remarksentry, *bandentry, *modeentry, *rstentry, *powerhbox, |
197 |
*powerentry, *endentry, *callentry; |
*powerentry, *endentry, *callentry, *count; |
198 |
|
gint c; |
199 |
|
gchar *countstr, *str; |
200 |
#if WANT_HAMLIB |
#if WANT_HAMLIB |
201 |
GtkWidget *mhzbutton, *modebutton, *rstbutton, *powerbutton; |
GtkWidget *mhzbutton, *modebutton, *rstbutton, *powerbutton; |
202 |
#endif |
#endif |
223 |
powerentry = lookup_widget (mainwindow, "powerentry"); |
powerentry = lookup_widget (mainwindow, "powerentry"); |
224 |
#if WANT_HAMLIB |
#if WANT_HAMLIB |
225 |
if (preferences.hamlib > 0) |
if (preferences.hamlib > 0) |
226 |
{ /* when polling use state struct else retrieve info from |
{ /* when polling use state struct else retrieve info from |
227 |
the rig one by one */ |
the rig one by one */ |
228 |
if (preferences.polltime == 0) get_riginfo(); |
if (preferences.polltime == 0) get_riginfo(); |
229 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (bandentry), 0, -1)) == 0) |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (bandentry), 0, -1)) == 0) |
230 |
{ |
{ |
231 |
mhzbutton = lookup_widget (mainwindow, "mhzbutton"); |
mhzbutton = lookup_widget (mainwindow, "mhzbutton"); |
232 |
g_signal_emit_by_name (G_OBJECT (mhzbutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (mhzbutton), "clicked"); |
233 |
} |
} |
234 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (modeentry), 0, -1)) == 0) |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (modeentry), 0, -1)) == 0) |
235 |
{ |
{ |
236 |
modebutton = lookup_widget (mainwindow, "modebutton"); |
modebutton = lookup_widget (mainwindow, "modebutton"); |
237 |
g_signal_emit_by_name (G_OBJECT (modebutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (modebutton), "clicked"); |
238 |
} |
} |
239 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (rstentry), 0, -1)) == 0) |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (rstentry), 0, -1)) == 0) |
240 |
{ |
{ |
241 |
rstbutton = lookup_widget (mainwindow, "rstbutton"); |
rstbutton = lookup_widget (mainwindow, "rstbutton"); |
242 |
g_signal_emit_by_name (G_OBJECT (rstbutton), "clicked"); |
g_signal_emit_by_name (G_OBJECT (rstbutton), "clicked"); |
243 |
} |
} |
244 |
if (GTK_WIDGET_VISIBLE (powerhbox)) |
if (GTK_WIDGET_VISIBLE (powerhbox)) |
245 |
|
{ |
246 |
|
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (powerentry), 0, -1)) == 0) |
247 |
{ |
{ |
248 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (powerentry), 0, -1)) |
powerbutton = lookup_widget (mainwindow, "powerbutton"); |
249 |
== 0) |
g_signal_emit_by_name (G_OBJECT (powerbutton), "clicked"); |
|
{ |
|
|
powerbutton = lookup_widget (mainwindow, "powerbutton"); |
|
|
g_signal_emit_by_name (G_OBJECT (powerbutton), "clicked"); |
|
|
} |
|
250 |
} |
} |
251 |
} |
} |
252 |
|
} |
253 |
else |
else |
254 |
{ |
{ |
255 |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
if (g_ascii_strcasecmp (preferences.defaultmhz, "?")) |
260 |
gtk_entry_set_text (GTK_ENTRY (modeentry), preferences.defaultmode); |
gtk_entry_set_text (GTK_ENTRY (modeentry), preferences.defaultmode); |
261 |
if (g_ascii_strcasecmp (preferences.defaulttxrst, "?")) |
if (g_ascii_strcasecmp (preferences.defaulttxrst, "?")) |
262 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (rstentry), 0, -1)) == 0) |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (rstentry), 0, -1)) == 0) |
263 |
gtk_entry_set_text (GTK_ENTRY (rstentry), preferences.defaulttxrst); |
{ |
264 |
|
if (keyerwindow && g_strrstr (preferences.defaulttxrst, "#")) |
265 |
|
{ |
266 |
|
count = lookup_widget (keyerwindow, "count"); |
267 |
|
c = gtk_spin_button_get_value (GTK_SPIN_BUTTON(count)); |
268 |
|
if (c < 10) |
269 |
|
countstr = g_strdup_printf ("00%d", c); |
270 |
|
else if (c < 100) |
271 |
|
countstr = g_strdup_printf ("0%d", c); |
272 |
|
else |
273 |
|
countstr = g_strdup_printf ("%d", c); |
274 |
|
str = my_strreplace (preferences.defaulttxrst, "#", countstr); |
275 |
|
g_free (countstr); |
276 |
|
gtk_entry_set_text (GTK_ENTRY (rstentry), str); |
277 |
|
g_free (str); |
278 |
|
} |
279 |
|
else |
280 |
|
gtk_entry_set_text (GTK_ENTRY (rstentry), preferences.defaulttxrst); |
281 |
|
} |
282 |
if (GTK_WIDGET_VISIBLE (powerhbox) && g_ascii_strcasecmp (preferences.defaultpower, "?")) |
if (GTK_WIDGET_VISIBLE (powerhbox) && g_ascii_strcasecmp (preferences.defaultpower, "?")) |
283 |
{ |
{ |
284 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (powerentry), 0, -1)) == 0) |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (powerentry), 0, -1)) == 0) |
295 |
gtk_entry_set_text (GTK_ENTRY (modeentry), preferences.defaultmode); |
gtk_entry_set_text (GTK_ENTRY (modeentry), preferences.defaultmode); |
296 |
if (g_ascii_strcasecmp (preferences.defaulttxrst, "?")) |
if (g_ascii_strcasecmp (preferences.defaulttxrst, "?")) |
297 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (rstentry), 0, -1)) == 0) |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (rstentry), 0, -1)) == 0) |
298 |
gtk_entry_set_text (GTK_ENTRY (rstentry), preferences.defaulttxrst); |
{ |
299 |
|
if (keyerwindow && g_strrstr (preferences.defaulttxrst, "#")) |
300 |
|
{ |
301 |
|
count = lookup_widget (keyerwindow, "count"); |
302 |
|
c = gtk_spin_button_get_value (GTK_SPIN_BUTTON(count)); |
303 |
|
if (c < 10) |
304 |
|
countstr = g_strdup_printf ("00%d", c); |
305 |
|
else if (c < 100) |
306 |
|
countstr = g_strdup_printf ("0%d", c); |
307 |
|
else |
308 |
|
countstr = g_strdup_printf ("%d", c); |
309 |
|
str = my_strreplace (preferences.defaulttxrst, "#", countstr); |
310 |
|
g_free (countstr); |
311 |
|
gtk_entry_set_text (GTK_ENTRY (rstentry), str); |
312 |
|
g_free (str); |
313 |
|
} |
314 |
|
else |
315 |
|
gtk_entry_set_text (GTK_ENTRY (rstentry), preferences.defaulttxrst); |
316 |
|
} |
317 |
if (GTK_WIDGET_VISIBLE (powerhbox) && g_ascii_strcasecmp (preferences.defaultpower, "?")) |
if (GTK_WIDGET_VISIBLE (powerhbox) && g_ascii_strcasecmp (preferences.defaultpower, "?")) |
318 |
{ |
{ |
319 |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (powerentry), 0, -1)) == 0) |
if (strlen(gtk_editable_get_chars (GTK_EDITABLE (powerentry), 0, -1)) == 0) |