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
513534e2
Commit
513534e2
authored
Oct 12, 2020
by
Vivek Yadav
Browse files
resolved edit custom effect description issue
parent
c75ac2a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/effects/effectlist/view/effectlistwidget.cpp
View file @
513534e2
...
...
@@ -110,10 +110,12 @@ void EffectListWidget::reloadEffectMenu(QMenu *effectsMenu, KActionCategory *eff
void
EffectListWidget
::
editCustomAsset
(
const
QModelIndex
&
index
)
{
QDialog
dialog
(
this
);
QDialog
dialog
(
this
);
QFormLayout
form
(
&
dialog
);
QLineEdit
*
effectName
=
new
QLineEdit
(
getName
(
index
),
&
dialog
);
QString
currentName
=
getName
(
index
);
QLineEdit
*
effectName
=
new
QLineEdit
(
currentName
,
&
dialog
);
QTextEdit
*
descriptionBox
=
new
QTextEdit
(
getDescription
(
true
,
index
),
&
dialog
);
QString
currentDescription
=
descriptionBox
->
toPlainText
();
form
.
addRow
(
i18n
(
"Name : "
),
effectName
);
form
.
addRow
(
i18n
(
"Comments : "
),
descriptionBox
);
QDialogButtonBox
buttonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
Qt
::
Horizontal
,
&
dialog
);
...
...
@@ -121,12 +123,15 @@ void EffectListWidget::editCustomAsset(const QModelIndex &index)
QObject
::
connect
(
&
buttonBox
,
SIGNAL
(
accepted
()),
&
dialog
,
SLOT
(
accept
()));
QObject
::
connect
(
&
buttonBox
,
SIGNAL
(
rejected
()),
&
dialog
,
SLOT
(
reject
()));
if
(
dialog
.
exec
()
==
QDialog
::
Accepted
)
{
QString
name
=
effectName
->
text
();
QString
enteredDescription
=
descriptionBox
->
toPlainText
();
if
(
name
.
trimmed
().
isEmpty
()
&&
enteredDescription
.
trimmed
().
isEmpty
())
{
return
;
}
m_model
->
editCustomAsset
(
name
,
enteredDescription
,
m_proxyModel
->
mapToSource
(
index
));
}
QString
name
=
effectName
->
text
();
QString
enteredDescription
=
descriptionBox
->
toPlainText
();
if
(
name
.
trimmed
().
isEmpty
()
&&
enteredDescription
.
trimmed
().
isEmpty
())
{
return
;
}
if
(
enteredDescription
.
trimmed
().
right
(
currentName
.
size
()
+
2
)
==
"("
+
currentName
+
")"
){
//removing previous effect name from the string
enteredDescription
=
enteredDescription
.
left
(
enteredDescription
.
size
()
-
currentName
.
size
()
-
2
);
}
m_model
->
editCustomAsset
(
name
,
enteredDescription
,
m_proxyModel
->
mapToSource
(
index
));
}
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