~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/pascal/compiler/fpcoptions/optiontabs.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2003 Alexander Dymo                                     *
 
3
 *   cloudtemple@mksat.net                                                 *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 ***************************************************************************/
 
11
#include <kdialog.h>
 
12
#include <klocale.h>
 
13
 
 
14
#include <qspinbox.h>
 
15
#include <qlabel.h>
 
16
#include <qlayout.h>
 
17
#include <qvbuttongroup.h>
 
18
#include <qapplication.h>
 
19
#include <qframe.h>
 
20
#include <qpushbutton.h>
 
21
 
 
22
#include "flagboxes.h"
 
23
 
 
24
#include "optiontabs.h"
 
25
 
 
26
FeedbackTab::FeedbackTab(QWidget *parent, const char *name)
 
27
    : QWidget(parent, name), controller(new FlagCheckBoxController(QStringList::split(",","-v")))
 
28
{
 
29
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
30
    layout->setAutoAdd(true);
 
31
 
 
32
    QVButtonGroup *output_group = new QVButtonGroup(i18n("Output"), this);
 
33
    new FlagCheckBox(output_group, controller,
 
34
                     "-vr", i18n("Format errors like GCC does"));
 
35
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
36
    layout->addSpacing(10);
 
37
 
 
38
    QVButtonGroup *verbose_group = new QVButtonGroup(i18n("Verbose"), this);
 
39
    new FlagCheckBox(verbose_group, controller,
 
40
                     "-va", i18n("Write all possible info"));
 
41
    new FlagCheckBox(verbose_group, controller,
 
42
                     "-v0", i18n("Write no messages"));
 
43
    new FlagCheckBox(verbose_group, controller,
 
44
                     "-ve", i18n("Show only errors"));
 
45
    new FlagCheckBox(verbose_group, controller,
 
46
                     "-vi", i18n("Show some general information"));
 
47
    new FlagCheckBox(verbose_group, controller,
 
48
                     "-vw", i18n("Issue warnings"));
 
49
    new FlagCheckBox(verbose_group, controller,
 
50
                     "-vn", i18n("Issue notes"));
 
51
    new FlagCheckBox(verbose_group, controller,
 
52
                     "-vh", i18n("Issue hints"));
 
53
    new FlagCheckBox(verbose_group, controller,
 
54
                     "-vd", i18n("Write other debugging info"));
 
55
 
 
56
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
57
    layout->addSpacing(10);
 
58
 
 
59
    QVButtonGroup *other_group = new QVButtonGroup(i18n("Other Information"), this);
 
60
    new FlagCheckBox(other_group, controller,
 
61
                     "-vl", i18n("Show line numbers when processing files"));
 
62
    new FlagCheckBox(other_group, controller,
 
63
                     "-vu", i18n("Print information on loaded units"));
 
64
    new FlagCheckBox(other_group, controller,
 
65
                     "-vt", i18n("Print the names of loaded files"));
 
66
    new FlagCheckBox(other_group, controller,
 
67
                     "-vm", i18n("Write which macros are defined"));
 
68
    new FlagCheckBox(other_group, controller,
 
69
                     "-vc", i18n("Warn when processing a conditional"));
 
70
    new FlagCheckBox(other_group, controller,
 
71
                     "-vp", i18n("Print the names of procedures and functions"));
 
72
    new FlagCheckBox(other_group, controller,
 
73
                     "-vb", i18n("Show all procedure declarations if an overloaded function error occurs"));
 
74
 
 
75
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
76
 
 
77
    layout->addStretch();
 
78
}
 
79
 
 
80
FeedbackTab::~FeedbackTab()
 
81
{
 
82
    delete controller;
 
83
}
 
84
 
 
85
void FeedbackTab::readFlags(QStringList *list)
 
86
{
 
87
    controller->readFlags(list);
 
88
}
 
89
 
 
90
void FeedbackTab::writeFlags(QStringList *list)
 
91
{
 
92
    controller->writeFlags(list);
 
93
}
 
94
 
 
95
 
 
96
 
 
97
FilesAndDirectoriesTab::FilesAndDirectoriesTab( QWidget * parent, const char * name )
 
98
    :QWidget(parent, name), controller(new FlagCheckBoxController()),
 
99
    pathController(new FlagPathEditController())
 
