diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2013-04-07 22:26:28 -0430 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-10 08:31:11 +0000 |
commit | 94d3d78aa7b7258f0a2f397d36599928342959e6 (patch) | |
tree | 08092c6b48b1f8138172ff831a629f19eac631dd | |
parent | 372f50605347d750ecb3e50c05ec4c27636b48d9 (diff) |
fdo#61389 - Display Properties, Set as default actions in save mode.
It dosent make sense to display delete action since we are saving
a template same for edit.
Change-Id: I83368f80a29f60c8d24b47fe3682ca93a2373a98
Reviewed-on: https://gerrit.libreoffice.org/3301
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 44 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.src | 12 |
2 files changed, 44 insertions, 12 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 6f78ebe7e120..3097f1f1a592 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -307,6 +307,14 @@ void SfxTemplateManagerDlg::setSaveMode(bool bMode) mpViewBar->ShowItem(TBI_TEMPLATE_SAVE); mpViewBar->HideItem(TBI_TEMPLATE_IMPORT); mpViewBar->HideItem(TBI_TEMPLATE_REPOSITORY); + + mpTemplateBar->ShowItem(TBI_TEMPLATE_SAVE); + mpTemplateBar->ShowItem(TBI_TEMPLATE_PROPERTIES); + mpTemplateBar->ShowItem(TBI_TEMPLATE_DEFAULT); + mpTemplateBar->HideItem(TBI_TEMPLATE_EDIT); + mpTemplateBar->HideItem(TBI_TEMPLATE_MOVE); + mpTemplateBar->HideItem(TBI_TEMPLATE_EXPORT); + mpTemplateBar->HideItem(TBI_TEMPLATE_DELETE); } else { @@ -850,16 +858,22 @@ void SfxTemplateManagerDlg::OnTemplateState (const ThumbnailViewItem *pItem) if (pItem->isSelected()) { - if (!mbIsSaveMode) + if (maSelTemplates.empty()) { - if (maSelTemplates.empty()) + mpViewBar->Show(false); + mpTemplateBar->Show(); + } + else if (maSelTemplates.size() != 1 || !bInSelection) + { + if (!mbIsSaveMode) { - mpViewBar->Show(false); - mpTemplateBar->Show(); + mpTemplateBar->HideItem(TBI_TEMPLATE_EDIT); + mpTemplateBar->HideItem(TBI_TEMPLATE_PROPERTIES); + mpTemplateBar->HideItem(TBI_TEMPLATE_DEFAULT); } - else if (maSelTemplates.size() != 1 || !bInSelection) + else { - mpTemplateBar->HideItem(TBI_TEMPLATE_EDIT); + mpTemplateBar->HideItem(TBI_TEMPLATE_SAVE); mpTemplateBar->HideItem(TBI_TEMPLATE_PROPERTIES); mpTemplateBar->HideItem(TBI_TEMPLATE_DEFAULT); } @@ -874,16 +888,22 @@ void SfxTemplateManagerDlg::OnTemplateState (const ThumbnailViewItem *pItem) { maSelTemplates.erase(pItem); - if (!mbIsSaveMode) + if (maSelTemplates.empty()) + { + mpTemplateBar->Show(false); + mpViewBar->Show(); + } + else if (maSelTemplates.size() == 1) { - if (maSelTemplates.empty()) + if (!mbIsSaveMode) { - mpTemplateBar->Show(false); - mpViewBar->Show(); + mpTemplateBar->ShowItem(TBI_TEMPLATE_EDIT); + mpTemplateBar->ShowItem(TBI_TEMPLATE_PROPERTIES); + mpTemplateBar->ShowItem(TBI_TEMPLATE_DEFAULT); } - else if (maSelTemplates.size() == 1) + else { - mpTemplateBar->ShowItem(TBI_TEMPLATE_EDIT); + mpTemplateBar->ShowItem(TBI_TEMPLATE_SAVE); mpTemplateBar->ShowItem(TBI_TEMPLATE_PROPERTIES); mpTemplateBar->ShowItem(TBI_TEMPLATE_DEFAULT); } diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index 60c28574c99b..9beb3dac9e86 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -212,6 +212,18 @@ TabPage TAB_TEMPLATE_MANAGER { ToolBoxItem { + Identifier = TBI_TEMPLATE_SAVE; + Hide = TRUE; + Text [ en-US ] = "Save"; + + ItemImage = Image + { + ImageBitmap = Bitmap { File = "actionview028.png" ; }; + }; + }; + + ToolBoxItem + { Identifier = TBI_TEMPLATE_EDIT; Text [ en-US ] = "Edit"; |