Kaydet (Commit) 9a4d86a0 authored tarafından Efe Gürkan YALAMAN's avatar Efe Gürkan YALAMAN Kaydeden (comit) Jan Holesovsky

Some folder features moved to backingwindow

Create new folder and delete a folder moved from template manager dialog
to startcenter.

Change-Id: If89b9fd7ee499f7fccda08d3ac989728148a24a0
üst f689f13c
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include "backingwindow.hxx" #include "backingwindow.hxx"
#include "inputdlg.hxx"
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
//well find a better way for it. //FIXME:well find a better way for it.
#include "../doc/doc.hrc" #include "../doc/doc.hrc"
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -593,6 +594,56 @@ void BackingWindow::OnTemplateImport () ...@@ -593,6 +594,56 @@ void BackingWindow::OnTemplateImport ()
} }
} }
void BackingWindow::OnFolderDelete()
{
QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, SfxResId(STR_QMSG_SEL_FOLDER_DELETE).toString());
if ( aQueryDlg.Execute() == RET_NO )
return;
OUString aFolderList;
std::set<const ThumbnailViewItem*,selection_cmp_fn>::const_iterator pIter;
std::set<const ThumbnailViewItem*,selection_cmp_fn> aSelFolders = maSelFolders; //Copy to avoid invalidating an iterator
for (pIter = aSelFolders.begin(); pIter != aSelFolders.end(); ++pIter)
{
if (!mpLocalView->removeRegion((*pIter)->mnId))
{
if (aFolderList.isEmpty())
aFolderList = (*pIter)->maTitle;
else
aFolderList = aFolderList + "\n" + (*pIter)->maTitle;
++pIter;
if (pIter == aSelFolders.end())
break;
}
}
if (!aFolderList.isEmpty())
{
OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_FOLDER).toString() );
ErrorBox(this, WB_OK,aMsg.replaceFirst("$1",aFolderList)).Execute();
}
}
void BackingWindow::OnFolderNew()
{
InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
int ret = dlg.Execute();
if (ret)
{
OUString aName = dlg.getEntryText();
mpCurrentView->createRegion(aName);
}
}
void BackingWindow::OnRegionState (const ThumbnailViewItem *pItem) void BackingWindow::OnRegionState (const ThumbnailViewItem *pItem)
{ {
if (pItem->isSelected()) if (pItem->isSelected())
...@@ -729,15 +780,15 @@ IMPL_LINK_NOARG(BackingWindow,TBXViewHdl) ...@@ -729,15 +780,15 @@ IMPL_LINK_NOARG(BackingWindow,TBXViewHdl)
if (nCurItemId == mpViewBar->GetItemId("import")) if (nCurItemId == mpViewBar->GetItemId("import"))
OnTemplateImport(); OnTemplateImport();
//else if (nCurItemId == mpViewBar->GetItemId("delete")) else if (nCurItemId == mpViewBar->GetItemId("delete"))
//{ {
//if (mpCurView == mpLocalView) if (mpCurrentView == mpLocalView)
////OnFolderDelete(); OnFolderDelete();
//else //else
////OnRepositoryDelete(); ////OnRepositoryDelete();
//} }
//else if (nCurItemId == mpViewBar->GetItemId("new_folder")) else if (nCurItemId == mpViewBar->GetItemId("new_folder"))
////OnFolderNew(); OnFolderNew();
//else if (nCurItemId == mpViewBar->GetItemId("save")) //else if (nCurItemId == mpViewBar->GetItemId("save"))
////OnTemplateSaveAs(); ////OnTemplateSaveAs();
......
...@@ -98,6 +98,10 @@ class BackingWindow ...@@ -98,6 +98,10 @@ class BackingWindow
void setupButton( PushButton* pButton ); void setupButton( PushButton* pButton );
void OnTemplateImport (); void OnTemplateImport ();
void OnFolderNew ();
void OnFolderDelete ();
void OnRegionState (const ThumbnailViewItem *pItem); void OnRegionState (const ThumbnailViewItem *pItem);
void dispatchURL( const OUString& i_rURL, void dispatchURL( const OUString& i_rURL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment