fileitemaction: use dropdown for file format (.md default, .org, .txt)
This commit is contained in:
parent
9399fa50fa
commit
a884c40361
|
|
@ -14,6 +14,7 @@
|
|||
#include <QFileInfo>
|
||||
#include <cstdio>
|
||||
#include <QFormLayout>
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QScreen>
|
||||
#include <QVBoxLayout>
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue