Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
a97fa5d8
Commit
a97fa5d8
authored
Jun 20, 2018
by
Jean-Baptiste Mardelle
Browse files
Allow adding project note from timeline ruler context menu
parent
e1161834
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/mainwindow.cpp
View file @
a97fa5d8
...
...
@@ -1571,6 +1571,8 @@ void MainWindow::setupActions()
addAction
(
QStringLiteral
(
"switch_track_target"
),
i18n
(
"Toggle Track Target"
),
pCore
->
projectManager
(),
SLOT
(
slotSwitchTrackTarget
()),
QIcon
(),
Qt
::
SHIFT
+
Qt
::
Key_T
);
addAction
(
QStringLiteral
(
"add_project_note"
),
i18n
(
"Add Project Note"
),
pCore
->
projectManager
(),
SLOT
(
slotAddProjectNote
()),
KoIconUtils
::
themedIcon
(
QStringLiteral
(
"bookmark"
)));
QHash
<
QString
,
QAction
*>
actions
;
actions
.
insert
(
QStringLiteral
(
"locate"
),
locateClip
);
actions
.
insert
(
QStringLiteral
(
"reload"
),
reloadClip
);
...
...
src/project/dialogs/noteswidget.cpp
View file @
a97fa5d8
...
...
@@ -67,3 +67,12 @@ void NotesWidget::mousePressEvent(QMouseEvent *e)
emit
seekProject
(
anchor
.
toInt
());
e
->
setAccepted
(
true
);
}
void
NotesWidget
::
addProjectNote
()
{
if
(
!
textCursor
().
atBlockStart
())
{
textCursor
().
movePosition
(
QTextCursor
::
EndOfBlock
);
insertPlainText
(
QStringLiteral
(
"
\n
"
));
}
emit
insertNotesTimecode
();
}
src/project/dialogs/noteswidget.h
View file @
a97fa5d8
...
...
@@ -34,7 +34,8 @@ class NotesWidget : public QTextEdit
public:
explicit
NotesWidget
(
QWidget
*
parent
=
nullptr
);
~
NotesWidget
();
/** @brief insert current timeline timecode and focus widget to allow entering quick note */
void
addProjectNote
();
protected:
void
mouseMoveEvent
(
QMouseEvent
*
e
)
override
;
void
mousePressEvent
(
QMouseEvent
*
e
)
override
;
...
...
src/project/projectmanager.cpp
View file @
a97fa5d8
...
...
@@ -699,6 +699,13 @@ QString ProjectManager::documentNotes() const
return
m_notesPlugin
->
widget
()
->
toHtml
();
}
void
ProjectManager
::
slotAddProjectNote
()
{
m_notesPlugin
->
widget
()
->
raise
();
m_notesPlugin
->
widget
()
->
setFocus
();
m_notesPlugin
->
widget
()
->
addProjectNote
();
}
void
ProjectManager
::
prepareSave
()
{
pCore
->
projectItemModel
()
->
saveDocumentProperties
(
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
documentProperties
(),
m_project
->
metadata
(),
...
...
src/project/projectmanager.h
View file @
a97fa5d8
...
...
@@ -141,6 +141,8 @@ public slots:
void
adjustProjectDuration
();
/** @brief Add an asset in timeline (effect, transition). */
void
activateAsset
(
const
QVariantMap
effectData
);
/** @brief insert current timeline timecode in notes widget and focus widget to allow entering quick note */
void
slotAddProjectNote
();
private
slots
:
void
slotRevert
();
...
...
src/timeline2/view/qml/timeline.qml
View file @
a97fa5d8
...
...
@@ -400,6 +400,13 @@ Rectangle {
timeline
.
editGuide
(
timeline
.
position
);
}
}
OLD.MenuItem
{
id
:
addProjectNote
text
:
i18n
(
'
Add Project Note
'
)
onTriggered
:
{
timeline
.
triggerAction
(
'
add_project_note
'
)
}
}
onAboutToShow
:
{
if
(
guidesModel
.
hasMarker
(
timeline
.
position
))
{
// marker at timeline position
...
...
Write
Preview
Supports
Markdown
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