Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
811de81d
Commit
811de81d
authored
Mar 13, 2008
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change tab icon & font when document was modified
svn path=/branches/KDE4/; revision=2054
parent
024a8b00
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
1 deletion
+33
-1
src/customtrackview.cpp
src/customtrackview.cpp
+6
-0
src/kdenlivedoc.cpp
src/kdenlivedoc.cpp
+9
-1
src/kdenlivedoc.h
src/kdenlivedoc.h
+4
-0
src/mainwindow.cpp
src/mainwindow.cpp
+13
-0
src/mainwindow.h
src/mainwindow.h
+1
-0
No files found.
src/customtrackview.cpp
View file @
811de81d
...
...
@@ -455,11 +455,13 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
m_commandStack
->
push
(
command
);
}
}
m_document
->
setModified
(
true
);
}
void
CustomTrackView
::
slotDeleteEffect
(
ClipItem
*
clip
,
QDomElement
effect
)
{
AddEffectCommand
*
command
=
new
AddEffectCommand
(
this
,
m_tracksCount
-
clip
->
track
(),
clip
->
startPos
(),
effect
,
false
);
m_commandStack
->
push
(
command
);
m_document
->
setModified
(
true
);
}
void
CustomTrackView
::
updateEffect
(
int
track
,
GenTime
pos
,
QDomElement
effect
)
{
...
...
@@ -471,6 +473,7 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement effect) {
m_document
->
renderer
()
->
mltRemoveEffect
(
track
,
pos
,
index
);
}
else
m_document
->
renderer
()
->
mltEditEffect
(
m_tracksCount
-
clip
->
track
(),
clip
->
startPos
(),
effectParams
);
}
m_document
->
setModified
(
true
);
}
void
CustomTrackView
::
slotChangeEffectState
(
ClipItem
*
clip
,
QDomElement
effect
,
bool
disable
)
{
...
...
@@ -478,6 +481,7 @@ void CustomTrackView::slotChangeEffectState(ClipItem *clip, QDomElement effect,
effect
.
setAttribute
(
"disabled"
,
disable
);
EditEffectCommand
*
command
=
new
EditEffectCommand
(
this
,
m_tracksCount
-
clip
->
track
(),
clip
->
startPos
(),
oldEffect
,
effect
,
true
);
m_commandStack
->
push
(
command
);
m_document
->
setModified
(
true
);
}
void
CustomTrackView
::
slotUpdateClipEffect
(
ClipItem
*
clip
,
QDomElement
oldeffect
,
QDomElement
effect
)
{
...
...
@@ -526,6 +530,7 @@ void CustomTrackView::dropEvent(QDropEvent * event) {
m_document
->
updateClip
(
m_dropItem
->
baseClip
()
->
getId
());
// kDebug()<<"IIIIIIIIIIIIIIIIIIIIIIII TRAX CNT: "<<m_tracksCount<<", DROP: "<<m_dropItem->track();
m_document
->
renderer
()
->
mltInsertClip
(
m_tracksCount
-
m_dropItem
->
track
(),
m_dropItem
->
startPos
(),
m_dropItem
->
xml
());
m_document
->
setModified
(
true
);
}
else
QGraphicsView
::
dropEvent
(
event
);
m_dropItem
=
NULL
;
}
...
...
@@ -627,6 +632,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) {
m_commandStack
->
push
(
command
);
m_document
->
renderer
()
->
doRefresh
();
}
m_document
->
setModified
(
true
);
m_operationMode
=
NONE
;
m_dragItem
=
NULL
;
}
...
...
src/kdenlivedoc.cpp
View file @
811de81d
...
...
@@ -259,7 +259,12 @@ KUrl KdenliveDoc::url() const {
void
KdenliveDoc
::
setUrl
(
KUrl
url
)
{
m_url
=
url
;
m_modified
=
false
;
}
void
KdenliveDoc
::
setModified
(
bool
mod
)
{
if
(
mod
==
m_modified
)
return
;
m_modified
=
mod
;
emit
docModified
(
m_modified
);
}
QString
KdenliveDoc
::
description
()
const
{
...
...
@@ -279,6 +284,7 @@ void KdenliveDoc::addClip(const QDomElement &elem, const int clipId) {
void
KdenliveDoc
::
deleteProjectClip
(
const
uint
clipId
)
{
emit
deletTimelineClip
(
clipId
);
m_clipManager
->
slotDeleteClip
(
clipId
);
setModified
(
true
);
}
void
KdenliveDoc
::
deleteClip
(
const
uint
clipId
)
{
...
...
@@ -289,6 +295,7 @@ void KdenliveDoc::deleteClip(const uint clipId) {
void
KdenliveDoc
::
slotAddClipFile
(
const
KUrl
url
,
const
QString
group
)
{
kDebug
()
<<
"///////// DOCUM, ADD CLP: "
<<
url
;
m_clipManager
->
slotAddClipFile
(
url
,
group
);
setModified
(
true
);
}
DocClipBase
*
KdenliveDoc
::
getBaseClip
(
int
clipId
)
{
...
...
@@ -297,6 +304,7 @@ DocClipBase *KdenliveDoc::getBaseClip(int clipId) {
void
KdenliveDoc
::
slotAddColorClipFile
(
const
QString
name
,
const
QString
color
,
QString
duration
,
const
QString
group
)
{
m_clipManager
->
slotAddColorClipFile
(
name
,
color
,
duration
,
group
);
setModified
(
true
);
}
#include "kdenlivedoc.moc"
...
...
src/kdenlivedoc.h
View file @
811de81d
...
...
@@ -74,6 +74,8 @@ Q_OBJECT public:
void
setUrl
(
KUrl
url
);
QDomElement
documentInfoXml
();
void
setProfilePath
(
QString
path
);
/** Set to true if document needs saving, false otherwise */
void
setModified
(
bool
mod
);
private:
KUrl
m_url
;
...
...
@@ -100,6 +102,8 @@ signals:
void
updateClipDisplay
(
int
);
void
deletTimelineClip
(
int
);
void
thumbsProgress
(
KUrl
,
int
);
/** emited when the document state has been modified (= needs saving or not) */
void
docModified
(
bool
);
};
#endif
src/mainwindow.cpp
View file @
811de81d
...
...
@@ -376,6 +376,7 @@ void MainWindow::saveFileAs(const QString &outputFileName) {
setCaption
(
m_activeDocument
->
description
());
m_timelineArea
->
setTabText
(
m_timelineArea
->
currentIndex
(),
m_activeDocument
->
description
());
m_timelineArea
->
setTabToolTip
(
m_timelineArea
->
currentIndex
(),
m_activeDocument
->
url
().
path
());
m_activeDocument
->
setModified
(
false
);
}
void
MainWindow
::
saveFileAs
()
{
...
...
@@ -536,6 +537,16 @@ void MainWindow::slotUpdateMousePosition(int pos) {
}
}
void
MainWindow
::
slotUpdateDocumentState
(
bool
modified
)
{
if
(
modified
)
{
m_timelineArea
->
setTabTextColor
(
m_timelineArea
->
currentIndex
(),
palette
().
color
(
QPalette
::
Link
));
m_timelineArea
->
setTabIcon
(
m_timelineArea
->
currentIndex
(),
KIcon
(
"document-save"
));
}
else
{
m_timelineArea
->
setTabTextColor
(
m_timelineArea
->
currentIndex
(),
palette
().
color
(
QPalette
::
Text
));
m_timelineArea
->
setTabIcon
(
m_timelineArea
->
currentIndex
(),
KIcon
(
"kdenlive"
));
}
}
void
MainWindow
::
connectDocument
(
TrackView
*
trackView
,
KdenliveDoc
*
doc
)
{
//changed
//m_projectMonitor->stop();
kDebug
()
<<
"/////////////////// CONNECTING DOC TO PROJECT VIEW ////////////////"
;
...
...
@@ -551,6 +562,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
disconnect
(
m_activeDocument
,
SIGNAL
(
deletTimelineClip
(
int
)),
m_activeTimeline
,
SLOT
(
slotDeleteClip
(
int
)));
disconnect
(
m_activeDocument
,
SIGNAL
(
thumbsProgress
(
KUrl
,
int
)),
this
,
SLOT
(
slotGotProgressInfo
(
KUrl
,
int
)));
disconnect
(
m_activeTimeline
,
SIGNAL
(
clipItemSelected
(
ClipItem
*
)),
effectStack
,
SLOT
(
slotClipItemSelected
(
ClipItem
*
)));
disconnect
(
m_activeDocument
,
SIGNAL
(
docModified
(
bool
)),
this
,
SLOT
(
slotUpdateDocumentState
(
bool
)));
disconnect
(
effectStack
,
SIGNAL
(
updateClipEffect
(
ClipItem
*
,
QDomElement
,
QDomElement
)),
m_activeTimeline
->
projectView
(),
SLOT
(
slotUpdateClipEffect
(
ClipItem
*
,
QDomElement
,
QDomElement
)));
disconnect
(
effectStack
,
SIGNAL
(
removeEffect
(
ClipItem
*
,
QDomElement
)),
m_activeTimeline
->
projectView
(),
SLOT
(
slotDeleteEffect
(
ClipItem
*
,
QDomElement
)));
disconnect
(
effectStack
,
SIGNAL
(
changeEffectState
(
ClipItem
*
,
QDomElement
,
bool
)),
m_activeTimeline
->
projectView
(),
SLOT
(
slotChangeEffectState
(
ClipItem
*
,
QDomElement
,
bool
)));
...
...
@@ -573,6 +585,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
connect
(
doc
,
SIGNAL
(
updateClipDisplay
(
int
)),
m_projectList
,
SLOT
(
slotUpdateClip
(
int
)));
connect
(
doc
,
SIGNAL
(
deletTimelineClip
(
int
)),
trackView
,
SLOT
(
slotDeleteClip
(
int
)));
connect
(
doc
,
SIGNAL
(
thumbsProgress
(
KUrl
,
int
)),
this
,
SLOT
(
slotGotProgressInfo
(
KUrl
,
int
)));
connect
(
doc
,
SIGNAL
(
docModified
(
bool
)),
this
,
SLOT
(
slotUpdateDocumentState
(
bool
)));
connect
(
trackView
,
SIGNAL
(
clipItemSelected
(
ClipItem
*
)),
effectStack
,
SLOT
(
slotClipItemSelected
(
ClipItem
*
)));
connect
(
effectStack
,
SIGNAL
(
updateClipEffect
(
ClipItem
*
,
QDomElement
,
QDomElement
)),
trackView
->
projectView
(),
SLOT
(
slotUpdateClipEffect
(
ClipItem
*
,
QDomElement
,
QDomElement
)));
...
...
src/mainwindow.h
View file @
811de81d
...
...
@@ -135,6 +135,7 @@ private slots:
void
slotRenderProject
();
void
slotDoRender
(
const
QString
&
dest
,
const
QString
&
render
,
const
QStringList
&
avformat_args
,
bool
zoneOnly
,
bool
playAfter
);
void
slotFullScreen
();
void
slotUpdateDocumentState
(
bool
modified
);
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment