[PATCH] Add a button to create a new empty folder in template manage...
Rafael Dominguez (via Code Review)
gerrit at gerrit.libreoffice.org
Wed Mar 13 07:19:52 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2704
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/04/2704/1
Add a button to create a new empty folder in template manager.
Change-Id: I13f77790f26c972bd74dac08c0cb8fd77b049dbf
---
A icon-themes/galaxy/sfx2/imglst/actionview029.png
M sfx2/inc/sfx2/templateabstractview.hxx
M sfx2/inc/sfx2/templatelocalview.hxx
M sfx2/inc/sfx2/templateremoteview.hxx
M sfx2/inc/templatedlg.hxx
M sfx2/source/control/templateremoteview.cxx
M sfx2/source/doc/templatedlg.cxx
M sfx2/source/doc/templatedlg.hrc
M sfx2/source/doc/templatedlg.src
9 files changed, 42 insertions(+), 1 deletion(-)
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
--- /dev/null
+++ b/icon-themes/galaxy/sfx2/imglst/actionview029.png
Binary files 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
else
OnRepositoryDelete();
break;
+ case TBI_TEMPLATE_FOLDER_NEW:
+ OnFolderNew();
+ break;
case TBI_TEMPLATE_SAVE:
OnTemplateSaveAs();
break;
@@ -1111,6 +1114,20 @@
}
}
+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 @@
ImageBitmap = Bitmap { File = "actionview028.png" ; };
};
};
+
+ ToolBoxItem
+ {
+ Identifier = TBI_TEMPLATE_FOLDER_NEW;
+ Text [ en-US ] = "New folder";
+
+ ItemImage = Image
+ {
+ ImageBitmap = Bitmap { File = "actionview029.png"; };
+ };
+ };
};
};
--
To view, visit https://gerrit.libreoffice.org/2704
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I13f77790f26c972bd74dac08c0cb8fd77b049dbf
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Rafael Dominguez <venccsralph at gmail.com>
More information about the LibreOffice
mailing list