summaryrefslogtreecommitdiffstats
path: root/languages/pascal/compiler/fpcoptions/optiontabs.cpp
blob: 86c77cda94610cfdf058f0384dad320d59a2cd6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
/***************************************************************************
 *   Copyright (C) 2003 Alexander Dymo                                     *
 *   cloudtemple@mksat.net                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#include <kdialog.h>
#include <tdelocale.h>

#include <tqspinbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqvbuttongroup.h>
#include <tqapplication.h>
#include <tqframe.h>
#include <tqpushbutton.h>

#include "flagboxes.h"

#include "optiontabs.h"

FeedbackTab::FeedbackTab(TQWidget *parent, const char *name)
    : TQWidget(parent, name), controller(new FlagCheckBoxController(TQStringList::split(",","-v")))
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    TQVButtonGroup *output_group = new TQVButtonGroup(i18n("Output"), this);
    new FlagCheckBox(output_group, controller,
                     "-vr", i18n("Format errors like GCC does"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQVButtonGroup *verbose_group = new TQVButtonGroup(i18n("Verbose"), this);
    new FlagCheckBox(verbose_group, controller,
                     "-va", i18n("Write all possible info"));
    new FlagCheckBox(verbose_group, controller,
                     "-v0", i18n("Write no messages"));
    new FlagCheckBox(verbose_group, controller,
                     "-ve", i18n("Show only errors"));
    new FlagCheckBox(verbose_group, controller,
                     "-vi", i18n("Show some general information"));
    new FlagCheckBox(verbose_group, controller,
                     "-vw", i18n("Issue warnings"));
    new FlagCheckBox(verbose_group, controller,
                     "-vn", i18n("Issue notes"));
    new FlagCheckBox(verbose_group, controller,
                     "-vh", i18n("Issue hints"));
    new FlagCheckBox(verbose_group, controller,
                     "-vd", i18n("Write other debugging info"));

    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQVButtonGroup *other_group = new TQVButtonGroup(i18n("Other Information"), this);
    new FlagCheckBox(other_group, controller,
                     "-vl", i18n("Show line numbers when processing files"));
    new FlagCheckBox(other_group, controller,
                     "-vu", i18n("Print information on loaded units"));
    new FlagCheckBox(other_group, controller,
                     "-vt", i18n("Print the names of loaded files"));
    new FlagCheckBox(other_group, controller,
                     "-vm", i18n("Write which macros are defined"));
    new FlagCheckBox(other_group, controller,
                     "-vc", i18n("Warn when processing a conditional"));
    new FlagCheckBox(other_group, controller,
                     "-vp", i18n("Print the names of procedures and functions"));
    new FlagCheckBox(other_group, controller,
                     "-vb", i18n("Show all procedure declarations if an overloaded function error occurs"));

    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addStretch();
}

FeedbackTab::~FeedbackTab()
{
    delete controller;
}

void FeedbackTab::readFlags(TQStringList *list)
{
    controller->readFlags(list);
}

void FeedbackTab::writeFlags(TQStringList *list)
{
    controller->writeFlags(list);
}



FilesAndDirectoriesTab::FilesAndDirectoriesTab( TQWidget * parent, const char * name )
    :TQWidget(parent, name), controller(new FlagCheckBoxController()),
    pathController(new FlagPathEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagPathEdit(this, ":", pathController,
                     "-Fu", i18n("Unit search path (delimited by \":\"):"));
    new FlagPathEdit(this, ":", pathController,
                     "-Fi", i18n("Include file search path (delimited by \":\"):"));
    new FlagPathEdit(this, ":", pathController,
                     "-Fo", i18n("Object file search path (delimited by \":\"):"));
    new FlagPathEdit(this, ":", pathController,
                     "-Fl", i18n("Library search path (delimited by \":\"):"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addStretch();
}

FilesAndDirectoriesTab::~FilesAndDirectoriesTab( )
{
    delete controller;
    delete pathController;
}

void FilesAndDirectoriesTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    pathController->readFlags(str);
}

void FilesAndDirectoriesTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    pathController->writeFlags(str);
}

FilesAndDirectoriesTab2::FilesAndDirectoriesTab2( TQWidget * parent, const char * name )
    :TQWidget(parent, name), controller(new FlagCheckBoxController()),
    pathController(new FlagPathEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagPathEdit(this, "", pathController,
                     "-FE", i18n("Write executables and units in:"));
    new FlagPathEdit(this, "", pathController,
                     "-FU", i18n("Write units in:"));
    new FlagPathEdit(this, "", pathController,
                     "-o", i18n("Executable name:"), KFile::File);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(20);

    new FlagPathEdit(this, "", pathController,
                     "-e", i18n("Location of as and ld programs:"));
    new FlagPathEdit(this, "", pathController,
                     "-FL", i18n("Dynamic linker executable:"), KFile::File);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(20);

    new FlagPathEdit(this, "", pathController,
                     "-Fr", i18n("Compiler messages file:"), KFile::File);
    new FlagPathEdit(this, "", pathController,
                     "-Fe", i18n("Write compiler messages to file:"), KFile::File);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addStretch();
}

FilesAndDirectoriesTab2::~FilesAndDirectoriesTab2( )
{
    delete controller;
    delete pathController;
}

void FilesAndDirectoriesTab2::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    pathController->readFlags(str);
}

void FilesAndDirectoriesTab2::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    pathController->writeFlags(str);
}


LanguageTab::LanguageTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), controller(new FlagCheckBoxController(TQStringList::split(",","-v")))
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    TQVButtonGroup *compat_group = new TQVButtonGroup(i18n("Pascal Compatibility"), this);
    new FlagCheckBox(compat_group, controller,
                     "-S2", i18n("Switch on Delphi 2 extensions"));
    new FlagCheckBox(compat_group, controller,
                     "-Sd", i18n("Strict Delphi compatibility mode"));
    new FlagCheckBox(compat_group, controller,
                     "-So", i18n("Borland TP 7.0 compatibility mode"));
    new FlagCheckBox(compat_group, controller,
                     "-Sp", i18n("GNU Pascal compatibility mode"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQVButtonGroup *ccompat_group = new TQVButtonGroup(i18n("C/C++ Compatibility"), this);
    new FlagCheckBox(ccompat_group, controller,
                     "-Sc", i18n("Support C style operators *=, +=, /=, -="));
    new FlagCheckBox(ccompat_group, controller,
                     "-Si", i18n("Support C++ style INLINE"));
    new FlagCheckBox(ccompat_group, controller,
                     "-Sm", i18n("Support C style macros"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQVButtonGroup *lang_group = new TQVButtonGroup(i18n("Language"), this);
    new FlagCheckBox(lang_group, controller,
                     "-Sg", i18n("Support the label and goto commands"));
    new FlagCheckBox(lang_group, controller,
                     "-Sh", i18n("Use ansistrings by default for strings"));
    new FlagCheckBox(lang_group, controller,
                     "-Ss", i18n("Require the name of constructors to be init\n and the name of destructors to be done"));
    new FlagCheckBox(lang_group, controller,
                     "-St", i18n("Allow the static keyword in objects"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addStretch();
}

 LanguageTab::~ LanguageTab( )
{
    delete controller;
}

void LanguageTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
}

void LanguageTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
}

AssemblerTab::AssemblerTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), controller(new FlagCheckBoxController()),
    asmController(new FlagRadioButtonController)
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
//    layout->setAutoAdd(true);

    TQBoxLayout *layout2 = new TQHBoxLayout(layout, KDialog::spacingHint());

    TQVButtonGroup *info_group = new TQVButtonGroup(i18n("Assembler Info"), this);
    new FlagCheckBox(info_group, controller,
                     "-a", i18n("Do not delete assembler files"));
    new FlagCheckBox(info_group, controller,
                     "-al", i18n("List source"));
    new FlagCheckBox(info_group, controller,
                     "-ar", i18n("List register allocation and release info"));
    new FlagCheckBox(info_group, controller,
                     "-at", i18n("List temporary allocations and deallocations"));
    layout2->addWidget(info_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    //layout->addSpacing(10);

    TQVButtonGroup *asmkind_group = new TQVButtonGroup(i18n("Assembler Reader"), this);
    TQRadioButton *m_defaultkind = new TQRadioButton(i18n("Use default reader"), asmkind_group);
    m_defaultkind->setChecked(true);
    new FlagRadioButton(asmkind_group, asmController,
                        "-Ratt", i18n("AT&T style assembler"));
    new FlagRadioButton(asmkind_group, asmController,
                        "-Rintel", i18n("Intel style assembler"));
    new FlagRadioButton(asmkind_group, asmController,
                        "-Rdirect", i18n("Direct assembler"));
    layout2->addWidget(asmkind_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);


    TQVButtonGroup *asm_group = new TQVButtonGroup(i18n("Assembler Output"), this);
    new FlagCheckBox(asm_group, controller,
                     "-P", i18n("Use pipes instead of files when assembling"));
    TQRadioButton *m_default = new TQRadioButton(i18n("Use default output"), asm_group);
    m_default->setChecked(true);
    new FlagRadioButton(asm_group, asmController,
                        "-Aas", i18n("Use GNU as"));
    new FlagRadioButton(asm_group, asmController,
                        "-Aasout", i18n("Use GNU asaout"));
    new FlagRadioButton(asm_group, asmController,
                        "-Anasmcoff", i18n("Use NASM coff"));
    new FlagRadioButton(asm_group, asmController,
                        "-Anasmelf", i18n("Use NASM elf"));
    new FlagRadioButton(asm_group, asmController,
                        "-Anasmobj", i18n("Use NASM obj"));
    new FlagRadioButton(asm_group, asmController,
                        "-Amasm", i18n("Use MASM"));
    new FlagRadioButton(asm_group, asmController,
                        "-Atasm", i18n("Use TASM"));
    new FlagRadioButton(asm_group, asmController,
                        "-Acoff", i18n("Use coff"));
    new FlagRadioButton(asm_group, asmController,
                        "-Apecoff", i18n("Use pecoff"));
    layout->addWidget(asm_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addStretch();
}

 AssemblerTab::~ AssemblerTab( )
{
    delete controller;
    delete asmController;
}

void AssemblerTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    asmController->readFlags(str);
}

void AssemblerTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    asmController->writeFlags(str);
}



DebugOptimTab::DebugOptimTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), controller(new FlagCheckBoxController()),
    optimController(new FlagRadioButtonController)
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
//    layout->setAutoAdd(true);

    TQBoxLayout *layout2 = new TQHBoxLayout(layout, KDialog::spacingHint());

    TQBoxLayout *layout3 = new TQVBoxLayout(layout2, KDialog::spacingHint());

    TQVButtonGroup *debug_group = new TQVButtonGroup(i18n("Debugging"), this);
    new FlagCheckBox(debug_group, controller,
                     "-g", i18n("Generate information for GDB"), "-!g");
    new FlagCheckBox(debug_group, controller,
                     "-gd", i18n("Generate information for DBX"), "-!gd");
    new FlagCheckBox(debug_group, controller,
                     "-gl", i18n("Use lineinfo unit"), "-!gl");
    new FlagCheckBox(debug_group, controller,
                     "-gh", i18n("Use heaptrc unit"), "-!gh");
    new FlagCheckBox(debug_group, controller,
                     "-gc", i18n("Generate checks for pointers"), "-!gc");
    layout3->addWidget(debug_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout3->addSpacing(10);

    TQVButtonGroup *profile_group = new TQVButtonGroup(i18n("Profiling"), this);
    new FlagCheckBox(profile_group, controller,
                     "-pg", i18n("Generate profiler code for gprof"), "-!pg");
    layout3->addWidget(profile_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout3->addSpacing(10);

    TQBoxLayout *layout4 = new TQVBoxLayout(layout2, KDialog::spacingHint());

    TQVButtonGroup *optim_group1 = new TQVButtonGroup(i18n("General Optimization"), this);
    m_default = new TQRadioButton(i18n("Default"), optim_group1);
    m_default->setChecked(true);
    new FlagRadioButton(optim_group1, optimController,
                        "-Og", i18n("Generate smaller code"));
    optim1 = new FlagRadioButton(optim_group1, optimController,
                        "-OG", i18n("Generate faster code"));
    layout4->addWidget(optim_group1);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout4->addSpacing(10);

    TQVButtonGroup *optim_group2 = new TQVButtonGroup(i18n("Optimization Levels"), this);
    m_default2 = new TQRadioButton(i18n("Default"), optim_group2);
    m_default2->setChecked(true);
    new FlagRadioButton(optim_group2, optimController,
                        "-O1", i18n("Level 1"));
    new FlagRadioButton(optim_group2, optimController,
                        "-O2", i18n("Level 2"));
    optim2 = new FlagRadioButton(optim_group2, optimController,
                        "-O3", i18n("Level 3"));
    layout4->addWidget(optim_group2);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout4->addSpacing(10);

    TQHBoxLayout *layout5 = new TQHBoxLayout(layout, KDialog::spacingHint());

    TQVButtonGroup *optim_group3 = new TQVButtonGroup(i18n("Architecture"), this);
    m_default3 = new TQRadioButton(i18n("Default"), optim_group3);
    m_default3->setChecked(true);
    new FlagRadioButton(optim_group3, optimController,
                     "-Op1", i18n("386/486"));
    new FlagRadioButton(optim_group3, optimController,
                     "-Op2", i18n("Pentium/PentiumMMX"));
    new FlagRadioButton(optim_group3, optimController,
                     "-Op2", i18n("PentiumPro/PII/Cyrix 6x86/K6"));
    layout5->addWidget(optim_group3);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    TQVButtonGroup *optim_group4 = new TQVButtonGroup(i18n("Another Optimization"), this);
    new FlagCheckBox(optim_group4, controller,
                     "-Or", i18n("Use register variables"), "-!Or");
    new FlagCheckBox(optim_group4, controller,
                     "-Ou", i18n("Uncertain optimizations"), "-!Ou");
    layout5->addWidget(optim_group4);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    TQHBoxLayout *layout6 = new TQHBoxLayout(layout, KDialog::spacingHint());
    TQPushButton *release = new TQPushButton(i18n("Release"), this);
    TQPushButton *debug = new TQPushButton(i18n("Debug"), this);
    layout6->addWidget(release);
    layout6->addWidget(debug);
    connect(release, TQT_SIGNAL(clicked()), this, TQT_SLOT(setReleaseOptions()));
    connect(debug, TQT_SIGNAL(clicked()), this, TQT_SLOT(setDebugOptions()));

    layout->addStretch();
}

 DebugOptimTab::~ DebugOptimTab( )
{
    delete controller;
    delete optimController;
}

void DebugOptimTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    optimController->readFlags(str);
}

void DebugOptimTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    optimController->writeFlags(str);
}

void DebugOptimTab::setReleaseOptions()
{
    m_default->setChecked(true);
    m_default2->setChecked(true);
//    m_default3->setChecked(true);
    TQStringList sl = TQStringList::split(",", "-!g,-!gd,-!gl,-!gh,-!gc,-!pg,-!Ou,-!Or");
    readFlags(&sl);
    optim1->setChecked(true);
    optim2->setChecked(true);
}

void DebugOptimTab::setDebugOptions()
{
    TQStringList sl = TQStringList::split(",", "-g,-gl,-gh,-gc");
    readFlags(&sl);
    m_default->setChecked(true);
    m_default2->setChecked(true);
//    m_default3->setChecked(true);
}

CodegenTab::CodegenTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), controller(new FlagCheckBoxController()),
    listController(new FlagEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    TQVButtonGroup *compile_group = new TQVButtonGroup(i18n("Compile Time Checks"), this);
    new FlagCheckBox(compile_group, controller,
                     "-Sa", i18n("Include assert statements in compiled code"));
    new FlagCheckBox(compile_group, controller,
                     "-Un", i18n("Do not check the unit name for being the same as the file name"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQVButtonGroup *run_group = new TQVButtonGroup(i18n("Run Time Checks"), this);
    new FlagCheckBox(run_group, controller,
                     "-Cr", i18n("Range checking"));
    new FlagCheckBox(run_group, controller,
                     "-Ct", i18n("Stack checking"));
    new FlagCheckBox(run_group, controller,
                     "-Ci", i18n("Input/Output checking"));
    new FlagCheckBox(run_group, controller,
                     "-Co", i18n("Integer overflow checking"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagListEdit(this, ":", listController, "-d", i18n("Conditional defines (delimited by \":\"):"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    new FlagListEdit(this, ":", listController, "-u", i18n("Undefine conditional defines (delimited by \":\"):"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagSpinEdit(this, 1024, 67107840, 1, 131072, listController,
                    "-Cs", i18n("Stack size:"));
    new FlagSpinEdit(this, 1024, 67107840, 1, 2097152, listController,
                    "-Ch", i18n("Heap size:"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addStretch();
}

CodegenTab::~ CodegenTab( )
{
    delete controller;
    delete listController;
}

void CodegenTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    listController->readFlags(str);
}

void CodegenTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    listController->writeFlags(str);
}

LinkerTab::LinkerTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), controller(new FlagCheckBoxController()),
    listController(new FlagEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());

    TQBoxLayout *layout2 = new TQHBoxLayout(layout, KDialog::spacingHint());

    TQVButtonGroup *link_group = new TQVButtonGroup(i18n("Linking Stage"), this);
    new FlagCheckBox(link_group, controller,
                     "-CD", i18n("Create dynamic library"));
    new FlagCheckBox(link_group, controller,
                     "-CX", i18n("Create smartlinked units"));
    new FlagCheckBox(link_group, controller,
                     "-Ur", i18n("Generate release units"));
    new FlagCheckBox(link_group, controller,
                     "-Cn", i18n("Omit the linking stage"));
    new FlagCheckBox(link_group, controller,
                     "-s",  i18n("Create assembling and linking script"));
    layout2->addWidget(link_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    TQVButtonGroup *exec_group = new TQVButtonGroup(i18n("Executable Generation"), this);
    new FlagCheckBox(exec_group, controller,
                     "-Xs",  i18n("Strip the symbols from the executable"));
    new FlagCheckBox(exec_group, controller,
                     "-XS",  i18n("Link with static units"));
    new FlagCheckBox(exec_group, controller,
                     "-XX",  i18n("Link with smartlinked units"));
    new FlagCheckBox(exec_group, controller,
                     "-XD",  i18n("Link with dynamic libraries"));
    new FlagCheckBox(exec_group, controller,
                     "-Xc",  i18n("Link with the C library"));
    layout2->addWidget(exec_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    FlagListEdit *led = new FlagListEdit(this, ":", listController, "-k", i18n("Options passed to the linker (delimited by \":\"):"));
    layout->addWidget(led);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addStretch();
}

LinkerTab::~LinkerTab( )
{
    delete controller;
    delete listController;
}

void LinkerTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    listController->readFlags(str);
}

void LinkerTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    listController->writeFlags(str);
}

MiscTab::MiscTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), controller(new FlagCheckBoxController()),
    radioController(new FlagRadioButtonController()),
    pathController(new FlagPathEditController()),
    editController(new FlagEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagCheckBox(this, controller,
                     "-B", i18n("Recompile all used units"));
    new FlagCheckBox(this, controller,
                     "-n", i18n("Do not read default configuration file"));
    new FlagPathEdit(this, "", pathController,
                     "@", i18n("Compiler configuration file:"), KFile::File);
    new FlagSpinEdit(this, 1, 1000, 1, 50, editController,
                    "-Se", i18n("Stop after the error:"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQVButtonGroup *browser_group = new TQVButtonGroup(i18n("Browser Info"), this);
    TQRadioButton *m_defaultBrowser = new TQRadioButton(i18n("No browser info"), browser_group);
    m_defaultBrowser->setChecked(true);
    new FlagRadioButton(browser_group, radioController,
                     "-b", i18n("Global browser info"));
    new FlagRadioButton(browser_group, radioController,
                     "-bl", i18n("Global and local browser info"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQVButtonGroup *target_group = new TQVButtonGroup(i18n("Target OS"), this);
    TQRadioButton *m_defaultTarget = new TQRadioButton(i18n("Default"), target_group);
    m_defaultTarget->setChecked(true);
    new FlagRadioButton(target_group, radioController,
                     "-TGO32V1", i18n("DOS and version 1 of the DJ DELORIE extender"));
    new FlagRadioButton(target_group, radioController,
                     "-TGO32V2", i18n("DOS and version 2 of the DJ DELORIE extender"));
    new FlagRadioButton(target_group, radioController,
                     "-TLINUX",  i18n("Linux"));
    new FlagRadioButton(target_group, radioController,
                     "-TOS2", i18n("OS/2 (2.x) using the EMX extender"));
    new FlagRadioButton(target_group, radioController,
                     "-TWIN32", i18n("WINDOWS 32 bit"));
    new FlagRadioButton(target_group, radioController,
                     "-TSUNOS", i18n("SunOS/Solaris"));
    new FlagRadioButton(target_group, radioController,
                     "-TBEOS", i18n("BeOS"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    layout->addStretch();
}

MiscTab::~ MiscTab( )
{
    delete controller;
    delete pathController;
    delete radioController;
    delete editController;
}

void MiscTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    radioController->readFlags(str);
    pathController->readFlags(str);
    editController->readFlags(str);
}

void MiscTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    radioController->writeFlags(str);
    pathController->writeFlags(str);
    editController->writeFlags(str);
}

#include "optiontabs.moc"