100
{
 
101
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
102
    layout->setAutoAdd(true);
 
103
 
 
104
    new FlagPathEdit(this, ":", pathController,
 
105
                     "-Fu", i18n("Unit search path (delimited by \":\"):"));
 
106
    new FlagPathEdit(this, ":", pathController,
 
107
                     "-Fi", i18n("Include file search path (delimited by \":\"):"));
 
108
    new FlagPathEdit(this, ":", pathController,
 
109
                     "-Fo", i18n("Object file search path (delimited by \":\"):"));
 
110
    new FlagPathEdit(this, ":", pathController,
 
111
                     "-Fl", i18n("Library search path (delimited by \":\"):"));
 
112
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
113
    layout->addStretch();
 
114
}
 
115
 
 
116
FilesAndDirectoriesTab::~FilesAndDirectoriesTab( )
 
117
{
 
118
    delete controller;
 
119
    delete pathController;
 
120
}
 
121
 
 
122
void FilesAndDirectoriesTab::readFlags( QStringList * str )
 
123
{
 
124
    controller->readFlags(str);
 
125
    pathController->readFlags(str);
 
126
}
 
127
 
 
128
void FilesAndDirectoriesTab::writeFlags( QStringList * str )
 
129
{
 
130
    controller->writeFlags(str);
 
131
    pathController->writeFlags(str);
 
132
}
 
133
 
 
134
FilesAndDirectoriesTab2::FilesAndDirectoriesTab2( QWidget * parent, const char * name )
 
135
    :QWidget(parent, name), controller(new FlagCheckBoxController()),
 
136
    pathController(new FlagPathEditController())
 
137
{
 
138
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
139
    layout->setAutoAdd(true);
 
140
 
 
141
    new FlagPathEdit(this, "", pathController,
 
142
                     "-FE", i18n("Write executables and units in:"));
 
143
    new FlagPathEdit(this, "", pathController,
 
144
                     "-FU", i18n("Write units in:"));
 
145
    new FlagPathEdit(this, "", pathController,
 
146
                     "-o", i18n("Executable name:"), KFile::File);
 
147
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
148
    layout->addSpacing(20);
 
149
 
 
150
    new FlagPathEdit(this, "", pathController,
 
151
                     "-e", i18n("Location of as and ld programs:"));
 
152
    new FlagPathEdit(this, "", pathController,
 
153
                     "-FL", i18n("Dynamic linker executable:"), KFile::File);
 
154
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
155
    layout->addSpacing(20);
 
156
 
 
157
    new FlagPathEdit(this, "", pathController,
 
158
                     "-Fr", i18n("Compiler messages file:"), KFile::File);
 
159
    new FlagPathEdit(this, "", pathController,
 
160
                     "-Fe", i18n("Write compiler messages to file:"), KFile::File);
 
161
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
162
 
 
163
    layout->addStretch();
 
164
}
 
165
 
 
166
FilesAndDirectoriesTab2::~FilesAndDirectoriesTab2( )
 
167
{
 
168
    delete controller;
 
169
    delete pathController;
 
170
}
 
171
 
 
172
void FilesAndDirectoriesTab2::readFlags( QStringList * str )
 
173
{
 
174
    controller->readFlags(str);
 
175
    pathController->readFlags(str);
 
176
}
 
177
 
 
178
void FilesAndDirectoriesTab2::writeFlags( QStringList * str )
 
179
{
 
180
    controller->writeFlags(str);
 
181
    pathController->writeFlags(str);
 
182
}
 
183
 
 
184
 
 
185
LanguageTab::LanguageTab( QWidget * parent, const char * name )
 
186
    : QWidget(parent, name), controller(new FlagCheckBoxController(QStringList::split(",","-v")))
 
