143 |
void cw (GtkButton *button, gpointer user_data) |
void cw (GtkButton *button, gpointer user_data) |
144 |
{ |
{ |
145 |
GtkWidget *entry, *callentry; |
GtkWidget *entry, *callentry; |
146 |
gchar *entryname, *sendstr, *call; |
gchar *entryname, *sendstr, *call, *p; |
147 |
gint result = 0; |
gint result = 0; |
148 |
|
|
149 |
entryname = g_strdup_printf("%sentry", (gchar *)user_data); |
entryname = g_strdup_printf("%sentry", (gchar *)user_data); |
154 |
call = gtk_editable_get_chars (GTK_EDITABLE (callentry), 0, -1); |
call = gtk_editable_get_chars (GTK_EDITABLE (callentry), 0, -1); |
155 |
if (strlen (sendstr) > 0) |
if (strlen (sendstr) > 0) |
156 |
{ |
{ |
157 |
my_strreplace (sendstr, "%", preferences.callsign); |
sendstr = my_strreplace (sendstr, "%", preferences.callsign); |
158 |
my_strreplace (sendstr, "@", call); |
if (strlen (call) > 0) |
159 |
|
{ |
160 |
|
|
161 |
|
sendstr = my_strreplace (sendstr, "@", call); |
162 |
|
g_free (call); |
163 |
|
} |
164 |
|
else |
165 |
|
sendstr = my_strreplace (sendstr, "@", "?"); |
166 |
result = tonetkeyer (K_MESSAGE, sendstr); |
result = tonetkeyer (K_MESSAGE, sendstr); |
167 |
if (result == -1) |
if (result == -1) |
168 |
update_statusbar (_("Send to cwdaemon failed")); |
update_statusbar (_("Send to cwdaemon failed")); |
169 |
|
g_free (sendstr); |
170 |
} |
} |
|
g_free (call); |
|
|
g_free (sendstr); |
|
171 |
g_free (entryname); |
g_free (entryname); |
172 |
} |
} |
173 |
|
|