[Libreoffice-commits] core.git: icon-themes/galaxy sfx2/inc sfx2/source

Rafael Dominguez venccsralph at gmail.com
Wed Mar 13 08:52:23 PDT 2013


 icon-themes/galaxy/sfx2/imglst/actionview029.png |binary
 sfx2/inc/sfx2/templateabstractview.hxx           |    2 ++
 sfx2/inc/sfx2/templatelocalview.hxx              |    2 +-
 sfx2/inc/sfx2/templateremoteview.hxx             |    2 ++
 sfx2/inc/templatedlg.hxx                         |    1 +
 sfx2/source/control/templateremoteview.cxx       |    6 ++++++
 sfx2/source/doc/templatedlg.cxx                  |   17 +++++++++++++++++
 sfx2/source/doc/templatedlg.hrc                  |    2 ++
 sfx2/source/doc/templatedlg.src                  |   11 +++++++++++
 9 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit 8d5c061cd66c2a0d41ceda7b61cacef1365f7c4f
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Mar 13 09:44:56 2013 -0430

    Add a button to create a new empty folder in template manager.
    
    Change-Id: I13f77790f26c972bd74dac08c0cb8fd77b049dbf
    Reviewed-on: https://gerrit.libreoffice.org/2704
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/icon-themes/galaxy/sfx2/imglst/actionview029.png b/icon-themes/galaxy/sfx2/imglst/actionview029.png
new file mode 100644
index 0000000..69d60ce
Binary files /dev/null and b/icon-themes/galaxy/sfx2/imglst/actionview029.png differ
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 90dba09..bfbd2aa 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -87,6 +87,8 @@ public:
 
     virtual void filterTemplatesByApp (const FILTER_APPLICATION &eApp);
 
+    virtual sal_uInt16 createRegion (const OUString &rName) = 0;
+
     void showOverlay (bool bVisible);
 
     void setItemDimensions (long ItemWidth, long ThumbnailHeight, long DisplayHeight, int itemPadding);
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index 432b008..5fc14c9 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -42,7 +42,7 @@ public:
     std::vector<TemplateItemProperties>
         getFilteredItems (const boost::function<bool (const TemplateItemProperties&) > &rFunc) const;
 
-    sal_uInt16 createRegion (const OUString &rName);
+    virtual sal_uInt16 createRegion (const OUString &rName);
 
     bool removeRegion (const sal_uInt16 nItemId);
 
diff --git a/sfx2/inc/sfx2/templateremoteview.hxx b/sfx2/inc/sfx2/templateremoteview.hxx
index b760f00..34da085 100644
--- a/sfx2/inc/sfx2/templateremoteview.hxx
+++ b/sfx2/inc/sfx2/templateremoteview.hxx
@@ -27,6 +27,8 @@ public:
 
     bool loadRepository (TemplateRepository* pRepository, bool bRefresh);
 
+    virtual sal_uInt16 createRegion (const OUString &rName);
+
 private:
 
     com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 1cc9ae5..53a70ff 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -84,6 +84,7 @@ private:
     void OnTemplateDelete ();
     void OnTemplateAsDefault ();
     void OnTemplateExport ();
+    void OnFolderNew ();
     void OnFolderDelete ();
     void OnRepositoryDelete ();
     void OnTemplateSaveAs ();
diff --git a/sfx2/source/control/templateremoteview.cxx b/sfx2/source/control/templateremoteview.cxx
index acf0703..b67b8aa 100644
--- a/sfx2/source/control/templateremoteview.cxx
+++ b/sfx2/source/control/templateremoteview.cxx
@@ -156,4 +156,10 @@ bool TemplateRemoteView::loadRepository (TemplateRepository* pItem, bool bRefres
     return true;
 }
 
+sal_uInt16 TemplateRemoteView::createRegion(const OUString &/*rName*/)
+{
+    // TODO: Create new folder in current remote repository
+    return 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 8826ccc..c2bbf7c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -374,6 +374,9 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXViewHdl)
         else
             OnRepositoryDelete();
         break;
+    case TBI_TEMPLATE_FOLDER_NEW:
+        OnFolderNew();
+        break;
     case TBI_TEMPLATE_SAVE:
         OnTemplateSaveAs();
         break;
@@ -1111,6 +1114,20 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault ()
     }
 }
 
+void SfxTemplateManagerDlg::OnFolderNew()
+{
+    InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+
+    int ret = dlg.Execute();
+
+    if (ret)
+    {
+        OUString aName = dlg.getEntryText();
+
+        mpCurView->createRegion(aName);
+    }
+}
+
 void SfxTemplateManagerDlg::OnFolderDelete()
 {
     QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, SfxResId(STR_QMSG_SEL_FOLDER_DELETE).toString());
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index 7eeca35..b56cb52 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -41,6 +41,8 @@
 
 #define TBI_TEMPLATE_SAVE           28
 
+#define TBI_TEMPLATE_FOLDER_NEW     29
+
 #define STR_ACTION_REFRESH          263
 #define STR_ACTION_SORT_NAME        264
 
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 8446d62..fcd53bc 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -230,6 +230,17 @@ ModelessDialog DLG_TEMPLATE_MANAGER
                     ImageBitmap = Bitmap { File = "actionview028.png" ; };
                 };
             };
+
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_FOLDER_NEW;
+                Text [ en-US ] = "New folder";
+
+                ItemImage = Image
+                {
+                    ImageBitmap = Bitmap { File = "actionview029.png"; };
+                };
+            };
         };
     };
 


More information about the Libreoffice-commits mailing list