187
{
 
188
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
189
    layout->setAutoAdd(true);
 
190
 
 
191
    QVButtonGroup *compat_group = new QVButtonGroup(i18n("Pascal Compatibility"), this);
 
192
    new FlagCheckBox(compat_group, controller,
 
193
                     "-S2", i18n("Switch on Delphi 2 extensions"));
 
194
    new FlagCheckBox(compat_group, controller,
 
195
                     "-Sd", i18n("Strict Delphi compatibility mode"));
 
196
    new FlagCheckBox(compat_group, controller,
 
197
                     "-So", i18n("Borland TP 7.0 compatibility mode"));
 
198
    new FlagCheckBox(compat_group, controller,
 
199
                     "-Sp", i18n("GNU Pascal compatibility mode"));
 
200
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
201
    layout->addSpacing(10);
 
202
 
 
203
    QVButtonGroup *ccompat_group = new QVButtonGroup(i18n("C/C++ Compatibility"), this);
 
204
    new FlagCheckBox(ccompat_group, controller,
 
205
                     "-Sc", i18n("Support C style operators *=, +=, /=, -="));
 
206
    new FlagCheckBox(ccompat_group, controller,
 
207
                     "-Si", i18n("Support C++ style INLINE"));
 
208
    new FlagCheckBox(ccompat_group, controller,
 
209
                     "-Sm", i18n("Support C style macros"));
 
210
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
211
    layout->addSpacing(10);
 
212
 
 
213
    QVButtonGroup *lang_group = new QVButtonGroup(i18n("Language"), this);
 
214
    new FlagCheckBox(lang_group, controller,
 
215
                     "-Sg", i18n("Support the label and goto commands"));
 
216
    new FlagCheckBox(lang_group, controller,
 
217
                     "-Sh", i18n("Use ansistrings by default for strings"));
 
218
    new FlagCheckBox(lang_group, controller,
 
219
                     "-Ss", i18n("Require the name of constructors to be init\n and the name of destructors to be done"));
 
220
    new FlagCheckBox(lang_group, controller,
 
221
                     "-St", i18n("Allow the static keyword in objects"));
 
222
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
223
 
 
224
    layout->addStretch();
 
225
}
 
226
 
 
227
 LanguageTab::~ LanguageTab( )
 
228
{
 
229
    delete controller;
 
230
}
 
231
 
 
232
void LanguageTab::readFlags( QStringList * str )
 
233
{
 
234
    controller->readFlags(str);
 
235
}
 
236
 
 
237
void LanguageTab::writeFlags( QStringList * str )
 
238
{
 
239
    controller->writeFlags(str);
 
240
}
 
241
 
 
242
AssemblerTab::AssemblerTab( QWidget * parent, const char * name )
 
243
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
 
244
    asmController(new FlagRadioButtonController)
 
245
{
 
246
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
247
//    layout->setAutoAdd(true);
 
248
 
 
249
    QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
 
250
 
 
251
    QVButtonGroup *info_group = new QVButtonGroup(i18n("Assembler Info"), this);
 
252
    new FlagCheckBox(info_group, controller,
 
253
                     "-a", i18n("Do not delete assembler files"));
 
254
    new FlagCheckBox(info_group, controller,
 
255
                     "-al", i18n("List source"));
 
256
    new FlagCheckBox(info_group, controller,
 
257
                     "-ar", i18n("List register allocation and release info"));
 
258
    new FlagCheckBox(info_group, controller,
 
259
                     "-at", i18n("List temporary allocations and deallocations"));
 
260
    layout2->addWidget(info_group);
 
261
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
262
    //layout->addSpacing(10);
 
263
 
 
264
    QVButtonGroup *asmkind_group = new QVButtonGroup(i18n("Assembler Reader"), this);
 
265
    QRadioButton *m_defaultkind = new QRadioButton(i18n("Use default reader"), asmkind_group);
 
266
    m_defaultkind->setChecked(true);
 
267
    new FlagRadioButton(asmkind_group, asmController,
 
268
                        "-Ratt", i18n("AT&T style assembler"));
 
269
    new FlagRadioButton(asmkind_group, asmController,
 
270
                        "-Rintel", i18n("Intel style assembler"));
 
271
    new FlagRadioButton(asmkind_group, asmController,
 
272
                        "-Rdirect", i18n("Direct assembler"));
 
273
    layout2->addWidget(asmkind_group);
 
274
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
275
    layout->addSpacing(10);
 
276
 
 
277
 
 
278
    QVButtonGroup *asm_group = new QVButtonGroup(i18n("Assembler Output"), this);
 
279
    new FlagCheckBox(asm_group, controller,
 
280
                     "-P", i18n("Use pipes instead of files when assembling"));
 
281
    QRadioButton *m_default = new QRadioButton(i18n("Use default output"), asm_group);
 
282
    m_default->setChecked(true);
 
283
    new FlagRadioButton(asm_group, asmController,
 
284
                        "-Aas", i18n("Use GNU as"));
 
285
    new FlagRadioButton(asm_group, asmController,
 
286
                        "-Aasout", i18n("Use GNU asaout"));
 
287
    new FlagRadioButton(asm_group, asmController,
 
288
                        "-Anasmcoff", i18n("Use NASM coff"));
 
289
    new FlagRadioButton(asm_group, asmController,
 
290
                        "-Anasmelf", i18n("Use NASM elf"));
 
291
    new FlagRadioButton(asm_group, asmController,
 
292
                        "-Anasmobj", i18n("Use NASM obj"));
 
293
    new FlagRadioButton(asm_group, asmController,
 
294
                        "-Amasm", i18n("Use MASM"));
 
295
    new FlagRadioButton(asm_group, asmController,
 
296
                        "-Atasm", i18n("Use TASM"));
 
297
    new FlagRadioButton(asm_group, asmController,
 
298
                        "-Acoff", i18n("Use coff"));
 
299
    new FlagRadioButton(asm_group, asmController,
 
300
                        "-Apecoff", i18n("Use pecoff"));
 
301
    layout->addWidget(asm_group);
 
302
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
303
 
 
304
    layout->addStretch();
 
305
}
 
