From 660cecb12deff3d6a6e11a767e6f89829a734eac Mon Sep 17 00:00:00 2001 From: Marco Gittler Date: Wed, 20 Feb 2008 12:56:57 +0000 Subject: [PATCH] effectstack can insert new points (button) svn path=/branches/KDE4/; revision=1885 --- src/effectstackview.cpp | 19 ++++++++++++++++--- src/effectstackview.h | 1 + src/parameterplotter.cpp | 9 +++++++++ src/parameterplotter.h | 4 +++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/effectstackview.cpp b/src/effectstackview.cpp index 8efd877f..3ff18746 100644 --- a/src/effectstackview.cpp +++ b/src/effectstackview.cpp @@ -49,9 +49,9 @@ EffectStackView::EffectStackView( QWidget *parent) connect (ui.buttonLeftRight, SIGNAL (clicked()), this , SLOT ( slotSetMoveX() ) ); connect (ui.buttonUpDown, SIGNAL (clicked()), this , SLOT ( slotSetMoveY() ) ); connect (ui.buttonShowInTimeline, SIGNAL (clicked()), this , SLOT ( slotShowInTimeline() ) ); - connect (ui.buttonNew, SIGNAL (clicked()), this , SLOT ( slotSetNew() ) ); + connect (ui.buttonNewPoints, SIGNAL (clicked()), this , SLOT ( slotSetNew() ) ); connect (ui.buttonHelp, SIGNAL (clicked()), this , SLOT ( slotSetHelp() ) ); - + connect (ui.parameterList, SIGNAL (currentIndexChanged ( const QString & ) ), this, SLOT( slotParameterChanged(const QString&) ) ); ui.infoBox->hide(); updateButtonStatus(); @@ -72,6 +72,9 @@ EffectStackView::EffectStackView( QWidget *parent) data1[300]=133; QPair > testpair1("dx",data1); points.append(testpair1); + ui.parameterList->addItem("all"); + ui.parameterList->addItem("gray"); + ui.parameterList->addItem("dx"); ui.kplotwidget->setPointLists(points,0,305); @@ -152,7 +155,8 @@ void EffectStackView::slotSetMoveY(){ } void EffectStackView::slotSetNew(){ - + ui.kplotwidget->setNewPoints(!ui.kplotwidget->isNewPoints()); + updateButtonStatus(); } void EffectStackView::slotSetHelp(){ @@ -173,6 +177,15 @@ void EffectStackView::updateButtonStatus(){ ui.buttonShowInTimeline->setEnabled( ui.kplotwidget->isMoveX() || ui.kplotwidget->isMoveY () ); ui.buttonShowInTimeline->setDown(ui.kplotwidget->isMoveTimeline()); + + ui.buttonNewPoints->setEnabled(ui.parameterList->currentText()!="all"); + ui.buttonNewPoints->setDown(ui.kplotwidget->isNewPoints()); +} +void EffectStackView::slotParameterChanged(const QString& text){ + + //ui.buttonNewPoints->setEnabled(text!="all"); + updateButtonStatus(); } + #include "effectstackview.moc" diff --git a/src/effectstackview.h b/src/effectstackview.h index 8f01f4e1..5799e249 100644 --- a/src/effectstackview.h +++ b/src/effectstackview.h @@ -47,6 +47,7 @@ public slots: void slotSetNew(); void slotSetHelp(); void slotShowInTimeline(); + void slotParameterChanged(const QString&); }; #endif diff --git a/src/parameterplotter.cpp b/src/parameterplotter.cpp index a3092586..a69129ff 100644 --- a/src/parameterplotter.cpp +++ b/src/parameterplotter.cpp @@ -34,6 +34,7 @@ ParameterPlotter::ParameterPlotter (QWidget *parent):KPlotWidget (parent){ m_moveX=false; m_moveY=true; m_moveTimeline=true; + m_newPoints=false; } void ParameterPlotter::setPointLists(const QList< QPair > >& params,int startframe, int endframe){ @@ -134,6 +135,10 @@ void ParameterPlotter::setMoveTimeLine(bool b){ m_moveTimeline=b; } +void ParameterPlotter::setNewPoints(bool b){ + m_newPoints=b; +} + bool ParameterPlotter::isMoveX(){ return m_moveX; } @@ -145,3 +150,7 @@ bool ParameterPlotter::isMoveY(){ bool ParameterPlotter::isMoveTimeline(){ return m_moveTimeline; } + +bool ParameterPlotter::isNewPoints(){ + return m_newPoints; +} \ No newline at end of file diff --git a/src/parameterplotter.h b/src/parameterplotter.h index 294fd110..ae0e694f 100644 --- a/src/parameterplotter.h +++ b/src/parameterplotter.h @@ -25,12 +25,14 @@ class ParameterPlotter : public KPlotWidget { void setMoveX(bool); void setMoveY(bool); void setMoveTimeLine(bool); + void setNewPoints(bool); bool isMoveX(); bool isMoveY(); bool isMoveTimeline(); + bool isNewPoints(); private: KPlotPoint* movepoint; - bool m_moveX,m_moveY,m_moveTimeline; + bool m_moveX,m_moveY,m_moveTimeline,m_newPoints; QPoint oldmousepoint; int maxx,maxy; QStringList parameterNameList; -- 2.39.2