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
252
Issues
252
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
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
dad10878
Commit
dad10878
authored
Jun 17, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow undo/redo while dragging a clip in timeline.
Related to
#264
parent
f991f153
Pipeline
#4396
passed with stage
in 13 minutes and 54 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
src/mainwindow.cpp
src/mainwindow.cpp
+12
-0
src/mainwindow.h
src/mainwindow.h
+2
-0
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+7
-1
src/timeline2/view/timelinewidget.cpp
src/timeline2/view/timelinewidget.cpp
+1
-0
No files found.
src/mainwindow.cpp
View file @
dad10878
...
...
@@ -1408,10 +1408,22 @@ void MainWindow::setupActions()
QAction
*
undo
=
KStandardAction
::
undo
(
m_commandStack
,
SLOT
(
undo
()),
actionCollection
());
undo
->
setEnabled
(
false
);
connect
(
m_commandStack
,
&
QUndoGroup
::
canUndoChanged
,
undo
,
&
QAction
::
setEnabled
);
connect
(
this
,
&
MainWindow
::
enableUndo
,
[
this
,
undo
]
(
bool
enable
)
{
if
(
enable
)
{
enable
=
m_commandStack
->
activeStack
()
->
canUndo
();
}
undo
->
setEnabled
(
enable
);
});
QAction
*
redo
=
KStandardAction
::
redo
(
m_commandStack
,
SLOT
(
redo
()),
actionCollection
());
redo
->
setEnabled
(
false
);
connect
(
m_commandStack
,
&
QUndoGroup
::
canRedoChanged
,
redo
,
&
QAction
::
setEnabled
);
connect
(
this
,
&
MainWindow
::
enableUndo
,
[
this
,
redo
]
(
bool
enable
)
{
if
(
enable
)
{
enable
=
m_commandStack
->
activeStack
()
->
canRedo
();
}
redo
->
setEnabled
(
enable
);
});
auto
*
addClips
=
new
QMenu
(
this
);
...
...
src/mainwindow.h
View file @
dad10878
...
...
@@ -484,6 +484,8 @@ signals:
/** @brief Clear asset view if itemId is displayed. */
void
clearAssetPanel
(
int
itemId
=
-
1
);
void
adjustAssetPanelRange
(
int
itemId
,
int
in
,
int
out
);
/** @brief Enable or disable the undo stack. For example undo/redo should not be enabled when dragging a clip in timeline or we risk corruption. */
void
enableUndo
(
bool
enable
);
};
#endif
src/timeline2/view/qml/timeline.qml
View file @
dad10878
...
...
@@ -16,11 +16,13 @@ Rectangle {
color
:
activePalette
.
window
property
bool
validMenu
:
false
property
color
textColor
:
activePalette
.
text
property
bool
dragInProgress
:
dragProxyArea
.
pressed
||
dragProxyArea
.
drag
.
active
signal
clipClicked
()
signal
mousePosChanged
(
int
position
)
signal
zoomIn
(
bool
onMouse
)
signal
zoomOut
(
bool
onMouse
)
signal
processingDrag
(
bool
dragging
)
FontMetrics
{
id
:
fontMetrics
...
...
@@ -33,6 +35,10 @@ Rectangle {
id
:
compositionMenu
}
onDragInProgressChanged
:
{
processingDrag
(
!
root
.
dragInProgress
)
}
function
fitZoom
()
{
return
scrollView
.
width
/
(
timeline
.
duration
*
1.1
)
}
...
...
@@ -164,7 +170,7 @@ Rectangle {
}
function
isDragging
()
{
return
drag
Proxy
.
draggedItem
>
-
1
&&
dragProxyArea
.
pressed
return
drag
InProgress
}
function
initDrag
(
itemObject
,
itemCoord
,
itemId
,
itemPos
,
itemTrack
,
isComposition
)
{
...
...
src/timeline2/view/timelinewidget.cpp
View file @
dad10878
...
...
@@ -136,6 +136,7 @@ void TimelineWidget::setModel(const std::shared_ptr<TimelineItemModel> &model)
connect
(
rootObject
(),
SIGNAL
(
mousePosChanged
(
int
)),
pCore
->
window
(),
SLOT
(
slotUpdateMousePosition
(
int
)));
connect
(
rootObject
(),
SIGNAL
(
zoomIn
(
bool
)),
pCore
->
window
(),
SLOT
(
slotZoomIn
(
bool
)));
connect
(
rootObject
(),
SIGNAL
(
zoomOut
(
bool
)),
pCore
->
window
(),
SLOT
(
slotZoomOut
(
bool
)));
connect
(
rootObject
(),
SIGNAL
(
processingDrag
(
bool
)),
pCore
->
window
(),
SIGNAL
(
enableUndo
(
bool
)));
m_proxy
->
setRoot
(
rootObject
());
setVisible
(
true
);
loading
=
false
;
...
...
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