306
 
 
307
 AssemblerTab::~ AssemblerTab( )
 
308
{
 
309
    delete controller;
 
310
    delete asmController;
 
311
}
 
312
 
 
313
void AssemblerTab::readFlags( QStringList * str )
 
314
{
 
315
    controller->readFlags(str);
 
316
    asmController->readFlags(str);
 
317
}
 
318
 
 
319
void AssemblerTab::writeFlags( QStringList * str )
 
320
{
 
321
    controller->writeFlags(str);
 
322
    asmController->writeFlags(str);
 
323
}
 
324
 
 
325
 
 
326
 
 
327
DebugOptimTab::DebugOptimTab( QWidget * parent, const char * name )
 
328
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
 
329
    optimController(new FlagRadioButtonController)
 
330
{
 
331
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
332
//    layout->setAutoAdd(true);
 
333
 
 
334
    QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
 
335
 
 
336
    QBoxLayout *layout3 = new QVBoxLayout(layout2, KDialog::spacingHint());
 
337
 
 
338
    QVButtonGroup *debug_group = new QVButtonGroup(i18n("Debugging"), this);
 
339
    new FlagCheckBox(debug_group, controller,
 
340
                     "-g", i18n("Generate information for GDB"), "-!g");
 
341
    new FlagCheckBox(debug_group, controller,
 
342
                     "-gd", i18n("Generate information for DBX"), "-!gd");
 
343
    new FlagCheckBox(debug_group, controller,
 
344
                     "-gl", i18n("Use lineinfo unit"), "-!gl");
 
345
    new FlagCheckBox(debug_group, controller,
 
346
                     "-gh", i18n("Use heaptrc unit"), "-!gh");
 
347
    new FlagCheckBox(debug_group, controller,
 
348
                     "-gc", i18n("Generate checks for pointers"), "-!gc");
 
349
    layout3->addWidget(debug_group);
 
350
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
351
    layout3->addSpacing(10);
 
352
 
 
353
    QVButtonGroup *profile_group = new QVButtonGroup(i18n("Profiling"), this);
 
354
    new FlagCheckBox(profile_group, controller,
 
355
                     "-pg", i18n("Generate profiler code for gprof"), "-!pg");
 
356
    layout3->addWidget(profile_group);
 
357
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
358
    layout3->addSpacing(10);
 
359
 
 
360
    QBoxLayout *layout4 = new QVBoxLayout(layout2, KDialog::spacingHint());
 
361
 
 
362
    QVButtonGroup *optim_group1 = new QVButtonGroup(i18n("General Optimization"), this);
 
363
    m_default = new QRadioButton(i18n("Default"), optim_group1);
 
364
    m_default->setChecked(true);
 
365
    new FlagRadioButton(optim_group1, optimController,
 
366
                        "-Og", i18n("Generate smaller code"));
 
367
    optim1 = new FlagRadioButton(optim_group1, optimController,
 
368
                        "-OG", i18n("Generate faster code"));
 
369
    layout4->addWidget(optim_group1);
 
370
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
371
    layout4->addSpacing(10);
 
372
 
 
373
    QVButtonGroup *optim_group2 = new QVButtonGroup(i18n("Optimization Levels"), this);
 
374
    m_default2 = new QRadioButton(i18n("Default"), optim_group2);
 
375
    m_default2->setChecked(true);
 
376
    new FlagRadioButton(optim_group2, optimController,
 
377
                        "-O1", i18n("Level 1"));
 
378
    new FlagRadioButton(optim_group2, optimController,
 
379
                        "-O2", i18n("Level 2"));
 
380
    optim2 = new FlagRadioButton(optim_group2, optimController,
 
381
                        "-O3", i18n("Level 3"));
 
382
    layout4->addWidget(optim_group2);
 
383
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
384
    layout4->addSpacing(10);
 
385
 
 
386
    QHBoxLayout *layout5 = new QHBoxLayout(layout, KDialog::spacingHint());
 
387
 
 
388
    QVButtonGroup *optim_group3 = new QVButtonGroup(i18n("Architecture"), this);
 
389
    m_default3 = new QRadioButton(i18n("Default"), optim_group3);
 
390
    m_default3->setChecked(true);
 
391
    new FlagRadioButton(optim_group3, optimController,
 
392
                     "-Op1", i18n("386/486"));
 
393
    new FlagRadioButton(optim_group3, optimController,
 
394
                     "-Op2", i18n("Pentium/PentiumMMX"));
 
395
    new FlagRadioButton(optim_group3, optimController,
 
396
                     "-Op2", i18n("PentiumPro/PII/Cyrix 6x86/K6"));
 
397
    layout5->addWidget(optim_group3);
 
398
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
399
 
 
400
    QVButtonGroup *optim_group4 = new QVButtonGroup(i18n("Another Optimization"), this);
 
401
    new FlagCheckBox(optim_group4, controller,
 
402
                     "-Or", i18n("Use register variables"), "-!Or");
 
403
    new FlagCheckBox(optim_group4, controller,
 
404
                     "-Ou", i18n("Uncertain optimizations"), "-!Ou");
 
405
    layout5->addWidget(optim_group4);
 
406
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
407
 
 
408
    QHBoxLayout *layout6 = new QHBoxLayout(layout, KDialog::spacingHint());
 
409
    QPushButton *release = new QPushButton(i18n("Release"), this);
 
410
    QPushButton *debug = new QPushButton(i18n("Debug"), this);
 
411
    layout6->addWidget(release);
 
412
    layout6->addWidget(debug);
 
413
    connect(release, SIGNAL(clicked()), this, SLOT(setReleaseOptions()));
 
414
    connect(debug, SIGNAL(clicked()), this, SLOT(setDebugOptions()));
 
415
 
 
416
    layout->addStretch();
 
417
}
 
