Internal fpicker cleanup and rework
Changes: * Use SvHeaderTabListBox for the places list to get a nicer list * Remove the "Default Directory" button: it's in the places * Remove the Up and New Folder icons: look ugly beside the edit field * Added proper icons for places
This commit is contained in:
@@ -60,8 +60,8 @@ $(eval $(call gb_Library_add_exception_objects,fps_office,\
|
|||||||
fpicker/source/office/OfficeControlAccess \
|
fpicker/source/office/OfficeControlAccess \
|
||||||
fpicker/source/office/OfficeFilePicker \
|
fpicker/source/office/OfficeFilePicker \
|
||||||
fpicker/source/office/OfficeFolderPicker \
|
fpicker/source/office/OfficeFolderPicker \
|
||||||
|
fpicker/source/office/PlaceEditDialog \
|
||||||
fpicker/source/office/PlacesListBox \
|
fpicker/source/office/PlacesListBox \
|
||||||
fpicker/source/office/SvtPlaceDialog \
|
|
||||||
))
|
))
|
||||||
|
|
||||||
# vim: set noet sw=4 ts=4:
|
# vim: set noet sw=4 ts=4:
|
||||||
|
@@ -32,10 +32,10 @@
|
|||||||
|
|
||||||
#include "fpsofficeResMgr.hxx"
|
#include "fpsofficeResMgr.hxx"
|
||||||
#include "PlacesListBox.hxx"
|
#include "PlacesListBox.hxx"
|
||||||
#include "SvtPlaceDialog.hxx"
|
#include "PlaceEditDialog.hxx"
|
||||||
|
|
||||||
|
|
||||||
SvtPlaceDialog::SvtPlaceDialog( Window* pParent ) :
|
PlaceEditDialog::PlaceEditDialog( Window* pParent ) :
|
||||||
ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ),
|
ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ),
|
||||||
m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ),
|
m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ),
|
||||||
m_aFTServerName( this, SvtResId( FT_ADDPLACE_SERVERNAME ) ),
|
m_aFTServerName( this, SvtResId( FT_ADDPLACE_SERVERNAME ) ),
|
||||||
@@ -53,11 +53,11 @@ SvtPlaceDialog::SvtPlaceDialog( Window* pParent ) :
|
|||||||
{
|
{
|
||||||
// This constructor is called when user request a place creation, so
|
// This constructor is called when user request a place creation, so
|
||||||
// delete button is hidden.
|
// delete button is hidden.
|
||||||
m_aBTOk.SetClickHdl( LINK( this, SvtPlaceDialog, OKHdl) );
|
m_aBTOk.SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
|
||||||
m_aBTOk.Enable( sal_False );
|
m_aBTOk.Enable( sal_False );
|
||||||
|
|
||||||
m_aEDServerName.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
|
m_aEDServerName.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
|
||||||
m_aEDServerUrl.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
|
m_aEDServerUrl.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
|
||||||
|
|
||||||
m_aEDServerUrl.SetUrlFilter( &m_UrlFilter );
|
m_aEDServerUrl.SetUrlFilter( &m_UrlFilter );
|
||||||
Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) );
|
Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) );
|
||||||
@@ -66,7 +66,7 @@ SvtPlaceDialog::SvtPlaceDialog( Window* pParent ) :
|
|||||||
m_aBTDelete.Hide();
|
m_aBTDelete.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
SvtPlaceDialog::SvtPlaceDialog( Window* pParent, PlacePtr pPlace ) :
|
PlaceEditDialog::PlaceEditDialog( Window* pParent, PlacePtr pPlace ) :
|
||||||
ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ),
|
ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ),
|
||||||
m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ),
|
m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ),
|
||||||
m_aFTServerName( this, SvtResId( FT_ADDPLACE_SERVERNAME ) ),
|
m_aFTServerName( this, SvtResId( FT_ADDPLACE_SERVERNAME ) ),
|
||||||
@@ -82,11 +82,11 @@ SvtPlaceDialog::SvtPlaceDialog( Window* pParent, PlacePtr pPlace ) :
|
|||||||
m_aBTCancel ( this, SvtResId ( BT_ADDPLACE_CANCEL ) ),
|
m_aBTCancel ( this, SvtResId ( BT_ADDPLACE_CANCEL ) ),
|
||||||
m_aBTDelete ( this, SvtResId (BT_ADDPLACE_DELETE ) )
|
m_aBTDelete ( this, SvtResId (BT_ADDPLACE_DELETE ) )
|
||||||
{
|
{
|
||||||
m_aBTOk.SetClickHdl( LINK( this, SvtPlaceDialog, OKHdl) );
|
m_aBTOk.SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
|
||||||
m_aBTDelete.SetClickHdl ( LINK( this, SvtPlaceDialog, DelHdl) );
|
m_aBTDelete.SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) );
|
||||||
|
|
||||||
m_aEDServerName.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
|
m_aEDServerName.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
|
||||||
m_aEDServerUrl.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) );
|
m_aEDServerUrl.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
|
||||||
|
|
||||||
m_aEDServerUrl.SetUrlFilter( &m_UrlFilter );
|
m_aEDServerUrl.SetUrlFilter( &m_UrlFilter );
|
||||||
Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) );
|
Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) );
|
||||||
@@ -97,30 +97,30 @@ SvtPlaceDialog::SvtPlaceDialog( Window* pParent, PlacePtr pPlace ) :
|
|||||||
m_aEDServerUrl.SetText( pPlace->GetUrl() );
|
m_aEDServerUrl.SetText( pPlace->GetUrl() );
|
||||||
}
|
}
|
||||||
|
|
||||||
SvtPlaceDialog::~SvtPlaceDialog()
|
PlaceEditDialog::~PlaceEditDialog()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PlacePtr SvtPlaceDialog::GetPlace()
|
PlacePtr PlaceEditDialog::GetPlace()
|
||||||
{
|
{
|
||||||
PlacePtr newPlace( new Place( m_aEDServerName.GetText(), m_aEDServerUrl.GetURL(), Place::e_PlaceLocal, true) );
|
PlacePtr newPlace( new Place( m_aEDServerName.GetText(), m_aEDServerUrl.GetURL(), true) );
|
||||||
return newPlace;
|
return newPlace;
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK ( SvtPlaceDialog, OKHdl, Button *, EMPTYARG )
|
IMPL_LINK ( PlaceEditDialog, OKHdl, Button *, EMPTYARG )
|
||||||
{
|
{
|
||||||
EndDialog( RET_OK );
|
EndDialog( RET_OK );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK ( SvtPlaceDialog, DelHdl, Button *, EMPTYARG )
|
IMPL_LINK ( PlaceEditDialog, DelHdl, Button *, EMPTYARG )
|
||||||
{
|
{
|
||||||
// ReUsing existing symbols...
|
// ReUsing existing symbols...
|
||||||
EndDialog( RET_NO );
|
EndDialog( RET_NO );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK ( SvtPlaceDialog, EditHdl, Edit *, EMPTYARG )
|
IMPL_LINK ( PlaceEditDialog, EditHdl, Edit *, EMPTYARG )
|
||||||
{
|
{
|
||||||
String anUrl = m_aEDServerUrl.GetText();
|
String anUrl = m_aEDServerUrl.GetText();
|
||||||
anUrl.EraseLeadingChars().EraseTrailingChars();
|
anUrl.EraseLeadingChars().EraseTrailingChars();
|
@@ -28,6 +28,8 @@
|
|||||||
#ifndef _SVTPLACEDIALOG_HXX
|
#ifndef _SVTPLACEDIALOG_HXX
|
||||||
#define _SVTPLACEDIALOG_HXX
|
#define _SVTPLACEDIALOG_HXX
|
||||||
|
|
||||||
|
#include "PlacesListBox.hxx"
|
||||||
|
|
||||||
#include <vcl/button.hxx>
|
#include <vcl/button.hxx>
|
||||||
#include <vcl/dialog.hxx>
|
#include <vcl/dialog.hxx>
|
||||||
#include <vcl/fixed.hxx>
|
#include <vcl/fixed.hxx>
|
||||||
@@ -38,7 +40,7 @@
|
|||||||
#include <svl/restrictedpaths.hxx>
|
#include <svl/restrictedpaths.hxx>
|
||||||
|
|
||||||
class Place;
|
class Place;
|
||||||
class SvtPlaceDialog : public ModalDialog
|
class PlaceEditDialog : public ModalDialog
|
||||||
{
|
{
|
||||||
private :
|
private :
|
||||||
|
|
||||||
@@ -69,9 +71,9 @@ private :
|
|||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
SvtPlaceDialog( Window* pParent);
|
PlaceEditDialog( Window* pParent);
|
||||||
SvtPlaceDialog( Window* pParent, PlacePtr pPlace );
|
PlaceEditDialog( Window* pParent, PlacePtr pPlace );
|
||||||
~SvtPlaceDialog();
|
~PlaceEditDialog();
|
||||||
|
|
||||||
// Returns a place instance with given informations
|
// Returns a place instance with given informations
|
||||||
PlacePtr GetPlace();
|
PlacePtr GetPlace();
|
@@ -28,33 +28,68 @@
|
|||||||
|
|
||||||
#include <iodlg.hrc>
|
#include <iodlg.hrc>
|
||||||
#include <PlacesListBox.hxx>
|
#include <PlacesListBox.hxx>
|
||||||
#include "SvtPlaceDialog.hxx"
|
#include "PlaceEditDialog.hxx"
|
||||||
|
|
||||||
#include <vcl/msgbox.hxx>
|
#include <vcl/msgbox.hxx>
|
||||||
|
#include <svtools/headbar.hxx>
|
||||||
#include <svtools/svtdata.hxx>
|
#include <svtools/svtdata.hxx>
|
||||||
|
|
||||||
|
#define COLUMN_NAME 1
|
||||||
|
|
||||||
namespace css = com::sun::star;
|
namespace css = com::sun::star;
|
||||||
using rtl::OUString;
|
using rtl::OUString;
|
||||||
|
|
||||||
PlacesListBox::PlacesListBox( SvtFileDialog* pFileDlg, const ResId& rResId ) :
|
PlacesListBox_Impl::PlacesListBox_Impl( Window* pParent, const rtl::OUString& rTitle ) :
|
||||||
ListBox( pFileDlg, rResId ),
|
SvHeaderTabListBox( pParent, WB_TABSTOP ),
|
||||||
|
mpHeaderBar( NULL )
|
||||||
|
{
|
||||||
|
Size aBoxSize = pParent->GetSizePixel( );
|
||||||
|
mpHeaderBar = new HeaderBar( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
|
||||||
|
mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( aBoxSize.getWidth(), 16 ) );
|
||||||
|
|
||||||
|
long pTabs[] = { 2, 20, aBoxSize.getWidth() };
|
||||||
|
SetTabs( &pTabs[0], MAP_PIXEL );
|
||||||
|
mpHeaderBar->InsertItem( COLUMN_NAME, rTitle, aBoxSize.getWidth(), HIB_LEFT | HIB_VCENTER );
|
||||||
|
|
||||||
|
Size aHeadSize = mpHeaderBar->GetSizePixel();
|
||||||
|
SetPosSizePixel( Point( 0, aHeadSize.getHeight() ),
|
||||||
|
Size( aBoxSize.getWidth(), aBoxSize.getHeight() - aHeadSize.getHeight() ) );
|
||||||
|
|
||||||
|
InitHeaderBar( mpHeaderBar );
|
||||||
|
|
||||||
|
Show( );
|
||||||
|
mpHeaderBar->Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
PlacesListBox_Impl::~PlacesListBox_Impl( )
|
||||||
|
{
|
||||||
|
delete mpHeaderBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlacesListBox::PlacesListBox( SvtFileDialog* pFileDlg, const rtl::OUString& rTitle, const ResId& rResId ) :
|
||||||
|
Control( pFileDlg, rResId ),
|
||||||
maPlaces( ),
|
maPlaces( ),
|
||||||
mpDlg( pFileDlg ),
|
mpDlg( pFileDlg ),
|
||||||
|
mpImpl( NULL ),
|
||||||
mnNbEditables( 0 ),
|
mnNbEditables( 0 ),
|
||||||
mbUpdated( false )
|
mbUpdated( false )
|
||||||
{
|
{
|
||||||
SetSelectHdl( LINK( this, PlacesListBox, SelectHdl ) );
|
mpImpl = new PlacesListBox_Impl( this, rTitle );
|
||||||
SetDoubleClickHdl( LINK( this, PlacesListBox, DoubleClickHdl ) ) ;
|
|
||||||
|
mpImpl->SetSelectHdl( LINK( this, PlacesListBox, Selection ) );
|
||||||
|
mpImpl->SetDoubleClickHdl( LINK( this, PlacesListBox, DoubleClick ) ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlacesListBox::~PlacesListBox( )
|
PlacesListBox::~PlacesListBox( )
|
||||||
{
|
{
|
||||||
|
delete mpImpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlacesListBox::AppendPlace( PlacePtr pPlace )
|
void PlacesListBox::AppendPlace( PlacePtr pPlace )
|
||||||
{
|
{
|
||||||
maPlaces.push_back( pPlace );
|
maPlaces.push_back( pPlace );
|
||||||
InsertEntry( pPlace->GetName( ), getEntryIcon( pPlace->GetType( ) ));
|
mpImpl->InsertEntry( pPlace->GetName( ),
|
||||||
|
getEntryIcon( pPlace ), getEntryIcon( pPlace ) );
|
||||||
|
|
||||||
if(pPlace->IsEditable()) {
|
if(pPlace->IsEditable()) {
|
||||||
++mnNbEditables;
|
++mnNbEditables;
|
||||||
@@ -91,53 +126,50 @@ void PlacesListBox::RemovePlace( sal_uInt16 nPos )
|
|||||||
mbUpdated = true;
|
mbUpdated = true;
|
||||||
}
|
}
|
||||||
maPlaces.erase( maPlaces.begin() + nPos );
|
maPlaces.erase( maPlaces.begin() + nPos );
|
||||||
RemoveEntry( nPos );
|
SvLBoxEntry* pEntry = mpImpl->GetEntry( nPos );
|
||||||
|
mpImpl->RemoveEntry( pEntry );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlacesListBox::RemoveSelectedPlace() {
|
void PlacesListBox::RemoveSelectedPlace() {
|
||||||
RemovePlace(GetSelectEntryPos());
|
RemovePlace(mpImpl->GetCurrRow());
|
||||||
}
|
}
|
||||||
|
|
||||||
Image PlacesListBox::getEntryIcon(Place::ePlaceType aType)
|
void PlacesListBox::SetSizePixel( const Size& rNewSize )
|
||||||
{
|
{
|
||||||
Image theImage;
|
Control::SetSizePixel( rNewSize );
|
||||||
switch (aType) {
|
mpImpl->SetSizePixel( rNewSize );
|
||||||
case Place::e_PlaceCmis:
|
}
|
||||||
theImage = mpDlg->GetButtonImage( IMG_FILEDLG_BTN_UP );
|
|
||||||
break;
|
Image PlacesListBox::getEntryIcon( PlacePtr pPlace )
|
||||||
case Place::e_PlaceFtp:
|
{
|
||||||
theImage = mpDlg->GetButtonImage( IMG_FILEDLG_BTN_UP );
|
Image theImage = mpDlg->GetButtonImage( IMG_FILEDLG_PLACE_LOCAL );
|
||||||
break;
|
if ( !pPlace->IsLocal( ) )
|
||||||
case Place::e_PlaceLocal:
|
theImage = mpDlg->GetButtonImage( IMG_FILEDLG_PLACE_REMOTE );
|
||||||
default:
|
|
||||||
theImage = mpDlg->GetButtonImage( IMG_FILEDLG_BTN_UP );
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
return theImage;
|
return theImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK( PlacesListBox, SelectHdl, ListBox* , EMPTYARG )
|
IMPL_LINK( PlacesListBox, Selection, void* , EMPTYARG )
|
||||||
{
|
{
|
||||||
sal_uInt16 nSelected = GetSelectEntryPos();
|
sal_uInt32 nSelected = mpImpl->GetCurrRow();
|
||||||
PlacePtr pPlace = maPlaces[nSelected];
|
PlacePtr pPlace = maPlaces[nSelected];
|
||||||
|
|
||||||
mpDlg->OpenURL_Impl( pPlace->GetUrl() );
|
mpDlg->OpenURL_Impl( pPlace->GetUrl() );
|
||||||
|
|
||||||
if(pPlace->IsEditable())
|
if(pPlace->IsEditable())
|
||||||
mpDlg->RemovablePlaceSelected();
|
mpDlg->RemovablePlaceSelected();
|
||||||
else
|
else
|
||||||
mpDlg->RemovablePlaceSelected(false);
|
mpDlg->RemovablePlaceSelected(false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPL_LINK ( PlacesListBox, DoubleClickHdl, ListBox*, EMPTYARG )
|
IMPL_LINK ( PlacesListBox, DoubleClick, void*, EMPTYARG )
|
||||||
{
|
{
|
||||||
sal_uInt16 nSelected = GetSelectEntryPos();
|
sal_uInt16 nSelected = mpImpl->GetCurrRow();
|
||||||
PlacePtr pPlace = maPlaces[nSelected];
|
PlacePtr pPlace = maPlaces[nSelected];
|
||||||
if ( pPlace->IsEditable() == true )
|
if ( pPlace->IsEditable() == true )
|
||||||
{
|
{
|
||||||
SvtPlaceDialog aDlg(mpDlg,pPlace);
|
PlaceEditDialog aDlg(mpDlg,pPlace);
|
||||||
short aRetCode = aDlg.Execute();
|
short aRetCode = aDlg.Execute();
|
||||||
switch(aRetCode) {
|
switch(aRetCode) {
|
||||||
case RET_OK :
|
case RET_OK :
|
||||||
|
@@ -29,63 +29,68 @@
|
|||||||
#define _PLACESLISTBOX_HXX_
|
#define _PLACESLISTBOX_HXX_
|
||||||
|
|
||||||
#include <iodlg.hxx>
|
#include <iodlg.hxx>
|
||||||
#include <vcl/lstbox.hxx>
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <svtools/svtabbx.hxx>
|
||||||
|
#include <tools/urlobj.hxx>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
/** Class representing a file location: it mainly consist of display attributes and a URL.
|
/** Class representing a file location: it mainly consist of display attributes and a URL.
|
||||||
*/
|
*/
|
||||||
class Place
|
class Place
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
enum ePlaceType {
|
|
||||||
e_PlaceLocal = 0,
|
|
||||||
e_PlaceFtp,
|
|
||||||
e_PlaceCmis
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
rtl::OUString msName;
|
rtl::OUString msName;
|
||||||
rtl::OUString msUrl;
|
INetURLObject maUrl;
|
||||||
ePlaceType meType;
|
|
||||||
|
|
||||||
sal_Bool mbEditable;
|
sal_Bool mbEditable;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Place( rtl::OUString sName, rtl::OUString sUrl, ePlaceType eType, sal_Bool bEditable = false) :
|
Place( rtl::OUString sName, rtl::OUString sUrl, sal_Bool bEditable = false) :
|
||||||
msName( sName ),
|
msName( sName ),
|
||||||
msUrl( sUrl ),
|
maUrl( sUrl ),
|
||||||
meType( eType ),
|
|
||||||
mbEditable( bEditable ) {};
|
mbEditable( bEditable ) {};
|
||||||
|
|
||||||
~Place( ) {};
|
~Place( ) {};
|
||||||
|
|
||||||
Place( const Place& rCopy ) : msName( rCopy.msName ), msUrl( rCopy.msUrl ), meType( rCopy.meType ){ };
|
Place( const Place& rCopy ) : msName( rCopy.msName ), maUrl( rCopy.maUrl ) { };
|
||||||
|
|
||||||
void SetName(const rtl::OUString& aName ) { msName = aName; }
|
void SetName(const rtl::OUString& aName ) { msName = aName; }
|
||||||
void SetUrl(const rtl::OUString& aUrl ) { msUrl = aUrl; }
|
void SetUrl(const rtl::OUString& aUrl ) { maUrl.SetURL( aUrl ); }
|
||||||
|
|
||||||
rtl::OUString& GetName( ) { return msName; }
|
rtl::OUString& GetName( ) { return msName; }
|
||||||
rtl::OUString& GetUrl( ) { return msUrl; }
|
rtl::OUString GetUrl( ) { return maUrl.GetMainURL( INetURLObject::NO_DECODE ); }
|
||||||
ePlaceType& GetType( ) { return meType; }
|
sal_Bool IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; };
|
||||||
sal_Bool& IsEditable( ) { return mbEditable; }
|
sal_Bool& IsEditable( ) { return mbEditable; }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::shared_ptr< Place > PlacePtr;
|
typedef boost::shared_ptr< Place > PlacePtr;
|
||||||
|
|
||||||
|
class PlacesListBox_Impl : public SvHeaderTabListBox
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
HeaderBar* mpHeaderBar;
|
||||||
|
|
||||||
|
public:
|
||||||
|
PlacesListBox_Impl( Window* pParent, const rtl::OUString& rTitle );
|
||||||
|
~PlacesListBox_Impl( );
|
||||||
|
};
|
||||||
|
|
||||||
/** ListBox to handle Places.
|
/** ListBox to handle Places.
|
||||||
*/
|
*/
|
||||||
class PlacesListBox : public ListBox
|
class PlacesListBox : public Control
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::vector< PlacePtr > maPlaces;
|
std::vector< PlacePtr > maPlaces;
|
||||||
SvtFileDialog* mpDlg;
|
SvtFileDialog* mpDlg;
|
||||||
|
PlacesListBox_Impl* mpImpl;
|
||||||
sal_Int32 mnNbEditables;
|
sal_Int32 mnNbEditables;
|
||||||
bool mbUpdated;
|
bool mbUpdated;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlacesListBox( SvtFileDialog* pFileDlg, const ResId& rResId );
|
PlacesListBox( SvtFileDialog* pFileDlg, const rtl::OUString& rTitle, const ResId& rResId );
|
||||||
~PlacesListBox( );
|
~PlacesListBox( );
|
||||||
|
|
||||||
void AppendPlace( PlacePtr pPlace );
|
void AppendPlace( PlacePtr pPlace );
|
||||||
@@ -96,12 +101,14 @@ class PlacesListBox : public ListBox
|
|||||||
bool IsUpdated();
|
bool IsUpdated();
|
||||||
const std::vector<PlacePtr>& GetPlaces();
|
const std::vector<PlacePtr>& GetPlaces();
|
||||||
|
|
||||||
|
void SetSizePixel( const Size& rNewSize );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Image getEntryIcon( Place::ePlaceType eType);
|
|
||||||
|
|
||||||
DECL_LINK( SelectHdl, ListBox* );
|
Image getEntryIcon( PlacePtr pPlace );
|
||||||
DECL_LINK( DoubleClickHdl, ListBox* );
|
|
||||||
|
|
||||||
|
DECL_LINK( Selection, void* );
|
||||||
|
DECL_LINK( DoubleClick, void* );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <sal/macros.h>
|
#include <sal/macros.h>
|
||||||
#include "iodlg.hxx"
|
#include "iodlg.hxx"
|
||||||
|
#include "PlaceEditDialog.hxx"
|
||||||
#include "PlacesListBox.hxx"
|
#include "PlacesListBox.hxx"
|
||||||
#include "fpsofficeResMgr.hxx"
|
#include "fpsofficeResMgr.hxx"
|
||||||
#include <tools/stream.hxx>
|
#include <tools/stream.hxx>
|
||||||
@@ -88,7 +89,6 @@
|
|||||||
#include <osl/process.h>
|
#include <osl/process.h>
|
||||||
|
|
||||||
#include <officecfg/Office/Common.hxx>
|
#include <officecfg/Office/Common.hxx>
|
||||||
#include "SvtPlaceDialog.hxx"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -496,17 +496,20 @@ SvtFileDialog::~SvtFileDialog()
|
|||||||
// Save bookmarked places
|
// Save bookmarked places
|
||||||
if(_pImp->_pPlaces->IsUpdated()) {
|
if(_pImp->_pPlaces->IsUpdated()) {
|
||||||
const std::vector<PlacePtr> aPlaces = _pImp->_pPlaces->GetPlaces();
|
const std::vector<PlacePtr> aPlaces = _pImp->_pPlaces->GetPlaces();
|
||||||
Sequence< ::rtl::OUString > placesList(_pImp->_pPlaces->GetNbEditablePlaces());
|
Sequence< ::rtl::OUString > placesUrlsList(_pImp->_pPlaces->GetNbEditablePlaces());
|
||||||
|
Sequence< ::rtl::OUString > placesNamesList(_pImp->_pPlaces->GetNbEditablePlaces());
|
||||||
int i(0);
|
int i(0);
|
||||||
for(std::vector<PlacePtr>::const_iterator it = aPlaces.begin(); it != aPlaces.end(); ++it) {
|
for(std::vector<PlacePtr>::const_iterator it = aPlaces.begin(); it != aPlaces.end(); ++it) {
|
||||||
if((*it)->IsEditable()) {
|
if((*it)->IsEditable()) {
|
||||||
placesList[i] = (*it)->GetUrl();
|
placesUrlsList[i] = (*it)->GetUrl();
|
||||||
|
placesNamesList[i] = (*it)->GetName();
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context));
|
boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context));
|
||||||
officecfg::Office::Common::Misc::FilePickerPlaces::set(placesList, batch, m_context);
|
officecfg::Office::Common::Misc::FilePickerPlacesUrls::set(placesUrlsList, batch, m_context);
|
||||||
|
officecfg::Office::Common::Misc::FilePickerPlacesNames::set(placesNamesList, batch, m_context);
|
||||||
batch->commit();
|
batch->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,11 +621,9 @@ void SvtFileDialog::Init_Impl
|
|||||||
_pImp->_pBtnUp = new SvtUpButton_Impl( this, SvtResId( BTN_EXPLORERFILE_UP ) );
|
_pImp->_pBtnUp = new SvtUpButton_Impl( this, SvtResId( BTN_EXPLORERFILE_UP ) );
|
||||||
_pImp->_pBtnNewFolder = new ImageButton( this, SvtResId( BTN_EXPLORERFILE_NEWFOLDER ) );
|
_pImp->_pBtnNewFolder = new ImageButton( this, SvtResId( BTN_EXPLORERFILE_NEWFOLDER ) );
|
||||||
_pImp->_pBtnNewFolder->SetStyle( _pImp->_pBtnNewFolder->GetStyle() | WB_NOPOINTERFOCUS );
|
_pImp->_pBtnNewFolder->SetStyle( _pImp->_pBtnNewFolder->GetStyle() | WB_NOPOINTERFOCUS );
|
||||||
_pImp->_pBtnStandard = new SvtTravelButton_Impl( this, SvtResId( BTN_EXPLORERFILE_STANDARD ) );
|
|
||||||
|
|
||||||
_pImp->_pBtnUp->SetAccessibleName( _pImp->_pBtnUp->GetQuickHelpText() );
|
_pImp->_pBtnUp->SetAccessibleName( _pImp->_pBtnUp->GetQuickHelpText() );
|
||||||
_pImp->_pBtnNewFolder->SetAccessibleName( _pImp->_pBtnNewFolder->GetQuickHelpText() );
|
_pImp->_pBtnNewFolder->SetAccessibleName( _pImp->_pBtnNewFolder->GetQuickHelpText() );
|
||||||
_pImp->_pBtnStandard->SetAccessibleName( _pImp->_pBtnStandard->GetQuickHelpText() );
|
|
||||||
|
|
||||||
if ( ( nStyle & SFXWB_MULTISELECTION ) == SFXWB_MULTISELECTION )
|
if ( ( nStyle & SFXWB_MULTISELECTION ) == SFXWB_MULTISELECTION )
|
||||||
_pImp->_bMultiSelection = sal_True;
|
_pImp->_bMultiSelection = sal_True;
|
||||||
@@ -637,16 +638,10 @@ void SvtFileDialog::Init_Impl
|
|||||||
_pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP );
|
_pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP );
|
||||||
|
|
||||||
// determine the size of the buttons
|
// determine the size of the buttons
|
||||||
|
Size aSize = _pImp->_pBtnNewFolder->GetSizePixel();
|
||||||
Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) );
|
Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) );
|
||||||
_pImp->_pBtnNewFolder->SetModeImage( aNewFolderImg );
|
_pImp->_pBtnNewFolder->SetModeImage( aNewFolderImg );
|
||||||
|
|
||||||
Size aSize( aNewFolderImg.GetSizePixel() );
|
|
||||||
aSize.Width() += FILEDIALOG_DEF_IMAGEBORDER;
|
|
||||||
aSize.Height() += FILEDIALOG_DEF_IMAGEBORDER;
|
|
||||||
_pImp->_pBtnNewFolder->SetSizePixel( aSize );
|
|
||||||
_pImp->_pBtnUp->SetSizePixel( aSize );
|
|
||||||
_pImp->_pBtnStandard->SetSizePixel( aSize );
|
|
||||||
|
|
||||||
// set position of the buttons
|
// set position of the buttons
|
||||||
Size aDlgSize = GetOutputSizePixel();
|
Size aDlgSize = GetOutputSizePixel();
|
||||||
long n6AppFontInPixel =
|
long n6AppFontInPixel =
|
||||||
@@ -659,15 +654,11 @@ void SvtFileDialog::Init_Impl
|
|||||||
// component currently positioned
|
// component currently positioned
|
||||||
long nDelta = n6AppFontInPixel;
|
long nDelta = n6AppFontInPixel;
|
||||||
|
|
||||||
// Standard dir
|
// New folder
|
||||||
nDelta += aSize.Width();
|
|
||||||
Point aPos(
|
Point aPos(
|
||||||
aDlgSize.Width() - nDelta,
|
aDlgSize.Width() - nDelta,
|
||||||
_pImp->_pBtnStandard->GetPosPixel().Y()
|
_pImp->_pBtnNewFolder->GetPosPixel().Y()
|
||||||
);
|
);
|
||||||
_pImp->_pBtnStandard->SetPosPixel(aPos);
|
|
||||||
|
|
||||||
// New folder
|
|
||||||
nDelta += aSize.Width() + nHalf3AppFontInPixel;
|
nDelta += aSize.Width() + nHalf3AppFontInPixel;
|
||||||
aPos.X() = aDlgSize.Width() - nDelta;
|
aPos.X() = aDlgSize.Width() - nDelta;
|
||||||
_pImp->_pBtnNewFolder->SetPosPixel(aPos);
|
_pImp->_pBtnNewFolder->SetPosPixel(aPos);
|
||||||
@@ -678,19 +669,8 @@ void SvtFileDialog::Init_Impl
|
|||||||
_pImp->_pBtnUp->SetPosPixel(aPos);
|
_pImp->_pBtnUp->SetPosPixel(aPos);
|
||||||
|
|
||||||
// Connect to server ("...")
|
// Connect to server ("...")
|
||||||
nDelta += _pImp->_pBtnConnectToServer->GetSizePixel().Width() + n3AppFontInPixel;
|
nDelta += _pImp->_pBtnConnectToServer->GetSizePixel().Width() + nHalf3AppFontInPixel;
|
||||||
aPos.X() = aDlgSize.Width() - nDelta;
|
aPos.X() = aDlgSize.Width() - nDelta;
|
||||||
|
|
||||||
// Height of this button is URL bar's height
|
|
||||||
long nBtnHeight = aSize.Height();
|
|
||||||
aSize = _pImp->_pBtnConnectToServer->GetSizePixel();
|
|
||||||
aSize.Height() = _pImp->_pEdCurrentPath->GetOutputSizePixel().Height();
|
|
||||||
// Keep the same height as for the other buttons
|
|
||||||
_pImp->_pBtnConnectToServer->SetSizePixel( aSize );
|
|
||||||
|
|
||||||
// Repositon the URL bar and the "..." button in order to have it vertically
|
|
||||||
// aligned with the buttons
|
|
||||||
aPos.Y() += (nBtnHeight - aSize.Height()) / 2;
|
|
||||||
_pImp->_pBtnConnectToServer->SetPosPixel(aPos);
|
_pImp->_pBtnConnectToServer->SetPosPixel(aPos);
|
||||||
|
|
||||||
// Set the size of the URL bar
|
// Set the size of the URL bar
|
||||||
@@ -742,6 +722,7 @@ void SvtFileDialog::Init_Impl
|
|||||||
aPos.X() = _pImp->_pPlaces->GetPosPixel().X();
|
aPos.X() = _pImp->_pPlaces->GetPosPixel().X();
|
||||||
_pImp->_pPlaces->SetPosPixel( aPos );
|
_pImp->_pPlaces->SetPosPixel( aPos );
|
||||||
|
|
||||||
|
|
||||||
lcl_MoveControl( _pImp->_pFtFileName, 0, nYOffset );
|
lcl_MoveControl( _pImp->_pFtFileName, 0, nYOffset );
|
||||||
lcl_MoveControl( _pImp->_pEdFileName, 0, nYOffset );
|
lcl_MoveControl( _pImp->_pEdFileName, 0, nYOffset );
|
||||||
|
|
||||||
@@ -825,7 +806,6 @@ void SvtFileDialog::Init_Impl
|
|||||||
_pImp->_pEdFileName->SetHelpId( HID_FILESAVE_FILEURL );
|
_pImp->_pEdFileName->SetHelpId( HID_FILESAVE_FILEURL );
|
||||||
_pImp->_pBtnFileOpen->SetHelpId( HID_FILESAVE_DOSAVE );
|
_pImp->_pBtnFileOpen->SetHelpId( HID_FILESAVE_DOSAVE );
|
||||||
_pImp->_pBtnNewFolder->SetHelpId( HID_FILESAVE_CREATEDIRECTORY );
|
_pImp->_pBtnNewFolder->SetHelpId( HID_FILESAVE_CREATEDIRECTORY );
|
||||||
_pImp->_pBtnStandard->SetHelpId( HID_FILESAVE_DEFAULTDIRECTORY );
|
|
||||||
_pImp->_pBtnUp->SetHelpId( HID_FILESAVE_LEVELUP );
|
_pImp->_pBtnUp->SetHelpId( HID_FILESAVE_LEVELUP );
|
||||||
_pImp->GetFilterListControl()->SetHelpId( HID_FILESAVE_FILETYPE );
|
_pImp->GetFilterListControl()->SetHelpId( HID_FILESAVE_FILETYPE );
|
||||||
_pFileView->SetHelpId( HID_FILESAVE_FILEVIEW );
|
_pFileView->SetHelpId( HID_FILESAVE_FILEVIEW );
|
||||||
@@ -851,9 +831,6 @@ void SvtFileDialog::Init_Impl
|
|||||||
// correct the z-order of the controls
|
// correct the z-order of the controls
|
||||||
implArrangeControls();
|
implArrangeControls();
|
||||||
|
|
||||||
// special URLs, such as favourites and "restricted" paths
|
|
||||||
implInitializeSpecialURLLists( );
|
|
||||||
|
|
||||||
/// read our settings from the configuration
|
/// read our settings from the configuration
|
||||||
m_aConfiguration = OConfigurationTreeRoot::createWithServiceFactory(
|
m_aConfiguration = OConfigurationTreeRoot::createWithServiceFactory(
|
||||||
::comphelper::getProcessServiceFactory(),
|
::comphelper::getProcessServiceFactory(),
|
||||||
@@ -1467,7 +1444,7 @@ IMPL_STATIC_LINK ( SvtFileDialog, ConnectToServerPressed_Hdl, void*, EMPTYARG )
|
|||||||
{
|
{
|
||||||
pThis->_pFileView->EndInplaceEditing( false );
|
pThis->_pFileView->EndInplaceEditing( false );
|
||||||
|
|
||||||
SvtPlaceDialog aDlg( pThis );
|
PlaceEditDialog aDlg( pThis );
|
||||||
short aRetCode = aDlg.Execute();
|
short aRetCode = aDlg.Execute();
|
||||||
|
|
||||||
switch (aRetCode) {
|
switch (aRetCode) {
|
||||||
@@ -1493,9 +1470,9 @@ IMPL_STATIC_LINK ( SvtFileDialog, AddPlacePressed_Hdl, void*, EMPTYARG )
|
|||||||
{
|
{
|
||||||
// Maybe open the PlacesDialog would have been a better idea
|
// Maybe open the PlacesDialog would have been a better idea
|
||||||
// there is an ux choice to make we did not make...
|
// there is an ux choice to make we did not make...
|
||||||
PlacePtr newPlace(new Place(::rtl::OUString(pThis->_pFileView->GetViewURL()),
|
INetURLObject aURLObj( pThis->_pFileView->GetViewURL() );
|
||||||
::rtl::OUString(pThis->_pFileView->GetViewURL()),
|
PlacePtr newPlace(new Place( aURLObj.GetLastName(),
|
||||||
Place::e_PlaceLocal, true));
|
::rtl::OUString(pThis->_pFileView->GetViewURL()), true));
|
||||||
pThis->_pImp->_pPlaces->AppendPlace(newPlace);
|
pThis->_pImp->_pPlaces->AppendPlace(newPlace);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1505,7 +1482,6 @@ IMPL_STATIC_LINK ( SvtFileDialog, AddPlacePressed_Hdl, void*, EMPTYARG )
|
|||||||
IMPL_STATIC_LINK ( SvtFileDialog, RemovePlacePressed_Hdl, void*, EMPTYARG )
|
IMPL_STATIC_LINK ( SvtFileDialog, RemovePlacePressed_Hdl, void*, EMPTYARG )
|
||||||
{
|
{
|
||||||
pThis->_pImp->_pPlaces->RemoveSelectedPlace();
|
pThis->_pImp->_pPlaces->RemoveSelectedPlace();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2314,32 +2290,6 @@ short SvtFileDialog::PrepareExecute()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void SvtFileDialog::implInitializeSpecialURLLists( )
|
|
||||||
{
|
|
||||||
m_aURLFilter = ::svt::RestrictedPaths();
|
|
||||||
|
|
||||||
::std::vector< String > aFavourites;
|
|
||||||
if ( m_aURLFilter.hasFilter() )
|
|
||||||
{
|
|
||||||
// if we have restrictions, then the "favourites" are the restricted folders only
|
|
||||||
aFavourites = m_aURLFilter.getFilter();
|
|
||||||
// for approved URLs, we needed the final slashes, for
|
|
||||||
// favourites, we do not want to have them
|
|
||||||
::std::for_each( aFavourites.begin(), aFavourites.end(), RemoveFinalSlash() );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
::rtl::OUString sFavouritesList;
|
|
||||||
if ( getEnvironmentValue( "PathFavourites", sFavouritesList ) )
|
|
||||||
convertStringListToUrls( sFavouritesList, aFavourites );
|
|
||||||
}
|
|
||||||
|
|
||||||
DBG_ASSERT( _pImp->_pBtnStandard, "SvtFileDialog::implInitializeSpecialURLLists: how this?" );
|
|
||||||
if ( _pImp->_pBtnStandard )
|
|
||||||
_pImp->_pBtnStandard->SetFavouriteLocations( aFavourites );
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void SvtFileDialog::executeAsync( ::svt::AsyncPickerAction::Action _eAction,
|
void SvtFileDialog::executeAsync( ::svt::AsyncPickerAction::Action _eAction,
|
||||||
const String& _rURL, const String& _rFilter )
|
const String& _rURL, const String& _rFilter )
|
||||||
@@ -2591,7 +2541,7 @@ void SvtFileDialog::implArrangeControls()
|
|||||||
Control* pControls[] =
|
Control* pControls[] =
|
||||||
{
|
{
|
||||||
_pImp->_pEdCurrentPath, _pImp->_pBtnConnectToServer,
|
_pImp->_pEdCurrentPath, _pImp->_pBtnConnectToServer,
|
||||||
_pImp->_pBtnUp, _pImp->_pBtnNewFolder, _pImp->_pBtnStandard, // image buttons
|
_pImp->_pBtnUp, _pImp->_pBtnNewFolder, // image buttons
|
||||||
_pImp->_pPlaces, _pImp->_pBtnAddPlace, _pImp->_pBtnRemovePlace, // list of places
|
_pImp->_pPlaces, _pImp->_pBtnAddPlace, _pImp->_pBtnRemovePlace, // list of places
|
||||||
_pFileView, // the file view
|
_pFileView, // the file view
|
||||||
_pImp->_pFtFileName, _pImp->_pEdFileName,
|
_pImp->_pFtFileName, _pImp->_pEdFileName,
|
||||||
@@ -2709,9 +2659,6 @@ void SvtFileDialog::implUpdateImages( )
|
|||||||
if ( _pImp->_pBtnUp )
|
if ( _pImp->_pBtnUp )
|
||||||
_pImp->_pBtnUp->SetModeImage( GetButtonImage( IMG_FILEDLG_BTN_UP ) );
|
_pImp->_pBtnUp->SetModeImage( GetButtonImage( IMG_FILEDLG_BTN_UP ) );
|
||||||
|
|
||||||
if ( _pImp->_pBtnStandard )
|
|
||||||
_pImp->_pBtnStandard->SetModeImage( GetButtonImage( IMG_FILEDLG_BTN_STD ) );
|
|
||||||
|
|
||||||
if ( _pImp->_pBtnNewFolder )
|
if ( _pImp->_pBtnNewFolder )
|
||||||
_pImp->_pBtnNewFolder->SetModeImage( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) );
|
_pImp->_pBtnNewFolder->SetModeImage( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) );
|
||||||
}
|
}
|
||||||
@@ -2806,7 +2753,7 @@ void SvtFileDialog::Resize()
|
|||||||
Control* aMoveControlsHor[] =
|
Control* aMoveControlsHor[] =
|
||||||
{
|
{
|
||||||
_pImp->_pBtnConnectToServer,
|
_pImp->_pBtnConnectToServer,
|
||||||
_pImp->_pBtnUp, _pImp->_pBtnNewFolder, _pImp->_pBtnStandard
|
_pImp->_pBtnUp, _pImp->_pBtnNewFolder
|
||||||
};
|
};
|
||||||
Control** ppMoveControls = aMoveControlsHor;
|
Control** ppMoveControls = aMoveControlsHor;
|
||||||
Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsHor );
|
Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsHor );
|
||||||
@@ -2966,10 +2913,6 @@ Control* SvtFileDialog::getControl( sal_Int16 _nControlId, sal_Bool _bLabelContr
|
|||||||
pReturn = _pImp->_pBtnHelp;
|
pReturn = _pImp->_pBtnHelp;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOOLBOXBUTOON_DEFAULT_LOCATION:
|
|
||||||
pReturn = _pImp->_pBtnStandard;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TOOLBOXBUTOON_LEVEL_UP:
|
case TOOLBOXBUTOON_LEVEL_UP:
|
||||||
pReturn = _pImp->_pBtnUp;
|
pReturn = _pImp->_pBtnUp;
|
||||||
break;
|
break;
|
||||||
@@ -3107,7 +3050,7 @@ void SvtFileDialog::AddControls_Impl( )
|
|||||||
_pImp->_pLbImageTemplates->SetHelpId( HID_FILEOPEN_IMAGE_TEMPLATE );
|
_pImp->_pLbImageTemplates->SetHelpId( HID_FILEOPEN_IMAGE_TEMPLATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
_pImp->_pPlaces = new PlacesListBox( this, SvtResId( LB_EXPLORERFILE_PLACES_LISTBOX ) );
|
_pImp->_pPlaces = new PlacesListBox( this, ResId::toString( SvtResId( STR_PLACES_TITLE ) ), SvtResId( LB_EXPLORERFILE_PLACES_LISTBOX ) );
|
||||||
initDefaultPlaces();
|
initDefaultPlaces();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3435,14 +3378,15 @@ void SvtFileDialog::appendDefaultExtension(String& _rFileName,
|
|||||||
|
|
||||||
void SvtFileDialog::initDefaultPlaces( )
|
void SvtFileDialog::initDefaultPlaces( )
|
||||||
{
|
{
|
||||||
PlacePtr pRootPlace( new Place( ResId::toString( SvtResId( STR_MY_DOCUMENTS ) ), GetStandardDir(), Place::e_PlaceLocal ) );
|
PlacePtr pRootPlace( new Place( ResId::toString( SvtResId( STR_DEFAULT_DIRECTORY ) ), GetStandardDir() ) );
|
||||||
_pImp->_pPlaces->AppendPlace( pRootPlace );
|
_pImp->_pPlaces->AppendPlace( pRootPlace );
|
||||||
|
|
||||||
// Load from user settings
|
// Load from user settings
|
||||||
Sequence< ::rtl::OUString > placesList(officecfg::Office::Common::Misc::FilePickerPlaces::get(m_context));
|
Sequence< ::rtl::OUString > placesUrlsList(officecfg::Office::Common::Misc::FilePickerPlacesUrls::get(m_context));
|
||||||
|
Sequence< ::rtl::OUString > placesNamesList(officecfg::Office::Common::Misc::FilePickerPlacesNames::get(m_context));
|
||||||
|
|
||||||
for(sal_Int32 nPlace = 0; nPlace < placesList.getLength(); ++nPlace) {
|
for(sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace) {
|
||||||
PlacePtr pPlace(new Place(placesList[nPlace], placesList[nPlace], Place::e_PlaceLocal, true));
|
PlacePtr pPlace(new Place(placesNamesList[nPlace], placesUrlsList[nPlace], true));
|
||||||
_pImp->_pPlaces->AppendPlace(pPlace);
|
_pImp->_pPlaces->AppendPlace(pPlace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#define ED_EXPLORERFILE_CURRENTPATH 10
|
#define ED_EXPLORERFILE_CURRENTPATH 10
|
||||||
#define BTN_EXPLORERFILE_NEWFOLDER 11
|
#define BTN_EXPLORERFILE_NEWFOLDER 11
|
||||||
#define BTN_EXPLORERFILE_UP 12
|
#define BTN_EXPLORERFILE_UP 12
|
||||||
#define BTN_EXPLORERFILE_STANDARD 13
|
|
||||||
#define BTN_EXPLORERFILE_OPEN 14
|
#define BTN_EXPLORERFILE_OPEN 14
|
||||||
#define BTN_EXPLORERFILE_CANCEL 15
|
#define BTN_EXPLORERFILE_CANCEL 15
|
||||||
#define BTN_EXPLORERFILE_HELP 16
|
#define BTN_EXPLORERFILE_HELP 16
|
||||||
@@ -44,6 +43,8 @@
|
|||||||
#define IMG_FILEDLG_BTN_UP 10
|
#define IMG_FILEDLG_BTN_UP 10
|
||||||
#define IMG_FILEDLG_BTN_STD 11
|
#define IMG_FILEDLG_BTN_STD 11
|
||||||
#define IMG_FILEDLG_CREATEFOLDER 14
|
#define IMG_FILEDLG_CREATEFOLDER 14
|
||||||
|
#define IMG_FILEDLG_PLACE_LOCAL 15
|
||||||
|
#define IMG_FILEDLG_PLACE_REMOTE 16
|
||||||
|
|
||||||
#define CTL_EXPLORERFILE_FILELIST 20
|
#define CTL_EXPLORERFILE_FILELIST 20
|
||||||
|
|
||||||
@@ -74,16 +75,17 @@
|
|||||||
#define STR_BUTTONSELECT 6
|
#define STR_BUTTONSELECT 6
|
||||||
#define STR_ACTUALVERSION 7
|
#define STR_ACTUALVERSION 7
|
||||||
#define STR_PREVIEW 8
|
#define STR_PREVIEW 8
|
||||||
#define STR_MY_DOCUMENTS 9
|
#define STR_DEFAULT_DIRECTORY 9
|
||||||
|
#define STR_PLACES_TITLE 10
|
||||||
|
|
||||||
// DLG_SVT_ADDPLACE ------------------------------
|
// DLG_SVT_ADDPLACE ------------------------------
|
||||||
|
|
||||||
#define FT_ADDPLACE_SERVERURL 10
|
#define FT_ADDPLACE_SERVERURL 10
|
||||||
#define FT_ADDPLACE_SERVERNAME 11
|
#define FT_ADDPLACE_SERVERNAME 11
|
||||||
#define FT_ADDPLACE_SERVERTYPE 12
|
#define FT_ADDPLACE_SERVERTYPE 12
|
||||||
#define FT_ADDPLACE_SERVERLOGIN 13
|
#define FT_ADDPLACE_SERVERLOGIN 13
|
||||||
#define FT_ADDPLACE_SERVERPASSWORD 14
|
#define FT_ADDPLACE_SERVERPASSWORD 14
|
||||||
#define ED_ADDPLACE_SERVERURL 15
|
#define ED_ADDPLACE_SERVERURL 15
|
||||||
#define ED_ADDPLACE_SERVERNAME 16
|
#define ED_ADDPLACE_SERVERNAME 16
|
||||||
#define ED_ADDPLACE_SERVERTYPE 17
|
#define ED_ADDPLACE_SERVERTYPE 17
|
||||||
#define ED_ADDPLACE_SERVERLOGIN 18
|
#define ED_ADDPLACE_SERVERLOGIN 18
|
||||||
|
@@ -344,9 +344,6 @@ private:
|
|||||||
|
|
||||||
String implGetInitialURL( const String& _rPath, const String& _rFallback );
|
String implGetInitialURL( const String& _rPath, const String& _rFallback );
|
||||||
|
|
||||||
/// initializes the special URL lists, such as our favourites and our restricted paths
|
|
||||||
void implInitializeSpecialURLLists( );
|
|
||||||
|
|
||||||
/// executes a certain FileView action asynchronously
|
/// executes a certain FileView action asynchronously
|
||||||
void executeAsync(
|
void executeAsync(
|
||||||
::svt::AsyncPickerAction::Action _eAction,
|
::svt::AsyncPickerAction::Action _eAction,
|
||||||
|
@@ -36,10 +36,12 @@
|
|||||||
IMG_FILEDLG_BTN_UP; \
|
IMG_FILEDLG_BTN_UP; \
|
||||||
IMG_FILEDLG_BTN_STD; \
|
IMG_FILEDLG_BTN_STD; \
|
||||||
IMG_FILEDLG_CREATEFOLDER; \
|
IMG_FILEDLG_CREATEFOLDER; \
|
||||||
|
IMG_FILEDLG_PLACE_LOCAL; \
|
||||||
|
IMG_FILEDLG_PLACE_REMOTE; \
|
||||||
}; \
|
}; \
|
||||||
IdCount = \
|
IdCount = \
|
||||||
{ \
|
{ \
|
||||||
3; \
|
5; \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; };
|
#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; };
|
||||||
@@ -67,7 +69,7 @@ ModalDialog DLG_SVT_EXPLORERFILE
|
|||||||
Edit ED_EXPLORERFILE_CURRENTPATH
|
Edit ED_EXPLORERFILE_CURRENTPATH
|
||||||
{
|
{
|
||||||
Pos = MAP_APPFONT ( 6 , 6 ) ;
|
Pos = MAP_APPFONT ( 6 , 6 ) ;
|
||||||
Size = MAP_APPFONT ( 90 , 14 ) ;
|
Size = MAP_APPFONT ( 90 , 12 ) ;
|
||||||
Border = TRUE ;
|
Border = TRUE ;
|
||||||
};
|
};
|
||||||
ImageButton BTN_EXPLORERFILE_NEWFOLDER
|
ImageButton BTN_EXPLORERFILE_NEWFOLDER
|
||||||
@@ -75,6 +77,7 @@ ModalDialog DLG_SVT_EXPLORERFILE
|
|||||||
HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_NEWFOLDER";
|
HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_NEWFOLDER";
|
||||||
TabStop = FALSE ;
|
TabStop = FALSE ;
|
||||||
Pos = MAP_APPFONT ( 59 , 6 ) ;
|
Pos = MAP_APPFONT ( 59 , 6 ) ;
|
||||||
|
Size = MAP_APPFONT( 12, 12 ) ;
|
||||||
QuickHelpText [ en-US ] = "Create New Directory" ;
|
QuickHelpText [ en-US ] = "Create New Directory" ;
|
||||||
};
|
};
|
||||||
MenuButton BTN_EXPLORERFILE_UP
|
MenuButton BTN_EXPLORERFILE_UP
|
||||||
@@ -82,31 +85,21 @@ ModalDialog DLG_SVT_EXPLORERFILE
|
|||||||
HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_UP";
|
HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_UP";
|
||||||
TabStop = FALSE ;
|
TabStop = FALSE ;
|
||||||
Pos = MAP_APPFONT ( 109 , 6 ) ;
|
Pos = MAP_APPFONT ( 109 , 6 ) ;
|
||||||
|
Size = MAP_APPFONT( 12, 12 ) ;
|
||||||
QuickHelpText [ en-US ] = "Up One Level" ;
|
QuickHelpText [ en-US ] = "Up One Level" ;
|
||||||
};
|
};
|
||||||
|
Control LB_EXPLORERFILE_PLACES_LISTBOX
|
||||||
MenuButton BTN_EXPLORERFILE_STANDARD
|
|
||||||
{
|
|
||||||
HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_STANDARD";
|
|
||||||
TabStop = FALSE ;
|
|
||||||
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";
|
HelpID = "fpicker:ListBox:DLG_SVT_EXPLORERFILE:LB_EXPLORERFILE_PLACES_LISTBOX";
|
||||||
Pos = MAP_APPFONT ( 6 , 26 ) ;
|
Pos = MAP_APPFONT ( 6 , 26 ) ;
|
||||||
Size = MAP_APPFONT ( 50 , 75 ) ;
|
Size = MAP_APPFONT ( 50 , 75 ) ;
|
||||||
DropDown = FALSE ;
|
|
||||||
AutoSize = FALSE ;
|
|
||||||
AutoHScroll = TRUE ;
|
|
||||||
Border = TRUE ;
|
Border = TRUE ;
|
||||||
};
|
};
|
||||||
PushButton BTN_EXPLORERFILE_CONNECT_TO_SERVER
|
PushButton BTN_EXPLORERFILE_CONNECT_TO_SERVER
|
||||||
{
|
{
|
||||||
HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_CONNECT_TO_SERVER";
|
HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_CONNECT_TO_SERVER";
|
||||||
Pos = MAP_APPFONT ( 94 , 6 ) ;
|
Pos = MAP_APPFONT ( 94 , 6 ) ;
|
||||||
Size = MAP_APPFONT ( 15 , 10 ) ;
|
Size = MAP_APPFONT ( 12 , 12 ) ;
|
||||||
Text [ en-US ] = "..." ;
|
Text [ en-US ] = "..." ;
|
||||||
QuickHelpText [ en-US ] = "Connect To Server" ;
|
QuickHelpText [ en-US ] = "Connect To Server" ;
|
||||||
};
|
};
|
||||||
@@ -252,9 +245,13 @@ ModalDialog DLG_SVT_EXPLORERFILE
|
|||||||
{
|
{
|
||||||
Text [ en-US ] = "File Preview";
|
Text [ en-US ] = "File Preview";
|
||||||
};
|
};
|
||||||
String STR_MY_DOCUMENTS
|
String STR_DEFAULT_DIRECTORY
|
||||||
{
|
{
|
||||||
Text [ en-US ] = "My Documents" ;
|
Text [ en-US ] = "Default Directory" ;
|
||||||
|
};
|
||||||
|
String STR_PLACES_TITLE
|
||||||
|
{
|
||||||
|
Text [ en-US ] = "Places" ;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -358,7 +358,6 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
|
|||||||
_pBtnHelp ( NULL ),
|
_pBtnHelp ( NULL ),
|
||||||
_pBtnUp ( NULL ),
|
_pBtnUp ( NULL ),
|
||||||
_pBtnNewFolder ( NULL ),
|
_pBtnNewFolder ( NULL ),
|
||||||
_pBtnStandard ( NULL ),
|
|
||||||
_pCbPassword ( NULL ),
|
_pCbPassword ( NULL ),
|
||||||
_pEdCurrentPath ( NULL ),
|
_pEdCurrentPath ( NULL ),
|
||||||
_pCbAutoExtension ( NULL ),
|
_pCbAutoExtension ( NULL ),
|
||||||
@@ -386,7 +385,6 @@ SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl()
|
|||||||
delete _pCbPassword;
|
delete _pCbPassword;
|
||||||
delete _pCbAutoExtension;
|
delete _pCbAutoExtension;
|
||||||
delete _pCbOptions;
|
delete _pCbOptions;
|
||||||
delete _pBtnStandard;
|
|
||||||
delete _pBtnNewFolder;
|
delete _pBtnNewFolder;
|
||||||
delete _pBtnUp;
|
delete _pBtnUp;
|
||||||
delete _pBtnHelp;
|
delete _pBtnHelp;
|
||||||
|
@@ -184,7 +184,6 @@ public:
|
|||||||
HelpButton* _pBtnHelp;
|
HelpButton* _pBtnHelp;
|
||||||
SvtUpButton_Impl* _pBtnUp;
|
SvtUpButton_Impl* _pBtnUp;
|
||||||
ImageButton* _pBtnNewFolder;
|
ImageButton* _pBtnNewFolder;
|
||||||
SvtTravelButton_Impl* _pBtnStandard;
|
|
||||||
CheckBox* _pCbPassword;
|
CheckBox* _pCbPassword;
|
||||||
SvtURLBox* _pEdCurrentPath;
|
SvtURLBox* _pEdCurrentPath;
|
||||||
CheckBox* _pCbAutoExtension;
|
CheckBox* _pCbAutoExtension;
|
||||||
|
BIN
icon-themes/galaxy/fpicker/res/fp015.png
Normal file
BIN
icon-themes/galaxy/fpicker/res/fp015.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 253 B |
BIN
icon-themes/galaxy/fpicker/res/fp016.png
Normal file
BIN
icon-themes/galaxy/fpicker/res/fp016.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 B |
@@ -590,7 +590,10 @@
|
|||||||
<value oor:external=
|
<value oor:external=
|
||||||
"com.sun.star.configuration.backend.GconfBackend SymbolSet"/>
|
"com.sun.star.configuration.backend.GconfBackend SymbolSet"/>
|
||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="FilePickerPlaces">
|
<prop oor:name="FilePickerPlacesUrls">
|
||||||
|
<value/>
|
||||||
|
</prop>
|
||||||
|
<prop oor:name="FilePickerPlacesNames">
|
||||||
<value/>
|
<value/>
|
||||||
</prop>
|
</prop>
|
||||||
</node>
|
</node>
|
||||||
|
@@ -6755,9 +6755,14 @@
|
|||||||
</info>
|
</info>
|
||||||
<value>true</value>
|
<value>true</value>
|
||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="FilePickerPlaces" oor:type="oor:string-list" oor:nillable="false">
|
<prop oor:name="FilePickerPlacesUrls" oor:type="oor:string-list" oor:nillable="false">
|
||||||
<info>
|
<info>
|
||||||
<desc>List of the places the user bookmarked in the file picker dialog.</desc>
|
<desc>List of URLs of the places the user bookmarked in the file picker dialog.</desc>
|
||||||
|
</info>
|
||||||
|
</prop>
|
||||||
|
<prop oor:name="FilePickerPlacesNames" oor:type="oor:string-list" oor:nillable="false">
|
||||||
|
<info>
|
||||||
|
<desc>List of names of the places the user bookmarked in the file picker dialog.</desc>
|
||||||
</info>
|
</info>
|
||||||
</prop>
|
</prop>
|
||||||
</group>
|
</group>
|
||||||
|
Reference in New Issue
Block a user