diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-03-27 18:01:07 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-04-02 18:30:39 +0200 |
commit | 9d499f5f9edd01cf5c4dbb2bc7625b3c5d10757a (patch) | |
tree | cd5db4ae3b52628ee9ad83dc6e9345b61b49f911 /fpicker | |
parent | 5e301969bf1c8818b5c737757363c31584823485 (diff) |
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
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/Library_fps_office.mk | 2 | ||||
-rw-r--r-- | fpicker/source/office/PlaceEditDialog.cxx (renamed from fpicker/source/office/SvtPlaceDialog.cxx) | 32 | ||||
-rw-r--r-- | fpicker/source/office/PlaceEditDialog.hxx (renamed from fpicker/source/office/SvtPlaceDialog.hxx) | 10 | ||||
-rw-r--r-- | fpicker/source/office/PlacesListBox.cxx | 88 | ||||
-rw-r--r-- | fpicker/source/office/PlacesListBox.hxx | 51 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 104 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hrc | 10 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hxx | 3 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.src | 31 | ||||
-rw-r--r-- | fpicker/source/office/iodlgimp.cxx | 2 | ||||
-rw-r--r-- | fpicker/source/office/iodlgimp.hxx | 1 |
11 files changed, 156 insertions, 178 deletions
diff --git a/fpicker/Library_fps_office.mk b/fpicker/Library_fps_office.mk index a98efe15709c..1f0e9983b726 100644 --- a/fpicker/Library_fps_office.mk +++ b/fpicker/Library_fps_office.mk @@ -60,8 +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/PlaceEditDialog \ fpicker/source/office/PlacesListBox \ - fpicker/source/office/SvtPlaceDialog \ )) # vim: set noet sw=4 ts=4: diff --git a/fpicker/source/office/SvtPlaceDialog.cxx b/fpicker/source/office/PlaceEditDialog.cxx index 5de6bde15d63..d7569b41f31c 100644 --- a/fpicker/source/office/SvtPlaceDialog.cxx +++ b/fpicker/source/office/PlaceEditDialog.cxx @@ -32,10 +32,10 @@ #include "fpsofficeResMgr.hxx" #include "PlacesListBox.hxx" -#include "SvtPlaceDialog.hxx" +#include "PlaceEditDialog.hxx" -SvtPlaceDialog::SvtPlaceDialog( Window* pParent ) : +PlaceEditDialog::PlaceEditDialog( Window* pParent ) : ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ), m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ), 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 // delete button is hidden. - m_aBTOk.SetClickHdl( LINK( this, SvtPlaceDialog, OKHdl) ); + m_aBTOk.SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); m_aBTOk.Enable( sal_False ); - m_aEDServerName.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) ); - m_aEDServerUrl.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) ); + m_aEDServerName.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) ); + m_aEDServerUrl.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) ); m_aEDServerUrl.SetUrlFilter( &m_UrlFilter ); Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) ); @@ -66,7 +66,7 @@ SvtPlaceDialog::SvtPlaceDialog( Window* pParent ) : m_aBTDelete.Hide(); } -SvtPlaceDialog::SvtPlaceDialog( Window* pParent, PlacePtr pPlace ) : +PlaceEditDialog::PlaceEditDialog( Window* pParent, PlacePtr pPlace ) : ModalDialog( pParent, SvtResId( DLG_SVT_ADDPLACE ) ), m_aFTServerUrl( this, SvtResId( FT_ADDPLACE_SERVERURL ) ), 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_aBTDelete ( this, SvtResId (BT_ADDPLACE_DELETE ) ) { - m_aBTOk.SetClickHdl( LINK( this, SvtPlaceDialog, OKHdl) ); - m_aBTDelete.SetClickHdl ( LINK( this, SvtPlaceDialog, DelHdl) ); + m_aBTOk.SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); + m_aBTDelete.SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) ); - m_aEDServerName.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) ); - m_aEDServerUrl.SetModifyHdl( LINK( this, SvtPlaceDialog, EditHdl) ); + m_aEDServerName.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) ); + m_aEDServerUrl.SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) ); m_aEDServerUrl.SetUrlFilter( &m_UrlFilter ); Edit aDummyEdit ( this, SvtResId( ED_ADDPLACE_SERVERURL ) ); @@ -97,30 +97,30 @@ SvtPlaceDialog::SvtPlaceDialog( Window* pParent, PlacePtr pPlace ) : 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; } -IMPL_LINK ( SvtPlaceDialog, OKHdl, Button *, EMPTYARG ) +IMPL_LINK ( PlaceEditDialog, OKHdl, Button *, EMPTYARG ) { EndDialog( RET_OK ); return 1; } -IMPL_LINK ( SvtPlaceDialog, DelHdl, Button *, EMPTYARG ) +IMPL_LINK ( PlaceEditDialog, DelHdl, Button *, EMPTYARG ) { // ReUsing existing symbols... EndDialog( RET_NO ); return 1; } -IMPL_LINK ( SvtPlaceDialog, EditHdl, Edit *, EMPTYARG ) +IMPL_LINK ( PlaceEditDialog, EditHdl, Edit *, EMPTYARG ) { String anUrl = m_aEDServerUrl.GetText(); anUrl.EraseLeadingChars().EraseTrailingChars(); diff --git a/fpicker/source/office/SvtPlaceDialog.hxx b/fpicker/source/office/PlaceEditDialog.hxx index d7861674b259..4c6bb2879ea3 100644 --- a/fpicker/source/office/SvtPlaceDialog.hxx +++ b/fpicker/source/office/PlaceEditDialog.hxx @@ -28,6 +28,8 @@ #ifndef _SVTPLACEDIALOG_HXX #define _SVTPLACEDIALOG_HXX +#include "PlacesListBox.hxx" + #include <vcl/button.hxx> #include <vcl/dialog.hxx> #include <vcl/fixed.hxx> @@ -38,7 +40,7 @@ #include <svl/restrictedpaths.hxx> class Place; -class SvtPlaceDialog : public ModalDialog +class PlaceEditDialog : public ModalDialog { private : @@ -69,9 +71,9 @@ private : public : - SvtPlaceDialog( Window* pParent); - SvtPlaceDialog( Window* pParent, PlacePtr pPlace ); - ~SvtPlaceDialog(); + PlaceEditDialog( Window* pParent); + PlaceEditDialog( Window* pParent, PlacePtr pPlace ); + ~PlaceEditDialog(); // Returns a place instance with given informations PlacePtr GetPlace(); diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx index 5d08e1a552be..31bb1250a406 100644 --- a/fpicker/source/office/PlacesListBox.cxx +++ b/fpicker/source/office/PlacesListBox.cxx @@ -28,33 +28,68 @@ #include <iodlg.hrc> #include <PlacesListBox.hxx> -#include "SvtPlaceDialog.hxx" +#include "PlaceEditDialog.hxx" #include <vcl/msgbox.hxx> +#include <svtools/headbar.hxx> #include <svtools/svtdata.hxx> +#define COLUMN_NAME 1 + namespace css = com::sun::star; using rtl::OUString; -PlacesListBox::PlacesListBox( SvtFileDialog* pFileDlg, const ResId& rResId ) : - ListBox( pFileDlg, rResId ), +PlacesListBox_Impl::PlacesListBox_Impl( Window* pParent, const rtl::OUString& rTitle ) : + 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( ), mpDlg( pFileDlg ), + mpImpl( NULL ), mnNbEditables( 0 ), mbUpdated( false ) { - SetSelectHdl( LINK( this, PlacesListBox, SelectHdl ) ); - SetDoubleClickHdl( LINK( this, PlacesListBox, DoubleClickHdl ) ) ; + mpImpl = new PlacesListBox_Impl( this, rTitle ); + + mpImpl->SetSelectHdl( LINK( this, PlacesListBox, Selection ) ); + mpImpl->SetDoubleClickHdl( LINK( this, PlacesListBox, DoubleClick ) ) ; } PlacesListBox::~PlacesListBox( ) { + delete mpImpl; } void PlacesListBox::AppendPlace( PlacePtr pPlace ) { maPlaces.push_back( pPlace ); - InsertEntry( pPlace->GetName( ), getEntryIcon( pPlace->GetType( ) )); + mpImpl->InsertEntry( pPlace->GetName( ), + getEntryIcon( pPlace ), getEntryIcon( pPlace ) ); if(pPlace->IsEditable()) { ++mnNbEditables; @@ -91,53 +126,50 @@ void PlacesListBox::RemovePlace( sal_uInt16 nPos ) mbUpdated = true; } maPlaces.erase( maPlaces.begin() + nPos ); - RemoveEntry( nPos ); + SvLBoxEntry* pEntry = mpImpl->GetEntry( nPos ); + mpImpl->RemoveEntry( pEntry ); } } void PlacesListBox::RemoveSelectedPlace() { - RemovePlace(GetSelectEntryPos()); + RemovePlace(mpImpl->GetCurrRow()); +} + +void PlacesListBox::SetSizePixel( const Size& rNewSize ) +{ + Control::SetSizePixel( rNewSize ); + mpImpl->SetSizePixel( rNewSize ); } -Image PlacesListBox::getEntryIcon(Place::ePlaceType aType) +Image PlacesListBox::getEntryIcon( PlacePtr pPlace ) { - 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; - }; + Image theImage = mpDlg->GetButtonImage( IMG_FILEDLG_PLACE_LOCAL ); + if ( !pPlace->IsLocal( ) ) + theImage = mpDlg->GetButtonImage( IMG_FILEDLG_PLACE_REMOTE ); 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]; + mpDlg->OpenURL_Impl( pPlace->GetUrl() ); if(pPlace->IsEditable()) mpDlg->RemovablePlaceSelected(); else mpDlg->RemovablePlaceSelected(false); - 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]; if ( pPlace->IsEditable() == true ) { - SvtPlaceDialog aDlg(mpDlg,pPlace); + PlaceEditDialog aDlg(mpDlg,pPlace); short aRetCode = aDlg.Execute(); switch(aRetCode) { case RET_OK : diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx index f7f718b27faa..0326be885fbd 100644 --- a/fpicker/source/office/PlacesListBox.hxx +++ b/fpicker/source/office/PlacesListBox.hxx @@ -29,63 +29,68 @@ #define _PLACESLISTBOX_HXX_ #include <iodlg.hxx> -#include <vcl/lstbox.hxx> + #include <boost/shared_ptr.hpp> +#include <svtools/svtabbx.hxx> +#include <tools/urlobj.hxx> + #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; + INetURLObject maUrl; sal_Bool mbEditable; 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 ), - msUrl( sUrl ), - meType( eType ), + maUrl( sUrl ), mbEditable( bEditable ) {}; ~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 SetUrl(const rtl::OUString& aUrl ) { msUrl = aUrl; } + void SetUrl(const rtl::OUString& aUrl ) { maUrl.SetURL( aUrl ); } rtl::OUString& GetName( ) { return msName; } - rtl::OUString& GetUrl( ) { return msUrl; } - ePlaceType& GetType( ) { return meType; } + rtl::OUString GetUrl( ) { return maUrl.GetMainURL( INetURLObject::NO_DECODE ); } + sal_Bool IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; }; sal_Bool& IsEditable( ) { return mbEditable; } }; 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. */ -class PlacesListBox : public ListBox +class PlacesListBox : public Control { private: std::vector< PlacePtr > maPlaces; SvtFileDialog* mpDlg; + PlacesListBox_Impl* mpImpl; sal_Int32 mnNbEditables; bool mbUpdated; public: - PlacesListBox( SvtFileDialog* pFileDlg, const ResId& rResId ); + PlacesListBox( SvtFileDialog* pFileDlg, const rtl::OUString& rTitle, const ResId& rResId ); ~PlacesListBox( ); void AppendPlace( PlacePtr pPlace ); @@ -96,12 +101,14 @@ class PlacesListBox : public ListBox bool IsUpdated(); const std::vector<PlacePtr>& GetPlaces(); + void SetSizePixel( const Size& rNewSize ); + private: - Image getEntryIcon( Place::ePlaceType eType); - DECL_LINK( SelectHdl, ListBox* ); - DECL_LINK( DoubleClickHdl, ListBox* ); + Image getEntryIcon( PlacePtr pPlace ); + DECL_LINK( Selection, void* ); + DECL_LINK( DoubleClick, void* ); }; #endif diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 5d1916a45630..3c9df7d4c180 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -28,6 +28,7 @@ #include <sal/macros.h> #include "iodlg.hxx" +#include "PlaceEditDialog.hxx" #include "PlacesListBox.hxx" #include "fpsofficeResMgr.hxx" #include <tools/stream.hxx> @@ -88,7 +89,6 @@ #include <osl/process.h> #include <officecfg/Office/Common.hxx> -#include "SvtPlaceDialog.hxx" #include <algorithm> #include <functional> @@ -496,17 +496,20 @@ SvtFileDialog::~SvtFileDialog() // Save bookmarked places if(_pImp->_pPlaces->IsUpdated()) { 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); for(std::vector<PlacePtr>::const_iterator it = aPlaces.begin(); it != aPlaces.end(); ++it) { if((*it)->IsEditable()) { - placesList[i] = (*it)->GetUrl(); + placesUrlsList[i] = (*it)->GetUrl(); + placesNamesList[i] = (*it)->GetName(); ++i; } } 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(); } @@ -618,11 +621,9 @@ void SvtFileDialog::Init_Impl _pImp->_pBtnUp = new SvtUpButton_Impl( this, SvtResId( BTN_EXPLORERFILE_UP ) ); _pImp->_pBtnNewFolder = new ImageButton( this, SvtResId( BTN_EXPLORERFILE_NEWFOLDER ) ); _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->_pBtnNewFolder->SetAccessibleName( _pImp->_pBtnNewFolder->GetQuickHelpText() ); - _pImp->_pBtnStandard->SetAccessibleName( _pImp->_pBtnStandard->GetQuickHelpText() ); if ( ( nStyle & SFXWB_MULTISELECTION ) == SFXWB_MULTISELECTION ) _pImp->_bMultiSelection = sal_True; @@ -637,16 +638,10 @@ void SvtFileDialog::Init_Impl _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP ); // determine the size of the buttons + Size aSize = _pImp->_pBtnNewFolder->GetSizePixel(); Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) ); _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 Size aDlgSize = GetOutputSizePixel(); long n6AppFontInPixel = @@ -659,15 +654,11 @@ void SvtFileDialog::Init_Impl // component currently positioned long nDelta = n6AppFontInPixel; - // Standard dir - nDelta += aSize.Width(); + // New folder Point aPos( aDlgSize.Width() - nDelta, - _pImp->_pBtnStandard->GetPosPixel().Y() + _pImp->_pBtnNewFolder->GetPosPixel().Y() ); - _pImp->_pBtnStandard->SetPosPixel(aPos); - - // New folder nDelta += aSize.Width() + nHalf3AppFontInPixel; aPos.X() = aDlgSize.Width() - nDelta; _pImp->_pBtnNewFolder->SetPosPixel(aPos); @@ -678,19 +669,8 @@ void SvtFileDialog::Init_Impl _pImp->_pBtnUp->SetPosPixel(aPos); // Connect to server ("...") - nDelta += _pImp->_pBtnConnectToServer->GetSizePixel().Width() + n3AppFontInPixel; + nDelta += _pImp->_pBtnConnectToServer->GetSizePixel().Width() + nHalf3AppFontInPixel; 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); // Set the size of the URL bar @@ -742,6 +722,7 @@ void SvtFileDialog::Init_Impl aPos.X() = _pImp->_pPlaces->GetPosPixel().X(); _pImp->_pPlaces->SetPosPixel( aPos ); + lcl_MoveControl( _pImp->_pFtFileName, 0, nYOffset ); lcl_MoveControl( _pImp->_pEdFileName, 0, nYOffset ); @@ -825,7 +806,6 @@ void SvtFileDialog::Init_Impl _pImp->_pEdFileName->SetHelpId( HID_FILESAVE_FILEURL ); _pImp->_pBtnFileOpen->SetHelpId( HID_FILESAVE_DOSAVE ); _pImp->_pBtnNewFolder->SetHelpId( HID_FILESAVE_CREATEDIRECTORY ); - _pImp->_pBtnStandard->SetHelpId( HID_FILESAVE_DEFAULTDIRECTORY ); _pImp->_pBtnUp->SetHelpId( HID_FILESAVE_LEVELUP ); _pImp->GetFilterListControl()->SetHelpId( HID_FILESAVE_FILETYPE ); _pFileView->SetHelpId( HID_FILESAVE_FILEVIEW ); @@ -851,9 +831,6 @@ void SvtFileDialog::Init_Impl // correct the z-order of the controls implArrangeControls(); - // special URLs, such as favourites and "restricted" paths - implInitializeSpecialURLLists( ); - /// read our settings from the configuration m_aConfiguration = OConfigurationTreeRoot::createWithServiceFactory( ::comphelper::getProcessServiceFactory(), @@ -1467,7 +1444,7 @@ IMPL_STATIC_LINK ( SvtFileDialog, ConnectToServerPressed_Hdl, void*, EMPTYARG ) { pThis->_pFileView->EndInplaceEditing( false ); - SvtPlaceDialog aDlg( pThis ); + PlaceEditDialog aDlg( pThis ); short aRetCode = aDlg.Execute(); switch (aRetCode) { @@ -1493,9 +1470,9 @@ IMPL_STATIC_LINK ( SvtFileDialog, AddPlacePressed_Hdl, void*, EMPTYARG ) { // Maybe open the PlacesDialog would have been a better idea // there is an ux choice to make we did not make... - PlacePtr newPlace(new Place(::rtl::OUString(pThis->_pFileView->GetViewURL()), - ::rtl::OUString(pThis->_pFileView->GetViewURL()), - Place::e_PlaceLocal, true)); + INetURLObject aURLObj( pThis->_pFileView->GetViewURL() ); + PlacePtr newPlace(new Place( aURLObj.GetLastName(), + ::rtl::OUString(pThis->_pFileView->GetViewURL()), true)); pThis->_pImp->_pPlaces->AppendPlace(newPlace); return 0; } @@ -1505,7 +1482,6 @@ IMPL_STATIC_LINK ( SvtFileDialog, AddPlacePressed_Hdl, void*, EMPTYARG ) IMPL_STATIC_LINK ( SvtFileDialog, RemovePlacePressed_Hdl, void*, EMPTYARG ) { pThis->_pImp->_pPlaces->RemoveSelectedPlace(); - return 0; } @@ -2315,32 +2291,6 @@ short SvtFileDialog::PrepareExecute() } //----------------------------------------------------------------------------- -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, const String& _rURL, const String& _rFilter ) { @@ -2591,7 +2541,7 @@ void SvtFileDialog::implArrangeControls() Control* pControls[] = { _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 _pFileView, // the file view _pImp->_pFtFileName, _pImp->_pEdFileName, @@ -2709,9 +2659,6 @@ void SvtFileDialog::implUpdateImages( ) if ( _pImp->_pBtnUp ) _pImp->_pBtnUp->SetModeImage( GetButtonImage( IMG_FILEDLG_BTN_UP ) ); - if ( _pImp->_pBtnStandard ) - _pImp->_pBtnStandard->SetModeImage( GetButtonImage( IMG_FILEDLG_BTN_STD ) ); - if ( _pImp->_pBtnNewFolder ) _pImp->_pBtnNewFolder->SetModeImage( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) ); } @@ -2806,7 +2753,7 @@ void SvtFileDialog::Resize() Control* aMoveControlsHor[] = { _pImp->_pBtnConnectToServer, - _pImp->_pBtnUp, _pImp->_pBtnNewFolder, _pImp->_pBtnStandard + _pImp->_pBtnUp, _pImp->_pBtnNewFolder }; Control** ppMoveControls = aMoveControlsHor; Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsHor ); @@ -2966,10 +2913,6 @@ Control* SvtFileDialog::getControl( sal_Int16 _nControlId, sal_Bool _bLabelContr pReturn = _pImp->_pBtnHelp; break; - case TOOLBOXBUTOON_DEFAULT_LOCATION: - pReturn = _pImp->_pBtnStandard; - break; - case TOOLBOXBUTOON_LEVEL_UP: pReturn = _pImp->_pBtnUp; break; @@ -3107,7 +3050,7 @@ void SvtFileDialog::AddControls_Impl( ) _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(); } @@ -3435,14 +3378,15 @@ void SvtFileDialog::appendDefaultExtension(String& _rFileName, 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 ); // 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) { - PlacePtr pPlace(new Place(placesList[nPlace], placesList[nPlace], Place::e_PlaceLocal, true)); + for(sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace) { + PlacePtr pPlace(new Place(placesNamesList[nPlace], placesUrlsList[nPlace], true)); _pImp->_pPlaces->AppendPlace(pPlace); } diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index e54c7029c56d..3e089fc7a6f4 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -36,7 +36,6 @@ #define ED_EXPLORERFILE_CURRENTPATH 10 #define BTN_EXPLORERFILE_NEWFOLDER 11 #define BTN_EXPLORERFILE_UP 12 -#define BTN_EXPLORERFILE_STANDARD 13 #define BTN_EXPLORERFILE_OPEN 14 #define BTN_EXPLORERFILE_CANCEL 15 #define BTN_EXPLORERFILE_HELP 16 @@ -44,6 +43,8 @@ #define IMG_FILEDLG_BTN_UP 10 #define IMG_FILEDLG_BTN_STD 11 #define IMG_FILEDLG_CREATEFOLDER 14 +#define IMG_FILEDLG_PLACE_LOCAL 15 +#define IMG_FILEDLG_PLACE_REMOTE 16 #define CTL_EXPLORERFILE_FILELIST 20 @@ -74,16 +75,17 @@ #define STR_BUTTONSELECT 6 #define STR_ACTUALVERSION 7 #define STR_PREVIEW 8 -#define STR_MY_DOCUMENTS 9 +#define STR_DEFAULT_DIRECTORY 9 +#define STR_PLACES_TITLE 10 // DLG_SVT_ADDPLACE ------------------------------ -#define FT_ADDPLACE_SERVERURL 10 +#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_SERVERURL 15 #define ED_ADDPLACE_SERVERNAME 16 #define ED_ADDPLACE_SERVERTYPE 17 #define ED_ADDPLACE_SERVERLOGIN 18 diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 4b325de39e3b..4dda63bb8c1b 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -344,9 +344,6 @@ private: 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 void executeAsync( ::svt::AsyncPickerAction::Action _eAction, diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index 819694a53dbf..881b7411c914 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -36,10 +36,12 @@ IMG_FILEDLG_BTN_UP; \ IMG_FILEDLG_BTN_STD; \ IMG_FILEDLG_CREATEFOLDER; \ + IMG_FILEDLG_PLACE_LOCAL; \ + IMG_FILEDLG_PLACE_REMOTE; \ }; \ IdCount = \ { \ - 3; \ + 5; \ }; #define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }; @@ -67,7 +69,7 @@ ModalDialog DLG_SVT_EXPLORERFILE Edit ED_EXPLORERFILE_CURRENTPATH { Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 90 , 14 ) ; + Size = MAP_APPFONT ( 90 , 12 ) ; Border = TRUE ; }; ImageButton BTN_EXPLORERFILE_NEWFOLDER @@ -75,6 +77,7 @@ ModalDialog DLG_SVT_EXPLORERFILE HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_NEWFOLDER"; TabStop = FALSE ; Pos = MAP_APPFONT ( 59 , 6 ) ; + Size = MAP_APPFONT( 12, 12 ) ; QuickHelpText [ en-US ] = "Create New Directory" ; }; MenuButton BTN_EXPLORERFILE_UP @@ -82,31 +85,21 @@ ModalDialog DLG_SVT_EXPLORERFILE HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_UP"; TabStop = FALSE ; Pos = MAP_APPFONT ( 109 , 6 ) ; + Size = MAP_APPFONT( 12, 12 ) ; QuickHelpText [ en-US ] = "Up One Level" ; }; - - 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 + Control 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 ) ; + Size = MAP_APPFONT ( 12 , 12 ) ; Text [ en-US ] = "..." ; QuickHelpText [ en-US ] = "Connect To Server" ; }; @@ -252,9 +245,13 @@ ModalDialog DLG_SVT_EXPLORERFILE { Text [ en-US ] = "File Preview"; }; - String STR_MY_DOCUMENTS + String STR_DEFAULT_DIRECTORY + { + Text [ en-US ] = "Default Directory" ; + }; + String STR_PLACES_TITLE { - Text [ en-US ] = "My Documents" ; + Text [ en-US ] = "Places" ; }; }; diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 4a7ffc5e8cec..7900ee18c6b1 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -358,7 +358,6 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) : _pBtnHelp ( NULL ), _pBtnUp ( NULL ), _pBtnNewFolder ( NULL ), - _pBtnStandard ( NULL ), _pCbPassword ( NULL ), _pEdCurrentPath ( NULL ), _pCbAutoExtension ( NULL ), @@ -386,7 +385,6 @@ SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl() delete _pCbPassword; delete _pCbAutoExtension; delete _pCbOptions; - delete _pBtnStandard; delete _pBtnNewFolder; delete _pBtnUp; delete _pBtnHelp; diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx index de9df3be7152..3e5cd765fff5 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -184,7 +184,6 @@ public: HelpButton* _pBtnHelp; SvtUpButton_Impl* _pBtnUp; ImageButton* _pBtnNewFolder; - SvtTravelButton_Impl* _pBtnStandard; CheckBox* _pCbPassword; SvtURLBox* _pEdCurrentPath; CheckBox* _pCbAutoExtension; |