From a884c4036191e3d469aaeb64333e9a4dac5acc49 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 12 Jul 2026 20:48:14 +0200 Subject: [PATCH] fileitemaction: use dropdown for file format (.md default, .org, .txt) --- fileitemaction/denote_fileitemaction.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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);