KDevelop API Documentation

ghcoptionsplugin.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           ghcoptionsplugin.cpp  -  description
00003                              -------------------
00004     begin                : Sat Aug 16 2003
00005     copyright            : (C) 2003 by Peter Robinson
00006     email                : listener@thaldyron.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00019 
00020 #include <qvbox.h>
00021 
00022 #include <klocale.h>
00023 #include <kgenericfactory.h>
00024 
00025 //#include "optiontabs.h"
00026 #include "ghcoptionsplugin.h"
00027 
00028 K_EXPORT_COMPONENT_FACTORY( libkdevghcoptions, KGenericFactory<GhcOptionsPlugin>( "kdevghcoptions" ) )
00029 
00030 GhcOptionsPlugin::GhcOptionsPlugin(QObject *parent, const char *name, const QStringList& /*args*/)
00031     : KDevCompilerOptions(parent, name)
00032 {
00033 }
00034 
00035 GhcOptionsPlugin::~GhcOptionsPlugin()
00036 {
00037 }
00038 
00039 QString GhcOptionsPlugin::exec( QWidget *parent, const QString &flags )
00040 {
00041     GhcOptionsDialog *dlg = new GhcOptionsDialog(parent, "GHC Options Dialog");
00042     QString newFlags = flags;
00043     dlg->setFlags(flags);
00044     if (dlg->exec() == QDialog::Accepted)
00045         newFlags = dlg->flags();
00046     delete dlg;
00047     return newFlags;
00048 }
00049 
00050 
00051 
00052 GhcOptionsDialog::GhcOptionsDialog( QWidget *parent, const char *name )
00053     : KDialogBase(Tabbed, i18n("Glasgow Haskell Compiler"), Ok|Cancel, Ok, parent, name, true)
00054 {
00055     QVBox *vbox;
00056 
00057 /*    vbox = addVBoxPage(i18n("Language"));
00058     language = new LanguageTab(vbox, "language tab");
00059 
00060     vbox = addVBoxPage(i18n("Locations I"));
00061     directories = new FilesAndDirectoriesTab(vbox, "directories tab");
00062 
00063     vbox = addVBoxPage(i18n("Locations II"));
00064     directories2 = new FilesAndDirectoriesTab2(vbox, "directories2 tab");
00065 
00066     vbox = addVBoxPage(i18n("Debug && Optimization"));
00067     debug_optim = new DebugOptimTab(vbox, "debug_optim tab");
00068 
00069     vbox = addVBoxPage(i18n("Code Generation"));
00070     codegen = new CodegenTab(vbox, "codegen tab");
00071 
00072     vbox = addVBoxPage(i18n("Assembler"));
00073     assembler = new AssemblerTab(vbox, "assembler tab");
00074 
00075     vbox = addVBoxPage(i18n("Linker"));
00076     linker = new LinkerTab(vbox, "linker tab");
00077 
00078     vbox = addVBoxPage(i18n("Feedback"));
00079     feedback = new FeedbackTab(vbox, "feedback tab");
00080 
00081     vbox = addVBoxPage(i18n("Miscellaneous"));
00082     misc = new MiscTab(vbox, "miscellaneous tab");*/
00083 }
00084 
00085 GhcOptionsDialog::~GhcOptionsDialog()
00086 {
00087 }
00088 
00089 void GhcOptionsDialog::setFlags(const QString &flags)
00090 {
00091     QStringList flaglist = QStringList::split(" ", flags);
00092 
00093 /*    feedback->readFlags(&flaglist);
00094     language->readFlags(&flaglist);
00095     assembler->readFlags(&flaglist);
00096     linker->readFlags(&flaglist);
00097     codegen->readFlags(&flaglist);
00098     debug_optim->readFlags(&flaglist);
00099     directories->readFlags(&flaglist);
00100     directories2->readFlags(&flaglist);
00101     misc->readFlags(&flaglist);
00102     unrecognizedFlags = flaglist;*/
00103 }
00104 
00105 QString GhcOptionsDialog::flags() const
00106 {
00107     QStringList flaglist;
00108 
00109  /*   language->writeFlags(&flaglist);
00110     directories->writeFlags(&flaglist);
00111     directories2->writeFlags(&flaglist);
00112     debug_optim->writeFlags(&flaglist);
00113     codegen->writeFlags(&flaglist);
00114     assembler->writeFlags(&flaglist);
00115     linker->writeFlags(&flaglist);
00116     feedback->writeFlags(&flaglist);
00117     misc->writeFlags(&flaglist);
00118 
00119     QString flags;
00120     QStringList::ConstIterator li;
00121     for (li = flaglist.begin(); li != flaglist.end(); ++li) {
00122         flags += (*li);
00123         flags += " ";
00124     }
00125 
00126     for (li = unrecognizedFlags.begin(); li != unrecognizedFlags.end(); ++li) {
00127         flags += (*li);
00128         flags += " ";
00129     }
00130 
00131     flags.truncate(flags.length()-1);
00132     return flags;*/
00133 return "";
00134 }
00135 
00136 #include "ghcoptionsplugin.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:47 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003