Open a template when double clicking in its thumbnail.
Change-Id: I08884e5f113353261aebcd92b6ecf02146b377c1
This commit is contained in:
parent
bfb8b04829
commit
c6aab78b31
6 changed files with 39 additions and 0 deletions
|
@ -41,6 +41,8 @@ public:
|
|||
|
||||
void showOverlay (bool bVisible);
|
||||
|
||||
void setOverlayDblClickHdl (const Link &rLink);
|
||||
|
||||
void filterTemplatesByApp (const FILTER_APPLICATION &eApp);
|
||||
|
||||
void sortOverlayItems (const boost::function<bool (const ThumbnailViewItem*,
|
||||
|
|
|
@ -34,16 +34,21 @@ public:
|
|||
|
||||
void InsertItems (const std::vector<TemplateViewItem*> &rTemplates);
|
||||
|
||||
void setDblClickHdl (const Link &rLink) { maDblClickHdl = rLink; }
|
||||
|
||||
protected:
|
||||
|
||||
virtual void MouseButtonDown (const MouseEvent &rMEvt);
|
||||
|
||||
virtual void OnItemDblClicked (ThumbnailViewItem *pItem);
|
||||
|
||||
private:
|
||||
|
||||
Image maCloseImg;
|
||||
sal_uInt16 mnRegionId;
|
||||
rtl::OUString maFolderName;
|
||||
SfxDocumentTemplates *mpDocTemplates;
|
||||
Link maDblClickHdl;
|
||||
};
|
||||
|
||||
#endif // TEMPLATEVIEW_HXX
|
||||
|
|
|
@ -57,6 +57,8 @@ private:
|
|||
|
||||
DECL_LINK(MenuSelectHdl, Menu*);
|
||||
|
||||
DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*);
|
||||
|
||||
void OnTemplateImport ();
|
||||
void OnTemplateSearch ();
|
||||
void OnTemplateEdit ();
|
||||
|
|
|
@ -361,6 +361,11 @@ void TemplateFolderView::showOverlay (bool bVisible)
|
|||
}
|
||||
}
|
||||
|
||||
void TemplateFolderView::setOverlayDblClickHdl(const Link &rLink)
|
||||
{
|
||||
mpItemView->setDblClickHdl(rLink);
|
||||
}
|
||||
|
||||
void TemplateFolderView::filterTemplatesByApp (const FILTER_APPLICATION &eApp)
|
||||
{
|
||||
meFilterOption = eApp;
|
||||
|
|
|
@ -152,6 +152,11 @@ void TemplateView::MouseButtonDown (const MouseEvent &rMEvt)
|
|||
ThumbnailView::MouseButtonDown(rMEvt);
|
||||
}
|
||||
|
||||
void TemplateView::OnItemDblClicked(ThumbnailViewItem *pItem)
|
||||
{
|
||||
maDblClickHdl.Call(pItem);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
|
||||
|
|
|
@ -158,6 +158,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
|
|||
|
||||
maView->setItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVFolderStateHdl));
|
||||
maView->setTemplateStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl));
|
||||
maView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
|
||||
|
||||
aButtonAll.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewAllHdl));
|
||||
aButtonDocs.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewDocsHdl));
|
||||
|
@ -391,6 +392,25 @@ IMPL_LINK(SfxTemplateManagerDlg, MenuSelectHdl, Menu*, pMenu)
|
|||
return 0;
|
||||
}
|
||||
|
||||
IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem)
|
||||
{
|
||||
uno::Sequence< PropertyValue > aArgs(1);
|
||||
aArgs[0].Name = "AsTemplate";
|
||||
aArgs[0].Value <<= sal_True;
|
||||
|
||||
TemplateViewItem *pTemplateItem = static_cast<TemplateViewItem*>(pItem);
|
||||
|
||||
try
|
||||
{
|
||||
mxDesktop->loadComponentFromURL(pTemplateItem->getPath(),rtl::OUString("_blank"), 0, aArgs );
|
||||
}
|
||||
catch( const uno::Exception& )
|
||||
{
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SfxTemplateManagerDlg::OnTemplateImport ()
|
||||
{
|
||||
sal_Int16 nDialogType =
|
||||
|
|
Loading…
Reference in a new issue