418
 
 
419
 DebugOptimTab::~ DebugOptimTab( )
 
420
{
 
421
    delete controller;
 
422
    delete optimController;
 
423
}
 
424
 
 
425
void DebugOptimTab::readFlags( QStringList * str )
 
426
{
 
427
    controller->readFlags(str);
 
428
    optimController->readFlags(str);
 
429
}
 
430
 
 
431
void DebugOptimTab::writeFlags( QStringList * str )
 
432
{
 
433
    controller->writeFlags(str);
 
434
    optimController->writeFlags(str);
 
435
}
 
436
 
 
437
void DebugOptimTab::setReleaseOptions()
 
438
{
 
439
    m_default->setChecked(true);
 
440
    m_default2->setChecked(true);
 
441
//    m_default3->setChecked(true);
 
442
    QStringList sl = QStringList::split(",", "-!g,-!gd,-!gl,-!gh,-!gc,-!pg,-!Ou,-!Or");
 
443
    readFlags(&sl);
 
444
    optim1->setChecked(true);
 
445
    optim2->setChecked(true);
 
446
}
 
447
 
 
448
void DebugOptimTab::setDebugOptions()
 
449
{
 
450
    QStringList sl = QStringList::split(",", "-g,-gl,-gh,-gc");
 
451
    readFlags(&sl);
 
452
    m_default->setChecked(true);
 
453
    m_default2->setChecked(true);
 
454
//    m_default3->setChecked(true);
 
455
}
 
456
 
 
457
CodegenTab::CodegenTab( QWidget * parent, const char * name )
 
458
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
 
459
    listController(new FlagEditController())
 
