[Libreoffice-commits] .: Branch 'feature/template-dialog' - sfx2/inc sfx2/source
Rafael Dominguez
rdominguez at kemper.freedesktop.org
Fri Jun 22 03:14:49 PDT 2012
sfx2/inc/templatedlg.hxx | 5 +++++
sfx2/source/doc/templatedlg.cxx | 30 +++++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
New commits:
commit fed3b690201e75c37c73fb6f8de566d8faa7d958
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Fri Jun 22 05:45:33 2012 -0430
Keep track of selected templates and update toolbar as needed.
Change-Id: Id595985e49694acc0e132af3d11b2bb843924fb2
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index d2e0359..256f8ce 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -10,6 +10,8 @@
#ifndef TEMPLATEDLG_HXX
#define TEMPLATEDLG_HXX
+#include <set>
+
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
@@ -66,6 +68,9 @@ private:
ToolBox *mpActionBar;
ToolBox *mpTemplateBar;
TemplateFolderView *maView;
+
+ int mnSelectionCount;
+ std::set<const ThumbnailViewItem*> maSelTemplates;
};
#endif // TEMPLATEDLG_HXX
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index f04532b..d490ff5 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -11,6 +11,7 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatefolderview.hxx>
+#include <sfx2/thumbnailviewitem.hxx>
#include <vcl/toolbox.hxx>
#include "doc.hrc"
@@ -32,7 +33,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpViewBar( new ToolBox(this, SfxResId(TBX_ACTION_VIEW))),
mpActionBar( new ToolBox(this, SfxResId(TBX_ACTION_ACTION))),
mpTemplateBar( new ToolBox(this, SfxResId(TBX_ACTION_TEMPLATES))),
- maView(new TemplateFolderView(this,SfxResId(TEMPLATE_VIEW)))
+ maView(new TemplateFolderView(this,SfxResId(TEMPLATE_VIEW))),
+ mnSelectionCount(0)
{
maButtonSelMode.SetStyle(maButtonSelMode.GetStyle() | WB_TOGGLE);
@@ -201,6 +203,32 @@ IMPL_LINK(SfxTemplateManagerDlg, TVFolderStateHdl, const ThumbnailViewItem*, pIt
IMPL_LINK(SfxTemplateManagerDlg, TVTemplateStateHdl, const ThumbnailViewItem*, pItem)
{
+ if (pItem->isSelected())
+ {
+ if (maSelTemplates.empty())
+ {
+ mpViewBar->Show(false);
+ mpActionBar->Show(false);
+ mpTemplateBar->Show();
+ }
+
+ maSelTemplates.insert(pItem);
+ }
+ else
+ {
+ if (maSelTemplates.find(pItem) != maSelTemplates.end())
+ {
+ maSelTemplates.erase(pItem);
+
+ if (maSelTemplates.empty())
+ {
+ mpTemplateBar->Show(false);
+ mpViewBar->Show();
+ mpActionBar->Show();
+ }
+ }
+ }
+
return 0;
}
More information about the Libreoffice-commits
mailing list