Skip to content
GitLab
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
6d0b7533
Commit
6d0b7533
authored
Nov 25, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix undo broken when trying to delete all tracks (don't allow it and fix the underlying bug)
BUG: 462228
FIXED-IN: 22.12.0
parent
6dd5d2ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/dialogs/trackdialog.cpp
View file @
6d0b7533
...
...
@@ -9,6 +9,7 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include
"kdenlivesettings.h"
#include
<QIcon>
#include
<QPushButton>
#include
<utility>
TrackDialog
::
TrackDialog
(
std
::
shared_ptr
<
TimelineItemModel
>
model
,
int
trackIndex
,
QWidget
*
parent
,
bool
deleteMode
,
int
activeTrackId
)
...
...
@@ -85,6 +86,18 @@ void TrackDialog::buildCombo()
}
if
(
m_deleteMode
)
{
deleteTracks
->
setMinimumWidth
(
deleteTracks
->
sizeHintForColumn
(
0
));
connect
(
deleteTracks
,
&
QListWidget
::
itemChanged
,
this
,
[
=
]()
{
// Ensure we cannot check all tracks
int
count
=
deleteTracks
->
count
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
if
(
deleteTracks
->
item
(
i
)
->
checkState
()
==
Qt
::
Unchecked
)
{
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setEnabled
(
true
);
return
true
;
}
}
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setEnabled
(
false
);
return
true
;
});
}
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
6d0b7533
...
...
@@ -798,6 +798,8 @@ void TimelineController::deleteMultipleTracks(int tid)
}
if
(
result
)
{
pCore
->
pushUndo
(
undo
,
redo
,
allIds
.
count
()
>
1
?
i18n
(
"Delete Tracks"
)
:
i18n
(
"Delete Track"
));
}
else
{
undo
();
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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