[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 2 commits - sfx2/inc sfx2/source

2013-04-10 Thread Rafael Dominguez
 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 venccsra...@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 vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@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 venccsra...@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 vmik...@suse.cz

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 2 commits - sfx2/inc sfx2/source

2013-03-22 Thread Cédric Bosdonnat
 sfx2/inc/sfx2/templateview.hxx   |1 
 sfx2/inc/sfx2/thumbnailview.hxx  |7 +
 sfx2/source/control/templateabstractview.cxx |   10 ++
 sfx2/source/control/templateview.cxx |   16 +---
 sfx2/source/control/templateview.src |6 -
 sfx2/source/control/thumbnailview.cxx|  104 +--
 6 files changed, 117 insertions(+), 27 deletions(-)

New commits:
commit 9296cf4088a0637f0326803fe220816ebc8daf22
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Fri Mar 22 16:33:20 2013 +0100

fdo#61390: Fixed the tabstop in the TemplateView.

Change-Id: I887b11646efb9a839da11cd3e20cdf7e532caf3e
(cherry picked from commit 7a25aa2821ccf7318ce4a13efe171763989009d5)
Reviewed-on: https://gerrit.libreoffice.org/2913
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index 3e2a7c8..e219905 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -51,7 +51,6 @@ protected:
 private:
 TemplateAbstractView* mpMasterView;
 
-ControlmaButtons;
 PushButton maAllButton;
 FixedText  maFTName;
 sal_uInt16 mnId;
diff --git a/sfx2/source/control/templateabstractview.cxx 
b/sfx2/source/control/templateabstractview.cxx
index de2091f..14ab811 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -114,7 +114,7 @@ bool ViewFilter_Keyword::operator ()(const 
ThumbnailViewItem *pItem)
 
 TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits 
nWinStyle, bool bDisableTransientChildren)
 : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
-  mpItemView(new TemplateView(this)),
+  mpItemView(new TemplateView(pParent)),
   mbFilteredResults(false),
   meFilterOption(FILTER_APP_WRITER)
 {
@@ -123,7 +123,7 @@ TemplateAbstractView::TemplateAbstractView (Window 
*pParent, WinBits nWinStyle,
 
 TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId 
rResId, bool bDisableTransientChildren)
 : ThumbnailView(pParent,rResId,bDisableTransientChildren),
-  mpItemView(new TemplateView(this)),
+  mpItemView(new TemplateView(pParent)),
   mbFilteredResults(false),
   meFilterOption(FILTER_APP_WRITER)
 {
@@ -190,8 +190,14 @@ void TemplateAbstractView::filterTemplatesByApp (const 
FILTER_APPLICATION eApp)
 
 void TemplateAbstractView::showOverlay (bool bVisible)
 {
+Show(!bVisible);
 mpItemView-Show(bVisible);
 
+mpItemView-SetPosSizePixel(GetPosPixel(), GetSizePixel());
+mpItemView-SetStyle(GetStyle());
+
+mpItemView-GrabFocus();
+
 // Clear items is the overlay is closed.
 if (!bVisible)
 {
diff --git a/sfx2/source/control/templateview.cxx 
b/sfx2/source/control/templateview.cxx
index 615465d..46ebeaa 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -34,14 +34,13 @@ using namespace drawinglayer::attribute;
 using namespace drawinglayer::primitive2d;
 
 TemplateView::TemplateView (Window *pParent)
-: ThumbnailView(pParent,WB_VSCROLL),
+: ThumbnailView(pParent,WB_VSCROLL | WB_TABSTOP),
   mpMasterView(NULL),
-  maButtons(this, SfxResId(CONTROL_BUTTONS)),
-  maAllButton(maButtons, SfxResId(BTN_ALL_TEMPLATES)),
-  maFTName(maButtons, SfxResId(FT_NAME)),
+  maAllButton(this, SfxResId(BTN_ALL_TEMPLATES)),
+  maFTName(this, SfxResId(FT_NAME)),
   mnId(0)
 {
-mnHeaderHeight = maButtons.GetSizePixel().getHeight();
+mnHeaderHeight = maAllButton.GetSizePixel().getHeight() + 
maAllButton.GetPosPixel().Y() * 2;
 maAllButton.SetStyle(maAllButton.GetStyle() | WB_FLATBUTTON);
 }
 
@@ -88,13 +87,8 @@ void TemplateView::Resize()
 Size aWinSize = GetOutputSize();
 
 // Set the buttons panel and buttons size
-Size aPanelSize = maButtons.GetSizePixel();
-int nDeltaW = aWinSize.getWidth() - aPanelSize.getWidth();
-aPanelSize.setWidth(aWinSize.getWidth());
-maButtons.SetSizePixel(aPanelSize);
-
 Size aNameSize = maFTName.GetSizePixel();
-aNameSize.setWidth(aNameSize.getWidth() + nDeltaW);
+aNameSize.setWidth( aWinSize.getWidth() - maFTName.GetPosPixel().X());
 maFTName.SetSizePixel(aNameSize);
 
 ThumbnailView::Resize();
diff --git a/sfx2/source/control/templateview.src 
b/sfx2/source/control/templateview.src
index db4d575..8549c96 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -8,12 +8,6 @@
 
 #include templateview.hrc
 
-Control CONTROL_BUTTONS
-{
-Size = MAP_APPFONT( 290, 17 );
-TabStop = False;
-};
-
 PushButton BTN_ALL_TEMPLATES
 {
 Pos = MAP_APPFONT( 1, 1 );
commit 43bbcfc7a1625aa79b69c443c492f0969b31baad
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Fri Mar 22 11:43:11 2013 +0100

fdo#61390: simple 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 2 commits - sfx2/inc sfx2/source

2013-03-19 Thread Cédric Bosdonnat
 sfx2/inc/templatedlg.hxx |2 
 sfx2/source/control/templateview.src |2 
 sfx2/source/doc/doc.hrc  |1 
 sfx2/source/doc/templatedlg.cxx  |   45 
 sfx2/source/doc/templatedlg.src  |  124 ++-
 5 files changed, 99 insertions(+), 75 deletions(-)

New commits:
commit f403f6cc40c47b8007f5dc64287bef312e65f3e2
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Tue Mar 19 09:53:43 2013 +0100

Template Manager: fixed search edit field position

Change-Id: Ic5ef64ba3ed4c98397b0c4911de491df4c79946a
(cherry picked from commit b6ba04639b9922f6717f79ac4be215e09691d7a9)
Reviewed-on: https://gerrit.libreoffice.org/2844
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 1d52d45..f0a16b35 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -114,7 +114,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window 
*parent)
   maTabControl(this,SfxResId(TAB_CONTROL)),
   maTabPage(maTabControl, SfxResId(TAB_TEMPLATE_MANAGER)),
   mpToolbars( new Control(maTabPage,SfxResId(TOOLBARS))),
-  mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)),
+  mpSearchEdit(new Edit(maTabPage,WB_HIDE | WB_BORDER)),
   mpViewBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_VIEW))),
   mpActionBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_ACTION))),
   mpTemplateBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_TEMPLATES))),
