From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../compiler/dccoptions/dccoptionsplugin.cpp | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp (limited to 'languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp') diff --git a/languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp b/languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp new file mode 100644 index 00000000..a65ca9d6 --- /dev/null +++ b/languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp @@ -0,0 +1,114 @@ +/*************************************************************************** + * 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 +#include + +#include +#include +#include + +#include "dccoptionsplugin.h" + +#include "optiontabs.h" + +K_EXPORT_COMPONENT_FACTORY( libkdevdccoptions, KGenericFactory( "kdevdccoptions" ) ) + +DccOptionsPlugin::DccOptionsPlugin(QObject *parent, const char *name, const QStringList/* &args*/) + : KDevCompilerOptions(parent, name) +{ +} + +DccOptionsPlugin::~DccOptionsPlugin() +{ +} + +QString DccOptionsPlugin::exec(QWidget *parent, const QString &flags) +{ + DccOptionsDialog *dlg = new DccOptionsDialog(parent, "dcc options dialog"); + QString newFlags = flags; + dlg->setFlags(flags); + if(dlg->exec() == QDialog::Accepted) + newFlags = dlg->flags(); + delete dlg; + return newFlags; +} + + +DccOptionsDialog::DccOptionsDialog( QWidget * parent, const char * name ) + : KDialogBase(Tabbed, i18n("Delphi Compiler Options"), Ok|Cancel, Ok, parent, name, true) +{ + QVBox *vbox; + + vbox = addVBoxPage(i18n("General")); + general = new GeneralTab(vbox, "general tab"); + + vbox = addVBoxPage(i18n("Locations I")); + locations = new LocationsTab(vbox, "locations tab"); + + vbox = addVBoxPage(i18n("Locations II")); + locations2 = new Locations2Tab(vbox, "locations2 tab"); + + vbox = addVBoxPage(i18n("Code Generation")); + codegen = new CodegenTab(vbox, "codegen tab"); + + vbox = addVBoxPage(i18n("Debug && Optimization")); + debug_optim = new DebugOptimTab(vbox, "debug and optim tab"); + + vbox = addVBoxPage(i18n("Linker")); + linker = new LinkerTab(vbox, "linker tab"); +} + +DccOptionsDialog::~DccOptionsDialog( ) +{ +} + +void DccOptionsDialog::setFlags( const QString & flags ) +{ + QStringList flaglist = QStringList::split(" ", flags); + + general->readFlags(&flaglist); + codegen->readFlags(&flaglist); + debug_optim->readFlags(&flaglist); + locations->readFlags(&flaglist); + locations2->readFlags(&flaglist); + linker->readFlags(&flaglist); + + unrecognizedFlags = flaglist; +} + +QString DccOptionsDialog::flags( ) const +{ + QStringList flaglist; + + general->writeFlags(&flaglist); + locations->writeFlags(&flaglist); + locations2->writeFlags(&flaglist); + codegen->writeFlags(&flaglist); + debug_optim->writeFlags(&flaglist); + linker->writeFlags(&flaglist); + + QString flags; + QStringList::ConstIterator li; + for (li = flaglist.begin(); li != flaglist.end(); ++li) { + flags += (*li); + flags += " "; + } + + for (li = unrecognizedFlags.begin(); li != unrecognizedFlags.end(); ++li) { + flags += (*li); + flags += " "; + } + + flags.truncate(flags.length()-1); + return flags; +} + +#include "dccoptionsplugin.moc" -- cgit v1.2.1