[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra/animator-plugin-somsubhra] krita: One slot for document modified signal.
From: Somsubhra Bairi <somsubhra.bairi () gmail ! com>
Date: 2014-06-01 8:51:35
Message-ID: E1Wr1UN-00062X-FE () scm ! kde ! org
[Download RAW message or body]
Git commit 74b9b8d072f782e825fca926cd468ed78776a3bd by Somsubhra Bairi.
Committed on 01/06/2014 at 05:28.
Pushed by somsubhrabairi into branch 'animator-plugin-somsubhra'.
One slot for document modified signal.
M +4 -3 krita/plugins/extensions/dockers/animator/kis_timeline.cpp
M +11 -5 krita/ui/kis_animation_doc.cpp
M +2 -2 krita/ui/kis_animation_doc.h
http://commits.kde.org/calligra/74b9b8d072f782e825fca926cd468ed78776a3bd
diff --git a/krita/plugins/extensions/dockers/animator/kis_timeline.cpp \
b/krita/plugins/extensions/dockers/animator/kis_timeline.cpp index 297f6d9..fc47dd1 \
100644
--- a/krita/plugins/extensions/dockers/animator/kis_timeline.cpp
+++ b/krita/plugins/extensions/dockers/animator/kis_timeline.cpp
@@ -298,7 +298,6 @@ void KisTimeline::addframePressed()
void KisTimeline::frameBreakStateChanged(bool state)
{
- kWarning() << state;
this->frameBreakState = state;
}
@@ -317,7 +316,7 @@ void KisTimeline::breakFrame(QRect position)
this->m_cells->setSelectedFrame(newSelection);
newSelection->show();
this->lastBrokenFrame = position;
- dynamic_cast<KisAnimationDoc*>(this->getCanvas()->view()->document())->breakFrame(globalGeometry);
+ dynamic_cast<KisAnimationDoc*>(this->getCanvas()->view()->document())->breakFrame(globalGeometry, \
this->frameBreakState); }
void KisTimeline::nextFramePressed()
@@ -334,7 +333,9 @@ void KisTimeline::documentModified()
{
emit canvasModified();
KisAnimationFrame* selectedFrame = this->m_cells->getSelectedFrame();
- this->breakFrame(QRect(selectedFrame->x(), selectedFrame->y(), 10, 20));
+ if(selectedFrame) {
+ this->breakFrame(QRect(selectedFrame->x(), selectedFrame->y(), 10, 20));
+ }
}
void KisTimeline::playAnimation()
diff --git a/krita/ui/kis_animation_doc.cpp b/krita/ui/kis_animation_doc.cpp
index f23d7e8..6b94c2e 100644
--- a/krita/ui/kis_animation_doc.cpp
+++ b/krita/ui/kis_animation_doc.cpp
@@ -141,7 +141,6 @@ void KisAnimationDoc::frameSelectionChanged(QRect frame)
}
}
- connect(d->image.data(), SIGNAL(sigImageModified()), this, \
SLOT(slotFrameModified())); this->updateActiveFrame();
setCurrentImage(d->image);
}
@@ -208,7 +207,6 @@ void KisAnimationDoc::addBlankFrame(QRect frame)
}
}
- connect(d->image.data(), SIGNAL(sigImageModified()), this, \
SLOT(slotFrameModified())); this->updateXML();
this->updateActiveFrame();
@@ -279,16 +277,23 @@ void KisAnimationDoc::addKeyFrame(QRect frame)
}
}
- connect(d->image.data(), SIGNAL(sigImageModified()), this, \
SLOT(slotFrameModified())); this->updateXML();
this->updateActiveFrame();
setCurrentImage(d->image);
}
-void KisAnimationDoc::breakFrame(QRect frame)
+void KisAnimationDoc::breakFrame(QRect frame, bool blank)
{
// Implement breaking of frame and save both the frames.
+
+ if(blank) {
+ // Blank frame
+ kWarning() << "Break frame and add blank frame";
+ } else {
+ // Duplicate frame
+ kWarning() << "Break frame and duplicate frame";
+ }
}
void KisAnimationDoc::addPaintLayer()
@@ -438,8 +443,9 @@ void KisAnimationDoc::preSaveAnimation()
d->saved = true;
}
-void KisAnimationDoc::slotFrameModified()
+void KisAnimationDoc::setImageModified()
{
+ setModified(true);
emit sigFrameModified();
}
diff --git a/krita/ui/kis_animation_doc.h b/krita/ui/kis_animation_doc.h
index 41e9329..2f1fffc 100644
--- a/krita/ui/kis_animation_doc.h
+++ b/krita/ui/kis_animation_doc.h
@@ -37,7 +37,7 @@ public:
void addKeyFrame(QRect frame);
void addBlankFrame(QRect frame);
- void breakFrame(QRect frame);
+ void breakFrame(QRect frame, bool blank=false);
void addPaintLayer();
@@ -50,7 +50,7 @@ public slots:
void play();
void pause();
void stop();
- void slotFrameModified();
+ void setImageModified();
private:
void preSaveAnimation();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic