Kaydet (Commit) 5e301969 authored tarafından Martin Richard's avatar Martin Richard Kaydeden (comit) Cédric Bosdonnat

fpicker: a list of bookmarks in the file picker

under dual licences MPLv1+/LGPLv3+

Authors:
  Martin Richard <martius@martiusweb.net>
  Julien Levesy <jlevesy@gmail.com>
üst 149650b0
......@@ -60,6 +60,8 @@ $(eval $(call gb_Library_add_exception_objects,fps_office,\
fpicker/source/office/OfficeControlAccess \
fpicker/source/office/OfficeFilePicker \
fpicker/source/office/OfficeFolderPicker \
fpicker/source/office/PlacesListBox \
fpicker/source/office/SvtPlaceDialog \
))
# vim: set noet sw=4 ts=4:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* [ Copyright (C) 2011 Cedric Bosdonnat <cbosdonnat@suse.com> (initial developer) ]
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#include <iodlg.hrc>
#include <PlacesListBox.hxx>
#include "SvtPlaceDialog.hxx"
#include <vcl/msgbox.hxx>
#include <svtools/svtdata.hxx>
namespace css = com::sun::star;
using rtl::OUString;
PlacesListBox::PlacesListBox( SvtFileDialog* pFileDlg, const ResId& rResId ) :
ListBox( pFileDlg, rResId ),
maPlaces( ),
mpDlg( pFileDlg ),
mnNbEditables( 0 ),
mbUpdated( false )
{
SetSelectHdl( LINK( this, PlacesListBox, SelectHdl ) );
SetDoubleClickHdl( LINK( this, PlacesListBox, DoubleClickHdl ) ) ;
}
PlacesListBox::~PlacesListBox( )
{
}
void PlacesListBox::AppendPlace( PlacePtr pPlace )
{
maPlaces.push_back( pPlace );
InsertEntry( pPlace->GetName( ), getEntryIcon( pPlace->GetType( ) ));
if(pPlace->IsEditable()) {
++mnNbEditables;
mbUpdated = true;
}
}
sal_Int32 PlacesListBox::GetNbPlaces() {
return maPlaces.size();
}
sal_Int32 PlacesListBox::GetNbEditablePlaces() {
return mnNbEditables;
}
bool PlacesListBox::IsUpdated() {
if(mbUpdated) {
mbUpdated = false;
return true;
}
return false;
}
const std::vector<PlacePtr>& PlacesListBox::GetPlaces() {
return maPlaces;
}
void PlacesListBox::RemovePlace( sal_uInt16 nPos )
{
if ( nPos < maPlaces.size() )
{
if(maPlaces[nPos]->IsEditable()) {
--mnNbEditables;
mbUpdated = true;
}
maPlaces.erase( maPlaces.begin() + nPos );
RemoveEntry( nPos );
}
}
void PlacesListBox::RemoveSelectedPlace() {
RemovePlace(GetSelectEntryPos());
}
Image PlacesListBox::getEntryIcon(Place::ePlaceType aType)
{
Image theImage;
switch (aType) {
case Place::e_PlaceCmis:
theImage = mpDlg->GetButtonImage( IMG_FILEDLG_BTN_UP );
break;
case Place::e_PlaceFtp:
theImage = mpDlg->GetButtonImage( IMG_FILEDLG_BTN_UP );
break;
case Place::e_PlaceLocal:
default:
theImage = mpDlg->GetButtonImage( IMG_FILEDLG_BTN_UP );
break;
};
return theImage;
}
IMPL_LINK( PlacesListBox, SelectHdl, ListBox* , EMPTYARG )
{
sal_uInt16 nSelected = GetSelectEntryPos();
PlacePtr pPlace = maPlaces[nSelected];
mpDlg->OpenURL_Impl( pPlace->GetUrl() );
if(pPlace->IsEditable())
mpDlg->RemovablePlaceSelected();
else
mpDlg->RemovablePlaceSelected(false);
return 0;
}
IMPL_LINK ( PlacesListBox, DoubleClickHdl, ListBox*, EMPTYARG )
{
sal_uInt16 nSelected = GetSelectEntryPos();
PlacePtr pPlace = maPlaces[nSelected];
if ( pPlace->IsEditable() == true )
{
SvtPlaceDialog aDlg(mpDlg,pPlace);
short aRetCode = aDlg.Execute();
switch(aRetCode) {
case RET_OK :
{
pPlace->SetName ( aDlg.GetServerName() );
pPlace->SetUrl( aDlg.GetServerUrl() );
break;
}
case RET_NO :
{
RemovePlace(nSelected);
break;
}
default:
break;
};
}
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* [ Copyright (C) 2011 Cedric Bosdonnat <cbosdonnat@suse.com> (initial developer) ]
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef _PLACESLISTBOX_HXX_
#define _PLACESLISTBOX_HXX_
#include <iodlg.hxx>
#include <vcl/lstbox.hxx>
#include <boost/shared_ptr.hpp>
#include <vector>
/** Class representing a file location: it mainly consist of display attributes and a URL.
*/
class Place
{
public:
enum ePlaceType {
e_PlaceLocal = 0,
e_PlaceFtp,
e_PlaceCmis
};
private:
rtl::OUString msName;
rtl::OUString msUrl;
ePlaceType meType;
sal_Bool mbEditable;
public:
Place( rtl::OUString sName, rtl::OUString sUrl, ePlaceType eType, sal_Bool bEditable = false) :
msName( sName ),
msUrl( sUrl ),
meType( eType ),
mbEditable( bEditable ) {};
~Place( ) {};
Place( const Place& rCopy ) : msName( rCopy.msName ), msUrl( rCopy.msUrl ), meType( rCopy.meType ){ };
void SetName(const rtl::OUString& aName ) { msName = aName; }
void SetUrl(const rtl::OUString& aUrl ) { msUrl = aUrl; }
rtl::OUString& GetName( ) { return msName; }
rtl::OUString& GetUrl( ) { return msUrl; }
ePlaceType& GetType( ) { return meType; }
sal_Bool& IsEditable( ) { return mbEditable; }
};
typedef boost::shared_ptr< Place > PlacePtr;
/** ListBox to handle Places.
*/
class PlacesListBox : public ListBox
{
private:
std::vector< PlacePtr > maPlaces;
SvtFileDialog* mpDlg;
sal_Int32 mnNbEditables;
bool mbUpdated;
public:
PlacesListBox( SvtFileDialog* pFileDlg, const ResId& rResId );
~PlacesListBox( );
void AppendPlace( PlacePtr pPlace );
void RemovePlace( sal_uInt16 nPos );
void RemoveSelectedPlace();
sal_Int32 GetNbPlaces();
sal_Int32 GetNbEditablePlaces();
bool IsUpdated();
const std::vector<PlacePtr>& GetPlaces();
private:
Image getEntryIcon( Place::ePlaceType eType);
DECL_LINK( SelectHdl, ListBox* );
DECL_LINK( DoubleClickHdl, ListBox* );
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* [ Copyright (C) 2012 Julien Levesy <jlevesy@gmail.com> (initial developer) ]
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#include "iodlg.hrc"
#include <svtools/svtools.hrc>
#include <vcl/msgbox.hxx>
#include "fpsofficeResMgr.hxx"
#include "PlacesListBox.hxx"
#include "SvtPlaceDialog.hxx"
SvtPlaceDialog::SvtPlaceDialog( Window* pParent ) :
ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ),
m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ),
m_aFTServerName( this, SvtResId( FT_ADDPLACE_SERVERNAME ) ),
m_aFTServerType( this, SvtResId( FT_ADDPLACE_SERVERTYPE ) ),
m_aFTServerLogin( this, SvtResId( FT_ADDPLACE_SERVERLOGIN ) ),
m_aFTServerPassword( this, SvtResId( FT_ADDPLACE_SERVERPASSWORD) ),
m_aEDServerUrl ( this, SvtResId( ED_ADDPLACE_SERVERURL ) ),
m_aEDServerName ( this, SvtResId( ED_ADDPLACE_SERVERNAME ) ),
m_aEDServerType ( this, SvtResId( ED_ADDPLACE_SERVERTYPE ) ),
m_aEDServerLogin ( this, SvtResId( ED_ADDPLACE_SERVERLOGIN ) ),
m_aEDServerPassword ( this, SvtResId( ED_ADDPLACE_SERVERPASSWORD ) ),
m_aBTOk( this, SvtResId( BT_ADDPLACE_OK ) ),
m_aBTCancel ( this, SvtResId ( BT_ADDPLACE_CANCEL ) ),
m_aBTDelete ( this, SvtResId (BT_ADDPLACE_DELETE ) )
{
// This constructor is called when user request a place creation, so
// delete button is hidden.
m_aBTOk.SetClickHdl( LINK( this, SvtPlaceDialog, OKHdl) );
m_aBTOk.Enable( sal_False );
m_aEDServerName.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
m_aEDServerUrl.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
m_aEDServerUrl.SetUrlFilter( &m_UrlFilter );
Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) );
m_aEDServerUrl.SetPosSizePixel( aDummyEdit.GetPosPixel(), aDummyEdit.GetSizePixel() );
m_aEDServerUrl.Show();
m_aBTDelete.Hide();
}
SvtPlaceDialog::SvtPlaceDialog( Window* pParent, PlacePtr pPlace ) :
ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ),
m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ),
m_aFTServerName( this, SvtResId( FT_ADDPLACE_SERVERNAME ) ),
m_aFTServerType( this, SvtResId( FT_ADDPLACE_SERVERTYPE ) ),
m_aFTServerLogin( this, SvtResId( FT_ADDPLACE_SERVERLOGIN ) ),
m_aFTServerPassword( this, SvtResId( FT_ADDPLACE_SERVERPASSWORD) ),
m_aEDServerUrl ( this, SvtResId( ED_ADDPLACE_SERVERURL ) ),
m_aEDServerName ( this, SvtResId( ED_ADDPLACE_SERVERNAME ) ),
m_aEDServerType ( this, SvtResId( ED_ADDPLACE_SERVERTYPE ) ),
m_aEDServerLogin ( this, SvtResId( ED_ADDPLACE_SERVERLOGIN ) ),
m_aEDServerPassword ( this, SvtResId( ED_ADDPLACE_SERVERPASSWORD ) ),
m_aBTOk( this, SvtResId( BT_ADDPLACE_OK ) ),
m_aBTCancel ( this, SvtResId ( BT_ADDPLACE_CANCEL ) ),
m_aBTDelete ( this, SvtResId (BT_ADDPLACE_DELETE ) )
{
m_aBTOk.SetClickHdl( LINK( this, SvtPlaceDialog, OKHdl) );
m_aBTDelete.SetClickHdl ( LINK( this, SvtPlaceDialog, DelHdl) );
m_aEDServerName.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
m_aEDServerUrl.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
m_aEDServerUrl.SetUrlFilter( &m_UrlFilter );
Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) );
m_aEDServerUrl.SetPosSizePixel( aDummyEdit.GetPosPixel(), aDummyEdit.GetSizePixel() );
m_aEDServerUrl.Show();
m_aEDServerName.SetText( pPlace->GetName() );
m_aEDServerUrl.SetText( pPlace->GetUrl() );
}
SvtPlaceDialog::~SvtPlaceDialog()
{
}
PlacePtr SvtPlaceDialog::GetPlace()
{
PlacePtr newPlace( new Place( m_aEDServerName.GetText(), m_aEDServerUrl.GetURL(), Place::e_PlaceLocal, true) );
return newPlace;
}
IMPL_LINK ( SvtPlaceDialog, OKHdl, Button *, EMPTYARG )
{
EndDialog( RET_OK );
return 1;
}
IMPL_LINK ( SvtPlaceDialog, DelHdl, Button *, EMPTYARG )
{
// ReUsing existing symbols...
EndDialog( RET_NO );
return 1;
}
IMPL_LINK ( SvtPlaceDialog, EditHdl, Edit *, EMPTYARG )
{
String anUrl = m_aEDServerUrl.GetText();
anUrl.EraseLeadingChars().EraseTrailingChars();
String aName = m_aEDServerName.GetText();
aName.EraseLeadingChars().EraseTrailingChars();
if ( ( anUrl.Len() ) && ( aName.Len() ) )
{
if ( !m_aBTOk.IsEnabled() )
m_aBTOk.Enable( sal_True );
}
else
{
if ( m_aBTOk.IsEnabled() )
m_aBTOk.Enable( sal_False );
}
return 1;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* [ Copyright (C) 2012 Julien Levesy <jlevesy@gmail.com> (initial developer) ]
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef _SVTPLACEDIALOG_HXX
#define _SVTPLACEDIALOG_HXX
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
#include <svtools/inettbc.hxx>
#include <svl/restrictedpaths.hxx>
class Place;
class SvtPlaceDialog : public ModalDialog
{
private :
FixedText m_aFTServerUrl;
FixedText m_aFTServerName;
FixedText m_aFTServerType;
FixedText m_aFTServerLogin;
FixedText m_aFTServerPassword;
SvtURLBox m_aEDServerUrl;
Edit m_aEDServerName;
Edit m_aEDServerType;
Edit m_aEDServerLogin;
Edit m_aEDServerPassword;
OKButton m_aBTOk;
CancelButton m_aBTCancel;
PushButton m_aBTDelete;
::svt::RestrictedPaths m_UrlFilter;
DECL_LINK( OKHdl, Button *);
DECL_LINK ( DelHdl, Button *);
DECL_LINK ( EditHdl, Edit *);
public :
SvtPlaceDialog( Window* pParent);
SvtPlaceDialog( Window* pParent, PlacePtr pPlace );
~SvtPlaceDialog();
// Returns a place instance with given informations
PlacePtr GetPlace();
rtl::OUString GetServerName() { return m_aEDServerName.GetText(); }
rtl::OUString GetServerUrl() { return m_aEDServerUrl.GetText(); }
};
#endif //_SVTPLACEDIALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* [ Copyright (C) 2012 Cédric Bosdonnat <cbosdonnat@suse.com> (initial developer) ]
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef _FPS_OFFICE_RESMGR_HXX_
#define _FPS_OFFICE_RESMGR_HXX_
#include <rtl/instance.hxx>
#include <tools/resmgr.hxx>
namespace
{
struct ResMgrHolder
{
ResMgr * operator ()()
{
return ResMgr::CreateResMgr ("fps_office");
}
static ResMgr * getOrCreate()
{
return rtl_Instance<
ResMgr, ResMgrHolder,
osl::MutexGuard, osl::GetGlobalMutex >::create (
ResMgrHolder(), osl::GetGlobalMutex());
}
};
struct SvtResId : public ResId
{
SvtResId (sal_uInt16 nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {}
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
......@@ -33,7 +33,7 @@
// ModalDialog DLG_SVT_EXPLORERFILE
#define FT_EXPLORERFILE_CURRENTPATH 10
#define ED_EXPLORERFILE_CURRENTPATH 10
#define BTN_EXPLORERFILE_NEWFOLDER 11
#define BTN_EXPLORERFILE_UP 12
#define BTN_EXPLORERFILE_STANDARD 13
......@@ -59,6 +59,11 @@
#define CB_AUTO_EXTENSION 42
#define CB_OPTIONS 43
#define LB_EXPLORERFILE_PLACES_LISTBOX 50
#define BTN_EXPLORERFILE_CONNECT_TO_SERVER 51
#define BTN_EXPLORERFILE_ADD_PLACE 52
#define BTN_EXPLORERFILE_REMOVE_PLACE 53
// -----------------------------------------------
#define STR_EXPLORERFILE_OPEN 1
......@@ -68,7 +73,24 @@
#define STR_PATHSELECT 5
#define STR_BUTTONSELECT 6
#define STR_ACTUALVERSION 7
#define STR_PREVIEW 8
#define STR_PREVIEW 8
#define STR_MY_DOCUMENTS 9
// DLG_SVT_ADDPLACE ------------------------------
#define FT_ADDPLACE_SERVERURL 10
#define FT_ADDPLACE_SERVERNAME 11
#define FT_ADDPLACE_SERVERTYPE 12
#define FT_ADDPLACE_SERVERLOGIN 13
#define FT_ADDPLACE_SERVERPASSWORD 14
#define ED_ADDPLACE_SERVERURL 15
#define ED_ADDPLACE_SERVERNAME 16
#define ED_ADDPLACE_SERVERTYPE 17
#define ED_ADDPLACE_SERVERLOGIN 18
#define ED_ADDPLACE_SERVERPASSWORD 19
#define BT_ADDPLACE_OK 20
#define BT_ADDPLACE_CANCEL 21
#define BT_ADDPLACE_DELETE 22
// DLG_SVT_QUERYFOLDERNAME -----------------------
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
/*********** **************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
......@@ -37,6 +37,7 @@
#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 <com/sun/star/ucb/IOErrorCode.hpp>
#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
#include <unotools/confignode.hxx>
......@@ -46,6 +47,8 @@
#include "asyncfilepicker.hxx"
#include "OfficeControlAccess.hxx"
#include "fpsmartcontent.hxx"
#include <comphelper/configuration.hxx>
#include <comphelper/processfactory.hxx>
#include <set>
......@@ -122,6 +125,7 @@ private:
m_xListener;
bool m_bInExecuteAsync;
bool m_bHasFilename;
::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_context;
DECL_STATIC_LINK( SvtFileDialog, FilterSelectHdl_Impl, ListBox* );
DECL_STATIC_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton* );
......@@ -131,6 +135,12 @@ private:
DECL_STATIC_LINK( SvtFileDialog, FileNameGetFocusHdl_Impl, void* );
DECL_STATIC_LINK( SvtFileDialog, FileNameModifiedHdl_Impl, void* );
DECL_STATIC_LINK( SvtFileDialog, URLBoxModifiedHdl_Impl, void* );
DECL_STATIC_LINK( SvtFileDialog, ConnectToServerPressed_Hdl, void* );
DECL_STATIC_LINK( SvtFileDialog, AddPlacePressed_Hdl, void* );
DECL_STATIC_LINK( SvtFileDialog, RemovePlacePressed_Hdl, void* );
void Init_Impl( WinBits nBits );
/** find a filter with the given wildcard
@param _rFilter
......@@ -158,6 +168,7 @@ private:
DECL_LINK( ClickHdl_Impl, CheckBox* );
DECL_LINK(PlayButtonHdl_Impl, void *);
// removes a filter with wildcards from the path and returns it
sal_Bool IsolateFilterFromPath_Impl( String& rPath, String& rFilter );
......@@ -256,6 +267,8 @@ public:
void onAsyncOperationStarted();
void onAsyncOperationFinished();
void RemovablePlaceSelected(bool enable = true);
void displayIOException( const String& _rURL, ::com::sun::star::ucb::IOErrorCode _eCode );
void simulateAccessDenied( const String& _rURL )
{
......@@ -357,6 +370,8 @@ private:
String& _rFileName,
const String& _rFilterDefaultExtension,
const String& _rFilterExtensions);
void initDefaultPlaces( );
};
//***************************************************************************
......
......@@ -64,11 +64,11 @@ ModalDialog DLG_SVT_EXPLORERFILE
Sizeable = TRUE;
HelpId = HID_EXPLORERDLG_FILE ;
Size = MAP_APPFONT ( 280 , 174 ) ;
FixedText FT_EXPLORERFILE_CURRENTPATH
Edit ED_EXPLORERFILE_CURRENTPATH
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 100 , 10 ) ;
NoLabel = TRUE ;
Size = MAP_APPFONT ( 90 , 14 ) ;
Border = TRUE ;
};
ImageButton BTN_EXPLORERFILE_NEWFOLDER
{
......@@ -92,11 +92,45 @@ ModalDialog DLG_SVT_EXPLORERFILE
Pos = MAP_APPFONT ( 59 , 6 ) ;
QuickHelpText [ en-US ] = "Default Directory" ;
};
ListBox LB_EXPLORERFILE_PLACES_LISTBOX
{
HelpID = "fpicker:ListBox:DLG_SVT_EXPLORERFILE:LB_EXPLORERFILE_PLACES_LISTBOX";
Pos = MAP_APPFONT ( 6 , 26 ) ;
Size = MAP_APPFONT ( 50 , 75 ) ;
DropDown = FALSE ;
AutoSize = FALSE ;
AutoHScroll = TRUE ;
Border = TRUE ;
};
PushButton BTN_EXPLORERFILE_CONNECT_TO_SERVER
{
HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_CONNECT_TO_SERVER";
Pos = MAP_APPFONT ( 94 , 6 ) ;
Size = MAP_APPFONT ( 15 , 10 ) ;
Text [ en-US ] = "..." ;
QuickHelpText [ en-US ] = "Connect To Server" ;
};
PushButton BTN_EXPLORERFILE_ADD_PLACE
{
HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_ADD_PLACE";
Pos = MAP_APPFONT ( 6 , 101 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
Text [ en-US ] = "+" ;
QuickHelpText [ en-US ] = "Bookmark This Place" ;
};
PushButton BTN_EXPLORERFILE_REMOVE_PLACE
{
HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_REMOVE_PLACE";
Pos = MAP_APPFONT ( 19 , 101 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
Text [ en-US ] = "-" ;
QuickHelpText [ en-US ] = "Remove Selected Bookmark" ;
};
Control CTL_EXPLORERFILE_FILELIST
{
TabStop = TRUE ;
Pos = MAP_APPFONT ( 6 , 26 ) ;
Size = MAP_APPFONT ( 268 , 85 ) ;
Pos = MAP_APPFONT ( 59 , 26 ) ;
Size = MAP_APPFONT ( 215 , 85 ) ;
Border = TRUE ;
};
FixedText FT_EXPLORERFILE_FILENAME
......@@ -218,9 +252,117 @@ ModalDialog DLG_SVT_EXPLORERFILE
{
Text [ en-US ] = "File Preview";
};
String STR_MY_DOCUMENTS
{
Text [ en-US ] = "My Documents" ;
};
};
// Add Place Dialog --------------------------------------------------------------
ModalDialog DLG_SVT_ADDPLACE
{
OutputSize = TRUE ;
Border = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
Closeable = TRUE ;
Sizeable = TRUE;
HelpId = HID_EXPLORERDLG_FILE ;
Size = MAP_APPFONT ( 200 , 140 ) ;
FixedText FT_ADDPLACE_SERVERURL
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "Server Url" ;
};
FixedText FT_ADDPLACE_SERVERNAME
{
Pos = MAP_APPFONT ( 12 , 34 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "Server Name" ;
};
FixedText FT_ADDPLACE_SERVERTYPE
{
Pos = MAP_APPFONT ( 12 , 54 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "Type" ;
};
FixedText FT_ADDPLACE_SERVERLOGIN
{
Pos = MAP_APPFONT ( 12 , 74 ) ;
Size = MAP_APPFONT ( 30 , 10 ) ;
Text [ en-US ] = "Login" ;
};
FixedText FT_ADDPLACE_SERVERPASSWORD
{
Pos = MAP_APPFONT ( 12 , 94 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "Password" ;
};
Edit ED_ADDPLACE_SERVERURL
{
//HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME";
Pos = MAP_APPFONT ( 62, 12 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
Border = TRUE ;
//Left = TRUE ;
};
Edit ED_ADDPLACE_SERVERNAME
{
//HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME";
Pos = MAP_APPFONT ( 62, 32 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
Border = TRUE ;
//Left = TRUE ;
};
Edit ED_ADDPLACE_SERVERTYPE
{
//HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME";
Pos = MAP_APPFONT ( 62, 52 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
Border = TRUE ;
//Left = TRUE ;
};
Edit ED_ADDPLACE_SERVERLOGIN
{
//HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME";
Pos = MAP_APPFONT ( 62, 72 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
Border = TRUE ;
//Left = TRUE ;
};
Edit ED_ADDPLACE_SERVERPASSWORD
{
//HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME";
Pos = MAP_APPFONT ( 62, 92 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
Border = TRUE ;
//Left = TRUE ;
};
OKButton BT_ADDPLACE_OK
{
Pos = MAP_APPFONT ( 80 , 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
CancelButton BT_ADDPLACE_CANCEL
{
Pos = MAP_APPFONT ( 140, 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
PushButton BT_ADDPLACE_DELETE
{
//HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_CONNECT_TO_SERVER";
Pos = MAP_APPFONT ( 10 , 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "Delete" ;
//QuickHelpText [ en-US ] = "Connect To Server" ;
};
};
// QueryFolderNameDialog ----------------------------------------------------------
ModalDialog DLG_SVT_QUERYFOLDERNAME
{
HelpID = "fpicker:ModalDialog:DLG_SVT_QUERYFOLDERNAME";
......@@ -229,7 +371,7 @@ ModalDialog DLG_SVT_QUERYFOLDERNAME
OutputSize = TRUE ;
SVLook = TRUE ;
Text = "Ordner" ;
Size = MAP_APPFONT ( 218 , 45 ) ;
Size = MAP_APPFONT ( 100 , 45 ) ;
FixedText FT_SVT_QUERYFOLDERNAME_DLG_NAME
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
......
......@@ -360,9 +360,13 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
_pBtnNewFolder ( NULL ),
_pBtnStandard ( NULL ),
_pCbPassword ( NULL ),
_pFtCurrentPath ( NULL ),
_pEdCurrentPath ( NULL ),
_pCbAutoExtension ( NULL ),
_pCbOptions ( NULL ),
_pPlaces ( NULL ),
_pBtnConnectToServer( NULL ),
_pBtnAddPlace ( NULL ),
_pBtnRemovePlace ( NULL ),
_nState ( FILEDLG_STATE_REMOTE ),
_nStyle ( 0 ),
_bDoubleClick ( sal_False ),
......@@ -378,7 +382,7 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl()
{
delete _pFtCurrentPath;
delete _pEdCurrentPath;
delete _pCbPassword;
delete _pCbAutoExtension;
delete _pCbOptions;
......@@ -400,6 +404,10 @@ SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl()
delete _pFtFileName;
delete _pUserFilter;
delete _pFilter;
delete _pPlaces;
delete _pBtnConnectToServer;
delete _pBtnAddPlace;
delete _pBtnRemovePlace;
}
//*****************************************************************************
......
......@@ -28,6 +28,8 @@
#ifndef _IODLGIMP_HXX
#define _IODLGIMP_HXX
#include <PlacesListBox.hxx>
#include <tools/string.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
......@@ -184,10 +186,15 @@ public:
ImageButton* _pBtnNewFolder;
SvtTravelButton_Impl* _pBtnStandard;
CheckBox* _pCbPassword;
FixedText* _pFtCurrentPath;
SvtURLBox* _pEdCurrentPath;
CheckBox* _pCbAutoExtension;
CheckBox* _pCbOptions;
PlacesListBox* _pPlaces;
PushButton* _pBtnConnectToServer;
PushButton* _pBtnAddPlace;
PushButton* _pBtnRemovePlace;
SvtFileDlgMode _eMode;
SvtFileDlgType _eDlgType;
SvtFileDlgState _nState;
......
......@@ -590,6 +590,9 @@
<value oor:external=
"com.sun.star.configuration.backend.GconfBackend SymbolSet"/>
</prop>
<prop oor:name="FilePickerPlaces">
<value/>
</prop>
</node>
<node oor:name="Save">
<node oor:name="Document">
......
......@@ -6755,6 +6755,11 @@
</info>
<value>true</value>
</prop>
<prop oor:name="FilePickerPlaces" oor:type="oor:string-list" oor:nillable="false">
<info>
<desc>List of the places the user bookmarked in the file picker dialog.</desc>
</info>
</prop>
</group>
<group oor:name="Forms">
<info>
......
......@@ -43,6 +43,7 @@
#define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4)
#define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5)
#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6)
#define DLG_SVT_ADDPLACE (RID_SVTOOLS_START+7)
#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16)
......
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