]> git.sesse.net Git - kdenlive/commitdiff
Allow adding comments to bool parameters
authorTill Theato <root@ttill.de>
Sat, 8 Jan 2011 22:52:58 +0000 (22:52 +0000)
committerTill Theato <root@ttill.de>
Sat, 8 Jan 2011 22:52:58 +0000 (22:52 +0000)
svn path=/trunk/kdenlive/; revision=5309

src/doubleparameterwidget.cpp
src/doubleparameterwidget.h
src/effectstackedit.cpp
src/effectstackedit.h
src/effectstackview.cpp
src/effectstackview.h
src/keyframeedit.cpp
src/keyframeedit.h
src/widgets/boolval_ui.ui

index ed8e23f969bedbc9300de9a0a69ed47761477510..f9e8f5e1edfbd64d0f6df050d84d3c4e3fc4a9c7 100644 (file)
@@ -105,16 +105,14 @@ void DoubleParameterWidget::slotReset()
     setValue(m_default);
 }
 
-void DoubleParameterWidget::slotShowComment()
+void DoubleParameterWidget::slotShowComment( bool show)
 {
     if (m_commentLabel->text() != QString()) {
-        if (m_commentLabel->isHidden()) {
-            m_commentLabel->setHidden(false);
+        m_commentLabel->setVisible(show);
+        if (show)
             layout()->setContentsMargins(0, 0, 0, 15);
-        } else {
-            m_commentLabel->setHidden(true);
+        else
             layout()->setContentsMargins(0, 0, 0, 0);
-        }
     }
 }
 
index 9a7681fccb6df70916addd0b7b36ab496b5bf54f..e677ad01b37f85cb5aea47ba9a93d13885ffa242 100644 (file)
@@ -65,7 +65,7 @@ public slots:
 
 private slots:
     /** @brief Shows/Hides the comment label. */
-    void slotShowComment();
+    void slotShowComment(bool show);
 
 private:
     int m_default;
index 176052b48f18ab315e2a0e66ba45b837397c9849..37c17c75fc668ec4267f010fcb6533a0af62b6b8 100644 (file)
@@ -242,7 +242,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             m_vbox->addWidget(doubleparam);
             m_valueItems[paramName] = doubleparam;
             connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
-            connect(this, SIGNAL(showComments()), doubleparam, SLOT(slotShowComment()));
+            connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
         } else if (type == "list") {
             Listval *lsval = new Listval;
             lsval->setupUi(toFillin);
@@ -275,8 +275,12 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             bval->setupUi(toFillin);
             bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
             bval->name->setText(paramName);
+            bval->labelComment->setText(comment);
+            bval->labelComment->setHidden(true);
             m_valueItems[paramName] = bval;
             connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(collectAllParameters()));
+            if (!comment.isEmpty())
+                connect(this, SIGNAL(showComments(bool)), bval->labelComment, SLOT(setVisible(bool)));
             m_uiItems.append(bval);
         } else if (type == "complex") {
             ComplexParameter *pl = new ComplexParameter;
@@ -331,7 +335,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
                 m_keyframeEditor = geo;
                 connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
                 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
-                connect(this, SIGNAL(showComments()), geo, SIGNAL(showComments()));
+                connect(this, SIGNAL(showComments(bool)), geo, SIGNAL(showComments(bool)));
             } else {
                 // we already have a keyframe editor, so just add another column for the new param
                 m_keyframeEditor->addParameter(pa);
index f1e9613b6bdd8681e293c5548c99b42dc676f1b9..012faf66cd6e6950b5d97147cf2a8cb1d40092b8 100644 (file)
@@ -99,7 +99,7 @@ signals:
     void displayMessage(const QString&, int);
     void checkMonitorPosition(int);
     void syncEffectsPos(int pos);
-    void showComments();
+    void showComments(bool show);
     void effectStateChanged(bool enabled);
 };
 
index cd9a6b4de1012f2964967907c4e2b11d2460854f..1c2fe12ce9a8f75a7c1afbfe524c2dd76ea47ac5 100644 (file)
@@ -92,7 +92,7 @@ EffectStackView::EffectStackView(Monitor *monitor, QWidget *parent) :
     connect(m_effectedit, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
     connect(m_effectedit, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
     connect(monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
-    connect(this, SIGNAL(showComments()), m_effectedit, SIGNAL(showComments()));
+    connect(this, SIGNAL(showComments(bool)), m_effectedit, SIGNAL(showComments(bool)));
     m_effectLists["audio"] = &MainWindow::audioEffects;
     m_effectLists["video"] = &MainWindow::videoEffects;
     m_effectLists["custom"] = &MainWindow::customEffects;
@@ -334,8 +334,7 @@ void EffectStackView::slotItemSelectionChanged(bool update)
     m_ui.frame->setEnabled(isChecked);
     m_ui.buttonShowComments->setEnabled(hasItem);
 
-    if (m_ui.buttonShowComments->isChecked())
-        emit showComments();
+    emit showComments(m_ui.buttonShowComments->isChecked());
     m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count() || !hasItem);
 }
 
@@ -396,8 +395,7 @@ void EffectStackView::slotResetEffect()
         }
     }
 
-    if (m_ui.buttonShowComments->isChecked())
-        emit showComments();
+    emit showComments(m_ui.buttonShowComments->isChecked());
     m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count());
 }
 
@@ -513,7 +511,7 @@ int EffectStackView::isTrackMode(bool *ok) const
 void EffectStackView::slotShowComments()
 {
     m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count());
-    emit showComments();
+    emit showComments(m_ui.buttonShowComments->isChecked());
 }
 
 #include "effectstackview.moc"
index 29ba056f0665d8ac923e0b79a396a4d6c4361022..e87b8289284c389f3351a6effff33bae3291e8a8 100644 (file)
@@ -160,7 +160,7 @@ signals:
     /** The region effect for current effect was changed */
     void updateClipRegion(ClipItem*, int, QString);
     void displayMessage(const QString&, int);
-    void showComments();
+    void showComments(bool show);
 };
 
 #endif
index cc050c181702343be318334f0081d7dc870beb14..e3af8ab303b7e44e8a7127dbd58c3c20d24beb17 100644 (file)
@@ -119,7 +119,7 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe)
             m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(),
             m_params.at(columnId).attribute("default").toInt(), comment, m_params.at(columnId).attribute("suffix"), this);
     connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
-    connect(this, SIGNAL(showComments()), doubleparam, SLOT(slotShowComment()));
+    connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
     m_slidersLayout->addWidget(doubleparam, columnId, 0);
 
     QRadioButton *radio = new QRadioButton(this);
index b6a0a6815cd9384542531cca24a541996e1da8a9..4d1f1f5f2d67b9ff1a36ba05666a9270fdb11cd9 100644 (file)
@@ -138,7 +138,7 @@ private slots:
 signals:
     void parameterChanged();
     void seekToPos(int);
-    void showComments();
+    void showComments(bool show);
 };
 
 #endif
index f2660805ed772d0c303640f244d083b55401be64..6405d1ea3927156c929140996eb7adb54cfc3f54 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>326</width>
-    <height>30</height>
+    <width>329</width>
+    <height>43</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
      </property>
     </widget>
    </item>
+   <item row="1" column="0" colspan="2">
+    <widget class="QLabel" name="labelComment">
+     <property name="frameShape">
+      <enum>QFrame::StyledPanel</enum>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Raised</enum>
+     </property>
+     <property name="text">
+      <string>TextLabel</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <resources/>