diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-30 08:50:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-30 15:36:26 +0100 |
commit | ee74bd73856c355f1491e9ff7c3bbbf74a7858bb (patch) | |
tree | 82909c55844f23fd812c5a8477a2c0b78d88e65a /writerperfect/source | |
parent | 98770243f7f5387aae06e83ed4de0d68e02abb02 (diff) |
EPUB export: add UI to set custom metadata
The motivation here is that when it comes to date or author, the typical
metata for the Writer document won't match the metadata of the book the
file represents, so allowing a custom override as part of EPUB export
makes sense.
Change-Id: I19aaed83ae0e69bc0dfa3084e1c9dc9cc534328f
Reviewed-on: https://gerrit.libreoffice.org/45553
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/source')
-rw-r--r-- | writerperfect/source/writer/EPUBExportDialog.cxx | 24 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBExportDialog.hxx | 5 |
2 files changed, 29 insertions, 0 deletions
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx b/writerperfect/source/writer/EPUBExportDialog.cxx index da42954a5d02..c0e316e1f32a 100644 --- a/writerperfect/source/writer/EPUBExportDialog.cxx +++ b/writerperfect/source/writer/EPUBExportDialog.cxx @@ -98,6 +98,12 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsH get(m_pCoverButton, "coverbutton"); m_pCoverButton->SetClickHdl(LINK(this, EPUBExportDialog, CoverClickHdl)); + get(m_pIdentifier, "identifier"); + get(m_pTitle, "title"); + get(m_pInitialCreator, "author"); + get(m_pLanguage, "language"); + get(m_pDate, "date"); + get(m_pOKButton, "ok"); m_pOKButton->SetClickHdl(LINK(this, EPUBExportDialog, OKClickHdl)); } @@ -124,9 +130,22 @@ IMPL_LINK_NOARG(EPUBExportDialog, CoverClickHdl, Button *, void) IMPL_LINK_NOARG(EPUBExportDialog, OKClickHdl, Button *, void) { + // General if (!m_pCoverPath->GetText().isEmpty()) mrFilterData["RVNGCoverImage"] <<= m_pCoverPath->GetText(); + // Metadata + if (!m_pIdentifier->GetText().isEmpty()) + mrFilterData["RVNGIdentifier"] <<= m_pIdentifier->GetText(); + if (!m_pTitle->GetText().isEmpty()) + mrFilterData["RVNGTitle"] <<= m_pTitle->GetText(); + if (!m_pInitialCreator->GetText().isEmpty()) + mrFilterData["RVNGInitialCreator"] <<= m_pInitialCreator->GetText(); + if (!m_pLanguage->GetText().isEmpty()) + mrFilterData["RVNGLanguage"] <<= m_pLanguage->GetText(); + if (!m_pDate->GetText().isEmpty()) + mrFilterData["RVNGDate"] <<= m_pDate->GetText(); + EndDialog(RET_OK); } @@ -142,6 +161,11 @@ void EPUBExportDialog::dispose() m_pCoverPath.clear(); m_pCoverButton.clear(); m_pOKButton.clear(); + m_pIdentifier.clear(); + m_pTitle.clear(); + m_pInitialCreator.clear(); + m_pLanguage.clear(); + m_pDate.clear(); ModalDialog::dispose(); } diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx b/writerperfect/source/writer/EPUBExportDialog.hxx index e211ca3340c7..4ff67ee6f5e5 100644 --- a/writerperfect/source/writer/EPUBExportDialog.hxx +++ b/writerperfect/source/writer/EPUBExportDialog.hxx @@ -39,6 +39,11 @@ private: VclPtr<Edit> m_pCoverPath; VclPtr<PushButton> m_pCoverButton; VclPtr<PushButton> m_pOKButton; + VclPtr<Edit> m_pIdentifier; + VclPtr<Edit> m_pTitle; + VclPtr<Edit> m_pInitialCreator; + VclPtr<Edit> m_pLanguage; + VclPtr<Edit> m_pDate; }; } // namespace writerperfect |