1
/***************************************************************************
2
* Copyright (C) 2003 Alexander Dymo *
3
* cloudtemple@mksat.net *
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. *
10
***************************************************************************/
16
#include <kgenericfactory.h>
18
#include "dccoptionsplugin.h"
20
#include "optiontabs.h"
22
K_EXPORT_COMPONENT_FACTORY( libkdevdccoptions, KGenericFactory<DccOptionsPlugin>( "kdevdccoptions" ) )
24
DccOptionsPlugin::DccOptionsPlugin(QObject *parent, const char *name, const QStringList/* &args*/)
25
: KDevCompilerOptions(parent, name)
29
DccOptionsPlugin::~DccOptionsPlugin()
33
QString DccOptionsPlugin::exec(QWidget *parent, const QString &flags)
35
DccOptionsDialog *dlg = new DccOptionsDialog(parent, "dcc options dialog");
36
QString newFlags = flags;
38
if(dlg->exec() == QDialog::Accepted)
39
newFlags = dlg->flags();
45
DccOptionsDialog::DccOptionsDialog( QWidget * parent, const char * name )
46
: KDialogBase(Tabbed, i18n("Delphi Compiler Options"), Ok|Cancel, Ok, parent, name, true)
50
vbox = addVBoxPage(i18n("General"));
51
general = new GeneralTab(vbox, "general tab");
53
vbox = addVBoxPage(i18n("Locations I"));
54
locations = new LocationsTab(vbox, "locations tab");
56
vbox = addVBoxPage(i18n("Locations II"));
57
locations2 = new Locations2Tab(vbox, "locations2 tab");
59
vbox = addVBoxPage(i18n("Code Generation"));
60
codegen = new CodegenTab(vbox, "codegen tab");
62
vbox = addVBoxPage(i18n("Debug && Optimization"));
63
debug_optim = new DebugOptimTab(vbox, "debug and optim tab");
65
vbox = addVBoxPage(i18n("Linker"));
66
linker = new LinkerTab(vbox, "linker tab");
69
DccOptionsDialog::~DccOptionsDialog( )
73
void DccOptionsDialog::setFlags( const QString & flags )
75
QStringList flaglist = QStringList::split(" ", flags);
77
general->readFlags(&flaglist);
78
codegen->readFlags(&flaglist);
79
debug_optim->readFlags(&flaglist);
80
locations->readFlags(&flaglist);
81
locations2->readFlags(&flaglist);
82
linker->readFlags(&flaglist);
84
unrecognizedFlags = flaglist;
87
QString DccOptionsDialog::flags( ) const
91
general->writeFlags(&flaglist);
92
locations->writeFlags(&flaglist);
93
locations2->writeFlags(&flaglist);
94
codegen->writeFlags(&flaglist);
95
debug_optim->writeFlags(&flaglist);
96
linker->writeFlags(&flaglist);
99
QStringList::ConstIterator li;
100
for (li = flaglist.begin(); li != flaglist.end(); ++li) {
105
for (li = unrecognizedFlags.begin(); li != unrecognizedFlags.end(); ++li) {
110
flags.truncate(flags.length()-1);
114
#include "dccoptionsplugin.moc"