[Libreoffice-commits] .: 9 commits - framework/uiconfig officecfg/registry sc/uiconfig sd/uiconfig sfx2/inc sfx2/source sw/uiconfig
Rafael Dominguez
rdominguez at kemper.freedesktop.org
Fri Aug 10 14:41:45 PDT 2012
framework/uiconfig/startmodule/menubar/menubar.xml | 1
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 7
sc/uiconfig/scalc/menubar/menubar.xml | 2
sd/uiconfig/sdraw/menubar/menubar.xml | 3
sd/uiconfig/simpress/menubar/menubar.xml | 3
sfx2/inc/sfx2/sfxcommands.h | 1
sfx2/inc/sfx2/templateabstractview.hxx | 2
sfx2/inc/sfx2/thumbnailview.hxx | 6
sfx2/inc/templatedlg.hxx | 5
sfx2/source/appl/appopen.cxx | 43 ++-
sfx2/source/control/templateabstractview.cxx | 5
sfx2/source/control/thumbnailview.cxx | 20 +
sfx2/source/doc/templatedlg.cxx | 135 +++++++++-
sfx2/source/doc/templatedlg.hrc | 5
sfx2/source/doc/templatedlg.src | 12
sw/uiconfig/sglobal/menubar/menubar.xml | 3
sw/uiconfig/sweb/menubar/menubar.xml | 3
sw/uiconfig/swform/menubar/menubar.xml | 2
sw/uiconfig/swreport/menubar/menubar.xml | 3
sw/uiconfig/swriter/menubar/menubar.xml | 3
sw/uiconfig/swxform/menubar/menubar.xml | 3
21 files changed, 228 insertions(+), 39 deletions(-)
New commits:
commit 68129703673851b81f0c75b256026f981aba1928
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 23:03:45 2012 -0430
Remove TemplateManager menu entry.
Change-Id: I000fc9c1328aec5924da1557da599e6c7bdcb373
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index c74db9d..07f55f3 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -2341,11 +2341,6 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:TemplateManager" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Template Manager</value>
- </prop>
- </node>
<node oor:name=".uno:Organizer" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Organize...</value>
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index 990d32b..ec84a44 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -28,7 +28,6 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
<menu:menuitem menu:id=".uno:Signature"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 71d6443..13c6939 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -30,7 +30,6 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
<menu:menuitem menu:id=".uno:Signature"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h
index 0b37f65..fc075b2 100644
--- a/sfx2/inc/sfx2/sfxcommands.h
+++ b/sfx2/inc/sfx2/sfxcommands.h
@@ -46,7 +46,6 @@
#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate"
#define CMD_SID_OPENURL ".uno:OpenUrl"
#define CMD_SID_OPTIONS ".uno:Options"
-#define CMD_SID_TEMPLATE_MANAGER ".uno:TemplateManager"
#define CMD_SID_ORGANIZER ".uno:Organizer"
#define CMD_SID_PASTE ".uno:Paste"
#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial"
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 0b59c6b..e9e072d 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -47,7 +47,6 @@ String STR_REPOSITORY_NEW
ModelessDialog DLG_TEMPLATE_MANAGER
{
- HelpId = CMD_SID_TEMPLATE_MANAGER;
OutputSize = TRUE;
SVLook = TRUE;
Moveable = TRUE;
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 33845ea..d53da39 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -37,7 +37,6 @@
</menu:menu>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index 762bc31..225355a 100644
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -25,7 +25,6 @@
</menu:menu>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 624ae03..8b65699 100644
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -38,7 +38,6 @@
</menu:menu>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index db2af71..251cbe4 100644
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -39,7 +39,6 @@
</menu:menu>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index cfe3a29..b71b33e 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -40,7 +40,6 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
<menu:menuitem menu:id=".uno:Signature"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index 50ceb4f..92a62fb 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -40,7 +40,6 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDocumentProperties"/>
<menu:menuitem menu:id=".uno:Signature"/>
- <menu:menuitem menu:id=".uno:TemplateManager"/>
<menu:menu menu:id=".uno:TemplateMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
commit f6ea2e072940d897cfef4ee5f837c47a8321a8f3
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 22:58:30 2012 -0430
Show Template Manager instead of old dialog when creating a template.
- Only when experimental features is set.
Change-Id: I81e2bba38506757afe202cba5c69560e3fa89f3c
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index c162f3c..1d1798f 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -65,6 +65,7 @@
#include <unotools/localfilehelper.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/moduleoptions.hxx>
+#include <svtools/miscopt.hxx>
#include <svtools/templdlg.hxx>
#include <osl/file.hxx>
#include <unotools/extendedsecurityoptions.hxx>
@@ -98,6 +99,7 @@
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/event.hxx>
+#include "templatedlg.hxx"
#include "openuriexternally.hxx"
using namespace ::com::sun::star;
@@ -563,22 +565,43 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
SfxErrorContext aEc(ERRCTX_SFX_NEWDOC);
if ( !pTemplNameItem && !pTemplFileNameItem )
{
- Window* pTopWin = GetTopWindow();
- SvtDocumentTemplateDialog* pDocTemplDlg = new SvtDocumentTemplateDialog( NULL );
- int nRet = pDocTemplDlg->Execute();
sal_Bool bNewWin = sal_False;
- if ( nRet == RET_OK )
+ Window* pTopWin = GetTopWindow();
+
+ SvtMiscOptions aMiscOptions;
+ if ( !aMiscOptions.IsExperimentalMode() )
{
- rReq.Done();
- if ( pTopWin != GetTopWindow() )
+ SvtDocumentTemplateDialog* pDocTemplDlg = new SvtDocumentTemplateDialog( NULL );
+ int nRet = pDocTemplDlg->Execute();
+ if ( nRet == RET_OK )
{
- // the dialogue opens a document -> a new TopWindow appears
- pTopWin = GetTopWindow();
- bNewWin = sal_True;
+ rReq.Done();
+ if ( pTopWin != GetTopWindow() )
+ {
+ // the dialogue opens a document -> a new TopWindow appears
+ pTopWin = GetTopWindow();
+ bNewWin = sal_True;
+ }
+ }
+
+ delete pDocTemplDlg;
+ }
+ else
+ {
+ SfxTemplateManagerDlg aTemplDlg(NULL);
+ int nRet = aTemplDlg.Execute();
+ if ( nRet == RET_OK )
+ {
+ rReq.Done();
+ if ( pTopWin != GetTopWindow() )
+ {
+ // the dialogue opens a document -> a new TopWindow appears
+ pTopWin = GetTopWindow();
+ bNewWin = sal_True;
+ }
}
}
- delete pDocTemplDlg;
if ( bNewWin && pTopWin )
// after the destruction of the dialogue its parent comes to top,
// but we want that the new document is on top
commit 3639f46e481d1ce661bc51b664fab9904eee8d43
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 22:32:08 2012 -0430
Rename Templates->Save menu to Save As Template.
- Move entry to File menu instead of File->Templates.
Change-Id: I3c7df6057f9634d0e3879c90e0760f1fecc98954
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index bf1242a..c74db9d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -2311,7 +2311,7 @@
</node>
<node oor:name=".uno:SaveAsTemplate" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Save...</value>
+ <value xml:lang="en-US">Save As Template...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 3108d0a..0bff97c 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
@@ -35,7 +36,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index 5fbfaac..990d32b 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
@@ -32,7 +33,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 8d379ac..71d6443 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
@@ -34,7 +35,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index b82b494..33845ea 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
@@ -41,7 +42,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index 1f0efd7..762bc31 100644
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:Reload"/>
<menu:menuseparator/>
@@ -29,7 +30,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index e42fc69..624ae03 100644
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index f794fee..db2af71 100644
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
@@ -43,7 +44,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 12f19b0..cfe3a29 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
@@ -44,7 +45,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index fd90dc4..50ceb4f 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -11,6 +11,7 @@
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
+ <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Reload"/>
@@ -44,7 +45,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
commit 02874016213dab401b173e8b4d469bcc2bf76b45
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 22:31:06 2012 -0430
Remove Template Save menu entry from start center.
Change-Id: I4a26d9039df748c25b6de1e01844bb57b0988e19
diff --git a/framework/uiconfig/startmodule/menubar/menubar.xml b/framework/uiconfig/startmodule/menubar/menubar.xml
index bf9e4d2..cba848f 100644
--- a/framework/uiconfig/startmodule/menubar/menubar.xml
+++ b/framework/uiconfig/startmodule/menubar/menubar.xml
@@ -19,7 +19,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Organizer"/>
<menu:menuitem menu:id=".uno:AddressBookSource"/>
- <menu:menuitem menu:id=".uno:SaveAsTemplate"/>
<menu:menuitem menu:id=".uno:OpenTemplate"/>
</menu:menupopup>
</menu:menu>
commit c919a21c1a7e480eb4ffbd26353c0a6bf9aafb4b
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 20:51:21 2012 -0430
Rename unselectItems -> deselectItems.
Change-Id: Ie9ad44077df03ba8e5e4edb4068982a0f8af353b
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx
index 7eebe5d..b2d02e8 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -225,11 +225,11 @@ public:
/**
*
- * @brief unselect all current selected items.
+ * @brief deselect all current selected items.
*
**/
- void unselectItems ();
+ void deselectItems ();
rtl::OUString GetItemText( sal_uInt16 nItemId ) const;
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 9057132..fe886a8 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -1057,7 +1057,7 @@ void ThumbnailView::deselectItem(const sal_uInt16 nItemId)
}
}
-void ThumbnailView::unselectItems()
+void ThumbnailView::deselectItems()
{
for (size_t i = 0, n = mItemList.size(); i < n; ++i)
{
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 4880f13..d2d263a 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1154,7 +1154,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
}
// Deselect all items and update search results
- mpSearchView->unselectItems();
+ mpSearchView->deselectItems();
SearchUpdateHdl(mpSearchEdit);
}
commit ec412c3192d41e4ee527dbdfefe5760da1098335
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 20:34:22 2012 -0430
Deselect item after setting it as default template.
Change-Id: I587484f72c5751b07636339c1eb4748cbfe1ed78
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 6a1adce..58fec13 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -79,6 +79,8 @@ public:
// Check if the overlay is visible or not.
bool isOverlayVisible () const;
+ void deselectOverlayItem (const sal_uInt16 nItemId);
+
void sortOverlayItems (const boost::function<bool (const ThumbnailViewItem*,
const ThumbnailViewItem*) > &func);
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx
index 9a9e516..7eebe5d 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -221,6 +221,8 @@ public:
bool IsItemSelected( sal_uInt16 nItemId ) const
{ return nItemId == mnSelItemId; }
+ void deselectItem (const sal_uInt16 nItemId);
+
/**
*
* @brief unselect all current selected items.
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 99539e0..d4c92f7 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -85,6 +85,11 @@ bool TemplateAbstractView::isOverlayVisible () const
return mpItemView->IsVisible();
}
+void TemplateAbstractView::deselectOverlayItem(const sal_uInt16 nItemId)
+{
+ mpItemView->deselectItem(nItemId);
+}
+
void TemplateAbstractView::sortOverlayItems(const boost::function<bool (const ThumbnailViewItem*,
const ThumbnailViewItem*) > &func)
{
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index ad2f5b8..9057132 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -1039,6 +1039,24 @@ void ThumbnailView::SelectItem( sal_uInt16 nItemId )
}
}
+void ThumbnailView::deselectItem(const sal_uInt16 nItemId)
+{
+ for (size_t i = 0, n = mItemList.size(); i < n; ++i)
+ {
+ if (mItemList[i]->mnId == nItemId)
+ {
+ mItemList[i]->setSelection(false);
+
+ maItemStateHdl.Call(mItemList[i]);
+
+ if (IsReallyVisible() && IsUpdateMode())
+ mItemList[i]->Paint(mpProcessor,mpItemAttrs);
+
+ break;
+ }
+ }
+}
+
void ThumbnailView::unselectItems()
{
for (size_t i = 0, n = mItemList.size(); i < n; ++i)
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index bf3aee6..4880f13 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -906,6 +906,15 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault ()
SfxObjectFactory::SetStandardTemplate(aServiceName,pItem->getPath());
createDefaultTemplateMenu();
+
+ // clear selection and display view/action toolbars
+ maView->deselectOverlayItem(pItem->mnId);
+ maSelTemplates.clear();
+
+ mpTemplateBar->SetItemDown(TBI_TEMPLATE_DEFAULT,false);
+ mpTemplateBar->Show(false);
+ mpViewBar->Show();
+ mpActionBar->Show();
}
}
commit ad2844f81c64e312b05784800eb7b2008c83b0a6
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 18:29:30 2012 -0430
Implement resetting default template.
Change-Id: If781865ad802c411187c5b5cc4ed71a5deaed4f7
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 46b9b3e..91bc0be 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -65,6 +65,7 @@ private:
DECL_LINK(MenuSelectHdl, Menu*);
DECL_LINK(MoveMenuSelectHdl, Menu*);
DECL_LINK(RepositoryMenuSelectHdl, Menu*);
+ DECL_LINK(DefaultTemplateMenuSelectHdl, Menu*);
DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*);
@@ -83,6 +84,8 @@ private:
void createRepositoryMenu ();
+ void createDefaultTemplateMenu ();
+
// Exchange view between local/online view.
void switchMainView (bool bDisplayLocal);
@@ -124,6 +127,7 @@ private:
TemplateOnlineView *mpOnlineView;
PopupMenu *mpActionMenu;
PopupMenu *mpRepositoryMenu;
+ PopupMenu *mpTemplateDefaultMenu;
int mnSelectionCount;
std::set<const ThumbnailViewItem*> maSelTemplates;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 0fab68b..bf3aee6 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -27,6 +27,7 @@
#include <sfx2/templateviewitem.hxx>
#include <sfx2/thumbnailviewitem.hxx>
#include <sot/storage.hxx>
+#include <svtools/imagemgr.hxx>
#include <svtools/PlaceEditDialog.hxx>
#include <tools/urlobj.hxx>
#include <unotools/moduleoptions.hxx>
@@ -68,6 +69,8 @@ void lcl_createTemplate(uno::Reference<XComponentLoader> xDesktop, const FILTER_
bool lcl_getServiceName (const OUString &rFileURL, OUString &rName );
+std::vector<OUString> lcl_getAllFactoryURLs ();
+
// Sort by name in ascending order
class SortView_Name
{
@@ -122,11 +125,16 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpActionMenu = new PopupMenu;
mpActionMenu->InsertItem(MNI_ACTION_SORT_NAME,SfxResId(STR_ACTION_SORT_NAME).toString(),SfxResId(IMG_ACTION_SORT));
mpActionMenu->InsertItem(MNI_ACTION_REFRESH,SfxResId(STR_ACTION_REFRESH).toString(),SfxResId(IMG_ACTION_REFRESH));
+ mpActionMenu->InsertItem(MNI_ACTION_DEFAULT,SfxResId(STR_ACTION_DEFAULT).toString());
mpActionMenu->SetSelectHdl(LINK(this,SfxTemplateManagerDlg,MenuSelectHdl));
mpRepositoryMenu = new PopupMenu;
mpRepositoryMenu->SetSelectHdl(LINK(this,SfxTemplateManagerDlg,RepositoryMenuSelectHdl));
+ mpTemplateDefaultMenu = new PopupMenu;
+ mpTemplateDefaultMenu->SetSelectHdl(LINK(this,SfxTemplateManagerDlg,DefaultTemplateMenuSelectHdl));
+ mpActionMenu->SetPopupMenu(MNI_ACTION_DEFAULT,mpTemplateDefaultMenu);
+
Size aWinSize = GetOutputSize();
// Calculate thumbnail view minimum size
@@ -252,6 +260,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpOnlineView->Populate();
createRepositoryMenu();
+ createDefaultTemplateMenu();
maView->Populate();
maView->Show();
@@ -272,6 +281,7 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg ()
delete mpOnlineView;
delete mpActionMenu;
delete mpRepositoryMenu;
+ delete mpTemplateDefaultMenu;
}
IMPL_LINK_NOARG(SfxTemplateManagerDlg,ViewAllHdl)
@@ -602,6 +612,18 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
return 0;
}
+IMPL_LINK(SfxTemplateManagerDlg, DefaultTemplateMenuSelectHdl, Menu*, pMenu)
+{
+ sal_uInt16 nId = pMenu->GetCurItemId();
+
+ OUString aServiceName = SfxObjectShell::GetServiceNameFromFactory( mpTemplateDefaultMenu->GetItemCommand(nId));
+ SfxObjectFactory::SetStandardTemplate( aServiceName, OUString() );
+
+ createDefaultTemplateMenu();
+
+ return 0;
+}
+
IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem)
{
uno::Sequence< PropertyValue > aArgs(1);
@@ -882,6 +904,8 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault ()
if (lcl_getServiceName(pItem->getPath(),aServiceName))
{
SfxObjectFactory::SetStandardTemplate(aServiceName,pItem->getPath());
+
+ createDefaultTemplateMenu();
}
}
@@ -959,6 +983,29 @@ void SfxTemplateManagerDlg::createRepositoryMenu()
mpRepositoryMenu->InsertItem(MNI_REPOSITORY_NEW,SfxResId(STR_REPOSITORY_NEW).toString());
}
+void SfxTemplateManagerDlg::createDefaultTemplateMenu ()
+{
+ std::vector<OUString> aList = lcl_getAllFactoryURLs();
+
+ if (!aList.empty())
+ {
+ mpTemplateDefaultMenu->Clear();
+
+ sal_uInt16 nItemId = MNI_ACTION_DEFAULT + 1;
+ for( std::vector<OUString>::const_iterator i = aList.begin(); i != aList.end(); ++i )
+ {
+ INetURLObject aObj(*i);
+ OUString aTitle = SvFileInformationManager::GetDescription(aObj);
+ mpTemplateDefaultMenu->InsertItem(nItemId, aTitle, SvFileInformationManager::GetImage(aObj, false));
+ mpTemplateDefaultMenu->SetItemCommand(nItemId++, *i);
+ }
+
+ mpActionMenu->ShowItem(MNI_ACTION_DEFAULT);
+ }
+ else
+ mpActionMenu->HideItem(MNI_ACTION_DEFAULT);
+}
+
void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
{
if (bDisplayLocal)
@@ -1131,4 +1178,23 @@ bool lcl_getServiceName ( const OUString &rFileURL, OUString &rName )
return bRet;
}
+std::vector<OUString> lcl_getAllFactoryURLs ()
+{
+ SvtModuleOptions aModOpt;
+ std::vector<OUString> aList;
+ const ::com::sun::star::uno::Sequence<OUString> &aServiceNames = aModOpt.GetAllServiceNames();
+
+ for( sal_Int32 i=0, nCount = aServiceNames.getLength(); i < nCount; ++i )
+ {
+ if ( SfxObjectFactory::GetStandardTemplate( aServiceNames[i] ).Len() > 0 )
+ {
+ SvtModuleOptions::EFactory eFac = SvtModuleOptions::E_WRITER;
+ SvtModuleOptions::ClassifyFactoryByName( aServiceNames[i], eFac );
+ aList.push_back(aModOpt.GetFactoryEmptyDocumentURL(eFac));
+ }
+ }
+
+ return aList;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index beb3f70..af9b137 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -37,6 +37,8 @@
#define TBI_TEMPLATE_FOLDER_DEL 25
#define TBI_TEMPLATE_REPOSITORY 26
+#define MNI_ACTION_DEFAULT 27
+
#define STR_ACTION_REFRESH 263
#define STR_ACTION_SORT_NAME 264
@@ -53,5 +55,7 @@
#define MNI_REPOSITORY_NEW 275
#define MNI_REPOSITORY_BASE 276
+#define STR_ACTION_DEFAULT 277
+
#define IMG_ACTION_SORT 304
#define IMG_ACTION_REFRESH 305
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 7d06f16..0b59c6b 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -20,6 +20,11 @@ String STR_ACTION_REFRESH
Text [ en-US ] = "Refresh";
};
+String STR_ACTION_DEFAULT
+{
+ Text [ en-US ] = "Reset Default Template "; /* leave ending space */
+};
+
String STR_MOVE_NEW
{
Text [ en-US ] = "New folder";
commit 5d94560309628bcd3f04ef9c815936f45e27b3a0
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 16:16:02 2012 -0430
Hide set as default option when more than one template is selected.
Change-Id: I3291fad1455d289c35543c3b360b9fee620da3e9
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 5079b34..0fab68b 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -497,6 +497,8 @@ IMPL_LINK(SfxTemplateManagerDlg, TVTemplateStateHdl, const ThumbnailViewItem*, p
mpActionBar->Show(false);
mpTemplateBar->Show();
}
+ else
+ mpTemplateBar->HideItem(TBI_TEMPLATE_DEFAULT);
maSelTemplates.insert(pItem);
}
@@ -512,6 +514,8 @@ IMPL_LINK(SfxTemplateManagerDlg, TVTemplateStateHdl, const ThumbnailViewItem*, p
mpViewBar->Show();
mpActionBar->Show();
}
+ else if (maSelTemplates.size() == 1)
+ mpTemplateBar->ShowItem(TBI_TEMPLATE_DEFAULT);
}
}
commit aca63abb7867951ebef50a540dbbeb8e8b83435e
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Aug 8 16:03:40 2012 -0430
Implement setting a template as default.
Change-Id: I8ae47ffb38febdd467e1e557448189dd09e755bc
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 8991791..46b9b3e 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -75,6 +75,7 @@ private:
void OnTemplateEdit ();
void OnTemplateProperties ();
void OnTemplateDelete ();
+ void OnTemplateAsDefault ();
void OnFolderDelete ();
void OnRepositoryDelete ();
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 1e80c28..5079b34 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -14,6 +14,10 @@
#include "templatesearchviewitem.hxx"
#include <comphelper/processfactory.hxx>
+#include <comphelper/storagehelper.hxx>
+#include <sfx2/app.hxx>
+#include <sfx2/docfac.hxx>
+#include <sfx2/fcontnr.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatelocalview.hxx>
@@ -22,6 +26,7 @@
#include <sfx2/templateonlineviewitem.hxx>
#include <sfx2/templateviewitem.hxx>
#include <sfx2/thumbnailviewitem.hxx>
+#include <sot/storage.hxx>
#include <svtools/PlaceEditDialog.hxx>
#include <tools/urlobj.hxx>
#include <unotools/moduleoptions.hxx>
@@ -30,6 +35,8 @@
#include <vcl/toolbox.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/lang/XComponent.hpp>
@@ -54,10 +61,13 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::embed;
using namespace ::com::sun::star::frame;
void lcl_createTemplate(uno::Reference<XComponentLoader> xDesktop, const FILTER_APPLICATION eApp);
+bool lcl_getServiceName (const OUString &rFileURL, OUString &rName );
+
// Sort by name in ascending order
class SortView_Name
{
@@ -379,6 +389,9 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXTemplateHdl)
case TBI_TEMPLATE_DELETE:
OnTemplateDelete();
break;
+ case TBI_TEMPLATE_DEFAULT:
+ OnTemplateAsDefault();
+ break;
default:
break;
}
@@ -855,6 +868,19 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
}
}
+void SfxTemplateManagerDlg::OnTemplateAsDefault ()
+{
+ assert(!maSelTemplates.empty());
+
+ const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*(maSelTemplates.begin()));
+
+ OUString aServiceName;
+ if (lcl_getServiceName(pItem->getPath(),aServiceName))
+ {
+ SfxObjectFactory::SetStandardTemplate(aServiceName,pItem->getPath());
+ }
+}
+
void SfxTemplateManagerDlg::OnFolderDelete()
{
std::set<const ThumbnailViewItem*>::const_iterator pIter;
@@ -1073,4 +1099,32 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
SearchUpdateHdl(mpSearchEdit);
}
+bool lcl_getServiceName ( const OUString &rFileURL, OUString &rName )
+{
+ bool bRet = false;
+
+ if ( !rFileURL.isEmpty() )
+ {
+ try
+ {
+ uno::Reference< embed::XStorage > xStorage =
+ comphelper::OStorageHelper::GetStorageFromURL( rFileURL, embed::ElementModes::READ );
+
+ sal_uIntPtr nFormat = SotStorage::GetFormatID( xStorage );
+
+ const SfxFilter* pFilter = SFX_APP()->GetFilterMatcher().GetFilter4ClipBoardId( nFormat );
+
+ if ( pFilter )
+ {
+ rName = pFilter->GetServiceName();
+ bRet = true;
+ }
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ return bRet;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index 3336090..beb3f70 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -27,6 +27,7 @@
#define TBI_TEMPLATE_PROPERTIES 16
#define TBI_TEMPLATE_MOVE 17
#define TBI_TEMPLATE_DELETE 18
+#define TBI_TEMPLATE_DEFAULT 19
#define MNI_ACTION_REFRESH 22
#define MNI_ACTION_SORT_NAME 23
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index c5d54d3..7d06f16 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -227,6 +227,12 @@ ModelessDialog DLG_TEMPLATE_MANAGER
ToolBoxItem
{
+ Identifier = TBI_TEMPLATE_DEFAULT;
+ Text [ en-US ] = "Set as default";
+ };
+
+ ToolBoxItem
+ {
Identifier = TBI_TEMPLATE_MOVE;
Text [ en-US ] = "Move to folder" ;
};
More information about the Libreoffice-commits
mailing list