diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-05-30 01:57:00 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-06-01 14:03:40 +0000 |
commit | bb8040595c9b6f0ccde39e6833f27a50abb891d8 (patch) | |
tree | 648623177d6ef56e12305239cabbee3cf19dedae /sfx2 | |
parent | 6a8407d82d71083c8bdec6a106ba9092a5196cbe (diff) |
Impress: Replace Presentation Wizard with Template Manager
Drop the Presentation wizard and show the Template Manager instead
when starting Impress.
1. Opens a blank template with Template Manager.
2. If user selects a template, load it over the blank template.
3. SfxTemplateSelectionDlg for impress integration.
Change-Id: Ia9c3cafc973e3741c6ea9f838018a35956f37f4a
Reviewed-on: https://gerrit.libreoffice.org/25642
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index c0b478c5ffdb..907e4c8e56a4 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -1645,5 +1645,47 @@ void SfxTemplateCategoryDialog::HideNewCategoryOption() mpNewCategoryEdit->Hide(); } +// SfxTemplateSelectionDialog ----------------------------------------------------------------- + +SfxTemplateSelectionDlg::SfxTemplateSelectionDlg(vcl::Window* pParent): + SfxTemplateManagerDlg(pParent), + msTemplatePath(OUString()) +{ + mpCBApp->SelectEntryPos(MNI_IMPRESS); + mpCBApp->Disable(); + mpCBFolder->SelectEntryPos(0); + + if(mpLocalView->IsVisible()) + { + mpLocalView->filterItems(ViewFilter_Application(getCurrentApplicationFilter())); + mpLocalView->showAllTemplates(); + } + + mpLocalView->setOpenTemplateHdl(LINK(this,SfxTemplateSelectionDlg, OpenTemplateHdl)); + mpSearchView->setOpenTemplateHdl(LINK(this,SfxTemplateSelectionDlg, OpenTemplateHdl)); +} + +SfxTemplateSelectionDlg::~SfxTemplateSelectionDlg() +{ + disposeOnce(); +} + +void SfxTemplateSelectionDlg::dispose() +{ + SfxTemplateManagerDlg::dispose(); +} + +short SfxTemplateSelectionDlg::Execute() +{ + return ModalDialog::Execute(); +} + +IMPL_LINK_TYPED(SfxTemplateSelectionDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem, void) +{ + TemplateViewItem *pViewItem = static_cast<TemplateViewItem*>(pItem); + msTemplatePath = pViewItem->getPath(); + + EndDialog(RET_OK); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |