From bb8040595c9b6f0ccde39e6833f27a50abb891d8 Mon Sep 17 00:00:00 2001 From: Akshay Deep Date: Mon, 30 May 2016 01:57:00 +0530 Subject: 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 Tested-by: Samuel Mehrbrodt --- sfx2/source/doc/templatedlg.cxx | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'sfx2') 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(pItem); + msTemplatePath = pViewItem->getPath(); + + EndDialog(RET_OK); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit