#include "ui_boolval_ui.h"
#include "ui_wipeval_ui.h"
#include "ui_urlval_ui.h"
+#include "ui_keywordval_ui.h"
+#include "ui_fontval_ui.h"
#include "complexparameter.h"
#include "geometryval.h"
#include "positionedit.h"
#include "doubleparameterwidget.h"
#include "cornerswidget.h"
#include "beziercurve/beziersplinewidget.h"
-#ifdef QJSON
+#ifdef USE_QJSON
#include "rotoscoping/rotowidget.h"
#endif
{
};
+class Keywordval: public QWidget, public Ui::Keywordval_UI
+{
+};
+
+class Fontval: public QWidget, public Ui::Fontval_UI
+{
+};
+
QMap<QString, QImage> EffectStackEdit::iconCache;
EffectStackEdit::EffectStackEdit(Monitor *monitor, QWidget *parent) :
QStringList listitems = pa.attribute("paramlist").split(';');
if (listitems.count() == 1) {
// probably custom effect created before change to ';' as separator
- listitems = pa.attribute("paramlist").split(",");
+ listitems = pa.attribute("paramlist").split(',');
}
QDomElement list = pa.firstChildElement("paramlistdisplay");
QStringList listitemsdisplay;
m_keyframeEditor->addParameter(pa);
}
} else if (type == "color") {
- if (value.startsWith('#'))
- value = value.replace('#', "0x");
- bool ok;
- ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, QColor(value.toUInt(&ok, 16)), this);
+ ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, value, this);
+ choosecolor->setAlphaChannelEnabled(pa.attribute("alpha") == "1");
m_vbox->addWidget(choosecolor);
m_valueItems[paramName] = choosecolor;
connect(choosecolor, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
QString depends = pa.attribute("depends");
if (!depends.isEmpty())
meetDependency(paramName, type, EffectsList::parameter(d, depends));
-#ifdef QJSON
+#ifdef USE_QJSON
} else if (type == "roto-spline") {
RotoWidget *roto = new RotoWidget(value, m_monitor, info, m_timecode, this);
roto->slotShowScene(!disable);
connect(cval->urlwidget, SIGNAL(returnPressed()) , this, SLOT(collectAllParameters()));
connect(cval->urlwidget, SIGNAL(urlSelected(const KUrl&)) , this, SLOT(collectAllParameters()));
m_uiItems.append(cval);
+ } else if (type == "keywords") {
+ Keywordval* kval = new Keywordval;
+ kval->setupUi(toFillin);
+ kval->label->setText(paramName);
+ kval->lineeditwidget->setText(value);
+ QDomElement klistelem = pa.firstChildElement("keywords");
+ QDomElement kdisplaylistelem = pa.firstChildElement("keywordsdisplay");
+ QStringList keywordlist;
+ QStringList keyworddisplaylist;
+ if (!klistelem.isNull()) {
+ keywordlist = klistelem.text().split(';');
+ keyworddisplaylist = i18n(kdisplaylistelem.text().toUtf8().data()).split(';');
+ }
+ if (keyworddisplaylist.count() != keywordlist.count()) {
+ keyworddisplaylist = keywordlist;
+ }
+ for (int i = 0; i < keywordlist.count(); i++) {
+ kval->comboboxwidget->addItem(keyworddisplaylist.at(i), keywordlist.at(i));
+ }
+ // Add disabled user prompt at index 0
+ kval->comboboxwidget->insertItem(0, i18n("<select a keyword>"), "");
+ kval->comboboxwidget->model()->setData( kval->comboboxwidget->model()->index(0,0), QVariant(Qt::NoItemFlags), Qt::UserRole -1);
+ kval->comboboxwidget->setCurrentIndex(0);
+ m_valueItems[paramName] = kval;
+ connect(kval->lineeditwidget, SIGNAL(editingFinished()) , this, SLOT(collectAllParameters()));
+ connect(kval->comboboxwidget, SIGNAL(activated (const QString&)), this, SLOT(collectAllParameters()));
+ m_uiItems.append(kval);
+ } else if (type == "fontfamily") {
+ Fontval* fval = new Fontval;
+ fval->setupUi(toFillin);
+ fval->name->setText(paramName);
+ fval->fontfamilywidget->setCurrentFont(QFont(value));
+ m_valueItems[paramName] = fval;
+ connect(fval->fontfamilywidget, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(collectAllParameters())) ;
+ m_uiItems.append(fval);
} else {
delete toFillin;
toFillin = NULL;
setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
} else if (type == "color") {
ChooseColorWidget *choosecolor = ((ChooseColorWidget*)m_valueItems.value(paramName));
- setValue = choosecolor->getColor().name();
+ setValue = choosecolor->getColor();
} else if (type == "complex") {
ComplexParameter *complex = ((ComplexParameter*)m_valueItems.value(paramName));
namenode.item(i) = complex->getParamDesc();
QString depends = pa.attributes().namedItem("depends").nodeValue();
if (!depends.isEmpty())
meetDependency(paramName, type, EffectsList::parameter(newparam, depends));
-#ifdef QJSON
+#ifdef USE_QJSON
} else if (type == "roto-spline") {
RotoWidget *widget = static_cast<RotoWidget *>(m_valueItems.value(paramName));
setValue = widget->getSpline();
} else if (type == "url") {
KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;
setValue = req->url().path();
+ } else if (type == "keywords"){
+ QLineEdit *line = ((Keywordval*)m_valueItems.value(paramName))->lineeditwidget;
+ QComboBox *combo = ((Keywordval*)m_valueItems.value(paramName))->comboboxwidget;
+ if(combo->currentIndex())
+ {
+ QString comboval = combo->itemData(combo->currentIndex()).toString();
+ line->insert(comboval);
+ combo->setCurrentIndex(0);
+ }
+ setValue = line->text();
+ } else if (type == "fontfamily") {
+ QFontComboBox* fontfamily = ((Fontval*)m_valueItems.value(paramName))->fontfamilywidget;
+ setValue = fontfamily->currentFont().family();
}
if (!setValue.isNull())