Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
256
Issues
256
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
6fac7eba
Commit
6fac7eba
authored
Aug 12, 2014
by
Till Theato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move notes widget handling to own class.
parent
b21c4566
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
114 additions
and
32 deletions
+114
-32
src/doc/kdenlivedoc.cpp
src/doc/kdenlivedoc.cpp
+4
-2
src/doc/kdenlivedoc.h
src/doc/kdenlivedoc.h
+2
-1
src/mainwindow.cpp
src/mainwindow.cpp
+0
-19
src/mainwindow.h
src/mainwindow.h
+0
-7
src/project/CMakeLists.txt
src/project/CMakeLists.txt
+1
-0
src/project/dialogs/noteswidget.cpp
src/project/dialogs/noteswidget.cpp
+1
-1
src/project/notesplugin.cpp
src/project/notesplugin.cpp
+51
-0
src/project/notesplugin.h
src/project/notesplugin.h
+45
-0
src/project/projectmanager.cpp
src/project/projectmanager.cpp
+7
-2
src/project/projectmanager.h
src/project/projectmanager.h
+3
-0
No files found.
src/doc/kdenlivedoc.cpp
View file @
6fac7eba
...
...
@@ -32,6 +32,8 @@
#include "effectslist/initeffects.h"
#include "dialogs/profilesdialog.h"
#include "titler/titlewidget.h"
#include "project/notesplugin.h"
#include "project/dialogs/noteswidget.h"
#include <KDebug>
#include <KStandardDirs>
...
...
@@ -62,12 +64,12 @@
const
double
DOCUMENTVERSION
=
0.88
;
KdenliveDoc
::
KdenliveDoc
(
const
KUrl
&
url
,
const
KUrl
&
projectFolder
,
QUndoGroup
*
undoGroup
,
const
QString
&
profileName
,
const
QMap
<
QString
,
QString
>&
properties
,
const
QMap
<
QString
,
QString
>&
metadata
,
const
QPoint
&
tracks
,
Render
*
render
,
KTextEdit
*
notes
,
bool
*
openBackup
,
MainWindow
*
parent
,
KProgressDialog
*
progressDialog
)
:
KdenliveDoc
::
KdenliveDoc
(
const
KUrl
&
url
,
const
KUrl
&
projectFolder
,
QUndoGroup
*
undoGroup
,
const
QString
&
profileName
,
const
QMap
<
QString
,
QString
>&
properties
,
const
QMap
<
QString
,
QString
>&
metadata
,
const
QPoint
&
tracks
,
Render
*
render
,
NotesPlugin
*
notes
,
bool
*
openBackup
,
MainWindow
*
parent
,
KProgressDialog
*
progressDialog
)
:
QObject
(
parent
),
m_autosave
(
NULL
),
m_url
(
url
),
m_render
(
render
),
m_notesWidget
(
notes
),
m_notesWidget
(
notes
->
widget
()
),
m_commandStack
(
new
QUndoStack
(
undoGroup
)),
m_modified
(
false
),
m_projectFolder
(
projectFolder
)
...
...
src/doc/kdenlivedoc.h
View file @
6fac7eba
...
...
@@ -40,6 +40,7 @@ class ClipManager;
class
DocClipBase
;
class
MainWindow
;
class
TrackInfo
;
class
NotesPlugin
;
class
KTextEdit
;
class
KProgressDialog
;
...
...
@@ -52,7 +53,7 @@ class KdenliveDoc: public QObject
Q_OBJECT
public:
KdenliveDoc
(
const
KUrl
&
url
,
const
KUrl
&
projectFolder
,
QUndoGroup
*
undoGroup
,
const
QString
&
profileName
,
const
QMap
<
QString
,
QString
>&
properties
,
const
QMap
<
QString
,
QString
>&
metadata
,
const
QPoint
&
tracks
,
Render
*
render
,
KTextEdit
*
notes
,
bool
*
openBackup
,
MainWindow
*
parent
=
0
,
KProgressDialog
*
progressDialog
=
0
);
KdenliveDoc
(
const
KUrl
&
url
,
const
KUrl
&
projectFolder
,
QUndoGroup
*
undoGroup
,
const
QString
&
profileName
,
const
QMap
<
QString
,
QString
>&
properties
,
const
QMap
<
QString
,
QString
>&
metadata
,
const
QPoint
&
tracks
,
Render
*
render
,
NotesPlugin
*
notes
,
bool
*
openBackup
,
MainWindow
*
parent
=
0
,
KProgressDialog
*
progressDialog
=
0
);
~
KdenliveDoc
();
QDomNodeList
producersList
();
double
fps
()
const
;
...
...
src/mainwindow.cpp
View file @
6fac7eba
...
...
@@ -215,15 +215,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
#endif
/* ! Q_WS_MAC */
pCore
->
monitorManager
()
->
initMonitors
(
m_clipMonitor
,
m_projectMonitor
,
m_recMonitor
);
m_notesWidget
=
new
NotesWidget
();
connect
(
m_notesWidget
,
SIGNAL
(
insertNotesTimecode
()),
this
,
SLOT
(
slotInsertNotesTimecode
()));
connect
(
m_notesWidget
,
SIGNAL
(
seekProject
(
int
)),
m_projectMonitor
->
render
,
SLOT
(
seekToFrame
(
int
)));
m_notesWidget
->
setTabChangesFocus
(
true
);
#if KDE_IS_VERSION(4,4,0)
m_notesWidget
->
setClickMessage
(
i18n
(
"Enter your project notes here ..."
));
#endif
m_notesDock
=
addDock
(
i18n
(
"Project Notes"
),
"notes_widget"
,
m_notesWidget
);
m_effectStack
=
new
EffectStackView2
(
m_projectMonitor
);
connect
(
m_effectStack
,
SIGNAL
(
startFilterJob
(
ItemInfo
,
QString
,
QString
,
QString
,
QString
,
QString
,
QMap
<
QString
,
QString
>
)),
m_projectList
,
SLOT
(
slotStartFilterJob
(
ItemInfo
,
QString
,
QString
,
QString
,
QString
,
QString
,
QMap
<
QString
,
QString
>
)));
m_effectStackDock
=
addDock
(
i18n
(
"Effect Stack"
),
"effect_stack"
,
m_effectStack
);
...
...
@@ -299,7 +290,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
/// Tabify Widgets ///
tabifyDockWidget
(
m_effectListDock
,
m_effectStackDock
);
tabifyDockWidget
(
m_effectListDock
,
m_transitionConfigDock
);
tabifyDockWidget
(
m_projectListDock
,
m_notesDock
);
tabifyDockWidget
(
m_clipMonitorDock
,
m_projectMonitorDock
);
#ifndef Q_WS_MAC
...
...
@@ -1881,8 +1871,6 @@ void MainWindow::connectDocument(KdenliveDoc *newDoc, KdenliveDoc **projectManag
connect
(
newDoc
,
SIGNAL
(
guidesUpdated
()),
this
,
SLOT
(
slotGuidesUpdated
()));
connect
(
newDoc
,
SIGNAL
(
saveTimelinePreview
(
QString
)),
pCore
->
projectManager
()
->
currentTrackView
(),
SLOT
(
slotSaveTimelinePreview
(
QString
)));
connect
(
m_notesWidget
,
SIGNAL
(
textChanged
()),
newDoc
,
SLOT
(
setModified
()));
connect
(
pCore
->
projectManager
()
->
currentTrackView
()
->
projectView
(),
SIGNAL
(
updateClipMarkers
(
DocClipBase
*
)),
this
,
SLOT
(
slotUpdateClipMarkers
(
DocClipBase
*
)));
connect
(
pCore
->
projectManager
()
->
currentTrackView
(),
SIGNAL
(
showTrackEffects
(
int
,
TrackInfo
)),
this
,
SLOT
(
slotTrackSelected
(
int
,
TrackInfo
)));
...
...
@@ -3629,13 +3617,6 @@ void MainWindow::slotUpdateProxySettings()
m_projectList
->
updateProxyConfig
();
}
void
MainWindow
::
slotInsertNotesTimecode
()
{
int
frames
=
m_projectMonitor
->
render
->
seekPosition
().
frames
(
pCore
->
projectManager
()
->
current
()
->
fps
());
QString
position
=
pCore
->
projectManager
()
->
current
()
->
timecode
().
getTimecodeFromFrames
(
frames
);
m_notesWidget
->
insertHtml
(
"<a href=
\"
"
+
QString
::
number
(
frames
)
+
"
\"
>"
+
position
+
"</a> "
);
}
void
MainWindow
::
slotArchiveProject
()
{
QList
<
DocClipBase
*>
list
=
m_projectList
->
documentClipList
();
...
...
src/mainwindow.h
View file @
6fac7eba
...
...
@@ -49,8 +49,6 @@
#include "statusbarmessagelabel.h"
#include "dvdwizard/dvdwizard.h"
#include "stopmotion/stopmotion.h"
#include "project/dialogs/noteswidget.h"
#include "ui_backupdialog_ui.h"
class
KdenliveDoc
;
class
TrackView
;
...
...
@@ -128,7 +126,6 @@ public:
ProjectList
*
m_projectList
;
StopmotionWidget
*
m_stopmotion
;
QUndoGroup
*
m_commandStack
;
NotesWidget
*
m_notesWidget
;
KActionCollection
*
m_tracksActionCollection
;
EffectStackView2
*
m_effectStack
;
TransitionSettings
*
m_transitionConfig
;
...
...
@@ -174,8 +171,6 @@ private:
QDockWidget
*
m_effectListDock
;
EffectsListView
*
m_effectList
;
QDockWidget
*
m_notesDock
;
QDockWidget
*
m_effectStackDock
;
QDockWidget
*
m_transitionConfigDock
;
...
...
@@ -490,8 +485,6 @@ private slots:
void
slotOpenStopmotion
();
/** @brief Update project because the use of proxy clips was enabled / disabled. */
void
slotUpdateProxySettings
();
/** @brief Insert current project's timecode into the notes widget. */
void
slotInsertNotesTimecode
();
/** @brief Disable proxies for this project. */
void
slotDisableProxies
();
...
...
src/project/CMakeLists.txt
View file @
6fac7eba
...
...
@@ -15,6 +15,7 @@ set(kdenlive_SRCS
project/projectlistview.cpp
project/subprojectitem.cpp
project/transitionsettings.cpp
project/notesplugin.cpp
project/jobs/abstractclipjob.cpp
project/jobs/proxyclipjob.cpp
project/jobs/cutclipjob.cpp
...
...
src/project/dialogs/noteswidget.cpp
View file @
6fac7eba
...
...
@@ -29,7 +29,7 @@
NotesWidget
::
NotesWidget
(
QWidget
*
parent
)
:
KTextEdit
(
parent
)
{
connect
(
this
,
SIGNAL
(
aboutToShowContextMenu
(
QMenu
*
)),
this
,
SLOT
(
slotFillNotesMenu
(
QMenu
*
)));
connect
(
this
,
SIGNAL
(
aboutToShowContextMenu
(
QMenu
*
)),
SLOT
(
slotFillNotesMenu
(
QMenu
*
)));
setMouseTracking
(
true
);
}
...
...
src/project/notesplugin.cpp
0 → 100644
View file @
6fac7eba
/*
Copyright (C) 2014 Till Theato <root@ttill.de>
This file is part of kdenlive. See www.kdenlive.org.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
#include "notesplugin.h"
#include "dialogs/noteswidget.h"
#include "core.h"
#include "mainwindow.h"
#include "monitor/monitormanager.h"
#include "doc/kdenlivedoc.h"
#include "project/projectmanager.h"
NotesPlugin
::
NotesPlugin
(
ProjectManager
*
projectManager
)
:
QObject
(
projectManager
)
{
m_widget
=
new
NotesWidget
();
connect
(
m_widget
,
SIGNAL
(
insertNotesTimecode
()),
SLOT
(
slotInsertTimecode
()));
m_widget
->
setTabChangesFocus
(
true
);
#if KDE_IS_VERSION(4,4,0)
m_widget
->
setClickMessage
(
i18n
(
"Enter your project notes here ..."
));
#endif
pCore
->
window
()
->
addDock
(
i18n
(
"Project Notes"
),
"notes_widget"
,
m_widget
);
connect
(
projectManager
,
SIGNAL
(
docOpened
(
KdenliveDoc
*
)),
SLOT
(
setProject
(
KdenliveDoc
*
)));
}
void
NotesPlugin
::
setProject
(
KdenliveDoc
*
document
)
{
connect
(
m_widget
,
SIGNAL
(
seekProject
(
int
)),
pCore
->
monitorManager
()
->
projectMonitor
()
->
render
,
SLOT
(
seekToFrame
(
int
)));
connect
(
m_widget
,
SIGNAL
(
textChanged
()),
document
,
SLOT
(
setModified
()));
}
void
NotesPlugin
::
slotInsertTimecode
()
{
int
frames
=
pCore
->
monitorManager
()
->
projectMonitor
()
->
render
->
seekPosition
().
frames
(
pCore
->
projectManager
()
->
current
()
->
fps
());
QString
position
=
pCore
->
projectManager
()
->
current
()
->
timecode
().
getTimecodeFromFrames
(
frames
);
m_widget
->
insertHtml
(
"<a href=
\"
"
+
QString
::
number
(
frames
)
+
"
\"
>"
+
position
+
"</a> "
);
}
NotesWidget
*
NotesPlugin
::
widget
()
{
return
m_widget
;
}
#include "notesplugin.moc"
src/project/notesplugin.h
0 → 100644
View file @
6fac7eba
/*
Copyright (C) 2014 Till Theato <root@ttill.de>
This file is part of kdenlive. See www.kdenlive.org.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
#ifndef NOTESPLUGIN_H
#define NOTESPLUGIN_H
#include <QObject>
class
NotesWidget
;
class
KdenliveDoc
;
class
ProjectManager
;
/**
* @class NotesPlugin
* @brief Handles connection of NotesWidget
*
* Supposed to become a plugin/ProjectPart (@see refactoring branch).
*/
class
NotesPlugin
:
public
QObject
{
Q_OBJECT
public:
explicit
NotesPlugin
(
ProjectManager
*
projectManager
);
NotesWidget
*
widget
();
private
slots
:
void
setProject
(
KdenliveDoc
*
document
);
/** @brief Insert current timecode/cursor position into the widget. */
void
slotInsertTimecode
();
private:
NotesWidget
*
m_widget
;
};
#endif
src/project/projectmanager.cpp
View file @
6fac7eba
...
...
@@ -22,6 +22,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "project/dialogs/archivewidget.h"
#include "effectstack/effectstackview2.h"
#include "project/dialogs/backupwidget.h"
#include "project/notesplugin.h"
#include <KTabWidget>
#include <KFileDialog>
#include <KActionCollection>
...
...
@@ -48,6 +49,8 @@ ProjectManager::ProjectManager(QObject* parent) :
KAction
*
backupAction
=
new
KAction
(
KIcon
(
"edit-undo"
),
i18n
(
"Open Backup File"
),
this
);
pCore
->
window
()
->
addAction
(
"open_backup"
,
backupAction
);
connect
(
backupAction
,
SIGNAL
(
triggered
(
bool
)),
SLOT
(
slotOpenBackup
()));
m_notesPlugin
=
new
NotesPlugin
(
this
);
}
ProjectManager
::~
ProjectManager
()
...
...
@@ -124,7 +127,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
pCore
->
window
()
->
m_timelineArea
->
setEnabled
(
true
);
pCore
->
window
()
->
m_projectList
->
setEnabled
(
true
);
bool
openBackup
;
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
KUrl
(),
projectFolder
,
pCore
->
window
()
->
m_commandStack
,
profileName
,
documentProperties
,
documentMetadata
,
projectTracks
,
pCore
->
monitorManager
()
->
projectMonitor
()
->
render
,
pCore
->
window
()
->
m_notesWidget
,
&
openBackup
,
pCore
->
window
());
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
KUrl
(),
projectFolder
,
pCore
->
window
()
->
m_commandStack
,
profileName
,
documentProperties
,
documentMetadata
,
projectTracks
,
pCore
->
monitorManager
()
->
projectMonitor
()
->
render
,
m_notesPlugin
,
&
openBackup
,
pCore
->
window
());
doc
->
m_autosave
=
new
KAutoSaveFile
(
KUrl
(),
doc
);
bool
ok
;
m_trackView
=
new
TrackView
(
doc
,
pCore
->
window
()
->
m_tracksActionCollection
->
actions
(),
&
ok
,
pCore
->
window
());
...
...
@@ -138,6 +141,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
}
connectDocumentInfo
(
doc
);
pCore
->
window
()
->
connectDocument
(
doc
,
&
m_project
);
emit
docOpened
(
m_project
);
pCore
->
monitorManager
()
->
activateMonitor
(
Kdenlive
::
ClipMonitor
);
}
...
...
@@ -349,7 +353,7 @@ void ProjectManager::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
progressDialog
.
progressBar
()
->
setValue
(
0
);
bool
openBackup
;
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
stale
?
KUrl
(
stale
->
fileName
())
:
url
,
KdenliveSettings
::
defaultprojectfolder
(),
pCore
->
window
()
->
m_commandStack
,
KdenliveSettings
::
default_profile
(),
QMap
<
QString
,
QString
>
(),
QMap
<
QString
,
QString
>
(),
QPoint
(
KdenliveSettings
::
videotracks
(),
KdenliveSettings
::
audiotracks
()),
pCore
->
monitorManager
()
->
projectMonitor
()
->
render
,
pCore
->
window
()
->
m_notesWidget
,
&
openBackup
,
pCore
->
window
(),
&
progressDialog
);
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
stale
?
KUrl
(
stale
->
fileName
())
:
url
,
KdenliveSettings
::
defaultprojectfolder
(),
pCore
->
window
()
->
m_commandStack
,
KdenliveSettings
::
default_profile
(),
QMap
<
QString
,
QString
>
(),
QMap
<
QString
,
QString
>
(),
QPoint
(
KdenliveSettings
::
videotracks
(),
KdenliveSettings
::
audiotracks
()),
pCore
->
monitorManager
()
->
projectMonitor
()
->
render
,
m_notesPlugin
,
&
openBackup
,
pCore
->
window
(),
&
progressDialog
);
progressDialog
.
progressBar
()
->
setValue
(
1
);
progressDialog
.
progressBar
()
->
setMaximum
(
4
);
...
...
@@ -374,6 +378,7 @@ void ProjectManager::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
bool
ok
;
m_trackView
=
new
TrackView
(
doc
,
pCore
->
window
()
->
m_tracksActionCollection
->
actions
(),
&
ok
,
pCore
->
window
());
pCore
->
window
()
->
connectDocument
(
doc
,
&
m_project
);
emit
docOpened
(
m_project
);
progressDialog
.
progressBar
()
->
setValue
(
3
);
progressDialog
.
repaint
();
...
...
src/project/projectmanager.h
View file @
6fac7eba
...
...
@@ -19,6 +19,7 @@ class Project;
class
AbstractProjectPart
;
class
TrackView
;
class
KdenliveDoc
;
class
NotesPlugin
;
class
KAction
;
class
KUrl
;
class
KAutoSaveFile
;
...
...
@@ -88,6 +89,7 @@ private slots:
void
slotOpenBackup
(
const
KUrl
&
url
=
KUrl
());
signals:
void
docOpened
(
KdenliveDoc
*
document
);
// void projectOpened(Project *project);
private:
...
...
@@ -103,6 +105,7 @@ private:
KAction
*
m_fileRevert
;
KUrl
m_startUrl
;
KRecentFilesAction
*
m_recentFilesAction
;
NotesPlugin
*
m_notesPlugin
;
};
#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