460
{
 
461
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
462
    layout->setAutoAdd(true);
 
463
 
 
464
    QVButtonGroup *compile_group = new QVButtonGroup(i18n("Compile Time Checks"), this);
 
465
    new FlagCheckBox(compile_group, controller,
 
466
                     "-Sa", i18n("Include assert statements in compiled code"));
 
467
    new FlagCheckBox(compile_group, controller,
 
468
                     "-Un", i18n("Do not check the unit name for being the same as the file name"));
 
469
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
470
    layout->addSpacing(10);
 
471
 
 
472
    QVButtonGroup *run_group = new QVButtonGroup(i18n("Run Time Checks"), this);
 
473
    new FlagCheckBox(run_group, controller,
 
474
                     "-Cr", i18n("Range checking"));
 
475
    new FlagCheckBox(run_group, controller,
 
476
                     "-Ct", i18n("Stack checking"));
 
477
    new FlagCheckBox(run_group, controller,
 
478
                     "-Ci", i18n("Input/Output checking"));
 
479
    new FlagCheckBox(run_group, controller,
 
480
                     "-Co", i18n("Integer overflow checking"));
 
481
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
482
    layout->addSpacing(10);
 
483
 
 
484
    new FlagListEdit(this, ":", listController, "-d", i18n("Conditional defines (delimited by \":\"):"));
 
485
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
486
 
 
487
    new FlagListEdit(this, ":", listController, "-u", i18n("Undefine conditional defines (delimited by \":\"):"));
 
488
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
489
    layout->addSpacing(10);
 
490
 
 
491
    new FlagSpinEdit(this, 1024, 67107840, 1, 131072, listController,
 
492
                    "-Cs", i18n("Stack size:"));
 
493
    new FlagSpinEdit(this, 1024, 67107840, 1, 2097152, listController,
 
494
                    "-Ch", i18n("Heap size:"));
 
495
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
496
 
 
497
    layout->addStretch();
 
498
}
 
499
 
 
500
CodegenTab::~ CodegenTab( )
 
501
{
 
502
    delete controller;
 
503
    delete listController;
 
504
}
 
505
 
 
506
void CodegenTab::readFlags( QStringList * str )
 
507
{
 
508
    controller->readFlags(str);
 
509
    listController->readFlags(str);
 
510
}
 
511
 
 
512
void CodegenTab::writeFlags( QStringList * str )
 
513
{
 
514
    controller->writeFlags(str);
 
515
    listController->writeFlags(str);
 
516
}
 
517
 
 
518
LinkerTab::LinkerTab( QWidget * parent, const char * name )
 
519
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
 
520
    listController(new FlagEditController())
 
521
{
 
522
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
523
 
 
524
    QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
 
525
 
 
526
    QVButtonGroup *link_group = new QVButtonGroup(i18n("Linking Stage"), this);
 
527
    new FlagCheckBox(link_group, controller,
 
528
                     "-CD", i18n("Create dynamic library"));
 
529
    new FlagCheckBox(link_group, controller,
 
530
                     "-CX", i18n("Create smartlinked units"));
 
531
    new FlagCheckBox(link_group, controller,
 
532
                     "-Ur", i18n("Generate release units"));
 
533
    new FlagCheckBox(link_group, controller,
 
534
                     "-Cn", i18n("Omit the linking stage"));
 
535
    new FlagCheckBox(link_group, controller,
 
536
                     "-s",  i18n("Create assembling and linking script"));
 
537
    layout2->addWidget(link_group);
 
538
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
539
 
 
540
    QVButtonGroup *exec_group = new QVButtonGroup(i18n("Executable Generation"), this);
 
541
    new FlagCheckBox(exec_group, controller,
 
542
                     "-Xs",  i18n("Strip the symbols from the executable"));
 
543
    new FlagCheckBox(exec_group, controller,
 
544
                     "-XS",  i18n("Link with static units"));
 
545
    new FlagCheckBox(exec_group, controller,
 
546
                     "-XX",  i18n("Link with smartlinked units"));
 
547
    new FlagCheckBox(exec_group, controller,
 
548
                     "-XD",  i18n("Link with dynamic libraries"));
 
549
    new FlagCheckBox(exec_group, controller,
 
550
                     "-Xc",  i18n("Link with the C library"));
 
551
    layout2->addWidget(exec_group);
 
552
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
553
    layout->addSpacing(10);
 
554
 
 
555
    FlagListEdit *led = new FlagListEdit(this, ":", listController, "-k", i18n("Options passed to the linker (delimited by \":\"):"));
 
556
    layout->addWidget(led);
 
557
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
558
 
 
559
    layout->addStretch();
 
560
}
 
