[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 2 commits - sfx2/inc sfx2/source
Rafael Dominguez
venccsralph at gmail.com
Wed Apr 10 01:31:25 PDT 2013
sfx2/inc/sfx2/templatelocalview.hxx | 2 +
sfx2/source/control/templatelocalview.cxx | 11 ++++++
sfx2/source/doc/templatedlg.cxx | 50 +++++++++++++++++++++---------
sfx2/source/doc/templatedlg.src | 12 +++++++
4 files changed, 60 insertions(+), 15 deletions(-)
New commits:
commit 94d3d78aa7b7258f0a2f397d36599928342959e6
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sun Apr 7 22:26:28 2013 -0430
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 at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 6f78ebe..3097f1f 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 60c2857..9beb3da 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";
commit 372f50605347d750ecb3e50c05ec4c27636b48d9
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Sun Apr 7 21:46:11 2013 -0430
Display correct region name in error messages.
Change-Id: Icf4149272f67df6681bdad711362dd7d3802d04a
Reviewed-on: https://gerrit.libreoffice.org/3300
Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index 2e7e400..09b69ce 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -50,6 +50,8 @@ public:
OUString getRegionName(const sal_uInt16 nRegionId) const;
+ OUString getRegionItemName(const sal_uInt16 nItemId) const;
+
std::vector<OUString> getFolderNames ();
std::vector<TemplateItemProperties>
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index a4437c3..884897c 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -194,6 +194,17 @@ OUString TemplateLocalView::getRegionName(const sal_uInt16 nRegionId) const
return mpDocTemplates->GetRegionName(nRegionId);
}
+OUString TemplateLocalView::getRegionItemName(const sal_uInt16 nItemId) const
+{
+ for (size_t i = 0; i < maRegions.size(); ++i)
+ {
+ if (maRegions[i]->mnId == nItemId)
+ return maRegions[i]->maTitle;
+ }
+
+ return OUString();
+}
+
std::vector<OUString> TemplateLocalView::getFolderNames()
{
size_t n = maRegions.size();
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 948de70..6f78ebe 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1467,7 +1467,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)
aTemplateList = aTemplateList + "\n" + (*pIter)->maTitle;
}
- OUString aDst = maView->GetItemText(nItemId);
+ OUString aDst = maView->getRegionItemName(nItemId);
OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString());
aMsg = aMsg.replaceFirst("$1",aDst);
ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute();
@@ -1523,7 +1523,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)
{
OUString aMsg(SfxResId(STR_MSG_ERROR_REMOTE_MOVE).toString());
aMsg = aMsg.replaceFirst("$1",mpOnlineView->getCurRegionName());
- aMsg = aMsg.replaceFirst("$2",maView->GetItemText(nItemId));
+ aMsg = aMsg.replaceFirst("$2",maView->getRegionItemName(nItemId));
ErrorBox(this,WB_OK,aMsg.replaceFirst("$1",aTemplateList)).Execute();
}
}
@@ -1577,7 +1577,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
if (!aTemplateList.isEmpty())
{
- OUString aDst = maView->GetItemText(nItemId);
+ OUString aDst = maView->getRegionItemName(nItemId);
OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString());
aMsg = aMsg.replaceFirst("$1",aDst);
ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute();
More information about the Libreoffice-commits
mailing list