diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-29 11:46:12 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-29 17:54:17 +0100 |
commit | 06fa42837d8764e10627e7b97c04d0853e9976e3 (patch) | |
tree | ea5870fe3d2bd1d2db65f9e140ff5455da159789 /writerperfect/source/writer/EPUBExportDialog.cxx | |
parent | 612821223c574fe0956d348730d40623943821f3 (diff) |
EPUB export: add UI to set a custom cover image
Sets the EPUBCoverImage filter data key at UNO level.
Change-Id: I46eb3c0df1e6c34af0be070c32f9f37666dc718e
Reviewed-on: https://gerrit.libreoffice.org/45485
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/source/writer/EPUBExportDialog.cxx')
-rw-r--r-- | writerperfect/source/writer/EPUBExportDialog.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx b/writerperfect/source/writer/EPUBExportDialog.cxx index 23faa939db31..5c0eb9d1e930 100644 --- a/writerperfect/source/writer/EPUBExportDialog.cxx +++ b/writerperfect/source/writer/EPUBExportDialog.cxx @@ -9,6 +9,8 @@ #include "EPUBExportDialog.hxx" +#include <sfx2/opengrf.hxx> + #include "EPUBExportFilter.hxx" using namespace com::sun::star; @@ -90,6 +92,14 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsH else m_pSplit->SelectEntryPos(EPUBExportFilter::GetDefaultSplitMethod()); m_pSplit->SetSelectHdl(LINK(this, EPUBExportDialog, SplitSelectHdl)); + + get(m_pCoverPath, "coverpath"); + + get(m_pCoverButton, "coverbutton"); + m_pCoverButton->SetClickHdl(LINK(this, EPUBExportDialog, CoverClickHdl)); + + get(m_pOKButton, "ok"); + m_pOKButton->SetClickHdl(LINK(this, EPUBExportDialog, OKClickHdl)); } IMPL_LINK_NOARG(EPUBExportDialog, VersionSelectHdl, ListBox &, void) @@ -104,6 +114,22 @@ IMPL_LINK_NOARG(EPUBExportDialog, SplitSelectHdl, ListBox &, void) mrFilterData["EPUBSplitMethod"] <<= m_pSplit->GetSelectedEntryPos(); } +IMPL_LINK_NOARG(EPUBExportDialog, CoverClickHdl, Button *, void) +{ + SvxOpenGraphicDialog aDlg("Import", this); + aDlg.EnableLink(false); + if (aDlg.Execute() == ERRCODE_NONE) + m_pCoverPath->SetText(aDlg.GetPath()); +} + +IMPL_LINK_NOARG(EPUBExportDialog, OKClickHdl, Button *, void) +{ + if (!m_pCoverPath->GetText().isEmpty()) + mrFilterData["EPUBCoverImage"] <<= m_pCoverPath->GetText(); + + EndDialog(RET_OK); +} + EPUBExportDialog::~EPUBExportDialog() { disposeOnce(); @@ -113,6 +139,9 @@ void EPUBExportDialog::dispose() { m_pVersion.clear(); m_pSplit.clear(); + m_pCoverPath.clear(); + m_pCoverButton.clear(); + m_pOKButton.clear(); ModalDialog::dispose(); } |