Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
df397caa
Commit
df397caa
authored
May 07, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Select ALl and Delete shortcuts work in clip marker list.
Related to
#660
parent
c2d7a770
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
9 deletions
+41
-9
src/bin/bin.cpp
src/bin/bin.cpp
+2
-0
src/bin/bin.h
src/bin/bin.h
+4
-0
src/bin/model/markerlistmodel.cpp
src/bin/model/markerlistmodel.cpp
+2
-2
src/bin/model/markerlistmodel.hpp
src/bin/model/markerlistmodel.hpp
+1
-1
src/mainwindow.cpp
src/mainwindow.cpp
+14
-5
src/mltcontroller/clippropertiescontroller.cpp
src/mltcontroller/clippropertiescontroller.cpp
+16
-1
src/mltcontroller/clippropertiescontroller.h
src/mltcontroller/clippropertiescontroller.h
+2
-0
No files found.
src/bin/bin.cpp
View file @
df397caa
...
...
@@ -2359,6 +2359,8 @@ void Bin::showClipProperties(const std::shared_ptr<ProjectClip> &clip, bool forc
}
ClipPropertiesController
*
panel
=
clip
->
buildProperties
(
m_propertiesPanel
);
connect
(
this
,
&
Bin
::
refreshTimeCode
,
panel
,
&
ClipPropertiesController
::
slotRefreshTimeCode
);
connect
(
this
,
&
Bin
::
deleteMarkers
,
panel
,
&
ClipPropertiesController
::
slotDeleteSelectedMarkers
);
connect
(
this
,
&
Bin
::
selectMarkers
,
panel
,
&
ClipPropertiesController
::
slotSelectAllMarkers
);
connect
(
panel
,
&
ClipPropertiesController
::
updateClipProperties
,
this
,
&
Bin
::
slotEditClipCommand
);
connect
(
panel
,
&
ClipPropertiesController
::
seekToFrame
,
m_monitor
,
static_cast
<
void
(
Monitor
::*
)(
int
)
>
(
&
Monitor
::
slotSeek
));
connect
(
panel
,
&
ClipPropertiesController
::
editClip
,
this
,
&
Bin
::
slotEditClip
);
...
...
src/bin/bin.h
View file @
df397caa
...
...
@@ -502,6 +502,10 @@ signals:
void
setupTargets
(
bool
hasVideo
,
QList
<
int
>
audioStreams
);
/** @brief A drag event ended, inform timeline. */
void
processDragEnd
();
/** @brief Delete selected markers in clip properties dialog. */
void
deleteMarkers
();
/** @brief Selected all markers in clip properties dialog. */
void
selectMarkers
();
};
#endif
src/bin/model/markerlistmodel.cpp
View file @
df397caa
...
...
@@ -459,7 +459,7 @@ bool MarkerListModel::removeAllMarkers()
return
true
;
}
bool
MarkerListModel
::
editMarkerGui
(
const
GenTime
&
pos
,
QWidget
*
parent
,
bool
createIfNotFound
,
ClipController
*
clip
)
bool
MarkerListModel
::
editMarkerGui
(
const
GenTime
&
pos
,
QWidget
*
parent
,
bool
createIfNotFound
,
ClipController
*
clip
,
bool
createOnly
)
{
bool
exists
;
auto
marker
=
getMarker
(
pos
,
&
exists
);
...
...
@@ -476,7 +476,7 @@ bool MarkerListModel::editMarkerGui(const GenTime &pos, QWidget *parent, bool cr
if
(
dialog
->
exec
()
==
QDialog
::
Accepted
)
{
marker
=
dialog
->
newMarker
();
if
(
exists
)
{
if
(
exists
&&
!
createOnly
)
{
return
editMarker
(
pos
,
marker
.
time
(),
marker
.
comment
(),
marker
.
markerType
());
}
return
addMarker
(
marker
.
time
(),
marker
.
comment
(),
marker
.
markerType
());
...
...
src/bin/model/markerlistmodel.hpp
View file @
df397caa
...
...
@@ -124,7 +124,7 @@ public:
@param clip: pointer to the clip if we are editing a marker
@return true if dialog was accepted and modification successful
*/
bool
editMarkerGui
(
const
GenTime
&
pos
,
QWidget
*
parent
,
bool
createIfNotFound
,
ClipController
*
clip
=
nullptr
);
bool
editMarkerGui
(
const
GenTime
&
pos
,
QWidget
*
parent
,
bool
createIfNotFound
,
ClipController
*
clip
=
nullptr
,
bool
createOnly
=
false
);
// Mandatory overloads
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
...
...
src/mainwindow.cpp
View file @
df397caa
...
...
@@ -2432,6 +2432,10 @@ void MainWindow::slotDeleteItem()
m_assetPanel
->
deleteCurrentEffect
();
return
;
}
if
(
widget
==
pCore
->
bin
()
->
clipPropertiesDock
())
{
pCore
->
bin
()
->
deleteMarkers
();
return
;
}
widget
=
widget
->
parentWidget
();
}
...
...
@@ -2614,12 +2618,17 @@ void MainWindow::slotSelectTrack()
void
MainWindow
::
slotSelectAllTracks
()
{
if
((
QApplication
::
focusWidget
()
!=
nullptr
)
&&
(
QApplication
::
focusWidget
()
->
parentWidget
()
!=
nullptr
)
&&
QApplication
::
focusWidget
()
->
parentWidget
()
==
pCore
->
bin
())
{
pCore
->
bin
()
->
selectAll
();
}
else
{
getCurrentTimeline
()
->
controller
()
->
selectAll
();
if
(
QApplication
::
focusWidget
()
!=
nullptr
)
{
if
(
QApplication
::
focusWidget
()
->
parentWidget
()
!=
nullptr
&&
QApplication
::
focusWidget
()
->
parentWidget
()
==
pCore
->
bin
())
{
pCore
->
bin
()
->
selectAll
();
return
;
}
if
(
QApplication
::
focusWidget
()
->
objectName
()
==
QLatin1String
(
"markers_list"
))
{
pCore
->
bin
()
->
selectMarkers
();
return
;
}
}
getCurrentTimeline
()
->
controller
()
->
selectAll
();
}
void
MainWindow
::
slotUnselectAllTracks
()
...
...
src/mltcontroller/clippropertiescontroller.cpp
View file @
df397caa
...
...
@@ -206,6 +206,7 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
m_markerTree
->
setHeaderHidden
(
true
);
m_markerTree
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
m_markerTree
->
setModel
(
controller
->
getMarkerModel
().
get
());
m_markerTree
->
setObjectName
(
"markers_list"
);
mBox
->
addWidget
(
m_markerTree
);
auto
*
bar
=
new
QToolBar
;
bar
->
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-new"
)),
i18n
(
"Add marker"
),
this
,
SLOT
(
slotAddMarker
()));
...
...
@@ -1121,7 +1122,7 @@ void ClipPropertiesController::slotAddMarker()
{
auto
markerModel
=
m_controller
->
getMarkerModel
();
GenTime
pos
(
m_controller
->
originalProducer
()
->
position
(),
m_tc
.
fps
());
markerModel
->
editMarkerGui
(
pos
,
this
,
true
,
m_controller
);
markerModel
->
editMarkerGui
(
pos
,
this
,
true
,
m_controller
,
true
);
}
void
ClipPropertiesController
::
slotSaveMarkers
()
...
...
@@ -1376,3 +1377,17 @@ void ClipPropertiesController::slotTextChanged()
emit
updateClipProperties
(
m_id
,
m_originalProperties
,
properties
);
m_originalProperties
=
properties
;
}
void
ClipPropertiesController
::
slotDeleteSelectedMarkers
()
{
if
(
m_tabWidget
->
currentIndex
()
==
2
)
{
slotDeleteMarker
();
}
}
void
ClipPropertiesController
::
slotSelectAllMarkers
()
{
if
(
m_tabWidget
->
currentIndex
()
==
2
)
{
m_markerTree
->
selectAll
();
}
}
src/mltcontroller/clippropertiescontroller.h
View file @
df397caa
...
...
@@ -67,6 +67,8 @@ public slots:
void
slotRefreshTimeCode
();
void
slotFillMeta
(
QTreeWidget
*
tree
);
void
slotFillAnalysisData
();
void
slotDeleteSelectedMarkers
();
void
slotSelectAllMarkers
();
private
slots
:
void
slotColorModified
(
const
QColor
&
newcolor
);
...
...
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