diff --git a/fileitemaction/denote_fileitemaction.cpp b/fileitemaction/denote_fileitemaction.cpp index d0a128f..bb6e34e 100644 --- a/fileitemaction/denote_fileitemaction.cpp +++ b/fileitemaction/denote_fileitemaction.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -191,8 +192,11 @@ void DenoteFileItemAction::createDenoteFile(const QString &dirPath, QWidget *par sigEdit->setPlaceholderText(QStringLiteral("(optional)")); form->addRow(QStringLiteral("Signature:"), sigEdit); - auto *extEdit = new QLineEdit(QStringLiteral(".org")); - form->addRow(QStringLiteral("Extension:"), extEdit); + auto *extCombo = new QComboBox(); + extCombo->addItem(QStringLiteral(".md")); + extCombo->addItem(QStringLiteral(".org")); + extCombo->addItem(QStringLiteral(".txt")); + form->addRow(QStringLiteral("Format:"), extCombo); layout->addLayout(form); @@ -217,9 +221,7 @@ void DenoteFileItemAction::createDenoteFile(const QString &dirPath, QWidget *par } const QString signature = sigEdit->text().trimmed(); - QString ext = extEdit->text().trimmed(); - if (!ext.startsWith(QLatin1Char('.'))) - ext.prepend(QLatin1Char('.')); + const QString ext = extCombo->currentText(); // Build filename and full path const QString filename = Denote::buildFilename(title, tags, signature, ext);