Commit c396a58e authored by Vivek Yadav's avatar Vivek Yadav

Update effectlistwidget.cpp

parent 95585239
......@@ -111,24 +111,24 @@ void EffectListWidget::reloadEffectMenu(QMenu *effectsMenu, KActionCategory *eff
void EffectListWidget::editCustomAsset(const QModelIndex &index)
{
QDialog dialog(this);
QFormLayout form(&dialog);
QLineEdit *effectName = new QLineEdit(&dialog);
QTextEdit *descriptionBox = new QTextEdit(&dialog);
QString label_Name = QString("Name : ");
form.addRow(label_Name, effectName);
QString label = QString("Comments : ");
form.addRow(label, descriptionBox);
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
form.addRow(&buttonBox);
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));
}
QFormLayout form(&dialog);
QLineEdit *effectName = new QLineEdit(getName(index), &dialog);
QTextEdit *descriptionBox = new QTextEdit(getDescription(index), &dialog);
QString label_Name = QString("Name : ");
form.addRow(label_Name, effectName);
QString label = QString("Comments : ");
form.addRow(label, descriptionBox);
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
form.addRow(&buttonBox);
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));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment