219 |
if (result < 0) update_statusbar (_("Keyer send failed")); |
if (result < 0) update_statusbar (_("Keyer send failed")); |
220 |
} |
} |
221 |
|
|
|
/* do we run a contest? */ |
|
|
static void |
|
|
on_contest_toggled (GtkToggleButton * togglebutton, gpointer user_data) |
|
|
{ |
|
|
state.contest = gtk_toggle_button_get_active (togglebutton); |
|
|
} |
|
|
|
|
222 |
/* activate keyer window and initialize UDP socket */ |
/* activate keyer window and initialize UDP socket */ |
223 |
void on_keyer_activate (GtkMenuItem * menuitem, gpointer user_data) |
void on_keyer_activate (GtkMenuItem * menuitem, gpointer user_data) |
224 |
{ |
{ |
225 |
GtkWidget *keyervbox, *hbox1, *hbox2, *hbox3, *hbox4, *hbox5, *hbox6, |
GtkWidget *keyervbox, *hbox1, *hbox2, *hbox3, *hbox4, *hbox5, *hbox6, |
226 |
*hbox7, *hsep, *f1button, *f1entry, *f6button, *f6entry, |
*hsep, *f1button, *f1entry, *f6button, *f6entry, |
227 |
*f2button, *f2entry, *f7button, *f7entry, *f3button, *f3entry, |
*f2button, *f2entry, *f7button, *f7entry, *f3button, *f3entry, |
228 |
*f8button, *f8entry, *f4button, *f4entry, *f9button, *f9entry, |
*f8button, *f8entry, *f4button, *f4entry, *f9button, *f9entry, |
229 |
*f5button, *f5entry, *f10button, *f10entry, *scrolledkeyerwindow, |
*f5button, *f5entry, *f10button, *f10entry, *scrolledkeyerwindow, |
230 |
*keyertext, *wpm, *wpmcountlabel, *count, *stopbutton, |
*keyertext, *wpm, *wpmcountlabel, *count, *stopbutton; |
|
*contestcheckbutton, *checkstopbutton, *checkbutton9, *checkbutton0; |
|
231 |
GtkObject *wpm_adj, *count_adj; |
GtkObject *wpm_adj, *count_adj; |
232 |
GdkPixbuf *keyer_icon_pixbuf; |
GdkPixbuf *keyer_icon_pixbuf; |
233 |
GtkTextBuffer *buffer; |
GtkTextBuffer *buffer; |
334 |
hsep = gtk_hseparator_new (); |
hsep = gtk_hseparator_new (); |
335 |
gtk_box_pack_start (GTK_BOX (keyervbox), hsep, TRUE, TRUE, 3); |
gtk_box_pack_start (GTK_BOX (keyervbox), hsep, TRUE, TRUE, 3); |
336 |
|
|
|
hbox7 = gtk_hbox_new (TRUE, 0); |
|
|
gtk_box_pack_start (GTK_BOX (keyervbox), hbox7, FALSE, FALSE, 0); |
|
|
contestcheckbutton = gtk_check_button_new_with_label ("Contest"); |
|
|
gtk_box_pack_start (GTK_BOX (hbox7), contestcheckbutton, FALSE, FALSE, 0); |
|
|
// checkstopbutton = gtk_check_button_new_with_label ("1=a, 2=u"); |
|
|
// gtk_box_pack_start (GTK_BOX (hbox7), checkstopbutton, FALSE, FALSE, 0); |
|
|
// checkbutton9 = gtk_check_button_new_with_label ("9=n"); |
|
|
// gtk_box_pack_start (GTK_BOX (hbox7), checkbutton9, FALSE, FALSE, 0); |
|
|
// checkbutton0 = gtk_check_button_new_with_label ("0=t"); |
|
|
// gtk_box_pack_start (GTK_BOX (hbox7), checkbutton0, FALSE, FALSE, 0); |
|
|
|
|
337 |
scrolledkeyerwindow = gtk_scrolled_window_new (NULL, NULL); |
scrolledkeyerwindow = gtk_scrolled_window_new (NULL, NULL); |
338 |
gtk_box_pack_end (GTK_BOX (keyervbox), scrolledkeyerwindow, FALSE, TRUE, 0); |
gtk_box_pack_end (GTK_BOX (keyervbox), scrolledkeyerwindow, FALSE, TRUE, 0); |
339 |
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledkeyerwindow), |
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledkeyerwindow), |
424 |
g_signal_connect (G_OBJECT (wpm), "value_changed", G_CALLBACK (change_wpm), NULL); |
g_signal_connect (G_OBJECT (wpm), "value_changed", G_CALLBACK (change_wpm), NULL); |
425 |
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(keyertext)); |
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(keyertext)); |
426 |
g_signal_connect (G_OBJECT(buffer), "insert-text", G_CALLBACK (send_text), NULL); |
g_signal_connect (G_OBJECT(buffer), "insert-text", G_CALLBACK (send_text), NULL); |
|
g_signal_connect (G_OBJECT (contestcheckbutton), "toggled", |
|
|
G_CALLBACK (on_contest_toggled), NULL); |
|
427 |
|
|
428 |
gtk_widget_show_all (keyerwindow); |
gtk_widget_show_all (keyerwindow); |
429 |
} |
} |