From e9ae80694875f869892f13f4fcaf1170a00dea41 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/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/components/framewizard/fmfpeditor.cpp | 111 +++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 quanta/components/framewizard/fmfpeditor.cpp (limited to 'quanta/components/framewizard/fmfpeditor.cpp') diff --git a/quanta/components/framewizard/fmfpeditor.cpp b/quanta/components/framewizard/fmfpeditor.cpp new file mode 100644 index 00000000..cc262453 --- /dev/null +++ b/quanta/components/framewizard/fmfpeditor.cpp @@ -0,0 +1,111 @@ +/*************************************************************************** + fmfpeditor.cpp - description + ------------------- + begin : mer giu 4 2003 + copyright : (C) 2003 by Gulmini Luciano + email : gulmini.luciano@student.unife.it + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 "fmfpeditor.h" +#include +#include +#include +#include +#include +#include +#include +#include +//#include + +/*class PreviewWidget : public KPreviewWidgetBase { +};*/ + +fmFPeditor::fmFPeditor() : fmFPeditorS (){ + sbLeft->setWrapping(true); + sbTop->setWrapping(true); + + QString htmlFiles = i18n("*.html *.htm|HTML Files"); + QString phpFiles = i18n("*.php|PHP Files"); + QString xmlFiles = i18n("*.xml|XML Files"); + QString xhtmlFiles = i18n("*xhtml|XHTML Files"); + QString allFiles = i18n("*|All Files"); + + fc->setFilter(htmlFiles+"\n"+phpFiles+"\n"+xmlFiles+"\n"+xhtmlFiles+"\n"+allFiles); + +} +fmFPeditor::~fmFPeditor(){ +} + +QString fmFPeditor::noresizeValue() { + switch(bgNoresize->id(bgNoresize->selected())){ + case 0:return "";break; + default:return "noresize"; + } +} + +QString fmFPeditor::scrollingValue() { + switch(bgScrolling->id(bgScrolling->selected())){ + case 0:return "yes";break; + case 2:return "no";break; + default:return "auto"; + } +} + +QString fmFPeditor::frameborderValue() { + switch(bgBorder->id(bgBorder->selected())){ + case 1:return "0"; break; + default:return "1"; + } +} + +void fmFPeditor::setup(QMap m){ + leId->setText(m["id"]); + fc->setURL(m["src"]); + leClass->setText(m["class"]); + leLongdesc->setText(m["longdesc"]); + leTitle->setText(m["title"]); + leStyle->setText(m["style"]); + leName->setText(m["name"]); + + if(m["noresize"]!="noresize") bgNoresize->setButton(0); + else bgNoresize->setButton(1); + + if(m["scrolling"]=="yes") bgScrolling->setButton(0); + else + if(m["scrolling"]=="no") bgScrolling->setButton(2); + + if(m["frameborder"]=="0") bgBorder->setButton(1); + + sbLeft->setValue(m["marginwidth"].toInt()); + sbTop->setValue(m["marginheight"].toInt()); +} + +QMap fmFPeditor::attributeMap(){ + QMap map; + + map["name"] = leName->text(); + map["longdesc"] = leLongdesc->text(); + map["src"] = fc->url(); + map["scrolling"] = scrollingValue(); + map["id"] = leId->text(); + map["style"] = leStyle->text(); + map["title"] = leTitle->text(); + map["class"] = leClass->text(); + map["noresize"] = noresizeValue(); + map["frameborder"] = frameborderValue(); + map["marginwidth"] = QString::number( sbLeft->value(),10 ); + map["marginheight"] = QString::number( sbTop->value(),10 ); + + return map; +} + +#include "fmfpeditor.moc" -- cgit v1.2.1