diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-06-08 05:22:13 +0530 |
---|---|---|
committer | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-06-10 01:18:26 +0000 |
commit | 6c782fe1568d1b3a5f968b3696ba1bf8ad6d914c (patch) | |
tree | 3de934644fba8849c852f372d5afb2ca5f773778 /sfx2 | |
parent | 048ca1825e9213dba6b94045900d4099a3cfa75c (diff) |
GSoC: Templates: Display titles and category as tooltips
Tooltip text:
1. Template Manager:
All Categories: Title + Category
Category: Title
2. Start center: Title
Conflicts:
sfx2/source/doc/doc.hrc
Conflicts:
sfx2/source/doc/templatedlg.cxx
Reviewed-on: https://gerrit.libreoffice.org/26040
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Akshay Deep <akshaydeepiitr@gmail.com>
Conflicts:
sfx2/source/control/templateabstractview.cxx
sfx2/source/doc/doc.src
Change-Id: I0bfd5e78120f13338f88c1b0617df3a057cce02f
Reviewed-on: https://gerrit.libreoffice.org/26139
Reviewed-by: Akshay Deep <akshaydeepiitr@gmail.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/control/templatedefaultview.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/doc.hrc | 2 | ||||
-rw-r--r-- | sfx2/source/doc/doc.src | 4 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 4 |
7 files changed, 30 insertions, 6 deletions
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 4e5758530120..6c7fcae37b04 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -130,7 +130,7 @@ void TemplateAbstractView::insertItem(const TemplateItemProperties &rTemplate) Invalidate(); } -void TemplateAbstractView::insertItems(const std::vector<TemplateItemProperties> &rTemplates, bool isRegionSelected) +void TemplateAbstractView::insertItems(const std::vector<TemplateItemProperties> &rTemplates, bool isRegionSelected, bool bShowCategoryInTooltip) { mItemList.clear(); @@ -149,7 +149,16 @@ void TemplateAbstractView::insertItems(const std::vector<TemplateItemProperties> pChild->mnRegionId = pCur->nRegionId; pChild->maTitle = pCur->aName; pChild->setPath(pCur->aPath); - pChild->setHelpText(pCur->aRegionName); + + if(!bShowCategoryInTooltip) + pChild->setHelpText(pCur->aName); + else + { + OUString sHelpText = SfxResId(STR_TEMPLATE_TOOLTIP).toString(); + sHelpText = (sHelpText.replaceFirst("$1", pCur->aName)).replaceFirst("$1", pCur->aRegionName); + pChild->setHelpText(sHelpText); + } + pChild->maPreview1 = pCur->aThumbnail; if(IsDefaultTemplate(pCur->aPath)) diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx index d6ffb632f727..789ef16ff337 100644 --- a/sfx2/source/control/templatedefaultview.cxx +++ b/sfx2/source/control/templatedefaultview.cxx @@ -48,6 +48,15 @@ void TemplateDefaultView::reload() set_width_request(mnTextHeight + mnItemMaxSize + 2*mnItemPadding); } +void TemplateDefaultView::showAllTemplates() +{ + mnCurRegionId = 0; + maCurRegionName.clear(); + + insertItems(maAllTemplates, false); + maOpenRegionHdl.Call(nullptr); +} + void TemplateDefaultView::KeyInput( const KeyEvent& rKEvt ) { ThumbnailView::KeyInput(rKEvt); diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index b1e024217754..83d0e47b06ca 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -143,7 +143,8 @@ void TemplateLocalView::showAllTemplates() mnCurRegionId = 0; maCurRegionName.clear(); - insertItems(maAllTemplates, false); + insertItems(maAllTemplates, false, true); + maOpenRegionHdl.Call(nullptr); } diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 3c4510672765..350dc4a55e46 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -265,6 +265,7 @@ void BackingWindow::initControls() mpLocalView->setCreateContextMenuHdl(LINK(this, BackingWindow, CreateContextMenuHdl)); mpLocalView->setOpenTemplateHdl(LINK(this, BackingWindow, OpenTemplateHdl)); mpLocalView->setEditTemplateHdl(LINK(this, BackingWindow, EditTemplateHdl)); + mpLocalView->ShowTooltips( true ); setupButton( mpOpenButton ); setupButton( mpRemoteButton ); diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index ea4bc30c342f..1f516c29aaeb 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -125,8 +125,8 @@ #define STR_CREATE_ERROR (RID_SFX_DOC_START+103) #define STR_ERROR_SAVEAS (RID_SFX_DOC_START+105) #define STR_CATEGORY_RENAME (RID_SFX_DOC_START+109) -#define STR_TEMPLATE_SELECTION (RID_SFX_DOC_START+120) #define STR_RESET_DEFAULT (RID_SFX_DOC_START+122) +#define STR_TEMPLATE_TOOLTIP (RID_SFX_DOC_START+169) // please update to the last id #define ACT_SFX_DOC_END IMG_ACTION_REFRESH diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index eb8a5ae14408..9b7c0a5d122b 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -84,6 +84,10 @@ String STR_RENAME_TEMPLATE { Text [ en-US ] = "Enter New Name: " ; }; +String STR_TEMPLATE_TOOLTIP +{ + Text [ en-US ] = "Title: $1\nCategory: $1" ; +}; String STR_AUTOMATICVERSION { Text [ en-US ] = "Automatically saved version" ; diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index ab0da9172639..23b9458adabf 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -251,6 +251,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent) mpSearchView->setEditTemplateHdl(LINK(this,SfxTemplateManagerDlg, EditTemplateHdl)); mpSearchView->setDeleteTemplateHdl(LINK(this,SfxTemplateManagerDlg, DeleteTemplateHdl)); mpSearchView->setDefaultTemplateHdl(LINK(this,SfxTemplateManagerDlg, DefaultTemplateHdl)); + + mpLocalView->ShowTooltips(true); mpSearchView->ShowTooltips(true); mpOKButton->SetClickHdl(LINK(this, SfxTemplateManagerDlg, OkClickHdl)); @@ -737,7 +739,6 @@ IMPL_LINK_NOARG_TYPED(SfxTemplateManagerDlg, ImportClickHdl, Button*, void) mpLocalView->reload(); mpLocalView->showAllTemplates(); - mpLocalView->ShowTooltips(true); mpCBApp->SelectEntryPos(0); mpCBFolder->SelectEntryPos(0); mpActionMenu->HideItem(MNI_ACTION_RENAME_FOLDER); @@ -1297,7 +1298,6 @@ void SfxTemplateManagerDlg::OnCategoryDelete() mpLocalView->reload(); mpLocalView->showAllTemplates(); - mpLocalView->ShowTooltips(true); mpCBApp->SelectEntryPos(0); mpCBFolder->SelectEntryPos(0); mpActionMenu->HideItem(MNI_ACTION_RENAME_FOLDER); |