commit 831d4160c9587b29f44934f9318201632603048c
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Fri Mar 15 17:14:26 2013 +0100

Template manager: moved the controls into a proper TabPage to avoid problems

Conflicts:
sfx2/inc/templatedlg.hxx
sfx2/source/doc/templatedlg.src

Change-Id: Ibff35bf24873a38c9a09d71fb3630a57e06f1a3c
Reviewed-on: https://gerrit.libreoffice.org/2843
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 47c1989..095292e 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -15,6 +15,7 @@
 #include vcl/dialog.hxx
 #include vcl/button.hxx
 #include vcl/tabctrl.hxx
+#include vcl/tabpage.hxx
 
 class Edit;
 class PopupMenu;
@@ -126,6 +127,7 @@ private:
 private:
 
 TabControl maTabControl;
+TabPage maTabPage;
 Control *mpToolbars;
 
 Edit *mpSearchEdit;
diff --git a/sfx2/source/control/templateview.src 
b/sfx2/source/control/templateview.src
index d2711a7..db4d575 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -11,7 +11,6 @@
 Control CONTROL_BUTTONS
 {
 Size = MAP_APPFONT( 290, 17 );
-Border = True;
 TabStop = False;
 };
 
@@ -20,6 +19,7 @@ PushButton BTN_ALL_TEMPLATES
 Pos = MAP_APPFONT( 1, 1 );
 Size = MAP_APPFONT( 50, 14 );
 Text [ en-US ] = All Templates;
+TabStop = True;
 };
 
 FixedText FT_NAME
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc
index f3edfa7..b56a473 100644
--- a/sfx2/source/doc/doc.hrc
+++ b/sfx2/source/doc/doc.hrc
@@ -39,6 +39,7 @@
 #define DLG_DOC_TEMPLATE(RID_SFX_DOC_START+2)
 #define DLG_ORGANIZE(RID_SFX_DOC_START+3)
 #define DLG_TEMPLATE_MANAGER(RID_SFX_DOC_START+4)
+#define TAB_TEMPLATE_MANAGER(RID_SFX_DOC_START+5)
 
 #define BMP_STYLES_CLOSED   (RID_SFX_DOC_START+ 0)
 #define BMP_STYLES_OPENED   (RID_SFX_DOC_START+ 1)
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 7041966..1d52d45 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -99,22 +99,38 @@ private:
 OUString maKeyword;
 };
 
+class TemplateManagerPage : public TabPage
+{
+private:
+FixedText maFixedText;
+
+public:
+TemplateManagerPage( Window* pParent );
+~TemplateManagerPage( ) { };
+};
+
 SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
 : ModelessDialog(parent, SfxResId(DLG_TEMPLATE_MANAGER)),
   maTabControl(this,SfxResId(TAB_CONTROL)),
-  mpToolbars( new Control(maTabControl,SfxResId(TOOLBARS))),
+  maTabPage(maTabControl, SfxResId(TAB_TEMPLATE_MANAGER)),
+  mpToolbars( new Control(maTabPage,SfxResId(TOOLBARS))),
   mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)),
   mpViewBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_VIEW))),
   mpActionBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_ACTION))),
   mpTemplateBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_TEMPLATES))),
-  mpSearchView(new TemplateSearchView(this)),
-  maView(new TemplateLocalView(this,SfxResId(TEMPLATE_VIEW))),
-  mpOnlineView(new TemplateRemoteView(this, WB_VSCROLL,false)),
+