Remember last selected title template

CCBUG: 384340
parent 67b05157
......@@ -55,9 +55,13 @@ TitleTemplateDialog::TitleTemplateDialog(const QString &folder, QWidget *parent)
}
}
if (!templateFiles.isEmpty()) {
if (m_view.template_list->comboBox()->count() > 0) {
m_view.buttonBox->button(QDialogButtonBox::Ok)->setFocus();
}
int current = m_view.template_list->comboBox()->findText(KdenliveSettings::selected_template());
if (current > -1) {
m_view.template_list->comboBox()->setCurrentIndex(current);
}
const QStringList mimeTypeFilters = { QStringLiteral("application/x-kdenlivetitle") };
m_view.template_list->setFilter(mimeTypeFilters.join(' '));
connect(m_view.template_list->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreview()));
......@@ -86,4 +90,5 @@ void TitleTemplateDialog::updatePreview()
}
QPixmap pix = KThumb::getImage(QUrl::fromLocalFile(textTemplate), m_view.preview->width());
m_view.preview->setPixmap(pix);
KdenliveSettings::setSelected_template(m_view.template_list->comboBox()->currentText());
}
......@@ -951,4 +951,10 @@
<default>false</default>
</entry>
</group>
<group name="titles">
<entry name="selected_template" type="String">
<label>Name of last selected title template</label>
<default></default>
</entry>
</group>
</kcfg>
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