[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 3 commits - fpicker/source include/svtools svtools/source
Szymon Kłos
eszkadev at gmail.com
Fri Jul 3 10:47:33 PDT 2015
fpicker/source/office/fpdialogbase.hxx | 113 +++++++++++++++++++++++++++
fpicker/source/office/iodlg.hxx | 74 -----------------
include/svtools/RemoteFilesDialog.hxx | 6 -
svtools/source/dialogs/RemoteFilesDialog.cxx | 32 +++++--
4 files changed, 137 insertions(+), 88 deletions(-)
New commits:
commit 51832130a8c0c71efc3253fb22e077a37def37ec
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 3 15:01:21 2015 +0200
Implemented GetPathList method, opening of the multiple files
Change-Id: I79eb5178dc9b740e6ebaa9e8069fc2a144d4627d
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index 29668ad..3c728cd 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -850,10 +850,17 @@ const OUString& RemoteFilesDialog::GetPath()
std::vector<OUString> RemoteFilesDialog::GetPathList() const
{
- // TODO
- std::vector<OUString> aPaths;
- aPaths.push_back(m_sPath);
- return aPaths;
+ std::vector<OUString> aList;
+ sal_uLong nCount = m_pFileView->GetSelectionCount();
+ SvTreeListEntry* pEntry = nCount ? m_pFileView->FirstSelected() : NULL;
+
+ while( pEntry )
+ {
+ aList.push_back( SvtFileView::GetURL( pEntry ) );
+ pEntry = m_pFileView->NextSelected( pEntry );
+ }
+
+ return aList;
}
bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL )
commit d288210eb9dd2f77ffa01c392dea03b1b9ea8f03
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 3 14:52:14 2015 +0200
RemoteFilesDialog: blacklist
Change-Id: Ia8e87bdf4a5540a25dd1399090edfbf3af63a6da
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index 729a226..29668ad 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -15,6 +15,7 @@ class FolderTree : public SvTreeListBox
private:
Reference< XCommandEnvironment > m_xEnv;
::osl::Mutex m_aMutex;
+ Sequence< OUString > m_aBlackList;
public:
FolderTree( vcl::Window* pParent, WinBits nBits )
@@ -46,10 +47,9 @@ public:
if( pURL )
{
FolderDescriptor aFolder( *pURL );
- Sequence< OUString > aBlackList;
EnumerationResult eResult =
- pContentEnumerator->enumerateFolderContentSync( aFolder, aBlackList );
+ pContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList );
if ( SUCCESS == eResult )
{
@@ -114,6 +114,11 @@ public:
break;
}
}
+
+ void SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList )
+ {
+ m_aBlackList = rBlackList;
+ }
};
class FileViewContainer : public vcl::Window
@@ -493,11 +498,10 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString sURL )
if( m_pFileView )
{
- OUStringList BlackList;
OUString sFilter = GetCurFilter();
m_pFileView->EndInplaceEditing( false );
- eResult = m_pFileView->Initialize( sURL, sFilter, NULL, BlackList );
+ eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
if( eResult == eSuccess )
{
@@ -756,6 +760,7 @@ void RemoteFilesDialog::SetHasFilename( bool )
void RemoteFilesDialog::SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList )
{
m_aBlackList = rBlackList;
+ m_pTreeView->SetBlackList( rBlackList );
}
const ::com::sun::star::uno::Sequence< OUString >& RemoteFilesDialog::GetBlackList() const
commit 915bb98cdf302f6ec78b173e4ad966e43a98522f
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 3 14:35:18 2015 +0200
SvtFileDialog_Base in new file
Change-Id: I42189e9ca1c645104f8f5da381cbbb2098c8a0c2
diff --git a/fpicker/source/office/fpdialogbase.hxx b/fpicker/source/office/fpdialogbase.hxx
new file mode 100644
index 0000000..7812737
--- /dev/null
+++ b/fpicker/source/office/fpdialogbase.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_FPICKER_SOURCE_OFFICE_FPDIALOGBASE_HXX
+#define INCLUDED_FPICKER_SOURCE_OFFICE_FPDIALOGBASE_HXX
+
+#include <vcl/dialog.hxx>
+#include <com/sun/star/beans/StringPair.hpp>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include "svl/inettype.hxx"
+#include "asyncfilepicker.hxx"
+#include "OfficeControlAccess.hxx"
+#include "fpsmartcontent.hxx"
+
+#include <set>
+
+// @@@ using namespace com::sun::star::ucb;
+
+
+
+class SvTabListBox;
+class SvtFileView;
+class SvtFileDialogFilter_Impl;
+
+
+#define SFXWB_INSERT ( 0x04000000L | WB_OPEN )
+#define SFXWB_PASSWORD WB_PASSWORD
+#define SFXWB_READONLY WB_READONLY
+#define SFXWB_PATHDIALOG WB_PATH
+#define SFXWB_CLASSPATH ( 0x08000000L | SFXWB_PATHDIALOG )
+#define SFXWB_MULTISELECTION 0x20000000L // activate Multiselection
+#define SFXWB_NOREMOTE 0x40000000L
+
+#define SFX_EXTRA_AUTOEXTENSION 0x00000001L
+#define SFX_EXTRA_FILTEROPTIONS 0x00000002L
+#define SFX_EXTRA_SHOWVERSIONS 0x00000004L
+#define SFX_EXTRA_INSERTASLINK 0x00000008L
+#define SFX_EXTRA_SHOWPREVIEW 0x00000010L
+#define SFX_EXTRA_TEMPLATES 0x00000020L
+#define SFX_EXTRA_PLAYBUTTON 0x00000040L
+#define SFX_EXTRA_SELECTION 0x00000080L
+#define SFX_EXTRA_IMAGE_TEMPLATE 0x00000100L
+
+#define FILEDIALOG_FILTER_ALL "*.*"
+
+// SvtFileDialog_Base
+
+class SvtFileDialog_Base : public ModalDialog, public ::svt::IFilePickerController
+{
+public:
+ SvtFileDialog_Base( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription )
+ : ModalDialog( pParent, rID, rUIXMLDescription )
+ {
+ }
+
+ virtual SvtFileView* GetView() = 0;
+
+ virtual void SetHasFilename( bool bHasFilename ) = 0;
+ virtual void SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList ) = 0;
+ virtual const ::com::sun::star::uno::Sequence< OUString >& GetBlackList() const = 0;
+ virtual void SetStandardDir( const OUString& rStdDir ) = 0;
+ virtual const OUString& GetStandardDir() const = 0;
+ virtual void SetPath( const OUString& rNewURL ) = 0;
+ virtual const OUString& GetPath() = 0;
+ virtual std::vector<OUString> GetPathList() const = 0;
+ virtual bool ContentIsFolder( const OUString& rURL ) = 0;
+
+ virtual void AddFilter( const OUString& rFilter, const OUString& rType ) = 0;
+ virtual void AddFilterGroup( const OUString& _rFilter,
+ const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters ) = 0;
+ virtual OUString GetCurFilter() const = 0;
+ virtual void SetCurFilter( const OUString& rFilter ) = 0;
+
+ virtual void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) = 0;
+
+ virtual void EnableAutocompletion( bool _bEnable = true ) = 0;
+
+ virtual sal_Int32 getTargetColorDepth() = 0;
+ virtual sal_Int32 getAvailableWidth() = 0;
+ virtual sal_Int32 getAvailableHeight() = 0;
+
+ virtual void setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& rImage ) = 0;
+
+ virtual bool getShowState() = 0;
+};
+
+#define FILE_SELECTION_CHANGED 1
+#define DIRECTORY_CHANGED 2
+#define HELP_REQUESTED 3
+#define CTRL_STATE_CHANGED 4
+#define DIALOG_SIZE_CHANGED 5
+
+
+#endif // INCLUDED_FPICKER_SOURCE_OFFICE_IODLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 99df28b..2312a0a 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -39,6 +39,7 @@
#include "fpsmartcontent.hxx"
#include <comphelper/configuration.hxx>
#include <comphelper/processfactory.hxx>
+#include "fpdialogbase.hxx"
#include <set>
@@ -50,69 +51,6 @@ class SvTabListBox;
class SvtFileView;
class SvtFileDialogFilter_Impl;
-
-
-#define SFXWB_INSERT ( 0x04000000L | WB_OPEN )
-#define SFXWB_PASSWORD WB_PASSWORD
-#define SFXWB_READONLY WB_READONLY
-#define SFXWB_PATHDIALOG WB_PATH
-#define SFXWB_CLASSPATH ( 0x08000000L | SFXWB_PATHDIALOG )
-#define SFXWB_MULTISELECTION 0x20000000L // activate Multiselection
-#define SFXWB_NOREMOTE 0x40000000L
-
-#define SFX_EXTRA_AUTOEXTENSION 0x00000001L
-#define SFX_EXTRA_FILTEROPTIONS 0x00000002L
-#define SFX_EXTRA_SHOWVERSIONS 0x00000004L
-#define SFX_EXTRA_INSERTASLINK 0x00000008L
-#define SFX_EXTRA_SHOWPREVIEW 0x00000010L
-#define SFX_EXTRA_TEMPLATES 0x00000020L
-#define SFX_EXTRA_PLAYBUTTON 0x00000040L
-#define SFX_EXTRA_SELECTION 0x00000080L
-#define SFX_EXTRA_IMAGE_TEMPLATE 0x00000100L
-
-#define FILEDIALOG_FILTER_ALL "*.*"
-
-// SvtFileDialog_Base
-
-class SvtFileDialog_Base : public ModalDialog, public ::svt::IFilePickerController
-{
-public:
- SvtFileDialog_Base( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription )
- : ModalDialog( pParent, rID, rUIXMLDescription )
- {
- }
-
- virtual SvtFileView* GetView() = 0;
-
- virtual void SetHasFilename( bool bHasFilename ) = 0;
- virtual void SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList ) = 0;
- virtual const ::com::sun::star::uno::Sequence< OUString >& GetBlackList() const = 0;
- virtual void SetStandardDir( const OUString& rStdDir ) = 0;
- virtual const OUString& GetStandardDir() const = 0;
- virtual void SetPath( const OUString& rNewURL ) = 0;
- virtual const OUString& GetPath() = 0;
- virtual std::vector<OUString> GetPathList() const = 0;
- virtual bool ContentIsFolder( const OUString& rURL ) = 0;
-
- virtual void AddFilter( const OUString& rFilter, const OUString& rType ) = 0;
- virtual void AddFilterGroup( const OUString& _rFilter,
- const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters ) = 0;
- virtual OUString GetCurFilter() const = 0;
- virtual void SetCurFilter( const OUString& rFilter ) = 0;
-
- virtual void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) = 0;
-
- virtual void EnableAutocompletion( bool _bEnable = true ) = 0;
-
- virtual sal_Int32 getTargetColorDepth() = 0;
- virtual sal_Int32 getAvailableWidth() = 0;
- virtual sal_Int32 getAvailableHeight() = 0;
-
- virtual void setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& rImage ) = 0;
-
- virtual bool getShowState() = 0;
-};
-
// SvtFileDialog
@@ -467,16 +405,6 @@ inline SvtFileView* SvtFileDialog::GetView()
}
-
-
-
-#define FILE_SELECTION_CHANGED 1
-#define DIRECTORY_CHANGED 2
-#define HELP_REQUESTED 3
-#define CTRL_STATE_CHANGED 4
-#define DIALOG_SIZE_CHANGED 5
-
-
#endif // INCLUDED_FPICKER_SOURCE_OFFICE_IODLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/RemoteFilesDialog.hxx b/include/svtools/RemoteFilesDialog.hxx
index 43844ae..44236d7 100644
--- a/include/svtools/RemoteFilesDialog.hxx
+++ b/include/svtools/RemoteFilesDialog.hxx
@@ -38,7 +38,7 @@
#include <vector>
-#include "../../../fpicker/source/office/iodlg.hxx"
+#include "../../../fpicker/source/office/fpdialogbase.hxx"
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
@@ -48,10 +48,6 @@ using namespace ::com::sun::star::ui::dialogs;
using namespace ::comphelper;
using namespace ::svt;
-#define WB_MULTISELECTION 0x20000000L
-
-#define FILTER_ALL "*.*"
-
enum SvtRemoteDlgMode
{
REMOTEDLG_MODE_OPEN = 0,
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index f4821ee..729a226 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -245,7 +245,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_eMode = ( nBits & WB_SAVEAS ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN;
m_eType = ( nBits & WB_PATH ) ? REMOTEDLG_TYPE_PATHDLG : REMOTEDLG_TYPE_FILEDLG;
- m_bMultiselection = ( nBits & WB_MULTISELECTION ) ? true : false;
+ m_bMultiselection = ( nBits & SFXWB_MULTISELECTION ) ? true : false;
m_bIsUpdated = false;
m_nCurrentFilter = LISTBOX_ENTRY_NOTFOUND;
@@ -799,7 +799,7 @@ OUString RemoteFilesDialog::GetCurFilter() const
}
else
{
- sFilter = FILTER_ALL;
+ sFilter = FILEDIALOG_FILTER_ALL;
}
return sFilter;
More information about the Libreoffice-commits
mailing list