561
 
 
562
LinkerTab::~LinkerTab( )
 
563
{
 
564
    delete controller;
 
565
    delete listController;
 
566
}
 
567
 
 
568
void LinkerTab::readFlags( QStringList * str )
 
569
{
 
570
    controller->readFlags(str);
 
571
    listController->readFlags(str);
 
572
}
 
573
 
 
574
void LinkerTab::writeFlags( QStringList * str )
 
575
{
 
576
    controller->writeFlags(str);
 
577
    listController->writeFlags(str);
 
578
}
 
579
 
 
580
MiscTab::MiscTab( QWidget * parent, const char * name )
 
581
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
 
582
    radioController(new FlagRadioButtonController()),
 
583
    pathController(new FlagPathEditController()),
 
584
    editController(new FlagEditController())
 
585
{
 
586
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
 
587
    layout->setAutoAdd(true);
 
588
 
 
589
    new FlagCheckBox(this, controller,
 
590
                     "-B", i18n("Recompile all used units"));
 
591
    new FlagCheckBox(this, controller,
 
592
                     "-n", i18n("Do not read default configuration file"));
 
593
    new FlagPathEdit(this, "", pathController,
 
594
                     "@", i18n("Compiler configuration file:"), KFile::File);
 
595
    new FlagSpinEdit(this, 1, 1000, 1, 50, editController,
 
596
                    "-Se", i18n("Stop after the error:"));
 
597
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
598
    layout->addSpacing(10);
 
599
 
 
600
    QVButtonGroup *browser_group = new QVButtonGroup(i18n("Browser Info"), this);
 
601
    QRadioButton *m_defaultBrowser = new QRadioButton(i18n("No browser info"), browser_group);
 
602
    m_defaultBrowser->setChecked(true);
 
603
    new FlagRadioButton(browser_group, radioController,
 
604
                     "-b", i18n("Global browser info"));
 
605
    new FlagRadioButton(browser_group, radioController,
 
606
                     "-bl", i18n("Global and local browser info"));
 
607
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
608
    layout->addSpacing(10);
 
609
 
 
610
    QVButtonGroup *target_group = new QVButtonGroup(i18n("Target OS"), this);
 
611
    QRadioButton *m_defaultTarget = new QRadioButton(i18n("Default"), target_group);
 
612
    m_defaultTarget->setChecked(true);
 
613
    new FlagRadioButton(target_group, radioController,
 
614
                     "-TGO32V1", i18n("DOS and version 1 of the DJ DELORIE extender"));
 
615
    new FlagRadioButton(target_group, radioController,
 
616
                     "-TGO32V2", i18n("DOS and version 2 of the DJ DELORIE extender"));
 
617
    new FlagRadioButton(target_group, radioController,
 
618
                     "-TLINUX",  i18n("Linux"));
 
619
    new FlagRadioButton(target_group, radioController,
 
620
                     "-TOS2", i18n("OS/2 (2.x) using the EMX extender"));
 
621
    new FlagRadioButton(target_group, radioController,
 
622
                     "-TWIN32", i18n("WINDOWS 32 bit"));
 
623
    new FlagRadioButton(target_group, radioController,
 
624
                     "-TSUNOS", i18n("SunOS/Solaris"));
 
625
    new FlagRadioButton(target_group, radioController,
 
626
                     "-TBEOS", i18n("BeOS"));
 
627
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
 
628
    layout->addSpacing(10);
 
629
 
 
630
    layout->addStretch();
 
631
}
 
632
 
 
633
MiscTab::~ MiscTab( )
 
634
{
 
635
    delete controller;
 
636
    delete pathController;
 
637
    delete radioController;
 
638
    delete editController;
 
639
}
 
640
 
 
641
void MiscTab::readFlags( QStringList * str )
 
642
{
 
643
    controller->readFlags(str);
 
644
    radioController->readFlags(str);
 
645
    pathController->readFlags(str);
 
646
    editController->readFlags(str);
 
647
}
 
648
 
 
649
void MiscTab::writeFlags( QStringList * str )
 
650
{
 
651
    controller->writeFlags(str);
 
652
    radioController->writeFlags(str);
 
653
    pathController->writeFlags(str);
 
654
    editController->writeFlags(str);
 
655
}
 
656
 
 
657
#include "optiontabs.moc"