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
f23c89af
Commit
f23c89af
authored
Jan 21, 2022
by
Jean-Baptiste Mardelle
Browse files
Show number of Bin clips / selected clip in status bar, fix rename / focus clip in icon view
parent
faede6fb
Pipeline
#126899
passed with stage
in 5 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
f23c89af
...
...
@@ -648,12 +648,12 @@ void MyListView::mouseMoveEvent(QMouseEvent *event)
}
m_lastHoveredItem
=
index
;
}
pCore
->
w
in
dow
()
->
show
KeyBinding
(
i18n
(
"<b>Shift+seek</b> over thumbnail to set default thumbnail, <b>F2</b> to rename selected item"
));
pCore
->
b
in
()
->
update
KeyBinding
(
i18n
(
"<b>Shift+seek</b> over thumbnail to set default thumbnail, <b>F2</b> to rename selected item"
));
}
else
{
pCore
->
w
in
dow
()
->
show
KeyBinding
(
i18n
(
"<b>F2</b> to rename selected item"
));
pCore
->
b
in
()
->
update
KeyBinding
(
i18n
(
"<b>F2</b> to rename selected item"
));
}
}
else
{
pCore
->
w
in
dow
()
->
show
KeyBinding
();
pCore
->
b
in
()
->
update
KeyBinding
();
if
(
m_lastHoveredItem
.
isValid
())
{
emit
displayBinFrame
(
m_lastHoveredItem
,
-
1
);
m_lastHoveredItem
=
QModelIndex
();
...
...
@@ -733,16 +733,16 @@ void MyTreeView::mouseMoveEvent(QMouseEvent *event)
m_lastHoveredItem
=
QModelIndex
();
}
}
pCore
->
w
in
dow
()
->
show
KeyBinding
(
i18n
(
"<b>Shift+seek</b> over thumbnail to set default thumbnail, <b>F2</b> to rename selected item"
));
pCore
->
b
in
()
->
update
KeyBinding
(
i18n
(
"<b>Shift+seek</b> over thumbnail to set default thumbnail, <b>F2</b> to rename selected item"
));
}
else
{
pCore
->
w
in
dow
()
->
show
KeyBinding
(
i18n
(
"<b>F2</b> to rename selected item"
));
pCore
->
b
in
()
->
update
KeyBinding
(
i18n
(
"<b>F2</b> to rename selected item"
));
}
}
else
{
if
(
m_lastHoveredItem
.
isValid
())
{
emit
displayBinFrame
(
m_lastHoveredItem
,
-
1
);
m_lastHoveredItem
=
QModelIndex
();
}
pCore
->
w
in
dow
()
->
show
KeyBinding
();
pCore
->
b
in
()
->
update
KeyBinding
();
}
}
if
(
!
dragged
)
{
...
...
@@ -1386,6 +1386,8 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent, bool isMainBi
m_infoMessage
->
hide
();
connect
(
this
,
&
Bin
::
requesteInvalidRemoval
,
this
,
&
Bin
::
slotQueryRemoval
);
connect
(
pCore
.
get
(),
&
Core
::
updatePalette
,
this
,
&
Bin
::
slotUpdatePalette
);
connect
(
m_itemModel
.
get
(),
&
QAbstractItemModel
::
rowsInserted
,
this
,
&
Bin
::
updateClipsCount
);
connect
(
m_itemModel
.
get
(),
&
QAbstractItemModel
::
rowsRemoved
,
this
,
&
Bin
::
updateClipsCount
);
connect
(
this
,
SIGNAL
(
displayBinMessage
(
QString
,
KMessageWidget
::
MessageType
)),
this
,
SLOT
(
doDisplayMessage
(
QString
,
KMessageWidget
::
MessageType
)));
wheelAccumulatedDelta
=
0
;
}
...
...
@@ -2080,9 +2082,9 @@ void Bin::slotAddFolder()
void
Bin
::
ensureCurrent
()
{
const
QModelIndexList
indexes
=
m_proxyModel
->
selectionModel
()
->
select
edRow
s
(
0
);
const
QModelIndexList
indexes
=
m_proxyModel
->
selectionModel
()
->
select
ion
().
indexe
s
();
for
(
const
QModelIndex
&
ix
:
indexes
)
{
if
(
!
ix
.
isValid
())
{
if
(
!
ix
.
isValid
()
||
ix
.
column
()
!=
0
)
{
continue
;
}
m_itemView
->
setCurrentIndex
(
ix
);
...
...
@@ -2233,6 +2235,7 @@ void Bin::selectProxyModel(const QModelIndex &id)
// Display black bg in clip monitor
emit
openClip
(
std
::
shared_ptr
<
ProjectClip
>
());
}
updateClipsCount
();
}
std
::
vector
<
QString
>
Bin
::
selectedClipsIds
(
bool
allowSubClips
)
...
...
@@ -4232,9 +4235,9 @@ void Bin::slotRenameItem()
}
return
;
}
const
QModelIndexList
indexes
=
m_proxyModel
->
selectionModel
()
->
select
edRow
s
(
0
);
const
QModelIndexList
indexes
=
m_proxyModel
->
selectionModel
()
->
select
ion
().
indexe
s
();
for
(
const
QModelIndex
&
ix
:
indexes
)
{
if
(
!
ix
.
isValid
())
{
if
(
!
ix
.
isValid
()
||
ix
.
column
()
!=
0
)
{
continue
;
}
m_itemView
->
setCurrentIndex
(
ix
);
...
...
@@ -4913,3 +4916,39 @@ bool Bin::addProjectClipInFolder(const QString &path, const QString &parentFolde
}
return
ok
;
}
void
Bin
::
updateClipsCount
()
{
int
count
=
m_itemModel
->
clipsCount
();
if
(
count
<
2
)
{
m_clipsCountMessage
=
QString
();
}
else
{
int
selected
=
0
;
const
QModelIndexList
indexes
=
m_proxyModel
->
selectionModel
()
->
selection
().
indexes
();
for
(
const
QModelIndex
&
ix
:
indexes
)
{
if
(
ix
.
isValid
()
&&
ix
.
column
()
==
0
)
{
std
::
shared_ptr
<
AbstractProjectItem
>
item
=
m_itemModel
->
getBinItemByIndex
(
m_proxyModel
->
mapToSource
(
ix
));
if
(
item
->
itemType
()
==
AbstractProjectItem
::
ClipItem
)
{
selected
++
;
}
}
}
if
(
selected
==
0
)
{
m_clipsCountMessage
=
i18n
(
"<b>%1</b> clips | "
,
count
);
}
else
{
m_clipsCountMessage
=
i18n
(
"<b>%1</b> clips (%2 selected) | "
,
count
,
selected
);
}
}
showBinInfo
();
}
void
Bin
::
updateKeyBinding
(
const
QString
&
bindingMessage
)
{
m_keyBindingMessage
=
bindingMessage
;
showBinInfo
();
}
void
Bin
::
showBinInfo
()
{
pCore
->
window
()
->
showKeyBinding
(
QString
(
"%1%2"
).
arg
(
m_clipsCountMessage
,
m_keyBindingMessage
));
}
src/bin/bin.h
View file @
f23c89af
...
...
@@ -341,6 +341,8 @@ public:
static
void
checkProfile
(
const
std
::
shared_ptr
<
Mlt
::
Producer
>
&
producer
);
/** @brief Should we process a profile check for added clips */
std
::
atomic
<
bool
>
shouldCheckProfile
;
/** @brief Set the message for key binding info. */
void
updateKeyBinding
(
const
QString
&
bindingMessage
=
QString
());
private
slots
:
void
slotAddClip
();
...
...
@@ -401,6 +403,8 @@ private slots:
*/
void
editTags
(
const
QList
<
QString
>
&
allClips
,
const
QString
&
tag
,
bool
add
);
void
slotUpdatePalette
();
/** @brief Update the string description of the clips count, like: 123 clips (3 selected). */
void
updateClipsCount
();
public
slots
:
void
slotRemoveInvalidClip
(
const
QString
&
id
,
bool
replace
,
const
QString
&
errorMessage
);
...
...
@@ -558,6 +562,10 @@ private:
void
processAudioThumbs
();
void
updateSortingAction
(
int
ix
);
int
wheelAccumulatedDelta
;
QString
m_keyBindingMessage
;
QString
m_clipsCountMessage
;
/** @brief Show the clip count and key binfing info in status bar. */
void
showBinInfo
();
signals:
void
itemUpdated
(
std
::
shared_ptr
<
AbstractProjectItem
>
);
...
...
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