1 // =====================================================================
2 //
3 // flamp_dialog.cxx
4 //
5 // Author(s):
6 //	Dave Freese, W1HKJ, Copyright (C) 2010, 2011, 2012, 2013
7 //  Robert Stiles, KK5VD, Copyright (C) 2013, 2014, 2015
8 //
9 // This file is part of FLAMP.
10 //
11 // This is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This software is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 //
24 // =====================================================================
25 
26 #include <math.h>
27 
28 #include "config.h"
29 
30 #include "gettext.h"
31 #include "flamp_dialog.h"
32 #include "status.h"
33 #include "flamp.h"
34 #include "fileselect.h"
35 #include "debug.h"
36 #include "icons.h"
37 
38 #include "xml_io.h"
39 #include "file_io.h"
40 #include "amp.h"
41 #include "ztimer.h"
42 #include "time_table.h"
43 
44 #include "hamcast_group.h"
45 
46 //======================================================================
47 
48 Fl_Double_Window * main_window = 0;
49 Fl_Double_Window * wCmdLine    = 0;
50 
51 Fl_Tabs  * tabs       = 0;
52 Fl_Group * Config_tab = 0;
53 
54 Fl_Output * txt_rx_blocksize = 0;
55 Fl_Output * txt_rx_callinfo  = 0;
56 Fl_Output * txt_rx_datetime  = 0;
57 Fl_Output * txt_rx_descrip   = 0;
58 Fl_Output * txt_rx_filename  = 0;
59 Fl_Output * txt_rx_filesize  = 0;
60 Fl_Output * txt_rx_missing_blocks = 0;
61 Fl_Output * txt_rx_numblocks = 0;
62 
63 Fl_Button * btn_parse_blocks = 0;
64 
65 Fl_BlockMap * rx_progress  = 0;
66 
67 FTextView * txt_rx_output  = 0;
68 Fl_Hold_Browser * rx_queue = 0;
69 
70 Fl_Input2 * txt_tx_mycall  = 0;
71 Fl_Input2 * txt_tx_myinfo  = 0;
72 Fl_Input2 * txt_tx_send_to = 0;
73 Fl_Simple_Counter * cnt_blocksize     = 0;
74 Fl_Simple_Counter * cnt_repeat_header = 0;
75 Fl_Simple_Counter * cnt_repeat_nbr    = 0;
76 
77 Fl_Check_Button * btn_use_compression = 0;
78 Fl_ComboBox *     cbo_modes           = 0;
79 Fl_ComboBox *     encoders            = 0;
80 Fl_Hold_Browser * tx_queue            = 0;
81 Fl_Input *        drop_file           = 0;
82 Fl_Input2 *       txt_tx_descrip      = 0;
83 Fl_Output *       txt_transfer_size_time = 0;
84 Fl_Output *       txt_tx_filename     = 0;
85 Fl_Output *       txt_tx_numblocks    = 0;
86 
87 Fl_Button * btn_copy_missing = 0;
88 Fl_Button * btn_open_file    = 0;
89 Fl_Button * btn_rx_remove    = 0;
90 Fl_Button * btn_rxq_to_txq   = 0;
91 Fl_Button * btn_save_file    = 0;
92 
93 Fl_Button * btn_send_file      = 0;
94 Fl_Button * btn_send_queue     = 0;
95 Fl_Button * btn_tx_remove_file = 0;
96 
97 Fl_Button * btn_parse_relay_blocks    = 0;
98 Fl_Button * btn_send_relay            = 0;
99 Fl_Input2 * txt_relay_selected_blocks = 0;
100 Fl_Check_Button * btn_auto_rx_save = 0;
101 
102 
103 // Configuraton panel
104 
105 Fl_Check_Button * btn_fldigi_xmt_mode_change = 0;
106 Fl_Check_Button * btn_sync_mode_flamp_fldigi = 0;
107 Fl_Check_Button * btn_sync_mode_fldigi_flamp = 0;
108 
109 Fl_Check_Button * btn_disable_header_modem_on_block_fills = 0;
110 Fl_Check_Button * btn_enable_header_modem  = 0;
111 Fl_Check_Button * btn_enable_tx_unproto    = 0;
112 #if 0
113 Fl_Check_Button * btn_queue_fills_only     = 0;
114 #endif
115 Fl_Check_Button * btn_enable_txrx_interval = 0;
116 Fl_ComboBox *     cbo_header_modes         = 0;
117 
118 Fl_Counter        * cnt_tx_interval_mins = 0;
119 Fl_Output         * txt_tx_interval = 0;
120 Fl_Simple_Counter * cnt_rx_interval_secs = 0;
121 
122 Fl_Check_Button * btn_clear_tosend_on_tx_blocks = 0;
123 Fl_Check_Button * btn_enable_delete_warning     = 0;
124 Fl_Check_Button * btn_enable_tx_on_report       = 0;
125 Fl_Check_Button * btn_enable_unproto_markers    = 0;
126 
127 Fl_Check_Button * btn_auto_rx_save_local_time   = 0;
128 
129 // end Configuration panel.
130 
131 // Event panel
132 
133 Fl_Check_Button * btn_repeat_at_times = 0;
134 Fl_ComboBox *     cbo_repeat_every    = 0;
135 Fl_Input2 *       txt_repeat_times    = 0;
136 
137 Fl_Button *       btn_manual_load_queue    = 0;
138 Fl_Check_Button * btn_auto_load_queue      = 0;
139 Fl_Check_Button * btn_load_from_tx_folder  = 0;
140 Fl_Input2 *       txt_auto_load_queue_path = 0;
141 
142 Fl_Check_Button * btn_repeat_forever = 0;
143 Fl_Light_Button * do_events = 0;
144 
145 Fl_Output* outTimeValue = 0;
146 
147 // Hamcast Event subpanel panel
148 
149 Fl_Check_Button * btn_hamcast_mode_cycle = 0;
150 
151 Fl_Check_Button *   btn_hamcast_mode_enable_1           = 0;
152 Fl_ComboBox *       cbo_hamcast_mode_selection_1        = 0;
153 Fl_Output *         txt_hamcast_select_1_time           = 0;
154 Fl_Simple_Counter * cnt_hamcast_mode_selection_repeat_1 = 0;
155 
156 Fl_Check_Button *   btn_hamcast_mode_enable_2           = 0;
157 Fl_ComboBox *       cbo_hamcast_mode_selection_2        = 0;
158 Fl_Output *         txt_hamcast_select_2_time           = 0;
159 Fl_Simple_Counter * cnt_hamcast_mode_selection_repeat_2 = 0;
160 
161 Fl_Check_Button *   btn_hamcast_mode_enable_3           = 0;
162 Fl_ComboBox *       cbo_hamcast_mode_selection_3        = 0;
163 Fl_Output *         txt_hamcast_select_3_time           = 0;
164 Fl_Simple_Counter * cnt_hamcast_mode_selection_repeat_3 = 0;
165 
166 Fl_Check_Button *   btn_hamcast_mode_enable_4           = 0;
167 Fl_ComboBox *       cbo_hamcast_mode_selection_4        = 0;
168 Fl_Output *         txt_hamcast_select_4_time           = 0;
169 Fl_Simple_Counter * cnt_hamcast_mode_selection_repeat_4 = 0;
170 
171 Fl_Output * txt_hamcast_select_total_time = 0;
172 
173 // end hamcast Event sub panel.
174 
175 // end Event panel
176 
177 Fl_Input2*  txt_tx_selected_blocks = 0;
178 
179 extern void show_selected_xmt(int n);
180 extern void cb_load_tx_queue(void);
181 extern void cb_scripts_in_main_thread(void *);
182 
183 /** ********************************************************
184  * Basic modem character array pointer list. It's
185  * compared to a supplied list from FLDIGI via XMLRPC
186  * command. And matches entries available in the
187  * time_table.cxx structure. No, you can not remove this list
188  * and use the one in the time_table.cxx. As FLAMP generates
189  * this table using the --time-table command line switch.
190  ***********************************************************/
191 const char *s_basic_modes[] = {
192 	(char *) "8PSK125",
193 	(char *) "8PSK250",
194 	(char *) "8PSK500",
195 	(char *) "8PSK1000",
196 	(char *) "8PSK1200",
197 	(char *) "8PSK1333",
198 	(char *) "8PSK125F",
199 	(char *) "8PSK250F",
200 	(char *) "8PSK500F",
201 	(char *) "8PSK1000F",
202 	(char *) "8PSK1200F",
203 	(char *) "8PSK1333F",
204 	(char *) "BPSK31",
205 	(char *) "BPSK63",
206 	(char *) "BPSK63F",
207 	(char *) "BPSK125",
208 	(char *) "BPSK250",
209 	(char *) "BPSK500",
210 	(char *) "BPSK1000",
211 	(char *) "DOMX22",
212 	(char *) "DOMX44",
213 	(char *) "DOMX88",
214 	(char *) "MFSK16",
215 	(char *) "MFSK22",
216 	(char *) "MFSK31",
217 	(char *) "MFSK32",
218 	(char *) "MFSK64",
219 	(char *) "MFSK64L",
220 	(char *) "MFSK128",
221 	(char *) "MFSK128L",
222 	(char *) "MT63-500L",
223 	(char *) "MT63-500S",
224 	(char *) "MT63-1KL",
225 	(char *) "MT63-1KS",
226 	(char *) "MT63-2KL",
227 	(char *) "MT63-2KS",
228 	(char *) "Olivia-4-250",
229 	(char *) "Olivia-4-500",
230 	(char *) "Olivia-8-250",
231 	(char *) "Olivia-8-500",
232 	(char *) "Olivia-8-1K",
233 	(char *) "Olivia-16-500",
234 	(char *) "Olivia-16-1K",
235 	(char *) "Olivia-32-1K",
236 	(char *) "Olivia-64-2K",
237 	(char *) "PSK63RC4",
238 	(char *) "PSK63RC5",
239 	(char *) "PSK63RC10",
240 	(char *) "PSK63RC20",
241 	(char *) "PSK63RC32",
242 	(char *) "PSK125R",
243 	(char *) "PSK125RC4",
244 	(char *) "PSK125RC5",
245 	(char *) "PSK125C12",
246 	(char *) "PSK125RC10",
247 	(char *) "PSK125RC12",
248 	(char *) "PSK125RC16",
249 	(char *) "PSK250R",
250 	(char *) "PSK250C6",
251 	(char *) "PSK250RC2",
252 	(char *) "PSK250RC3",
253 	(char *) "PSK250RC5",
254 	(char *) "PSK250RC6",
255 	(char *) "PSK250RC7",
256 	(char *) "PSK500R",
257 	(char *) "PSK500C2",
258 	(char *) "PSK500C4",
259 	(char *) "PSK500RC2",
260 	(char *) "PSK500RC3",
261 	(char *) "PSK500RC4",
262 	(char *) "PSK800C2",
263 	(char *) "PSK800RC2",
264 	(char *) "PSK1000C2",
265 	(char *) "PSK1000R",
266 	(char *) "PSK1000RC2",
267 	(char *) "QPSK31",
268 	(char *) "QPSK63",
269 	(char *) "QPSK125",
270 	(char *) "QPSK250",
271 	(char *) "QPSK500",
272 	(char *) "THOR16",
273 	(char *) "THOR22",
274 	(char *) "THOR25x4",
275 	(char *) "THOR50x1",
276 	(char *) "THOR50x2",
277 	(char *) "THOR100",
278 	(char *) 0
279 };
280 
281 char *s_modes[sizeof(s_basic_modes)/sizeof(char *)];
282 
283 /** ********************************************************
284  * A string table of event types
285  ***********************************************************/
286 const char *event_types[] = {
287 	(char *) "5 min",
288 	(char *) "15 min",
289 	(char *) "30 min",
290 	(char *) "Hourly",
291 	(char *) "Even hours",
292 	(char *) "Odd hours",
293 	(char *) "Repeated at",
294 	(char *) "One time at",
295 	(char *) "Continuous at",
296 	(char *) 0
297 };
298 
299 std::string valid_modes;
300 
301 /** ********************************************************
302  *
303  ***********************************************************/
valid_mode_check(std::string & md)304 bool valid_mode_check(std::string &md)
305 {
306 	return (valid_modes.find(md) != string::npos);
307 }
308 
309 /** ********************************************************
310  *
311  ***********************************************************/
update_cbo_modes(std::string & fldigi_modes)312 void update_cbo_modes(std::string &fldigi_modes)
313 {
314 	memset(s_modes, 0, sizeof(s_modes));
315 
316 	valid_modes.clear();
317 	cbo_modes->clear();
318 	cbo_header_modes->clear();
319 	cbo_hamcast_mode_selection_1->clear();
320 	cbo_hamcast_mode_selection_2->clear();
321 	cbo_hamcast_mode_selection_3->clear();
322 	cbo_hamcast_mode_selection_4->clear();
323 
324 	int i = 0, j = 0;
325 	std::string match_str;
326 
327 	while (s_basic_modes[i] != (char *)0) {
328 		// Prevent find 8PSK1000 within 8PSK1000F by adding the
329 		// delimiter to the search (8PSK1000| != 8PSK1000F|).
330 		match_str.assign(s_basic_modes[i]).append("|");
331 		if (fldigi_modes.find(match_str) != std::string::npos) {
332 			s_modes[j] = (char *) s_basic_modes[i];
333 			cbo_modes->add(s_modes[j]);
334 			cbo_header_modes->add(s_modes[j]);
335 			cbo_hamcast_mode_selection_1->add(s_modes[j]);
336 			cbo_hamcast_mode_selection_2->add(s_modes[j]);
337 			cbo_hamcast_mode_selection_3->add(s_modes[j]);
338 			cbo_hamcast_mode_selection_4->add(s_modes[j]);
339 			valid_modes.append(s_modes[j]).append("|");
340 			j++;
341 		}
342 		i++;
343 	}
344 
345 	cbo_modes->index(progStatus.selected_mode);
346 	cbo_header_modes->index(progStatus.header_selected_mode);
347 	cbo_hamcast_mode_selection_1->index(progStatus.hamcast_mode_selection_1);
348 	cbo_hamcast_mode_selection_2->index(progStatus.hamcast_mode_selection_2);
349 	cbo_hamcast_mode_selection_3->index(progStatus.hamcast_mode_selection_3);
350 	cbo_hamcast_mode_selection_4->index(progStatus.hamcast_mode_selection_4);
351 	assign_bc_modem_list();
352 	g_modem.assign(cbo_modes->value());
353 	g_header_modem.assign(cbo_header_modes->value());
354 }
355 
356 /** ********************************************************
357  * Initialize a minimal set of available modems
358  ***********************************************************/
init_cbo_modes()359 void init_cbo_modes()
360 {
361 	string min_modes;
362 	min_modes.assign("DOMX22|MFSK16|MFSK22|MFSK31|MFSK32|");
363 	min_modes.append("MT63-500S|MT63-1KS|MT63-2KS|");
364 	min_modes.append("MT63-500L|MT63-1KL|MT63-2KL|");
365 	min_modes.append("BPSK125|BPSK250|BPSK500|");
366 	min_modes.append("PSK125R|PSK250R|PSK500R|");
367 	min_modes.append("Olivia-4-250|Olivia-4-500|Olivia-8-250|Olivia-8-500|");
368 	min_modes.append("Olivia-8-1K|Olivia-16-500|Olivia-16-1K|");
369 	min_modes.append("THOR16|THOR22");
370 	update_cbo_modes(min_modes);
371 }
372 
373 /** ********************************************************
374  *
375  ***********************************************************/
init_cbo_events()376 void init_cbo_events()
377 {
378 	int index = 0;
379 
380 	while(event_types[index]) {
381 		cbo_repeat_every->add(event_types[index]);
382 		index++;
383 	}
384 	cbo_repeat_every->index(progStatus.repeat_every);
385 }
386 
387 /** ********************************************************
388  *
389  ***********************************************************/
cb_cbo_modes(void * a,void * b)390 void cb_cbo_modes(void *a, void *b)
391 {
392 	progStatus.selected_mode = cbo_modes->index();
393 	g_modem.assign(cbo_modes->value());
394 	update_cAmp_changes(0);
395 	amp_mark_all_for_update();
396 	if (progStatus.sync_mode_flamp_fldigi)
397 		send_new_modem(cbo_modes->value());
398 	show_selected_xmt(0);
399 }
400 
401 /** ********************************************************
402  *
403  ***********************************************************/
cb_mnuExit(void * a,void * b)404 void cb_mnuExit(void *a, void *b)
405 {
406 	cb_exit();
407 }
408 
409 /** ********************************************************
410  *
411  ***********************************************************/
cb_mnuEventLog(void *,void *)412 void cb_mnuEventLog(void *, void *)
413 {
414 	debug::show();
415 }
416 
417 /** ********************************************************
418  *
419  ***********************************************************/
cb_mnuOnLineHelp(Fl_Menu_ *,void *)420 static void cb_mnuOnLineHelp(Fl_Menu_*, void*) {
421 	show_help();
422 }
423 
424 /** ********************************************************
425  *
426  ***********************************************************/
cb_mnu_folders(Fl_Menu_ *,void *)427 static void cb_mnu_folders(Fl_Menu_*, void*) {
428 	cb_folders();
429 }
430 
431 /** ********************************************************
432  *
433  ***********************************************************/
cb_mnu_scripts(Fl_Menu_ *,void *)434 static void cb_mnu_scripts(Fl_Menu_*, void*) {
435 	//static bool value = false;
436 	//Fl::awake(cb_scripts_in_main_thread, (void *)&value);
437 	cb_scripts(false);
438 }
439 
440 /** ********************************************************
441  *
442  ***********************************************************/
443 //static void cb_mnu_scripts_default(Fl_Menu_*, void*) {
444 	//static bool value = true;
445 	//Fl::awake(cb_scripts_in_main_thread, (void *)&value);
446 //	cb_scripts(true);
447 //}
448 
449 /** ********************************************************
450  *
451  ***********************************************************/
cb_mnuAbout(void *,void *)452 void cb_mnuAbout(void *, void *)
453 {
454 	fl_message2("\tFlamp: %s\n\n" \
455 				"\tAuthors:\n" \
456 				"\t\tDave Freese, W1HKJ\n" \
457 				"\t\tRobert Stiles, KK5VD",
458 				FLAMP_VERSION);
459 }
460 
461 /** ********************************************************
462  *
463  ***********************************************************/
cb_mnuCmdLineParams(void *,void *)464 void cb_mnuCmdLineParams(void *, void *)
465 {
466 	if (!wCmdLine) {
467 		wCmdLine = new Fl_Double_Window(0,0,604,404,"Command Line Options");
468 		wCmdLine->begin();
469 		Fl_Browser *bwsCmds = new Fl_Browser(2,2,600,400,"");
470 		int i = 0;
471 		string cmdline;
472 		while (options[i] != NULL) {
473 			cmdline.assign("@f").append(options[i]);
474 			bwsCmds->add(cmdline.c_str());
475 			i++;
476 		}
477 		wCmdLine->end();
478 	}
479 	wCmdLine->show();
480 }
481 
482 /** ********************************************************
483  *
484  ***********************************************************/
485 Fl_Menu_Item menu_[] = {
486 	{_("&File"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
487 	{_("&Folders"), 0, (Fl_Callback*)cb_mnu_folders, 0, FL_MENU_DIVIDER, FL_NORMAL_LABEL, 0, 14, 0},
488 	{_("E&xit"), 0x40078,  (Fl_Callback*)cb_mnuExit, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
489 	{0,0,0,0,0,0,0,0,0},
490 	{_("&Script"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
491 	{_("&Execute Script"), 0, (Fl_Callback*)cb_mnu_scripts, 0, FL_MENU_DIVIDER, FL_NORMAL_LABEL, 0, 14, 0},
492 	{0,0,0,0,0,0,0,0,0},
493 	{_("&Help"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
494 	{_("&Debug log"), 0,  (Fl_Callback*)cb_mnuEventLog, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
495 	{_("On Line help"), 0,  (Fl_Callback*)cb_mnuOnLineHelp, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
496 	{_("Command line parameters"), 0, (Fl_Callback*)cb_mnuCmdLineParams, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
497 	{_("About"), 0, (Fl_Callback*)cb_mnuAbout, 0, 128, FL_NORMAL_LABEL, 0, 14, 0},
498 	{0,0,0,0,0,0,0,0,0},
499 	{0,0,0,0,0,0,0,0,0}
500 };
501 
502 /** ********************************************************
503  *
504  ***********************************************************/
cb_tx_mycall(Fl_Input2 *,void *)505 static void cb_tx_mycall(Fl_Input2*, void*)
506 {
507 	progStatus.my_call = txt_tx_mycall->value();
508 	update_cAmp_changes(0);
509 	show_selected_xmt(tx_queue->value());
510 }
511 
512 /** ********************************************************
513  *
514  ***********************************************************/
cb_tx_myinfo(Fl_Input2 *,void *)515 static void cb_tx_myinfo(Fl_Input2*, void*)
516 {
517 	progStatus.my_info = txt_tx_myinfo->value();
518 	update_cAmp_changes(0);
519 	show_selected_xmt(tx_queue->value());
520 }
521 
522 /** ********************************************************
523  *
524  ***********************************************************/
cb_tx_send_to(Fl_Input2 *,void *)525 static void cb_tx_send_to(Fl_Input2*, void*)
526 {
527 	update_cAmp_changes(0);
528 	show_selected_xmt(tx_queue->value());
529 }
530 
531 /** ********************************************************
532  *
533  ***********************************************************/
cb_tx_descrip(Fl_Input2 *,void *)534 static void cb_tx_descrip(Fl_Input2*, void*)
535 {
536 	update_cAmp_changes(0);
537 	show_selected_xmt(tx_queue->value());
538 }
539 
540 /** ********************************************************
541  *
542  ***********************************************************/
cb_selected_blocks(Fl_Input2 *,void *)543 static void cb_selected_blocks(Fl_Input2*, void*)
544 {
545 	update_cAmp_changes(0);
546 	show_selected_xmt(tx_queue->value());
547 }
548 
549 /** ********************************************************
550  *
551  ***********************************************************/
cb_btn_save_file(Fl_Button *,void *)552 static void cb_btn_save_file(Fl_Button*, void*)
553 {
554 	writefile(0);
555 }
556 
557 /** ********************************************************
558  *
559  ***********************************************************/
cb_btn_transfer_file_txQ(Fl_Button *,void *)560 static void cb_btn_transfer_file_txQ(Fl_Button*, void*)
561 {
562 	writefile(1);
563 }
564 
565 /** ********************************************************
566  *
567  ***********************************************************/
cb_btn_rx_remove(Fl_Button *,void *)568 static void cb_btn_rx_remove(Fl_Button*, void*)
569 {
570 	receive_remove_from_queue(false);
571 }
572 
573 /** ********************************************************
574  *
575  ***********************************************************/
cb_btn_open_file(Fl_Button *,void *)576 static void cb_btn_open_file(Fl_Button*, void*)
577 {
578 	readfile();
579 }
580 
581 /** ********************************************************
582  *
583  ***********************************************************/
cb_btn_tx_remove_file(Fl_Button *,void *)584 static void cb_btn_tx_remove_file(Fl_Button*, void*)
585 {
586 	tx_removefile(false);
587 }
588 
589 /** ********************************************************
590  *
591  ***********************************************************/
cb_btn_copy_missing(Fl_Button *,void *)592 static void cb_btn_copy_missing(Fl_Button*, void*)
593 {
594 	send_missing_report();
595 }
596 
597 /** ********************************************************
598  *
599  ***********************************************************/
cb_btn_parse_blocks(Fl_Button *,void *)600 static void cb_btn_parse_blocks(Fl_Button*, void*)
601 {
602 	recv_missing_report();
603 }
604 
605 /** ********************************************************
606  *
607  ***********************************************************/
cb_tx_queue(Fl_Hold_Browser * hb,void *)608 static void cb_tx_queue(Fl_Hold_Browser *hb, void*)
609 {
610 	int value = tx_queue->value();
611 	show_selected_xmt(value);
612 }
613 
614 /** ********************************************************
615  *
616  ***********************************************************/
cb_rx_queue(Fl_Hold_Browser * hb,void *)617 static void cb_rx_queue(Fl_Hold_Browser *hb, void*)
618 {
619 	int n = hb->value();
620 	show_selected_rcv(n);
621 }
622 
623 /** ********************************************************
624  *
625  ***********************************************************/
cb_btn_send_file(Fl_Button *,void *)626 static void cb_btn_send_file(Fl_Button*, void*)
627 {
628 	if(transmitting) {
629 		if (do_events_flag == 1) {
630 			do_events_flag = 0;
631 			do_events->value(0);
632 			stop_events();
633 			do_events->label("Start Events");
634 			do_events->redraw_label();
635 		} else {
636 			abort_request();
637 		}
638 		return;
639 	}
640 
641 	if ((tx_queue->value() == 0) || (tx_queue->size() == 0)) return;
642 
643 	btn_send_queue->deactivate();
644 
645 	transmit_current();
646 }
647 
648 /** ********************************************************
649  *
650  ***********************************************************/
cb_btn_send_queue(Fl_Button *,void *)651 static void cb_btn_send_queue(Fl_Button*, void*)
652 {
653 	if(transmitting) {
654 		abort_request();
655 		return;
656 	}
657 
658 	if (tx_queue->size() == 0) return;
659 
660 	btn_send_queue->deactivate();
661 
662 	if(Fl::event_shift())
663 		transmit_queued(false, true);
664 	else
665 		transmit_queued(false, false);
666 
667 }
668 
669 /** ********************************************************
670  *
671  ***********************************************************/
cb_cnt_blocksize(Fl_Button *,void *)672 static void cb_cnt_blocksize(Fl_Button*, void*)
673 {
674 	int request_blk_size = (int)cnt_blocksize->value();
675 	int reset_flag = false;
676 
677 	if(progStatus.blocksize != request_blk_size)
678 		reset_flag = true;
679 
680 	progStatus.blocksize = request_blk_size;
681 	update_cAmp_changes(0);
682 	amp_mark_all_for_update();
683 	show_selected_xmt(tx_queue->value());
684 
685 	if(reset_flag)
686 		txt_tx_selected_blocks->value("");
687 }
688 
689 /** ********************************************************
690  *
691  ***********************************************************/
cb_cnt_repeat_nbr(Fl_Button *,void *)692 static void cb_cnt_repeat_nbr(Fl_Button*, void*)
693 {
694 	progStatus.repeatNN = (int)cnt_repeat_nbr->value();
695 	update_cAmp_changes(0);
696 	amp_mark_all_for_update();
697 	show_selected_xmt(tx_queue->value());
698 }
699 
700 /** ********************************************************
701  *
702  ***********************************************************/
cb_repeat_header(Fl_Button *,void *)703 static void cb_repeat_header(Fl_Button*, void*)
704 {
705 	progStatus.repeat_header = (int)cnt_repeat_header->value();
706 	update_cAmp_changes(0);
707 	amp_mark_all_for_update();
708 	show_selected_xmt(tx_queue->value());
709 }
710 
711 /** ********************************************************
712  *
713  ***********************************************************/
cb_use_compression()714 void cb_use_compression()
715 {
716 	bool req_compression = btn_use_compression->value();
717 	int reset_flag = false;
718 
719 	if(progStatus.use_compression != req_compression)
720 		reset_flag = true;
721 
722 	progStatus.use_compression = req_compression;
723 	update_cAmp_changes(0);
724 	show_selected_xmt(tx_queue->value());
725 
726 	if(reset_flag)
727 		txt_tx_selected_blocks->value("");
728 }
729 
730 /** ********************************************************
731  *
732  ***********************************************************/
cb_use_encoder()733 void cb_use_encoder()
734 {
735 	int req_encoder = encoders->index()+1;
736 	int reset_flag = false;
737 
738 	if(progStatus.encoder != req_encoder)
739 		reset_flag = true;
740 
741 	progStatus.encoder = req_encoder;
742 	progStatus.encoder_string.assign(encoders->value());
743 	update_cAmp_changes(0);
744 	show_selected_xmt(tx_queue->value());
745 
746 	if(reset_flag)
747 		txt_tx_selected_blocks->value("");
748 }
749 
750 /** ********************************************************
751  *
752  ***********************************************************/
init_encoders()753 void init_encoders()
754 {
755 	encoders->clear();
756 	encoders->add("base64");
757 	encoders->add("base128");
758 	encoders->add("base256");
759 	encoders->index(progStatus.encoder-1);
760 	progStatus.encoder_string.assign(encoders->value());
761 }
762 
763 /** ********************************************************
764  *
765  ***********************************************************/
cb_sync_mode_flamp_fldigi(Fl_Check_Button * b,void *)766 void cb_sync_mode_flamp_fldigi(Fl_Check_Button *b, void *)
767 {
768 	progStatus.sync_mode_flamp_fldigi = btn_sync_mode_flamp_fldigi->value();
769 }
770 
771 /** ********************************************************
772  *
773  ***********************************************************/
cb_sync_mode_fldigi_flamp(Fl_Check_Button * b,void *)774 void cb_sync_mode_fldigi_flamp(Fl_Check_Button *b, void *)
775 {
776 	progStatus.sync_mode_fldigi_flamp = btn_sync_mode_fldigi_flamp->value();
777 }
778 
779 /** ********************************************************
780  *
781  ***********************************************************/
cb_fldigi_xmt_mode_change(Fl_Check_Button * b,void *)782 void cb_fldigi_xmt_mode_change(Fl_Check_Button *b, void *)
783 {
784 	if(progStatus.use_txrx_interval == true) {
785 		progStatus.fldigi_xmt_mode_change = true;
786 		btn_fldigi_xmt_mode_change->value(progStatus.fldigi_xmt_mode_change);
787 	} else {
788 		progStatus.fldigi_xmt_mode_change = btn_fldigi_xmt_mode_change->value();
789 	}
790 }
791 
792 /** ********************************************************
793  *
794  ***********************************************************/
cb_repeat_at_times(Fl_Check_Button * b,void *)795 void cb_repeat_at_times(Fl_Check_Button *b, void *)
796 {
797 	progStatus.repeat_at_times = btn_repeat_at_times->value();
798 	if (progStatus.repeat_at_times) {
799 		btn_repeat_forever->value(0);
800 		progStatus.repeat_forever = false;
801 	}
802 }
803 
804 /** ********************************************************
805  *
806  ***********************************************************/
cb_auto_load_que(Fl_Check_Button * b,void *)807 void cb_auto_load_que(Fl_Check_Button *b, void *)
808 {
809 	int val = false;
810 
811 	val = btn_auto_load_queue->value();
812 	progStatus.auto_load_queue_path.assign(txt_auto_load_queue_path->value());
813 
814 	if(progStatus.auto_load_queue_path.size() < 1 && val == true) {
815 		progStatus.auto_load_queue = false;
816 		btn_auto_load_queue->value(false);
817 		return;
818 	}
819 	progStatus.auto_load_queue = val;
820 	btn_auto_load_queue->value(val);
821 }
822 
823 /** ********************************************************
824  *
825  ***********************************************************/
cb_load_from_tx_folder(Fl_Check_Button * b,void *)826 void cb_load_from_tx_folder(Fl_Check_Button *b, void *)
827 {
828 	progStatus.load_from_tx_folder = btn_load_from_tx_folder->value();
829 }
830 
831 /** ********************************************************
832  *
833  ***********************************************************/
cb_manual_load_que(Fl_Button * b,void *)834 void cb_manual_load_que(Fl_Button *b, void *)
835 {
836 	cb_load_tx_queue();
837 }
838 
839 /** ********************************************************
840  *
841  ***********************************************************/
cb_auto_load_queue_path(Fl_Input2 * b,void *)842 void cb_auto_load_queue_path(Fl_Input2 *b, void *)
843 {
844 	progStatus.auto_load_queue_path.assign(txt_auto_load_queue_path->value());
845 }
846 
847 /** ********************************************************
848  *
849  ***********************************************************/
cb_repeat_every(Fl_ComboBox * cb,void *)850 void cb_repeat_every(Fl_ComboBox *cb, void *)
851 {
852 	progStatus.repeat_every = cbo_repeat_every->index();
853 }
854 
855 /** ********************************************************
856  *
857  ***********************************************************/
cb_repeat_times(Fl_Input2 * txt,void *)858 void cb_repeat_times(Fl_Input2 *txt, void *)
859 {
860 	progStatus.repeat_times = txt_repeat_times->value();
861 }
862 
863 /** ********************************************************
864  *
865  ***********************************************************/
cb_repeat_forever(Fl_Check_Button * b,void *)866 void cb_repeat_forever(Fl_Check_Button *b, void *)
867 {
868 	progStatus.repeat_forever = btn_repeat_forever->value();
869 	if (progStatus.repeat_forever) {
870 		btn_repeat_at_times->value(0);
871 		progStatus.repeat_at_times = false;
872 	}
873 }
874 
875 /** ********************************************************
876  *
877  ***********************************************************/
cb_drop_file(Fl_Input *,void *)878 static void cb_drop_file(Fl_Input*, void*) {
879 	drop_file_changed();
880 }
881 
882 /** ********************************************************
883  *
884  ***********************************************************/
cb_do_events(Fl_Light_Button * b,void *)885 void cb_do_events(Fl_Light_Button *b, void*)
886 {
887 	if(generate_time_table) do_events->value(0);
888 
889 	do_events_flag = do_events->value();
890 
891 	if (do_events_flag) {
892 		do_events->label("Stop Events");
893 	} else {
894 		stop_events();
895 		do_events->label("Start Events");
896 	}
897 	do_events->redraw_label();
898 }
899 
900 /** ********************************************************
901  *
902  ***********************************************************/
cb_enable_txrx_interval(Fl_Check_Button * a,void * b)903 void cb_enable_txrx_interval(Fl_Check_Button *a, void *b)
904 {
905 	progStatus.use_txrx_interval = (bool) btn_enable_txrx_interval->value();
906 
907 	if(progStatus.use_txrx_interval == true) {
908 		progStatus.fldigi_xmt_mode_change = true;
909 		btn_fldigi_xmt_mode_change->value(progStatus.fldigi_xmt_mode_change);
910 	}
911 	show_selected_xmt(tx_queue->value());
912 }
913 
914 /** ********************************************************
915  *
916  ***********************************************************/
917 #include <iostream>
set_txt_tx_interval()918 void set_txt_tx_interval()
919 {
920 	char szT[25];
921 	int mins = floor(cnt_tx_interval_mins->value());
922 	int secs = round(60 * (cnt_tx_interval_mins->value() - mins));
923 	snprintf(szT, sizeof(szT), "%02d:%02d", mins, secs);
924 	txt_tx_interval->value(szT);
925 }
926 
cb_tx_interval_mins(Fl_Simple_Counter * a,void * b)927 void cb_tx_interval_mins(Fl_Simple_Counter *a, void *b)
928 {
929 	progStatus.tx_interval_minutes = cnt_tx_interval_mins->value();
930 	set_txt_tx_interval();
931 }
932 
933 /** ********************************************************
934  *
935  ***********************************************************/
cb_rx_interval_secs(Fl_Simple_Counter * a,void * b)936 void cb_rx_interval_secs(Fl_Simple_Counter *a, void *b)
937 {
938 	progStatus.rx_interval_seconds = cnt_rx_interval_secs->value();
939 }
940 
941 /** ********************************************************
942  *
943  ***********************************************************/
cb_enable_header_modem(Fl_Check_Button * a,void * b)944 void cb_enable_header_modem(Fl_Check_Button *a, void *b)
945 {
946 	progStatus.use_header_modem = btn_enable_header_modem->value();
947 }
948 
949 /** ********************************************************
950  *
951  ***********************************************************/
cb_header_modes(Fl_ComboBox * a,void * b)952 void cb_header_modes(Fl_ComboBox *a, void *b)
953 {
954 	progStatus.header_selected_mode = cbo_header_modes->index();
955 	g_header_modem.assign(cbo_header_modes->value());
956 }
957 
958 /** ********************************************************
959  *
960  ***********************************************************/
cb_disable_header_modem_on_block_fills(Fl_Check_Button * a,void * b)961 void cb_disable_header_modem_on_block_fills(Fl_Check_Button *a, void *b)
962 {
963 	progStatus.disable_header_modem_on_block_fills = (bool) btn_disable_header_modem_on_block_fills->value();
964 }
965 
966 /** ********************************************************
967  *
968  ***********************************************************/
cb_enable_tx_on_report(Fl_Check_Button * a,void * b)969 void cb_enable_tx_on_report(Fl_Check_Button *a, void *b)
970 {
971 	progStatus.use_tx_on_report = btn_enable_tx_on_report->value();
972 }
973 
974 /** ********************************************************
975  *
976  ***********************************************************/
cb_clear_tosend_on_tx_blocks(Fl_Check_Button * a,void * b)977 void cb_clear_tosend_on_tx_blocks(Fl_Check_Button *a, void *b)
978 {
979 	progStatus.clear_tosend_on_tx_blocks = btn_clear_tosend_on_tx_blocks->value();
980 }
981 
982 /** ********************************************************
983  *
984  ***********************************************************/
cb_enable_unproto_markers(Fl_Check_Button * a,void * b)985 void cb_enable_unproto_markers(Fl_Check_Button *a, void *b)
986 {
987 	progStatus.enable_unproto_markers = btn_enable_unproto_markers->value();
988 	update_cAmp_changes(0);
989 	show_selected_xmt(tx_queue->value());
990 }
991 
992 /** ********************************************************
993  *
994  ***********************************************************/
cb_enable_tx_unproto(Fl_Check_Button * a,void * b)995 void cb_enable_tx_unproto(Fl_Check_Button *a, void *b)
996 {
997 	progStatus.enable_tx_unproto = btn_enable_tx_unproto->value();
998 
999 	if(progStatus.enable_tx_unproto) {
1000 		btn_use_compression->value(0);
1001 		progStatus.use_compression = 0;
1002 	}
1003 
1004 	update_cAmp_changes(0);
1005 	show_selected_xmt(tx_queue->value());
1006 }
1007 
1008 #if 0
1009 /** ********************************************************
1010  *
1011  ***********************************************************/
1012 void cb_queue_fills_only(Fl_Check_Button *a, void *b)
1013 {
1014 	progStatus.queue_fills_only = btn_queue_fills_only->value();
1015 }
1016 #endif
1017 
1018 /** ********************************************************
1019  *
1020  ***********************************************************/
unproto_widgets(cAmp * amp)1021 void unproto_widgets(cAmp *amp)
1022 {
1023 	if(amp)
1024 		progStatus.enable_tx_unproto = amp->unproto();
1025 
1026 	if(progStatus.enable_tx_unproto) {
1027 		if(!progStatus.use_txrx_interval)
1028 			cnt_blocksize->deactivate();
1029 		cnt_repeat_header->deactivate();
1030 		btn_use_compression->deactivate();
1031 		encoders->deactivate();
1032 		txt_tx_numblocks->deactivate();
1033 	} else {
1034 		cnt_blocksize->activate();
1035 		cnt_repeat_header->activate();
1036 		btn_use_compression->activate();
1037 		encoders->activate();
1038 		txt_tx_numblocks->activate();
1039 		cnt_repeat_nbr->activate();
1040 	}
1041 }
1042 
1043 /** ********************************************************
1044  *
1045  ***********************************************************/
cb_hamcast_mode_cycle(Fl_Check_Button * a,void * b)1046 void cb_hamcast_mode_cycle(Fl_Check_Button *a, void *b)
1047 {
1048 	progStatus.hamcast_mode_cycle = btn_hamcast_mode_cycle->value();
1049 	if(progStatus.hamcast_mode_cycle) {
1050 		progStatus.hamcast_mode_cycle = assign_bc_modem_list();
1051 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1052 	}
1053 	estimate_bc();
1054 }
1055 
1056 /** ********************************************************
1057  *
1058  ***********************************************************/
cb_hamcast_mode_enable_1(Fl_Check_Button * a,void * b)1059 void cb_hamcast_mode_enable_1(Fl_Check_Button *a, void *b)
1060 {
1061 	progStatus.hamcast_mode_enable_1 = btn_hamcast_mode_enable_1->value();
1062 	if(!assign_bc_modem_list()) {
1063 		progStatus.hamcast_mode_cycle = false;
1064 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1065 	}
1066 	estimate_bc();
1067 }
1068 
1069 /** ********************************************************
1070  *
1071  ***********************************************************/
cb_hamcast_mode_selection_1(Fl_Check_Button * a,void * b)1072 void cb_hamcast_mode_selection_1(Fl_Check_Button *a, void *b)
1073 {
1074 	progStatus.hamcast_mode_selection_1 = cbo_hamcast_mode_selection_1->index();
1075 	if(!assign_bc_modem_list()) {
1076 		progStatus.hamcast_mode_cycle = false;
1077 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1078 	}
1079 	estimate_bc();
1080 }
1081 
1082 /** ********************************************************
1083  *
1084  ***********************************************************/
cb_hamcast_mode_enable_2(Fl_Check_Button * a,void * b)1085 void cb_hamcast_mode_enable_2(Fl_Check_Button *a, void *b)
1086 {
1087 	progStatus.hamcast_mode_enable_2 = btn_hamcast_mode_enable_2->value();
1088 	if(!assign_bc_modem_list()) {
1089 		progStatus.hamcast_mode_cycle = false;
1090 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1091 	}
1092 	estimate_bc();
1093 }
1094 
1095 /** ********************************************************
1096  *
1097  ***********************************************************/
cb_hamcast_mode_selection_2(Fl_Check_Button * a,void * b)1098 void cb_hamcast_mode_selection_2(Fl_Check_Button *a, void *b)
1099 {
1100 	progStatus.hamcast_mode_selection_2 = cbo_hamcast_mode_selection_2->index();
1101 	if(!assign_bc_modem_list()) {
1102 		progStatus.hamcast_mode_cycle = false;
1103 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1104 	}
1105 	estimate_bc();
1106 }
1107 
1108 /** ********************************************************
1109  *
1110  ***********************************************************/
cb_hamcast_mode_enable_3(Fl_Check_Button * a,void * b)1111 void cb_hamcast_mode_enable_3(Fl_Check_Button *a, void *b)
1112 {
1113 	progStatus.hamcast_mode_enable_3 = btn_hamcast_mode_enable_3->value();
1114 	if(!assign_bc_modem_list()) {
1115 		progStatus.hamcast_mode_cycle = false;
1116 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1117 	}
1118 	estimate_bc();
1119 }
1120 
1121 /** ********************************************************
1122  *
1123  ***********************************************************/
cb_hamcast_mode_selection_3(Fl_Check_Button * a,void * b)1124 void cb_hamcast_mode_selection_3(Fl_Check_Button *a, void *b)
1125 {
1126 	progStatus.hamcast_mode_selection_3 = cbo_hamcast_mode_selection_3->index();
1127 	if(!assign_bc_modem_list()) {
1128 		progStatus.hamcast_mode_cycle = false;
1129 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1130 	}
1131 	estimate_bc();
1132 }
1133 
1134 /** ********************************************************
1135  *
1136  ***********************************************************/
cb_hamcast_mode_enable_4(Fl_Check_Button * a,void * b)1137 void cb_hamcast_mode_enable_4(Fl_Check_Button *a, void *b)
1138 {
1139 	progStatus.hamcast_mode_enable_4 = btn_hamcast_mode_enable_4->value();
1140 	if(!assign_bc_modem_list()) {
1141 		progStatus.hamcast_mode_cycle = false;
1142 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1143 	}
1144 	estimate_bc();
1145 }
1146 
1147 /** ********************************************************
1148  *
1149  ***********************************************************/
cb_hamcast_mode_selection_4(Fl_Check_Button * a,void * b)1150 void cb_hamcast_mode_selection_4(Fl_Check_Button *a, void *b)
1151 {
1152 	progStatus.hamcast_mode_selection_4 = cbo_hamcast_mode_selection_4->index();
1153 	if(!assign_bc_modem_list()) {
1154 		progStatus.hamcast_mode_cycle = false;
1155 		btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1156 	}
1157 	estimate_bc();
1158 }
1159 
1160 /** ********************************************************
1161  *
1162  ***********************************************************/
cb_enable_delete_warning(Fl_Check_Button * a,void * b)1163 void cb_enable_delete_warning(Fl_Check_Button *a, void *b)
1164 {
1165 	progStatus.enable_delete_warning = btn_enable_delete_warning->value();
1166 }
1167 
1168 /** ********************************************************
1169  *
1170  ***********************************************************/
cb_btn_send_relay(Fl_Check_Button * a,void * b)1171 void cb_btn_send_relay(Fl_Check_Button *a, void *b)
1172 {
1173 	if(transmitting) {
1174 		abort_request();
1175 		return;
1176 	}
1177 	send_relay_data();
1178 }
1179 
1180 /** ********************************************************
1181  *
1182  ***********************************************************/
cb_btn_parse_relay_blocks(Fl_Check_Button * a,void * b)1183 void cb_btn_parse_relay_blocks(Fl_Check_Button *a, void *b)
1184 {
1185 	relay_missing_report();
1186 }
1187 
1188 /** ********************************************************
1189  *
1190  ***********************************************************/
cb_relay_selected_blocks(Fl_Check_Button * a,void * b)1191 void cb_relay_selected_blocks(Fl_Check_Button *a, void *b)
1192 {
1193 	update_rx_missing_blocks();
1194 }
1195 
1196 /** ********************************************************
1197  *
1198  ***********************************************************/
cb_auto_rx_save(Fl_Check_Button * a,void * b)1199 void cb_auto_rx_save(Fl_Check_Button *a, void *b)
1200 {
1201 	progStatus.auto_rx_save = btn_auto_rx_save->value();
1202 }
1203 
1204 /** ********************************************************
1205  *
1206  ***********************************************************/
cb_auto_rx_save_local_time(Fl_Check_Button * a,void * b)1207 void cb_auto_rx_save_local_time(Fl_Check_Button *a, void *b)
1208 {
1209 	progStatus.auto_rx_save_local_time = btn_auto_rx_save_local_time->value();
1210 }
1211 
1212 /** ********************************************************
1213  *
1214  ***********************************************************/
flamp_dialog()1215 Fl_Double_Window* flamp_dialog() {
1216 
1217 	int W = 500, H = 496;
1218 	int X = 2, Y = 26;
1219 	int tmp = 0;
1220 
1221 	Fl_Double_Window* w = new Fl_Double_Window(W, H, "");;
1222 	w->begin();
1223 
1224 	Fl_Menu_Bar* mb = new Fl_Menu_Bar(0, 0, W, 22);
1225 	mb->menu(menu_);
1226 	int y = Y;
1227 
1228 	tabs = new Fl_Tabs(X, y, W-4, H-Y-2, "");
1229 	tabs->labelcolor(FL_BLACK);
1230 	tabs->selection_color(fl_rgb_color(245, 255, 250)); // mint cream
1231 
1232 	// Receive Tab
1233 	y=Y+26;
1234 	Fl_Group *Rx_tab = new Fl_Group(4, y, W-8, H-y-2, _("Receive"));
1235 
1236 	y += 10;
1237 	txt_rx_filename = new Fl_Output(100, y, W-108, 20, _("File:"));
1238 	txt_rx_filename->box(FL_DOWN_BOX);
1239 	txt_rx_filename->tooltip("");
1240 
1241 	txt_rx_datetime = new Fl_Output(100, y+=26, W-194, 20, _("Date time:"));
1242 	txt_rx_datetime->box(FL_DOWN_BOX);
1243 	txt_rx_datetime->tooltip("");
1244 
1245 	btn_save_file = new Fl_Button(W - 88, y, 80, 20, _("Save"));
1246 	btn_save_file->callback((Fl_Callback*)cb_btn_save_file);
1247 	btn_save_file->tooltip("");
1248 
1249 	txt_rx_descrip = new Fl_Output(100, y+=26, W-194, 20, _("Description:"));
1250 	txt_rx_descrip->box(FL_DOWN_BOX);
1251 	txt_rx_descrip->tooltip("");
1252 
1253 	btn_rx_remove = new Fl_Button(W - 88, y, 80, 20, _("Remove"));
1254 	btn_rx_remove->callback((Fl_Callback*)cb_btn_rx_remove);
1255 	btn_rx_remove->tooltip("");
1256 
1257 	txt_rx_callinfo = new Fl_Output(100, y+=26, W - 108, 20, _("Call/info"));
1258 	txt_rx_callinfo->box(FL_DOWN_BOX);
1259 	txt_rx_callinfo->tooltip("");
1260 
1261 	int sp = (W-108 - 4 * 50) * 4 / 10;
1262 	txt_rx_filesize = new Fl_Output(100, y+=26, 50, 20, _("# bytes"));
1263 	txt_rx_filesize->box(FL_DOWN_BOX);
1264 	txt_rx_filesize->tooltip(_("# of data bytes"));
1265 
1266 	txt_rx_numblocks = new Fl_Output(100 + (50+sp), y, 50, 20, _("Nbr blks"));
1267 	txt_rx_numblocks->box(FL_DOWN_BOX);
1268 	txt_rx_numblocks->tooltip("");
1269 
1270 	txt_rx_blocksize = new Fl_Output(100 + 2*(50+sp), y, 50, 20, _("Blk size"));
1271 	txt_rx_blocksize->box(FL_DOWN_BOX);
1272 	txt_rx_blocksize->tooltip("");
1273 
1274 	btn_rxq_to_txq = new Fl_Button(W - 88, y, 80, 20, _("To TxQ"));
1275 	btn_rxq_to_txq->callback((Fl_Callback*)cb_btn_transfer_file_txQ);
1276 	btn_rxq_to_txq->tooltip("");
1277 
1278 	txt_rx_missing_blocks = new Fl_Output(100, y+=26, W-194, 20, _("Missing"));
1279 	txt_rx_missing_blocks->box(FL_DOWN_BOX);
1280 	txt_rx_missing_blocks->tooltip(_("Blocks not yet received"));
1281 
1282 	btn_copy_missing = new Fl_Button(W - 88, y, 80, 20, _("Report"));
1283 	btn_copy_missing->callback((Fl_Callback*)cb_btn_copy_missing);
1284 	btn_copy_missing->tooltip(_("Confirmation report-->fldigi"));
1285 
1286 	rx_progress = new Fl_BlockMap(100, y+=26, W-108, 20, _("Blocks"));
1287 	rx_progress->box(FL_DOWN_BOX);
1288 
1289 	txt_rx_output = new FTextView(8, y+=32, W-16, 80, "Data");
1290 	txt_rx_output->box(FL_DOWN_BOX);
1291 	txt_rx_output->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
1292 	txt_rx_output->tooltip(_("Ascii Text\nData type message"));
1293 
1294 	static const int cols[] = {60, 60, 0};
1295 	y += 88;
1296 
1297 	tmp = 10;
1298 	btn_send_relay = new Fl_Button(tmp, y, 70, 22, _("Relay"));
1299 	btn_send_relay->callback((Fl_Callback*)cb_btn_send_relay);
1300 	btn_send_relay->tooltip(_("Relay missing blocks"));
1301 
1302 	tmp += 75;
1303 	btn_parse_relay_blocks = new Fl_Button(tmp, y, 70, 22, _("Fetch"));
1304 	btn_parse_relay_blocks->callback((Fl_Callback*)cb_btn_parse_relay_blocks);
1305 	btn_parse_relay_blocks->tooltip(_("Fetch & parse fldigi block reports"));
1306 
1307 	tmp += 120;
1308 	txt_relay_selected_blocks = new Fl_Input2(tmp, y, W-(10+tmp), 20, _("blocks"));
1309 	txt_relay_selected_blocks->box(FL_DOWN_BOX);
1310 	txt_relay_selected_blocks->tooltip(_("Clear for all\nComma separated block #s"));
1311 	txt_relay_selected_blocks->callback((Fl_Callback*)cb_relay_selected_blocks);
1312 
1313 	y += 20;
1314 	btn_auto_rx_save = new Fl_Check_Button(tmp-2, y, 20, 20, _("Auto save on 100% reception"));
1315 	btn_auto_rx_save->callback((Fl_Callback*)cb_auto_rx_save);
1316 	btn_auto_rx_save->align(FL_ALIGN_RIGHT);
1317 	btn_auto_rx_save->down_box(FL_DOWN_BOX);
1318 	btn_auto_rx_save->value(progStatus.auto_rx_save);
1319 
1320 	y += 22;
1321 	rx_queue = new Fl_Hold_Browser(8, y, W-16, H-y-6, _("Receive Queue"));
1322 	rx_queue->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
1323 	rx_queue->column_widths(cols);
1324 	rx_queue->has_scrollbar(Fl_Browser_::VERTICAL_ALWAYS);
1325 	rx_queue->callback((Fl_Callback*)cb_rx_queue);
1326 	rx_queue->tooltip("");
1327 
1328 	Rx_tab->resizable(txt_rx_output);
1329 	Rx_tab->end();
1330 
1331 	// Receive Tab End
1332 
1333 	// Transmit Tab
1334 	y = Y + 26;
1335 	Fl_Group *Tx_tab = new Fl_Group(X+2, y, W-2*(X+2), H-y-2, _("Transmit"));
1336 
1337 	y += 10;
1338 
1339 	txt_tx_send_to = new Fl_Input2(X+70, y, W - 78, 20, _("Send to"));
1340 	txt_tx_send_to->box(FL_DOWN_BOX);
1341 	txt_tx_send_to->tooltip(_("QST (or blank) / Enumerated callsigns"));
1342 	txt_tx_send_to->value("QST");
1343 	txt_tx_send_to->callback((Fl_Callback*)cb_tx_send_to);
1344 
1345 	txt_tx_filename = new Fl_Output(70, y+=26, W - 78, 20, _("File"));
1346 	txt_tx_filename->box(FL_DOWN_BOX);
1347 	txt_tx_filename->tooltip("");
1348 
1349 	txt_tx_descrip = new Fl_Input2(70, y+=26, W - 78, 20, _("Descrip"));
1350 	txt_tx_descrip->box(FL_DOWN_BOX);
1351 	txt_tx_descrip->tooltip(_("Short description of file contents"));
1352 	txt_tx_descrip->callback((Fl_Callback*)cb_tx_descrip);
1353 
1354 	cnt_blocksize = new Fl_Simple_Counter(X+70, y+=26, 60, 20, _("Blk size"));
1355 	cnt_blocksize->step(CNT_BLOCK_SIZE_STEP_RATE);
1356 	cnt_blocksize->value(64);
1357 	cnt_blocksize->minimum(CNT_BLOCK_SIZE_MINIMUM);
1358 	cnt_blocksize->maximum(CNT_BLOCK_SIZE_MAXIMUM);
1359 	cnt_blocksize->align(FL_ALIGN_LEFT);
1360 	cnt_blocksize->callback((Fl_Callback*)cb_cnt_blocksize);
1361 	cnt_blocksize->tooltip(_("Maximum size of each data block"));
1362 
1363 	cnt_repeat_nbr = new Fl_Simple_Counter(X+70+60+65, y, 60, 20, _("Xmt Rpt"));
1364 	cnt_repeat_nbr->step(1);
1365 	cnt_repeat_nbr->value(1);
1366 	cnt_repeat_nbr->minimum(1);
1367 	cnt_repeat_nbr->maximum(999);
1368 	cnt_repeat_nbr->align(FL_ALIGN_LEFT);
1369 	cnt_repeat_nbr->callback((Fl_Callback*)cb_cnt_repeat_nbr);
1370 	cnt_repeat_nbr->tooltip(_("Repeat transmission specified # times"));
1371 
1372 	cnt_repeat_header = new Fl_Simple_Counter(X+70+60+65+60+65, y, 60, 20, _("Hdr Rpt"));
1373 	cnt_repeat_header->step(1);
1374 	cnt_repeat_header->value(1);
1375 	cnt_repeat_header->minimum(1);
1376 	cnt_repeat_header->maximum(10);
1377 	cnt_repeat_header->align(FL_ALIGN_LEFT);
1378 	cnt_repeat_header->callback((Fl_Callback*)cb_repeat_header);
1379 	cnt_repeat_header->tooltip(_("Repeat header #-times/transmission"));
1380 
1381 	txt_tx_numblocks = new Fl_Output(W-10-50, y, 50, 20, "# Bks");
1382 	txt_tx_numblocks->align(FL_ALIGN_LEFT);
1383 	txt_tx_numblocks->tooltip(_("Transfer size in blocks"));
1384 	txt_tx_numblocks->value("");
1385 
1386 	y+=26;
1387 
1388 	encoders = new Fl_ComboBox(X+70, y, 100, 20, "");
1389 	encoders->begin();
1390 	encoders->when(FL_WHEN_RELEASE);
1391 	encoders->tooltip(_("Encode after compression"));
1392 	encoders->callback((Fl_Callback*)cb_use_encoder);
1393 	encoders->end();
1394 
1395 	cbo_modes = new Fl_ComboBox(185, y, 118, 20, "");
1396 	cbo_modes->begin();
1397 	cbo_modes->align(FL_ALIGN_RIGHT);
1398 	cbo_modes->when(FL_WHEN_RELEASE);
1399 	cbo_modes->tooltip(_("fldigi modem type"));
1400 	cbo_modes->box(FL_DOWN_BOX);
1401 	cbo_modes->color(FL_BACKGROUND2_COLOR);
1402 	cbo_modes->selection_color(FL_BACKGROUND_COLOR);
1403 	cbo_modes->labeltype(FL_NORMAL_LABEL);
1404 	cbo_modes->labelfont(0);
1405 	cbo_modes->labelsize(14);
1406 	cbo_modes->labelcolor(FL_FOREGROUND_COLOR);
1407 	cbo_modes->callback((Fl_Callback*)cb_cbo_modes);
1408 	cbo_modes->end();
1409 
1410 	txt_transfer_size_time = new Fl_Output(306, y, 186, 20, "");
1411 	txt_transfer_size_time->tooltip(_("Transfer size / time"));
1412 	txt_transfer_size_time->value("");
1413 
1414 	y+=24;
1415 
1416 	btn_use_compression = new Fl_Check_Button(X+70, y, 20, 20, _("Comp"));
1417 	btn_use_compression->tooltip(_("Data will be sent compressed"));
1418 	btn_use_compression->align(FL_ALIGN_RIGHT);
1419 	btn_use_compression->down_box(FL_DOWN_BOX);
1420 	btn_use_compression->callback((Fl_Callback*)cb_use_compression);
1421 	btn_use_compression->value(progStatus.use_compression);
1422 
1423 	btn_enable_tx_unproto = new Fl_Check_Button(X+170, y, 20, 20,
1424 												_("Transmit unproto (plain text, 7bit ASCII)"));
1425 	btn_enable_tx_unproto->tooltip("");
1426 	btn_enable_tx_unproto->align(FL_ALIGN_RIGHT);
1427 	btn_enable_tx_unproto->down_box(FL_DOWN_BOX);
1428 	btn_enable_tx_unproto->callback((Fl_Callback*)cb_enable_tx_unproto);
1429 	btn_enable_tx_unproto->value(progStatus.enable_tx_unproto);
1430 #if 0
1431 	btn_enable_tx_unproto = new Fl_Check_Button(X+150, y, 20, 20,
1432 												_("TX Unproto (7 bit)"));
1433 	btn_enable_tx_unproto->tooltip(_("Transmit unproto (plain text, 7bit ASCII)"));
1434 	btn_enable_tx_unproto->align(FL_ALIGN_RIGHT);
1435 	btn_enable_tx_unproto->down_box(FL_DOWN_BOX);
1436 	btn_enable_tx_unproto->callback((Fl_Callback*)cb_enable_tx_unproto);
1437 	btn_enable_tx_unproto->value(progStatus.enable_tx_unproto);
1438 
1439 	btn_queue_fills_only = new Fl_Check_Button(W-190, y, 20, 20,
1440 												_("Missing Only (xmt all)"));
1441 	btn_queue_fills_only->tooltip(_("Tx missing queue list fills only (xmit all)"));
1442 	btn_queue_fills_only->align(FL_ALIGN_RIGHT);
1443 	btn_queue_fills_only->down_box(FL_DOWN_BOX);
1444 	btn_queue_fills_only->callback((Fl_Callback*)cb_queue_fills_only);
1445 	btn_queue_fills_only->value(progStatus.queue_fills_only);
1446 #endif
1447 	y+=24;
1448 
1449 	txt_tx_selected_blocks = new Fl_Input2(X+70, y, W - X - 162, 20, _("blocks"));
1450 	txt_tx_selected_blocks->box(FL_DOWN_BOX);
1451 	txt_tx_selected_blocks->tooltip(_("Clear for all\nComma separated block #s"));
1452 	txt_tx_selected_blocks->callback((Fl_Callback*)cb_selected_blocks);
1453 
1454 	btn_parse_blocks = new Fl_Button(W - 88, y, 80, 20, _("Fetch"));
1455 	btn_parse_blocks->callback((Fl_Callback*)cb_btn_parse_blocks);
1456 	btn_parse_blocks->tooltip(_("Fetch & parse fldigi block reports"));
1457 
1458 	btn_send_file = new Fl_Button(W - 370, y+=25, 70, 22, _(XMT_LABEL));
1459 	btn_send_file->callback((Fl_Callback*)cb_btn_send_file);
1460 	btn_send_file->tooltip(_("Transmit this file"));
1461 
1462 	btn_send_queue = new Fl_Button(W - 370 + 76, y, 70, 22, _("Xmt All"));
1463 	btn_send_queue->callback((Fl_Callback*)cb_btn_send_queue);
1464 	btn_send_queue->tooltip(_("Transmit entire queue"));
1465 
1466 	btn_tx_remove_file = new Fl_Button(W -370 + 2*76, y, 70, 22, _("Remove"));
1467 	btn_tx_remove_file->callback((Fl_Callback*)cb_btn_tx_remove_file);
1468 	btn_tx_remove_file->tooltip(_("Remove highlighted file from transmit queue"));
1469 
1470 	btn_open_file = new Fl_Button(W - 370 + 3*76, y, 70, 22, _("Add"));
1471 	btn_open_file->callback((Fl_Callback*)cb_btn_open_file);
1472 	btn_open_file->tooltip(_("Select file to add to queue"));
1473 
1474 	drop_file = new Fl_Input(W - 370 + 4*76, y - 2, 50, 24);
1475 	drop_file->box(FL_BORDER_BOX);
1476 	drop_file->textcolor(fl_rgb_color( 200, 0, 0) );
1477 	drop_file->value("  DnD");
1478 	drop_file->color(fl_rgb_color(244, 255, 255));
1479 	drop_file->cursor_color(fl_rgb_color(244, 255, 255));
1480 	drop_file->label("");
1481 	drop_file->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE);
1482 	drop_file->labelcolor(fl_rgb_color( 200, 0, 0) );
1483 	drop_file->tooltip(_("drag and drop tx queue files here ..."));
1484 	drop_file->callback((Fl_Callback*)cb_drop_file);
1485 	drop_file->when(FL_WHEN_CHANGED);
1486 
1487 	y += 26;
1488 	tx_queue = new Fl_Hold_Browser(8, y, W-16, H-y-6, _("Transmit Queue"));
1489 	tx_queue->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
1490 	tx_queue->has_scrollbar(Fl_Browser_::VERTICAL_ALWAYS);
1491 	tx_queue->callback((Fl_Callback*)cb_tx_queue);
1492 	tx_queue->tooltip("");
1493 
1494 	Tx_tab->resizable(tx_queue);
1495 	Tx_tab->end();
1496 
1497 	// Transmit Tab End
1498 
1499 	// Timed Even Tab
1500 
1501 	y = Y+26;
1502 
1503 	Fl_Group *Events_tab = new Fl_Group(X+2, y, W-2*(X+2), H-y-2, _("Events"));
1504 
1505 	Fl_Tabs *event_tabs = new Fl_Tabs(X+2, y, W-2*(X+2), H-y-2, "");
1506 	event_tabs->labelcolor(FL_BLACK);
1507 	event_tabs->selection_color(fl_rgb_color(245, 255, 250)); // mint cream
1508 
1509 	y = Y + 52;
1510 	Fl_Group *Timed_Events_tab = new Fl_Group(X+2, y, W-2*(X+2), H-y-2, _("Timed"));
1511 	y += 8;
1512 
1513 	Fl_Multiline_Output* explain_events = new Fl_Multiline_Output(
1514 																  X+4, y, W - X - 8, 92, "");
1515 	explain_events->tooltip("");
1516 	explain_events->color(fl_rgb_color(255, 250, 205));
1517 
1518 	std::string message = "\tTimed / Continuous events :\n" \
1519 						  "\tEach transmission is identical to a 'Xmt All' (The entire\n" \
1520 						  "\tqueue is transmitted).  The unproto 'QST (calls) de URCALL'\n" \
1521 						  "\tand the program identifier '<PROG 11 8E48>FLAMP 2.x.x' are\n" \
1522 						  "\tincluded.";
1523 
1524 	explain_events->value(_((char *) message.c_str()));
1525 
1526 	Fl_Group *Timed_Repeat_grp = new Fl_Group(X+4, y+=116, W-2*(X+4), 142, _("Timed Events")); //120
1527 	Timed_Repeat_grp->box(FL_ENGRAVED_BOX);
1528 	Timed_Repeat_grp->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
1529 
1530 	btn_repeat_at_times = new Fl_Check_Button(X+10, y+=8, 20, 20,
1531 											  _("Scheduled times of TX"));
1532 	btn_repeat_at_times->tooltip("");
1533 	btn_repeat_at_times->align(FL_ALIGN_RIGHT);
1534 	btn_repeat_at_times->down_box(FL_DOWN_BOX);
1535 	btn_repeat_at_times->callback((Fl_Callback*)cb_repeat_at_times);
1536 	btn_repeat_at_times->value(progStatus.repeat_at_times);
1537 
1538 	cbo_repeat_every = new Fl_ComboBox(X + 250, y, 140, 20, "Interval"); //20
1539 	cbo_repeat_every->begin();
1540 	cbo_repeat_every->align(FL_ALIGN_RIGHT);
1541 	cbo_repeat_every->when(FL_WHEN_RELEASE);
1542 	cbo_repeat_every->tooltip("");
1543 	cbo_repeat_every->callback((Fl_Callback*)cb_repeat_every);
1544 	cbo_repeat_every->end();
1545 
1546 	txt_repeat_times = new Fl_Input2(X+10, y+=42, W -X -20, 20, "Xmt times (HHMM)");
1547 	txt_repeat_times->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
1548 	txt_repeat_times->tooltip(_("Space/comma delimited times"));
1549 	txt_repeat_times->callback((Fl_Callback*)cb_repeat_times);
1550 	txt_repeat_times->when(FL_WHEN_CHANGED);
1551 	txt_repeat_times->value(progStatus.repeat_times.c_str());
1552 
1553 	btn_auto_load_queue = new Fl_Check_Button(X+10, y+=24, 20, 20,
1554 											  _("Auto Load TX Queue"));
1555 	btn_auto_load_queue->tooltip("");
1556 	btn_auto_load_queue->align(FL_ALIGN_RIGHT);
1557 	btn_auto_load_queue->down_box(FL_DOWN_BOX);
1558 	btn_auto_load_queue->callback((Fl_Callback*)cb_auto_load_que);
1559 	btn_auto_load_queue->value(progStatus.auto_load_queue);
1560 
1561 	btn_load_from_tx_folder = new Fl_Check_Button(X+200, y, 20, 20,
1562 												  _("Load from TX Dir."));
1563 	btn_load_from_tx_folder->tooltip("");
1564 	btn_load_from_tx_folder->align(FL_ALIGN_RIGHT);
1565 	btn_load_from_tx_folder->down_box(FL_DOWN_BOX);
1566 	btn_load_from_tx_folder->callback((Fl_Callback*)cb_load_from_tx_folder);
1567 	btn_load_from_tx_folder->value(progStatus.load_from_tx_folder);
1568 
1569 	btn_manual_load_queue = new Fl_Button(W - 106, y+12, 96, 22, _("Load Queue"));
1570 	btn_manual_load_queue->callback((Fl_Callback*)cb_manual_load_que);
1571 	btn_manual_load_queue->tooltip(_("Load queue with a file list"));
1572 
1573 	txt_auto_load_queue_path = new Fl_Input2(X+10, y+=42, W -X -20, 20, "Path to Load Queue File List");
1574 	txt_auto_load_queue_path->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
1575 	txt_auto_load_queue_path->tooltip(_("Path to the file containing a list of files"));
1576 	txt_auto_load_queue_path->callback((Fl_Callback*)cb_auto_load_queue_path);
1577 	txt_auto_load_queue_path->when(FL_WHEN_CHANGED);
1578 	txt_auto_load_queue_path->value(progStatus.auto_load_queue_path.c_str());
1579 
1580 	Timed_Repeat_grp->end();
1581 
1582 	Fl_Group* Continuous_Events_grp = new Fl_Group(X+4, y+=52, W-2*(X+4), 36, _("Continuous repeat"));
1583 	Continuous_Events_grp->box(FL_ENGRAVED_BOX);
1584 	Continuous_Events_grp->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
1585 
1586 	btn_repeat_forever = new Fl_Check_Button(X+10, y+8, 20, 20,
1587 											 _("Continuous repeat of transmission"));
1588 	btn_repeat_forever->tooltip("");
1589 	btn_repeat_forever->align(FL_ALIGN_RIGHT);
1590 	btn_repeat_forever->down_box(FL_DOWN_BOX);
1591 	btn_repeat_forever->callback((Fl_Callback*)cb_repeat_forever);
1592 	btn_repeat_forever->value(progStatus.repeat_forever);
1593 
1594 	Continuous_Events_grp->end();
1595 
1596 	outTimeValue = new Fl_Output(X+20, y+=44, 70, 24, ""); //52
1597 	outTimeValue->box(FL_DOWN_BOX);
1598 	outTimeValue->color(fl_rgb_color(255, 250, 205));
1599 	outTimeValue->value("");
1600 
1601 	do_events = new Fl_Light_Button(X+100, y, 120, 24, _("Start Events"));
1602 	do_events->callback((Fl_Callback*)cb_do_events);
1603 
1604 	Timed_Events_tab->end();
1605 
1606 	// Timed Even Tab End
1607 	// Timed Events Tab End
1608 	y = Y + 52;
1609 	Fl_Group *Hamcast_Events_tab = (Fl_Group *) new Hamcast_Group(X+2, y, W-2*(X+2), H-y-2, _("Hamcast"));
1610 	//Fl_Group *Hamcast_Events_tab = new Fl_Group(X+2, y, W-2*(X+2), H-y-2, _("Hamcast"));
1611 	y += 8;
1612 
1613 	y += 16;
1614 	int lx = X+12;
1615 	int lx_sep = 150;
1616 
1617 	Fl_Group *Hamcast_mode_group = new Fl_Group(X+4, y+=8, W-2*(X+4), 146, _("Hamcast modem rotation / Queue Transmit Time (on Timed Events)")); //120
1618 	Hamcast_mode_group->box(FL_ENGRAVED_BOX);
1619 	Hamcast_mode_group->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
1620 
1621 	btn_hamcast_mode_cycle = new Fl_Check_Button(lx, y+=8, 20, 20,
1622 												 _("Enable modem rotation"));
1623 	btn_hamcast_mode_cycle->tooltip("");
1624 	btn_hamcast_mode_cycle->align(FL_ALIGN_RIGHT);
1625 	btn_hamcast_mode_cycle->down_box(FL_DOWN_BOX);
1626 	btn_hamcast_mode_cycle->callback((Fl_Callback*)cb_hamcast_mode_cycle);
1627 	btn_hamcast_mode_cycle->value(progStatus.hamcast_mode_cycle);
1628 
1629 	txt_hamcast_select_total_time = new Fl_Output(lx+370, y, 100, 20, "Total Time: ");
1630 	txt_hamcast_select_total_time->tooltip(_("Transfer time"));
1631 	txt_hamcast_select_total_time->value("");
1632 
1633 	btn_hamcast_mode_enable_1 = new Fl_Check_Button(lx, y+=26, 20, 20, _("Enable Modem 1"));
1634 	btn_hamcast_mode_enable_1->tooltip("");
1635 	btn_hamcast_mode_enable_1->align(FL_ALIGN_RIGHT);
1636 	btn_hamcast_mode_enable_1->down_box(FL_DOWN_BOX);
1637 	btn_hamcast_mode_enable_1->callback((Fl_Callback*)cb_hamcast_mode_enable_1);
1638 	btn_hamcast_mode_enable_1->value(progStatus.hamcast_mode_enable_1);
1639 
1640 	cbo_hamcast_mode_selection_1 = new Fl_ComboBox(lx+lx_sep, y, 118, 20, "");
1641 	cbo_hamcast_mode_selection_1->begin();
1642 	cbo_hamcast_mode_selection_1->align(FL_ALIGN_RIGHT);
1643 	cbo_hamcast_mode_selection_1->when(FL_WHEN_RELEASE);
1644 	cbo_hamcast_mode_selection_1->tooltip(_("fldigi modem type"));
1645 	cbo_hamcast_mode_selection_1->box(FL_DOWN_BOX);
1646 	cbo_hamcast_mode_selection_1->color(FL_BACKGROUND2_COLOR);
1647 	cbo_hamcast_mode_selection_1->selection_color(FL_BACKGROUND_COLOR);
1648 	cbo_hamcast_mode_selection_1->labeltype(FL_NORMAL_LABEL);
1649 	cbo_hamcast_mode_selection_1->labelfont(0);
1650 	cbo_hamcast_mode_selection_1->labelsize(14);
1651 	cbo_hamcast_mode_selection_1->labelcolor(FL_FOREGROUND_COLOR);
1652 	cbo_hamcast_mode_selection_1->callback((Fl_Callback*)cb_hamcast_mode_selection_1);
1653 	cbo_hamcast_mode_selection_1->end();
1654 
1655 	txt_hamcast_select_1_time = new Fl_Output(lx+370, y, 100, 20, "Time: ");
1656 	txt_hamcast_select_1_time->tooltip(_("Transfer time"));
1657 	txt_hamcast_select_1_time->value("");
1658 
1659 	btn_hamcast_mode_enable_2 = new Fl_Check_Button(lx, y+=26, 20, 20, _("Enable Modem 2"));
1660 	btn_hamcast_mode_enable_2->tooltip("");
1661 	btn_hamcast_mode_enable_2->align(FL_ALIGN_RIGHT);
1662 	btn_hamcast_mode_enable_2->down_box(FL_DOWN_BOX);
1663 	btn_hamcast_mode_enable_2->callback((Fl_Callback*)cb_hamcast_mode_enable_2);
1664 	btn_hamcast_mode_enable_2->value(progStatus.hamcast_mode_enable_2);
1665 
1666 	cbo_hamcast_mode_selection_2 = new Fl_ComboBox(lx+lx_sep, y, 118, 20, "");
1667 	cbo_hamcast_mode_selection_2->begin();
1668 	cbo_hamcast_mode_selection_2->align(FL_ALIGN_RIGHT);
1669 	cbo_hamcast_mode_selection_2->when(FL_WHEN_RELEASE);
1670 	cbo_hamcast_mode_selection_2->tooltip(_("fldigi modem type"));
1671 	cbo_hamcast_mode_selection_2->box(FL_DOWN_BOX);
1672 	cbo_hamcast_mode_selection_2->color(FL_BACKGROUND2_COLOR);
1673 	cbo_hamcast_mode_selection_2->selection_color(FL_BACKGROUND_COLOR);
1674 	cbo_hamcast_mode_selection_2->labeltype(FL_NORMAL_LABEL);
1675 	cbo_hamcast_mode_selection_2->labelfont(0);
1676 	cbo_hamcast_mode_selection_2->labelsize(14);
1677 	cbo_hamcast_mode_selection_2->labelcolor(FL_FOREGROUND_COLOR);
1678 	cbo_hamcast_mode_selection_2->callback((Fl_Callback*)cb_hamcast_mode_selection_2);
1679 	cbo_hamcast_mode_selection_2->end();
1680 
1681 	txt_hamcast_select_2_time = new Fl_Output(lx+370, y, 100, 20, "Time: ");
1682 	txt_hamcast_select_2_time->tooltip(_("Transfer time"));
1683 	txt_hamcast_select_2_time->value("");
1684 
1685 	btn_hamcast_mode_enable_3 = new Fl_Check_Button(lx, y+=26, 20, 20, _("Enable Modem 3"));
1686 	btn_hamcast_mode_enable_3->tooltip("");
1687 	btn_hamcast_mode_enable_3->align(FL_ALIGN_RIGHT);
1688 	btn_hamcast_mode_enable_3->down_box(FL_DOWN_BOX);
1689 	btn_hamcast_mode_enable_3->callback((Fl_Callback*)cb_hamcast_mode_enable_3);
1690 	btn_hamcast_mode_enable_3->value(progStatus.hamcast_mode_enable_3);
1691 
1692 	cbo_hamcast_mode_selection_3 = new Fl_ComboBox(lx+lx_sep, y, 118, 20, "");
1693 	cbo_hamcast_mode_selection_3->begin();
1694 	cbo_hamcast_mode_selection_3->align(FL_ALIGN_RIGHT);
1695 	cbo_hamcast_mode_selection_3->when(FL_WHEN_RELEASE);
1696 	cbo_hamcast_mode_selection_3->tooltip(_("fldigi modem type"));
1697 	cbo_hamcast_mode_selection_3->box(FL_DOWN_BOX);
1698 	cbo_hamcast_mode_selection_3->color(FL_BACKGROUND2_COLOR);
1699 	cbo_hamcast_mode_selection_3->selection_color(FL_BACKGROUND_COLOR);
1700 	cbo_hamcast_mode_selection_3->labeltype(FL_NORMAL_LABEL);
1701 	cbo_hamcast_mode_selection_3->labelfont(0);
1702 	cbo_hamcast_mode_selection_3->labelsize(14);
1703 	cbo_hamcast_mode_selection_3->labelcolor(FL_FOREGROUND_COLOR);
1704 	cbo_hamcast_mode_selection_3->callback((Fl_Callback*)cb_hamcast_mode_selection_3);
1705 	cbo_hamcast_mode_selection_3->end();
1706 
1707 	txt_hamcast_select_3_time = new Fl_Output(lx+370, y, 100, 20, "Time: ");
1708 	txt_hamcast_select_3_time->tooltip(_("Transfer time"));
1709 	txt_hamcast_select_3_time->value("");
1710 
1711 	btn_hamcast_mode_enable_4 = new Fl_Check_Button(lx, y+=26, 20, 20, _("Enable Modem 4"));
1712 	btn_hamcast_mode_enable_4->tooltip("");
1713 	btn_hamcast_mode_enable_4->align(FL_ALIGN_RIGHT);
1714 	btn_hamcast_mode_enable_4->down_box(FL_DOWN_BOX);
1715 	btn_hamcast_mode_enable_4->callback((Fl_Callback*)cb_hamcast_mode_enable_4);
1716 	btn_hamcast_mode_enable_4->value(progStatus.hamcast_mode_enable_4);
1717 
1718 	cbo_hamcast_mode_selection_4 = new Fl_ComboBox(lx+lx_sep, y, 118, 20, "");
1719 	cbo_hamcast_mode_selection_4->begin();
1720 	cbo_hamcast_mode_selection_4->align(FL_ALIGN_RIGHT);
1721 	cbo_hamcast_mode_selection_4->when(FL_WHEN_RELEASE);
1722 	cbo_hamcast_mode_selection_4->tooltip(_("fldigi modem type"));
1723 	cbo_hamcast_mode_selection_4->box(FL_DOWN_BOX);
1724 	cbo_hamcast_mode_selection_4->color(FL_BACKGROUND2_COLOR);
1725 	cbo_hamcast_mode_selection_4->selection_color(FL_BACKGROUND_COLOR);
1726 	cbo_hamcast_mode_selection_4->labeltype(FL_NORMAL_LABEL);
1727 	cbo_hamcast_mode_selection_4->labelfont(0);
1728 	cbo_hamcast_mode_selection_4->labelsize(14);
1729 	cbo_hamcast_mode_selection_4->labelcolor(FL_FOREGROUND_COLOR);
1730 	cbo_hamcast_mode_selection_4->callback((Fl_Callback*)cb_hamcast_mode_selection_4);
1731 	cbo_hamcast_mode_selection_4->end();
1732 
1733 	txt_hamcast_select_4_time = new Fl_Output(lx+370, y, 100, 20, "Time: ");
1734 	txt_hamcast_select_4_time->tooltip(_("Transfer time"));
1735 	txt_hamcast_select_4_time->value("");
1736 	Hamcast_Events_tab->end();
1737 	// Hamcast Events Tab End
1738 
1739 	event_tabs->add(Timed_Events_tab);
1740 	event_tabs->add(Hamcast_Events_tab);
1741 
1742 	event_tabs->end();
1743 	Events_tab->end();
1744 	// Events Tab End
1745 
1746 	// Configuration Tab
1747 	y = Y + 26;
1748 	Config_tab = new Fl_Group(X+2, y, W-2*(X+2), H-y-2, _("Configure"));
1749 
1750 	y += 10;
1751 
1752 	txt_tx_mycall = new Fl_Input2(X+70, y, 150, 20, _("Callsign"));
1753 	txt_tx_mycall->box(FL_DOWN_BOX);
1754 	txt_tx_mycall->tooltip(_("Callsign of transmitting station"));
1755 	txt_tx_mycall->callback((Fl_Callback*)cb_tx_mycall);
1756 
1757 	txt_tx_myinfo = new Fl_Input2(X+70, y+=26, W-78, 20, _("Info"));
1758 	txt_tx_myinfo->box(FL_DOWN_BOX);
1759 	txt_tx_myinfo->tooltip(_("QTH etc. of transmitting station"));
1760 	txt_tx_myinfo->callback((Fl_Callback*)cb_tx_myinfo);
1761 
1762 
1763 	btn_sync_mode_flamp_fldigi = new Fl_Check_Button(X+70, y+=32, 20, 20,
1764 													 _("Auto sync fldigi to flamp mode selector"));
1765 	btn_sync_mode_flamp_fldigi->tooltip("");
1766 	btn_sync_mode_flamp_fldigi->align(FL_ALIGN_RIGHT);
1767 	btn_sync_mode_flamp_fldigi->down_box(FL_DOWN_BOX);
1768 	btn_sync_mode_flamp_fldigi->callback((Fl_Callback*)cb_sync_mode_flamp_fldigi);
1769 	btn_sync_mode_flamp_fldigi->value(progStatus.sync_mode_flamp_fldigi);
1770 
1771 	btn_sync_mode_fldigi_flamp = new Fl_Check_Button(X+70, y+=26, 20, 20,
1772 													 _("Auto sync flamp to fldigi mode selector"));
1773 	btn_sync_mode_fldigi_flamp->tooltip("");
1774 	btn_sync_mode_fldigi_flamp->align(FL_ALIGN_RIGHT);
1775 	btn_sync_mode_fldigi_flamp->down_box(FL_DOWN_BOX);
1776 	btn_sync_mode_fldigi_flamp->callback((Fl_Callback*)cb_sync_mode_fldigi_flamp);
1777 	btn_sync_mode_fldigi_flamp->value(progStatus.sync_mode_fldigi_flamp);
1778 
1779 	btn_fldigi_xmt_mode_change = new Fl_Check_Button(X+70, y+=26, 20, 20,
1780 													 _("Change fldigi mode just prior to transmit"));
1781 	btn_fldigi_xmt_mode_change->tooltip("");
1782 	btn_fldigi_xmt_mode_change->align(FL_ALIGN_RIGHT);
1783 	btn_fldigi_xmt_mode_change->down_box(FL_DOWN_BOX);
1784 	btn_fldigi_xmt_mode_change->callback((Fl_Callback*)cb_fldigi_xmt_mode_change);
1785 	btn_fldigi_xmt_mode_change->value(progStatus.fldigi_xmt_mode_change);
1786 
1787 	btn_enable_tx_on_report = new Fl_Check_Button(X+70, y+=26, 20, 20,
1788 												  _("Enable Tx on Report"));
1789 	btn_enable_tx_on_report->tooltip("");
1790 	btn_enable_tx_on_report->align(FL_ALIGN_RIGHT);
1791 	btn_enable_tx_on_report->down_box(FL_DOWN_BOX);
1792 	btn_enable_tx_on_report->callback((Fl_Callback*)cb_enable_tx_on_report);
1793 	btn_enable_tx_on_report->value(progStatus.use_tx_on_report);
1794 
1795 
1796 	btn_enable_delete_warning = new Fl_Check_Button(X+70, y+=26, 20, 20,
1797 													_("Warn User when removing files from Queue"));
1798 	btn_enable_delete_warning->tooltip("");
1799 	btn_enable_delete_warning->align(FL_ALIGN_RIGHT);
1800 	btn_enable_delete_warning->down_box(FL_DOWN_BOX);
1801 	btn_enable_delete_warning->callback((Fl_Callback*)cb_enable_delete_warning);
1802 	btn_enable_delete_warning->value(progStatus.enable_delete_warning);
1803 
1804 	btn_clear_tosend_on_tx_blocks = new Fl_Check_Button(X+70, y+=26, 20, 20,
1805 														_("Clear Missing Blocks on Non-Canceled Transmit(s)"));
1806 	btn_clear_tosend_on_tx_blocks->tooltip("");
1807 	btn_clear_tosend_on_tx_blocks->align(FL_ALIGN_RIGHT);
1808 	btn_clear_tosend_on_tx_blocks->down_box(FL_DOWN_BOX);
1809 	btn_clear_tosend_on_tx_blocks->callback((Fl_Callback*)cb_clear_tosend_on_tx_blocks);
1810 	btn_clear_tosend_on_tx_blocks->value(progStatus.clear_tosend_on_tx_blocks);
1811 
1812 
1813 	btn_disable_header_modem_on_block_fills = new Fl_Check_Button(X+70, y+=26, 20, 20,
1814 																  _("Inhibit header modem on block fills"));
1815 	btn_disable_header_modem_on_block_fills->tooltip("");
1816 	btn_disable_header_modem_on_block_fills->align(FL_ALIGN_RIGHT);
1817 	btn_disable_header_modem_on_block_fills->down_box(FL_DOWN_BOX);
1818 	btn_disable_header_modem_on_block_fills->callback((Fl_Callback*)cb_disable_header_modem_on_block_fills);
1819 	btn_disable_header_modem_on_block_fills->value(progStatus.disable_header_modem_on_block_fills);
1820 
1821 	btn_enable_unproto_markers = new Fl_Check_Button(X+70, y+=26, 20, 20,
1822 													 _("Mark start/end of unproto data"));
1823 	btn_enable_unproto_markers->tooltip("");
1824 	btn_enable_unproto_markers->align(FL_ALIGN_RIGHT);
1825 	btn_enable_unproto_markers->down_box(FL_DOWN_BOX);
1826 	btn_enable_unproto_markers->callback((Fl_Callback*)cb_enable_unproto_markers);
1827 	btn_enable_unproto_markers->value(progStatus.enable_unproto_markers);
1828 
1829 	btn_auto_rx_save_local_time = new Fl_Check_Button(X+70, y+=26, 20, 20,
1830 													 _("Auto save subfolders in local time, otherwise UTC"));
1831 	btn_auto_rx_save_local_time->tooltip("");
1832 	btn_auto_rx_save_local_time->align(FL_ALIGN_RIGHT);
1833 	btn_auto_rx_save_local_time->down_box(FL_DOWN_BOX);
1834 	btn_auto_rx_save_local_time->callback((Fl_Callback*)cb_auto_rx_save_local_time);
1835 	btn_auto_rx_save_local_time->value(progStatus.auto_rx_save_local_time);
1836 
1837 
1838 	btn_enable_header_modem = new Fl_Check_Button(X+70, y+=26, 20, 20,
1839 												  _("Enable header modem (Sync flamp to fldigi ignored)"));
1840 	btn_enable_header_modem->tooltip("");
1841 	btn_enable_header_modem->align(FL_ALIGN_RIGHT);
1842 	btn_enable_header_modem->down_box(FL_DOWN_BOX);
1843 	btn_enable_header_modem->callback((Fl_Callback*)cb_enable_header_modem);
1844 	btn_enable_header_modem->value(progStatus.use_header_modem);
1845 
1846 	cbo_header_modes = new Fl_ComboBox(X+94, y+=26, 118, 20, "");
1847 	cbo_header_modes->begin();
1848 	cbo_header_modes->align(FL_ALIGN_RIGHT);
1849 	cbo_header_modes->when(FL_WHEN_RELEASE);
1850 	cbo_header_modes->tooltip(_("fldigi modem type"));
1851 	cbo_header_modes->box(FL_DOWN_BOX);
1852 	cbo_header_modes->color(FL_BACKGROUND2_COLOR);
1853 	cbo_header_modes->selection_color(FL_BACKGROUND_COLOR);
1854 	cbo_header_modes->labeltype(FL_NORMAL_LABEL);
1855 	cbo_header_modes->labelfont(0);
1856 	cbo_header_modes->labelsize(14);
1857 	cbo_header_modes->labelcolor(FL_FOREGROUND_COLOR);
1858 	cbo_header_modes->callback((Fl_Callback*)cb_header_modes);
1859 	cbo_header_modes->end();
1860 
1861 	btn_enable_txrx_interval = new Fl_Check_Button(X+70, y+=26, 20, 20,
1862 												   _("Enable TX/RX Interval"));
1863 	btn_enable_txrx_interval->tooltip("");
1864 	btn_enable_txrx_interval->align(FL_ALIGN_RIGHT);
1865 	btn_enable_txrx_interval->down_box(FL_DOWN_BOX);
1866 	btn_enable_txrx_interval->callback((Fl_Callback*)cb_enable_txrx_interval);
1867 	btn_enable_txrx_interval->value(progStatus.use_txrx_interval);
1868 
1869 	cnt_tx_interval_mins = new Fl_Counter(X+25, y+=26, 100, 20, _("Tx Duration Mins"));
1870 	cnt_tx_interval_mins->step(0.05, 1.0);
1871 	cnt_tx_interval_mins->value(progStatus.tx_interval_minutes);
1872 	cnt_tx_interval_mins->minimum(1);
1873 	cnt_tx_interval_mins->maximum(ID_TIME_MINUTES);
1874 	cnt_tx_interval_mins->align(FL_ALIGN_RIGHT);
1875 	cnt_tx_interval_mins->callback((Fl_Callback*)cb_tx_interval_mins);
1876 	cnt_tx_interval_mins->tooltip(_("Transmit Duration in Minutes"));
1877 
1878 	txt_tx_interval = new Fl_Output(w->w()/2 + 50, y, 50, 20, "mm:ss");
1879 	txt_tx_interval->align(FL_ALIGN_TOP);
1880 	set_txt_tx_interval();
1881 
1882 	cnt_rx_interval_secs = new Fl_Simple_Counter(X+25, y+=26, 60, 20, _("Rx Duration Secs"));
1883 	cnt_rx_interval_secs->step(1);
1884 	cnt_rx_interval_secs->value(progStatus.rx_interval_seconds);
1885 	cnt_rx_interval_secs->minimum(MIN_INTERAL_TIME);
1886 	cnt_rx_interval_secs->maximum(120);
1887 	cnt_rx_interval_secs->align(FL_ALIGN_RIGHT);
1888 	cnt_rx_interval_secs->callback((Fl_Callback*)cb_rx_interval_secs);
1889 	cnt_rx_interval_secs->tooltip(_("Receive Duration in Seconds"));
1890 
1891 	Config_tab->end();
1892 
1893 	// Configuration Tab End
1894 
1895 	tabs->add(Rx_tab);
1896 	tabs->add(Tx_tab);
1897 	tabs->add(Events_tab);
1898 	tabs->add(Config_tab);
1899 
1900 	tabs->end();
1901 	w->end();
1902 
1903 	init_encoders();
1904 	init_cbo_modes();
1905 	init_cbo_events();
1906 
1907 	return w;
1908 }
1909 
1910