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 <QFileInfo>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
#include <QComboBox>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
@ -191,8 +192,11 @@ void DenoteFileItemAction::createDenoteFile(const QString &dirPath, QWidget *par
|
||||||
sigEdit->setPlaceholderText(QStringLiteral("(optional)"));
|
sigEdit->setPlaceholderText(QStringLiteral("(optional)"));
|
||||||
form->addRow(QStringLiteral("Signature:"), sigEdit);
|
form->addRow(QStringLiteral("Signature:"), sigEdit);
|
||||||
|
|
||||||
auto *extEdit = new QLineEdit(QStringLiteral(".org"));
|
auto *extCombo = new QComboBox();
|
||||||
form->addRow(QStringLiteral("Extension:"), extEdit);
|
extCombo->addItem(QStringLiteral(".md"));
|
||||||
|
extCombo->addItem(QStringLiteral(".org"));
|
||||||
|
extCombo->addItem(QStringLiteral(".txt"));
|
||||||
|
form->addRow(QStringLiteral("Format:"), extCombo);
|
||||||
|
|
||||||
layout->addLayout(form);
|
layout->addLayout(form);
|
||||||
|
|
||||||
|
|
@ -217,9 +221,7 @@ void DenoteFileItemAction::createDenoteFile(const QString &dirPath, QWidget *par
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString signature = sigEdit->text().trimmed();
|
const QString signature = sigEdit->text().trimmed();
|
||||||
QString ext = extEdit->text().trimmed();
|
const QString ext = extCombo->currentText();
|
||||||
if (!ext.startsWith(QLatin1Char('.')))
|
|
||||||
ext.prepend(QLatin1Char('.'));
|
|
||||||
|
|
||||||
// Build filename and full path
|
// Build filename and full path
|
||||||
const QString filename = Denote::buildFilename(title, tags, signature, ext);
|
const QString filename = Denote::buildFilename(title, tags, signature, ext);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue