]> git.sesse.net Git - kdenlive/commitdiff
more params can be set up
authorMarco Gittler <marco@gitma.de>
Thu, 21 Feb 2008 16:49:17 +0000 (16:49 +0000)
committerMarco Gittler <marco@gitma.de>
Thu, 21 Feb 2008 16:49:17 +0000 (16:49 +0000)
svn path=/branches/KDE4/; revision=1898

src/CMakeLists.txt
src/effectstackedit.cpp
src/effectstackview.cpp
src/widgets/boolval_ui.ui [new file with mode: 0644]
src/widgets/listval_ui.ui [new file with mode: 0644]

index 86e2dea791d4a70b12d326d38ce8099f3b13ab62..d68493bf05e3be54155f38dbb1f650073c6db744 100644 (file)
@@ -31,6 +31,8 @@ kde4_add_ui_files(kdenlive_UI
   widgets/projectsettings_ui.ui
   widgets/keyframewidget_ui.ui
   widgets/constval_ui.ui
+  widgets/listval_ui.ui
+  widgets/boolval_ui.ui
 )
  
 set(kdenlive_SRCS 
index 6b4c812929e0865124bc4c87b3f737efd600c49b..1047e8c866669e800a76d27d7cad1d866cc214c2 100644 (file)
 #include <QVBoxLayout>
 #include <QSlider>
 #include <QLabel>
+#include <QCheckBox>
 #include "ui_constval_ui.h"
+#include "ui_listval_ui.h"
+#include "ui_boolval_ui.h"
 
 EffectStackEdit::EffectStackEdit(QGroupBox* gbox,QWidget *parent): QWidget(parent)
 {
@@ -35,6 +38,7 @@ EffectStackEdit::EffectStackEdit(QGroupBox* gbox,QWidget *parent): QWidget(paren
        
 }
 void EffectStackEdit::transferParamDesc(const QDomElement& d,int ,int){
+       kDebug() << "in";
        params=d;
        QDomNodeList namenode = params.elementsByTagName("parameter");
        
@@ -44,25 +48,58 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d,int ,int){
                d.save(str,2);
                kDebug() << outstr;
        for (int i=0;i< namenode.count() ;i++){
+               kDebug() << "in form";
                QDomNode pa=namenode.item(i);
                QDomNode na=pa.firstChildElement("name");
-               QString type=pa.attributes().namedItem("type").nodeValue();
+               QDomNamedNodeMap nodeAtts=pa.attributes();
+               QString type=nodeAtts.namedItem("type").nodeValue();
                QWidget * toFillin=NULL,*labelToFillIn=NULL;
+               //TODO constant, list, bool, complex , color, geometry, position
                if (type=="double" || type=="constant"){
                        toFillin=new QWidget;
                        Ui::Constval_UI *ctval=new Ui::Constval_UI;
                        ctval->setupUi(toFillin);
                        
-                       ctval->horizontalSlider->setMinimum(pa.attributes().namedItem("min").nodeValue().toInt());
-                       ctval->horizontalSlider->setMaximum(pa.attributes().namedItem("max").nodeValue().toInt());
+                       ctval->horizontalSlider->setMinimum(nodeAtts.namedItem("min").nodeValue().toInt());
+                       ctval->horizontalSlider->setMaximum(nodeAtts.namedItem("max").nodeValue().toInt());
                        ctval->spinBox->setMinimum(ctval->horizontalSlider->minimum());
                        ctval->spinBox->setMaximum(ctval->horizontalSlider->maximum());
-                       ctval->horizontalSlider->setValue(pa.attributes().namedItem("default").nodeValue().toInt());
-                       ctval->title->setText(na.toElement().text() );
+                       if (nodeAtts.namedItem("value").isNull())
+                               ctval->horizontalSlider->setValue(nodeAtts.namedItem("default").nodeValue().toInt());
+                       else
+                               ctval->horizontalSlider->setValue(nodeAtts.namedItem("value").nodeValue().toInt());
+                       ctval->title->setTitle(na.toElement().text() );
                        valueItems[na.toElement().text()]=ctval;
                        connect (ctval->horizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT (slotSliderMoved(int)));
+               }
+               if (type=="list"){
+                       toFillin=new QWidget;
+                       Ui::Listval_UI *lsval=new Ui::Listval_UI;
+                       lsval->setupUi(toFillin);
+                       nodeAtts.namedItem("paramlist");
+                       
+                       lsval->list->addItems(nodeAtts.namedItem("paramlist").nodeValue().split(","));
+                       /*if (nodeAtts.namedItem("value").isNull())
+                               lsval->list->setCurrentText(nodeAtts.namedItem("default").nodeValue());
+                       else
+                               lsval->list->setCurrentText(nodeAtts.namedItem("value").nodeValue());
+                       */
+                       connect (lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT (slotSliderMoved(int)));
+                       lsval->title->setTitle(na.toElement().text() );
+                       valueItems[na.toElement().text()]=lsval;
+               }
+               if (type=="bool"){
+                       toFillin=new QWidget;
+                       Ui::Boolval_UI *bval=new Ui::Boolval_UI;
+                       bval->setupUi(toFillin);
+                       if (nodeAtts.namedItem("value").isNull())
+                               bval->checkBox->setCheckState(nodeAtts.namedItem("default").nodeValue()=="0" ? Qt::Unchecked : Qt::Checked);
+                       else
+                               bval->checkBox->setCheckState(nodeAtts.namedItem("value").nodeValue()=="0" ? Qt::Unchecked : Qt::Checked);              
                        
-               
+                       connect (bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT (slotSliderMoved(int)));
+                       bval->title->setTitle(na.toElement().text() );
+                       valueItems[na.toElement().text()]=bval;
                }
 
                if (toFillin){
@@ -82,6 +119,14 @@ void EffectStackEdit::collectAllParameters(){
                        QSlider* slider=((Ui::Constval_UI*)valueItems[na.toElement().text()])->horizontalSlider;
                        pa.attributes().namedItem("value").setNodeValue(QString::number(slider->value()));
                }
+               if (type=="list"){
+                       KComboBox *box=((Ui::Listval_UI*)valueItems[na.toElement().text()])->list;
+                       pa.attributes().namedItem("value").setNodeValue(box->currentText());
+               }
+               if (type=="bool"){
+                       QCheckBox *box=((Ui::Boolval_UI*)valueItems[na.toElement().text()])->checkBox;
+                       pa.attributes().namedItem("value").setNodeValue(box->checkState() == Qt::Checked ? "1" :"0" );
+               }
        }
        emit parameterChanged(params);
 }
index ca4d6d595a97351c7c470532d7a2c18835379531..9d789bf68a68db742717b49ef72794d22c41490a 100644 (file)
@@ -47,7 +47,7 @@ EffectStackView::EffectStackView(EffectsList *audioEffectList, EffectsList *vide
        
        ui.effectlist->setDragDropMode(QAbstractItemView::NoDragDrop);//use internal if drop is recognised right
        
-       connect (ui.effectlist, SIGNAL ( itemSelectionChanged()), this , SLOT( slotItemSelectionChanged() ));
+       connect (ui.effectlist, SIGNAL ( itemPressed(QListWidgetItem *)), this , SLOT( slotItemSelectionChanged() ));
        connect (ui.buttonNew, SIGNAL (clicked()), this, SLOT (slotNewEffect()) );
        connect (ui.buttonUp, SIGNAL (clicked()), this, SLOT (slotItemUp()) );
        connect (ui.buttonDown, SIGNAL (clicked()), this, SLOT (slotItemDown()) );
diff --git a/src/widgets/boolval_ui.ui b/src/widgets/boolval_ui.ui
new file mode 100644 (file)
index 0000000..6e5f8af
--- /dev/null
@@ -0,0 +1,72 @@
+<ui version="4.0" >
+ <class>Boolval_UI</class>
+ <widget class="QWidget" name="Boolval_UI" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>509</width>
+    <height>259</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="leftMargin" >
+    <number>0</number>
+   </property>
+   <property name="topMargin" >
+    <number>0</number>
+   </property>
+   <property name="rightMargin" >
+    <number>0</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <property name="horizontalSpacing" >
+    <number>0</number>
+   </property>
+   <property name="verticalSpacing" >
+    <number>0</number>
+   </property>
+   <item row="0" column="0" >
+    <layout class="QVBoxLayout" >
+     <item>
+      <widget class="QGroupBox" name="title" >
+       <property name="font" >
+        <font>
+         <pointsize>8</pointsize>
+        </font>
+       </property>
+       <property name="title" >
+        <string>GroupBox</string>
+       </property>
+       <property name="alignment" >
+        <set>Qt::AlignLeading</set>
+       </property>
+       <property name="flat" >
+        <bool>false</bool>
+       </property>
+       <property name="checkable" >
+        <bool>false</bool>
+       </property>
+       <layout class="QGridLayout" >
+        <item row="0" column="0" >
+         <widget class="QCheckBox" name="checkBox" >
+          <property name="text" >
+           <string>CheckBox</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/widgets/listval_ui.ui b/src/widgets/listval_ui.ui
new file mode 100644 (file)
index 0000000..b14471e
--- /dev/null
@@ -0,0 +1,80 @@
+<ui version="4.0" >
+ <class>Listval_UI</class>
+ <widget class="QWidget" name="Listval_UI" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>428</width>
+    <height>128</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="leftMargin" >
+    <number>0</number>
+   </property>
+   <property name="topMargin" >
+    <number>0</number>
+   </property>
+   <property name="rightMargin" >
+    <number>0</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <property name="horizontalSpacing" >
+    <number>0</number>
+   </property>
+   <property name="verticalSpacing" >
+    <number>0</number>
+   </property>
+   <item row="0" column="0" >
+    <widget class="QGroupBox" name="title" >
+     <property name="font" >
+      <font>
+       <pointsize>8</pointsize>
+      </font>
+     </property>
+     <property name="title" >
+      <string>GroupBox</string>
+     </property>
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>0</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>0</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <property name="horizontalSpacing" >
+       <number>0</number>
+      </property>
+      <property name="verticalSpacing" >
+       <number>0</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="KComboBox" name="list" />
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>