Rebased ref, commits from common ancestor: commit cbdb792046436886b66bd301a405a176f7ccead9 Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 11 10:19:08 2015 +0200
use shared context Change-Id: I513a07e8e8d361b8f9c9695ddc8d283ee62b565d diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index ade4e23..6cf9994 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -170,8 +170,8 @@ class FileViewContainer : public vcl::Window RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) : SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" ) - , m_context( comphelper::getProcessComponentContext() ) - , m_xMasterPasswd( PasswordContainer::create( m_context ) ) + , m_xContext( comphelper::getProcessComponentContext() ) + , m_xMasterPasswd( PasswordContainer::create( m_xContext ) ) , m_pCurrentAsyncAction( NULL ) , m_pFileNotifier( NULL ) , m_pSplitter( NULL ) @@ -301,7 +301,7 @@ void RemoteFilesDialog::dispose() } // save services - std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_context ) ); + std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_xContext ) ); officecfg::Office::Common::Misc::FilePickerLastService::set( m_sLastServiceUrl, batch ); @@ -431,13 +431,13 @@ void RemoteFilesDialog::FillServicesListbox() m_aServices.clear(); // Load from user settings - Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get( m_context ) ); - Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get( m_context ) ); + Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get( m_xContext ) ); + Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get( m_xContext ) ); unsigned int nPos = 0; unsigned int i = 0; - m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get( m_context ); + m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get( m_xContext ); for( sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace ) { @@ -782,7 +782,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, OUString sUrl( m_aServices[nPos]->GetUrl() ); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), 0 ), + InteractionHandler::createWithParent( m_xContext, 0 ), UNO_QUERY ); UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler ); @@ -804,7 +804,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, aPasswd[0] = aNewPass; Reference< XPasswordContainer2 > xPasswdContainer( - PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + PasswordContainer::create( m_xContext ) ); xPasswdContainer->addPersistent( sUrl, sUserName, aPasswd, xInteractionHandler ); } @@ -1284,11 +1284,10 @@ bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL ) { try { - Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW ); + InteractionHandler::createWithParent( m_xContext, 0 ), UNO_QUERY_THROW ); Reference< XCommandEnvironment > xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); - ::ucbhelper::Content aContent( rURL, xEnv, xContext ); + ::ucbhelper::Content aContent( rURL, xEnv, m_xContext ); return aContent.isFolder(); } @@ -1304,11 +1303,10 @@ bool RemoteFilesDialog::ContentIsDocument( const OUString& rURL ) { try { - Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW ); + InteractionHandler::createWithParent( m_xContext, 0 ), UNO_QUERY_THROW ); Reference< XCommandEnvironment > xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); - ::ucbhelper::Content aContent( rURL, xEnv, xContext ); + ::ucbhelper::Content aContent( rURL, xEnv, m_xContext ); return aContent.isDocument(); } diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 12751d0..f35d64c 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -122,7 +122,7 @@ public: virtual OUString getCurFilter( ) const SAL_OVERRIDE; private: - Reference< com::sun::star::uno::XComponentContext > m_context; + Reference< XComponentContext > m_xContext; Reference< XPasswordContainer2 > m_xMasterPasswd; SvtRemoteDlgMode m_eMode; commit 47866b82ef83ff04a1242f95f1f200d2a1182a27 Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 11 10:11:06 2015 +0200 shared PasswordContainer Change-Id: I73d4532cd9e6f811e32d46738808c81a03c2e895 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 37c9535..ade4e23 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -171,6 +171,7 @@ class FileViewContainer : public vcl::Window RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) : SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" ) , m_context( comphelper::getProcessComponentContext() ) + , m_xMasterPasswd( PasswordContainer::create( m_context ) ) , m_pCurrentAsyncAction( NULL ) , m_pFileNotifier( NULL ) , m_pSplitter( NULL ) @@ -587,10 +588,7 @@ void RemoteFilesDialog::EnableControls() try { - Reference< XPasswordContainer2 > xMasterPasswd( - PasswordContainer::create( comphelper::getProcessComponentContext() ) ); - - if( xMasterPasswd->isPersistentStoringAllowed() ) + if( m_xMasterPasswd->isPersistentStoringAllowed() ) { int nPos = GetSelectedServicePos(); @@ -598,7 +596,7 @@ void RemoteFilesDialog::EnableControls() { OUString sUrl( m_aServices[nPos]->GetUrl() ); - UrlRecord aURLEntries = xMasterPasswd->find( sUrl, Reference< XInteractionHandler>() ); + UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, Reference< XInteractionHandler>() ); if( aURLEntries.UserList.getLength() ) { @@ -775,10 +773,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, { try { - Reference< XPasswordContainer2 > xMasterPasswd( - PasswordContainer::create( comphelper::getProcessComponentContext() ) ); - - if( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) + if( m_xMasterPasswd->isPersistentStoringAllowed() && m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) { int nPos = GetSelectedServicePos(); @@ -790,7 +785,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), 0 ), UNO_QUERY ); - UrlRecord aURLEntries = xMasterPasswd->find( sUrl, xInteractionHandler ); + UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler ); if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() ) { diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 740262a..12751d0 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -122,7 +122,8 @@ public: virtual OUString getCurFilter( ) const SAL_OVERRIDE; private: - ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_context; + Reference< com::sun::star::uno::XComponentContext > m_context; + Reference< XPasswordContainer2 > m_xMasterPasswd; SvtRemoteDlgMode m_eMode; SvtRemoteDlgType m_eType; commit dc4eea9e5ae7c437db182a6c5af10fb1c83e140e Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 16:17:23 2015 +0200 added mnemonic_widget properties Change-Id: I36b2b5bdbc597b82e746c5f81b99064efb06da75 diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index 55867ff..07b0835 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -174,6 +174,7 @@ <property name="xalign">0</property> <property name="label" translatable="yes">Host:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">host</property> </object> <packing> <property name="left_attach">0</property> @@ -213,6 +214,7 @@ <property name="xalign">0</property> <property name="label" translatable="yes">Share:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">share</property> </object> <packing> <property name="left_attach">0</property> @@ -238,6 +240,7 @@ <property name="xalign">0</property> <property name="label" translatable="yes">Repository:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">repositories</property> </object> <packing> <property name="left_attach">0</property> @@ -335,6 +338,7 @@ <property name="xalign">0</property> <property name="label" translatable="yes">Port:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">port-nospin</property> </object> <packing> <property name="expand">False</property> @@ -408,9 +412,7 @@ <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Password*:</property> - <accessibility> - <relation type="description-for" target="password"/> - </accessibility> + <property name="mnemonic_widget">password</property> </object> <packing> <property name="left_attach">0</property> @@ -423,9 +425,6 @@ <property name="can_focus">True</property> <property name="visibility">False</property> <property name="invisible_char">â</property> - <accessibility> - <relation type="described-by" target="passwordLabel"/> - </accessibility> </object> <packing> <property name="left_attach">1</property> commit 3109bef86c1cf20e06393405e80f33a0b2991d45 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 16:07:40 2015 +0200 added password field in the Add service dialog Change-Id: I1074a3a2980e939de3f578cb566bab1e0ed96aed diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 7b90ae0..37c9535 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -655,6 +655,7 @@ void RemoteFilesDialog::DisableControls() IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl ) { ScopedVclPtrInstance< PlaceEditDialog > aDlg( this ); + aDlg->ShowPasswordControl(); short aRetCode = aDlg->Execute(); switch( aRetCode ) diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index e492978..cfcfe67 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -34,6 +34,8 @@ private: std::shared_ptr< DetailsContainer > m_xCurrentDetails; VclPtr<Edit> m_pEDUsername; + VclPtr<Edit> m_pEDPassword; + VclPtr<FixedText> m_pFTPasswordLabel; VclPtr<OKButton> m_pBTOk; VclPtr<CancelButton> m_pBTCancel; @@ -67,6 +69,9 @@ public : OUString GetServerName() { return m_pEDServerName->GetText(); } OUString GetServerUrl(); + OUString GetPassword() { return m_pEDPassword->GetText(); }; + + void ShowPasswordControl( bool bShow = true ) { m_pEDPassword->Show( bShow ); m_pFTPasswordLabel->Show( bShow ); } private: diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index 8ead056..b02e927 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -31,6 +31,11 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent) get( m_pBTCancel, "cancel" ); get( m_pBTDelete, "delete" ); get( m_pBTRepoRefresh, "repositoriesRefresh" ); + get( m_pEDPassword, "password" ); + get( m_pFTPasswordLabel, "passwordLabel" ); + + m_pEDPassword->Hide(); + m_pFTPasswordLabel->Hide(); m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); m_pBTOk->Enable( false ); @@ -59,6 +64,11 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla get( m_pBTCancel, "cancel" ); get( m_pBTDelete, "delete" ); get( m_pTypeGrid, "TypeGrid" ); + get( m_pEDPassword, "password" ); + get( m_pFTPasswordLabel, "passwordLabel" ); + + m_pEDPassword->Hide(); + m_pFTPasswordLabel->Hide(); m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); m_pBTDelete->SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) ); @@ -105,6 +115,8 @@ void PlaceEditDialog::dispose() m_pBTOk.clear(); m_pBTCancel.clear(); m_pBTDelete.clear(); + m_pEDPassword.clear(); + m_pFTPasswordLabel.clear(); ModalDialog::dispose(); } diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index ec5c41e..55867ff 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -191,7 +191,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -203,7 +203,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -295,7 +295,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -307,7 +307,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -403,6 +403,36 @@ </packing> </child> <child> + <object class="GtkLabel" id="passwordLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Password*:</property> + <accessibility> + <relation type="description-for" target="password"/> + </accessibility> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="password"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="visibility">False</property> + <property name="invisible_char">â</property> + <accessibility> + <relation type="described-by" target="passwordLabel"/> + </accessibility> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> <placeholder/> </child> </object> commit 16813b1d741127397aedf2bd5e735a20cd1d8f60 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 14:15:59 2015 +0200 Show 'change password' only if is password is stored Change-Id: I04275d2e45ff32ed003a2487cd87500d550e9d73 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index c90175d..7b90ae0 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -578,7 +578,39 @@ void RemoteFilesDialog::AddFileExtension() void RemoteFilesDialog::EnableControls() { if( m_pServices_lb->GetEntryCount() > 0 ) + { m_pServices_lb->Enable( true ); + + if( m_pServices_lb->GetSelectEntryCount() ) + { + m_pAddMenu->EnableItem( "change_password", false ); + + try + { + Reference< XPasswordContainer2 > xMasterPasswd( + PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + + if( xMasterPasswd->isPersistentStoringAllowed() ) + { + int nPos = GetSelectedServicePos(); + + if( nPos >= 0 ) + { + OUString sUrl( m_aServices[nPos]->GetUrl() ); + + UrlRecord aURLEntries = xMasterPasswd->find( sUrl, Reference< XInteractionHandler>() ); + + if( aURLEntries.UserList.getLength() ) + { + m_pAddMenu->EnableItem( "change_password" ); + } + } + } + } + catch( const Exception& ) + {} + } + } else m_pServices_lb->Enable( false ); @@ -745,7 +777,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, Reference< XPasswordContainer2 > xMasterPasswd( PasswordContainer::create( comphelper::getProcessComponentContext() ) ); - if( xMasterPasswd->isPersistentStoringAllowed() ) + if( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) { int nPos = GetSelectedServicePos(); @@ -759,29 +791,26 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, UrlRecord aURLEntries = xMasterPasswd->find( sUrl, xInteractionHandler ); - if( aURLEntries.Url == sUrl ) + if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() ) { - if( aURLEntries.UserList.getLength() ) - { - OUString sUserName = aURLEntries.UserList[0].UserName; + OUString sUserName = aURLEntries.UserList[0].UserName; - ::comphelper::SimplePasswordRequest* pPasswordRequest - = new ::comphelper::SimplePasswordRequest( PasswordRequestMode_PASSWORD_CREATE ); - Reference< XInteractionRequest > rRequest( pPasswordRequest ); + ::comphelper::SimplePasswordRequest* pPasswordRequest + = new ::comphelper::SimplePasswordRequest( PasswordRequestMode_PASSWORD_CREATE ); + Reference< XInteractionRequest > rRequest( pPasswordRequest ); - xInteractionHandler->handle( rRequest ); + xInteractionHandler->handle( rRequest ); - if ( pPasswordRequest->isPassword() ) - { - OUString aNewPass = pPasswordRequest->getPassword(); - Sequence< OUString > aPasswd( 1 ); - aPasswd[0] = aNewPass; - - Reference< XPasswordContainer2 > xPasswdContainer( - PasswordContainer::create(comphelper::getProcessComponentContext())); - xPasswdContainer->addPersistent( - sUrl, sUserName, aPasswd, xInteractionHandler ); - } + if ( pPasswordRequest->isPassword() ) + { + OUString aNewPass = pPasswordRequest->getPassword(); + Sequence< OUString > aPasswd( 1 ); + aPasswd[0] = aNewPass; + + Reference< XPasswordContainer2 > xPasswdContainer( + PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + xPasswdContainer->addPersistent( + sUrl, sUserName, aPasswd, xInteractionHandler ); } } } commit 765a2de8eea8157f2f0605a22ca446059afbf333 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 13:49:18 2015 +0200 added change password entry in the split button menu Change-Id: I68e76e346ec6d704c27fe6f4031453dd44dbc983 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index a85c40d..c90175d 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -738,6 +738,58 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, } } } + else if( sIdent == "change_password" ) + { + try + { + Reference< XPasswordContainer2 > xMasterPasswd( + PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + + if( xMasterPasswd->isPersistentStoringAllowed() ) + { + int nPos = GetSelectedServicePos(); + + if( nPos >= 0 ) + { + OUString sUrl( m_aServices[nPos]->GetUrl() ); + + Reference< XInteractionHandler > xInteractionHandler( + InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), 0 ), + UNO_QUERY ); + + UrlRecord aURLEntries = xMasterPasswd->find( sUrl, xInteractionHandler ); + + if( aURLEntries.Url == sUrl ) + { + if( aURLEntries.UserList.getLength() ) + { + OUString sUserName = aURLEntries.UserList[0].UserName; + + ::comphelper::SimplePasswordRequest* pPasswordRequest + = new ::comphelper::SimplePasswordRequest( PasswordRequestMode_PASSWORD_CREATE ); + Reference< XInteractionRequest > rRequest( pPasswordRequest ); + + xInteractionHandler->handle( rRequest ); + + if ( pPasswordRequest->isPassword() ) + { + OUString aNewPass = pPasswordRequest->getPassword(); + Sequence< OUString > aPasswd( 1 ); + aPasswd[0] = aNewPass; + + Reference< XPasswordContainer2 > xPasswdContainer( + PasswordContainer::create(comphelper::getProcessComponentContext())); + xPasswdContainer->addPersistent( + sUrl, sUserName, aPasswd, xInteractionHandler ); + } + } + } + } + } + } + catch( const Exception& ) + {} + } EnableControls(); } diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index a63bef3..740262a 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -10,6 +10,8 @@ #ifndef INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX #define INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX +#include <comphelper/docpasswordrequest.hxx> + #include <svtools/foldertree.hxx> #include <svtools/place.hxx> #include <svtools/PlaceEditDialog.hxx> @@ -32,6 +34,8 @@ #include <officecfg/Office/Common.hxx> #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/task/PasswordContainer.hpp> +#include <com/sun/star/task/XPasswordContainer2.hpp> #include <vector> @@ -42,6 +46,7 @@ #include "iodlg.hrc" using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::task; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ui::dialogs; diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui index 7c0c923..e0699a5 100644 --- a/fpicker/uiconfig/ui/remotefilesdialog.ui +++ b/fpicker/uiconfig/ui/remotefilesdialog.ui @@ -285,5 +285,13 @@ <property name="use_underline">True</property> </object> </child> + <child> + <object class="GtkMenuItem" id="change_password"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_Change password</property> + <property name="use_underline">True</property> + </object> + </child> </object> </interface> commit 37f87403daabe72962c5b8bf9a476e0365a4d9ea Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 12:02:55 2015 +0200 when user typed a folder name, open it Change-Id: I800f97bfd9f564c065ca7e59f5751768f2f2bd0d diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 20ce343..a85c40d 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -914,6 +914,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl ) IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) { + OUString sNameNoExt = m_pName_ed->GetText(); + OUString sPathNoExt; + // auto extension if( m_eMode == REMOTEDLG_MODE_SAVE ) AddFileExtension(); @@ -933,6 +936,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) if( !bSelected ) { m_sPath = sCurrentPath + INetURLObject::encode( sName, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL ); + sPathNoExt = sCurrentPath + INetURLObject::encode( sNameNoExt, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL ); } else { @@ -953,11 +957,11 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) bool bExists = false; if( bFileDlg ) - bExists = ContentIsDocument(m_sPath); + bExists = ContentIsDocument( m_sPath ); else - bExists = ContentIsFolder(m_sPath); + bExists = ContentIsFolder( m_sPath ); - if ( bExists ) + if( bExists ) { if( m_eMode == REMOTEDLG_MODE_SAVE ) { @@ -970,9 +974,15 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) } else { - if( m_eMode == REMOTEDLG_MODE_OPEN ) + if( ContentIsFolder( sPathNoExt ) ) + { + OpenURL( sPathNoExt ); + m_pName_ed->SetText( "" ); + return 0; - if( m_eMode == REMOTEDLG_MODE_SAVE && ContentIsFolder(m_sPath) ) + } + + if( m_eMode == REMOTEDLG_MODE_OPEN ) return 0; } commit 66b1b99ad285797fcee22a2fc825beeb971f6ad3 Author: Szymon KÅos <eszka...@gmail.com> Date: Fri Aug 7 18:32:32 2015 +0200 added New Folder button Change-Id: I4b1ef03e707fdfb3d1968dca9f48c548f872612c diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 80abcac..20ce343 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -183,6 +183,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) get( m_pServices_lb, "services_lb" ); get( m_pFilter_lb, "filter_lb" ); get( m_pName_ed, "name_ed" ); + get( m_pNewFolder, "new_folder" ); m_eMode = ( nBits & WB_SAVEAS ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN; m_eType = ( nBits & WB_PATH ) ? REMOTEDLG_TYPE_PATHDLG : REMOTEDLG_TYPE_FILEDLG; @@ -196,10 +197,20 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pName_ed->Enable( false ); if( m_eMode == REMOTEDLG_MODE_OPEN ) + { get( m_pOk_btn, "open" ); + + m_pNewFolder->Hide(); + } else + { get( m_pOk_btn, "save" ); + m_aImages = ImageList( fpicker::SvtResId( RID_FILEPICKER_IMAGES ) ); + m_pNewFolder->SetModeImage( m_aImages.GetImage( IMG_FILEDLG_CREATEFOLDER ) ); + m_pNewFolder->SetClickHdl( LINK( this, RemoteFilesDialog, NewFolderHdl ) ); + } + m_pOk_btn->Show(); m_pOk_btn->Enable( false ); @@ -324,6 +335,7 @@ void RemoteFilesDialog::dispose() m_pServices_lb.clear(); m_pFilter_lb.clear(); m_pName_ed.clear(); + m_pNewFolder.clear(); ModalDialog::dispose(); } @@ -872,6 +884,34 @@ IMPL_LINK ( RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr ) return 1; } +IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl ) +{ + m_pFileView->EndInplaceEditing( false ); + + SmartContent aContent( m_pFileView->GetViewURL() ); + OUString aTitle; + aContent.getTitle( aTitle ); + ScopedVclPtrInstance< QueryFolderNameDialog > aDlg( this, aTitle, fpicker::SVT_RESSTR( STR_SVT_NEW_FOLDER ) ); + bool bHandled = false; + + while( !bHandled ) + { + if( aDlg->Execute() == RET_OK ) + { + OUString aUrl = aContent.createFolder( aDlg->GetName() ); + if( !aUrl.isEmpty() ) + { + m_pFileView->CreatedFolder( aUrl, aDlg->GetName() ); + bHandled = true; + } + } + else + bHandled = true; + } + + return 1; +} + IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) { // auto extension diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 0d61f41..a63bef3 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -37,6 +37,9 @@ #include "fpdialogbase.hxx" #include "fpsofficeResMgr.hxx" +#include "OfficeFilePicker.hrc" +#include "QueryFolderName.hxx" +#include "iodlg.hrc" using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; @@ -141,6 +144,7 @@ private: VclPtr< MenuButton > m_pAddService_btn; VclPtr< ListBox > m_pServices_lb; VclPtr< Breadcrumb > m_pPath; + VclPtr<PushButton> m_pNewFolder; VclPtr< Splitter > m_pSplitter; VclPtr< FolderTree > m_pTreeView; VclPtr< SvtFileView > m_pFileView; @@ -149,6 +153,8 @@ private: VclPtr< Edit > m_pName_ed; PopupMenu* m_pAddMenu; + ImageList m_aImages; + std::vector< ServicePtr > m_aServices; std::vector< std::pair< OUString, OUString > > m_aFilters; @@ -184,6 +190,8 @@ private: DECL_LINK( SelectBreadcrumbHdl, Breadcrumb * ); + DECL_LINK( NewFolderHdl, void * ); + DECL_LINK( OkHdl, void * ); DECL_LINK( CancelHdl, void * ); }; diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui index 8bf57a3..7c0c923 100644 --- a/fpicker/uiconfig/ui/remotefilesdialog.ui +++ b/fpicker/uiconfig/ui/remotefilesdialog.ui @@ -138,12 +138,44 @@ </packing> </child> <child> - <object class="GtkBox" id="breadcrumb_container"> + <object class="GtkBox" id="box2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> + <property name="spacing">6</property> <child> - <placeholder/> + <object class="GtkBox" id="breadcrumb_container"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="new_folder"> + <property name="use_action_appearance">False</property> + <property name="width_request">25</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Create New Folder</property> + <property name="tooltip_text" translatable="yes">Create New Folder</property> + <property name="margin_left">6</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> commit 5fcf2b7c6d1694aeb9e6a67185bd057e82861f17 Author: Szymon KÅos <eszka...@gmail.com> Date: Fri Aug 7 14:54:39 2015 +0200 avoid name conflict: SvtResId Change-Id: I5fbde751c9d6b0d9be7d6dd50abfb99bb14a3512 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 11278f2..80abcac 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -206,7 +206,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pOk_btn->SetClickHdl( LINK( this, RemoteFilesDialog, OkHdl ) ); m_pCancel_btn->SetClickHdl( LINK( this, RemoteFilesDialog, CancelHdl ) ); - m_sRootLabel = ResId( STR_SVT_ROOTLABEL, *ResMgrHolder::getOrCreate() ); + m_sRootLabel = fpicker::SvtResId( STR_SVT_ROOTLABEL ); m_pPath = VclPtr<Breadcrumb>::Create( get< vcl::Window >( "breadcrumb_container" ) ); m_pPath->set_hexpand( true ); m_pPath->SetClickHdl( LINK( this, RemoteFilesDialog, SelectBreadcrumbHdl ) ); @@ -710,7 +710,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, if( nPos >= 0 ) { - OUString sMsg = ResId( STR_SVT_DELETESERVICE, *ResMgrHolder::getOrCreate() ); + OUString sMsg = fpicker::SvtResId( STR_SVT_DELETESERVICE ); sMsg = sMsg.replaceFirst( "$servicename$", m_pServices_lb->GetSelectEntry() ); ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO ); @@ -921,7 +921,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) { if( m_eMode == REMOTEDLG_MODE_SAVE ) { - OUString sMsg = ResId( STR_SVT_ALREADYEXISTOVERWRITE, *ResMgrHolder::getOrCreate() ); + OUString sMsg = fpicker::SvtResId( STR_SVT_ALREADYEXISTOVERWRITE ); sMsg = sMsg.replaceFirst( "$filename$", sName ); ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO ); if( aBox->Execute() != RET_YES ) diff --git a/fpicker/source/office/fpsofficeResMgr.hxx b/fpicker/source/office/fpsofficeResMgr.hxx index 76b4538..359fc88 100644 --- a/fpicker/source/office/fpsofficeResMgr.hxx +++ b/fpicker/source/office/fpsofficeResMgr.hxx @@ -13,7 +13,7 @@ #include <osl/getglobalmutex.hxx> #include <tools/resmgr.hxx> -namespace +namespace fpicker { struct ResMgrHolder { diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 6b5eaa7..6d1e1a1 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -100,6 +100,7 @@ using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::container; using namespace ::com::sun::star::task; using namespace ::com::sun::star::sdbc; +using namespace ::fpicker; using namespace ::utl; using namespace ::svt; commit 7b171d7826dd449c3a1ab2d951acc246ca20678c Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Aug 6 11:11:00 2015 +0200 Rework of the 'Add service' dialog Change-Id: Ie53352367a92468fb7b1bfbe106230327e4a6599 diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index 16b8e23..20e69f6 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -24,14 +24,20 @@ class DetailsContainer { - private: - Link<> m_aChangeHdl; - VclPtr<VclGrid> m_pFrame; - VclPtr<VclGrid> m_pCommon; - bool m_bIsActive; + protected: + Link<> m_aChangeHdl; + VclPtr<VclGrid> m_pDetailsGrid; + VclPtr<VclHBox> m_pHostBox; + VclPtr<Edit> m_pEDHost; + VclPtr<FixedText> m_pFTHost; + VclPtr<NumericField> m_pEDPort; + VclPtr<FixedText> m_pFTPort; + VclPtr<Edit> m_pEDRoot; + VclPtr<FixedText> m_pFTRoot; + bool m_bIsActive; public: - DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ); + DetailsContainer( VclBuilderContainer* pBuilder ); virtual ~DetailsContainer( ); void setChangeHdl( const Link<>& rLink ) { m_aChangeHdl = rLink; } @@ -60,11 +66,7 @@ class HostDetailsContainer : public DetailsContainer private: sal_uInt16 m_nDefaultPort; OUString m_sScheme; - - protected: - VclPtr<Edit> m_pEDHost; - VclPtr<NumericField> m_pEDPort; - VclPtr<Edit> m_pEDPath; + OUString m_sHost; public: HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ); @@ -104,9 +106,8 @@ class DavDetailsContainer : public HostDetailsContainer class SmbDetailsContainer : public DetailsContainer { private: - VclPtr<Edit> m_pEDHost; VclPtr<Edit> m_pEDShare; - VclPtr<Edit> m_pEDPath; + VclPtr<FixedText> m_pFTShare; public: SmbDetailsContainer( VclBuilderContainer* pBuilder ); @@ -114,6 +115,7 @@ class SmbDetailsContainer : public DetailsContainer virtual INetURLObject getUrl( ) SAL_OVERRIDE; virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE; + virtual void show( bool bShow = true ) SAL_OVERRIDE; }; class CmisDetailsContainer : public DetailsContainer @@ -125,10 +127,10 @@ class CmisDetailsContainer : public DetailsContainer OUString m_sRepoId; OUString m_sBinding; - VclPtr<Edit> m_pEDBinding; + VclPtr<VclHBox> m_pRepositoryBox; + VclPtr<FixedText> m_pFTRepository; VclPtr<ListBox> m_pLBRepository; VclPtr<Button> m_pBTRepoRefresh; - VclPtr<Edit> m_pEDRoot; public: CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding ); diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index f585666..49d9645 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -31,23 +31,30 @@ using namespace com::sun::star::task; using namespace com::sun::star::ucb; using namespace com::sun::star::uno; -DetailsContainer::DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ) : +DetailsContainer::DetailsContainer( VclBuilderContainer* pBuilder ) : m_bIsActive ( true ) { - pBuilder->get( m_pFrame, rFrame ); - pBuilder->get( m_pCommon, "CommonDetails" ); + pBuilder->get( m_pDetailsGrid, "Details" ); + pBuilder->get( m_pHostBox, "HostDetails" ); + pBuilder->get( m_pEDHost, "host" ); + pBuilder->get( m_pFTHost, "hostLabel" ); + pBuilder->get( m_pEDPort, "port-nospin" ); + pBuilder->get( m_pFTPort, "portLabel" ); + pBuilder->get( m_pEDRoot, "path" ); + pBuilder->get( m_pFTRoot, "pathLabel" ); } DetailsContainer::~DetailsContainer( ) { } -void DetailsContainer::show( bool bShow ) +void DetailsContainer::show( bool ) { - m_pFrame->Show( bShow ); + m_pDetailsGrid->Enable( m_bIsActive ); - m_pFrame->Enable( m_bIsActive ); - m_pCommon->Enable( m_bIsActive ); + m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); + m_pEDPort->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); + m_pEDRoot->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); } INetURLObject DetailsContainer::getUrl( ) @@ -80,34 +87,34 @@ IMPL_LINK_NOARG( DetailsContainer, ValueChangeHdl ) } HostDetailsContainer::HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ) : - DetailsContainer( pBuilder, "HostDetails" ), + DetailsContainer( pBuilder ), m_nDefaultPort( nPort ), m_sScheme( sScheme ) { - pBuilder->get( m_pEDHost, "host" ); - m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - - pBuilder->get( m_pEDPort, "port-nospin" ); - m_pEDPort->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - - pBuilder->get( m_pEDPath, "path" ); - m_pEDPath->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - show( false ); } void HostDetailsContainer::show( bool bShow ) { + m_pFTHost->Show( bShow ); + m_pHostBox->Show( bShow ); + m_pEDRoot->Show( bShow ); + m_pFTRoot->Show( bShow ); + DetailsContainer::show( bShow ); + if ( bShow ) + { m_pEDPort->SetValue( m_nDefaultPort ); + m_pEDHost->SetText( m_sHost ); + } } INetURLObject HostDetailsContainer::getUrl( ) { OUString sHost = m_pEDHost->GetText().trim( ); sal_Int64 nPort = m_pEDPort->GetValue(); - OUString sPath = m_pEDPath->GetText().trim( ); + OUString sPath = m_pEDRoot->GetText().trim( ); OUString sUrl; if ( !sHost.isEmpty( ) ) @@ -132,7 +139,7 @@ bool HostDetailsContainer::setUrl( const INetURLObject& rUrl ) { m_pEDHost->SetText( rUrl.GetHost( ) ); m_pEDPort->SetValue( rUrl.GetPort( ) ); - m_pEDPath->SetText( rUrl.GetURLPath() ); + m_pEDRoot->SetText( rUrl.GetURLPath() ); } return bSuccess; @@ -198,17 +205,13 @@ IMPL_LINK( DavDetailsContainer, ToggledDavsHdl, CheckBox*, pCheckBox ) } SmbDetailsContainer::SmbDetailsContainer( VclBuilderContainer* pBuilder ) : - DetailsContainer( pBuilder, "SmbDetails" ) + DetailsContainer( pBuilder ) { - pBuilder->get( m_pEDHost, "smbHost" ); - m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); + pBuilder->get( m_pEDShare, "share" ); + pBuilder->get( m_pFTShare, "shareLabel" ); - pBuilder->get( m_pEDShare, "smbShare" ); m_pEDShare->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - pBuilder->get( m_pEDPath, "smbPath" ); - m_pEDPath->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - show( false ); } @@ -216,7 +219,7 @@ INetURLObject SmbDetailsContainer::getUrl( ) { OUString sHost = m_pEDHost->GetText().trim( ); OUString sShare = m_pEDShare->GetText().trim( ); - OUString sPath = m_pEDPath->GetText().trim( ); + OUString sPath = m_pEDRoot->GetText().trim( ); OUString sUrl; if ( !sHost.isEmpty( ) ) @@ -252,14 +255,27 @@ bool SmbDetailsContainer::setUrl( const INetURLObject& rUrl ) m_pEDHost->SetText( rUrl.GetHost( ) ); m_pEDShare->SetText( sShare ); - m_pEDPath->SetText( sPath ); + m_pEDRoot->SetText( sPath ); } return bSuccess; } +void SmbDetailsContainer::show( bool bShow ) +{ + m_pEDShare->Show( bShow ); + m_pFTShare->Show( bShow ); + m_pEDRoot->Show( bShow ); + m_pFTRoot->Show( bShow ); + + m_pFTHost->Show( bShow ); + m_pHostBox->Show( bShow ); + m_pEDPort->Enable( !bShow ); + m_pFTPort->Enable( !bShow ); +} + CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding ) : - DetailsContainer( pBuilder, "CmisDetails" ), + DetailsContainer( pBuilder ), m_sUsername( ), m_xCmdEnv( ), m_aRepoIds( ), @@ -271,39 +287,50 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder, OUStr InteractionHandler::createWithParent(xContext, 0), UNO_QUERY ); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); - pBuilder->get( m_pEDBinding, "binding" ); + pBuilder->get( m_pFTRepository, "repositoryLabel" ); pBuilder->get( m_pLBRepository, "repositories" ); pBuilder->get( m_pBTRepoRefresh, "repositoriesRefresh" ); - - pBuilder->get( m_pEDRoot, "cmisPath" ); + pBuilder->get( m_pRepositoryBox, "RepositoryDetails" ); show( false ); } void CmisDetailsContainer::show( bool bShow ) { - m_pEDBinding->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); m_pLBRepository->SetSelectHdl( LINK( this, CmisDetailsContainer, SelectRepoHdl ) ); m_pBTRepoRefresh->SetClickHdl( LINK( this, CmisDetailsContainer, RefreshReposHdl ) ); - m_pEDRoot->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - m_pEDBinding->SetText( m_sBinding ); + m_pEDHost->SetText( m_sBinding ); if( ( m_sBinding == GDRIVE_BASE_URL ) || m_sBinding.startsWith( ALFRESCO_CLOUD_BASE_URL ) || ( m_sBinding == ONEDRIVE_BASE_URL ) ) { - DetailsContainer::show( false ); + m_pFTHost->Show( false ); + m_pHostBox->Show( false ); + m_pFTRepository->Show( false ); + m_pRepositoryBox->Show( false ); + m_pEDRoot->Show( false ); + m_pFTRoot->Show( false ); } else { - DetailsContainer::show( bShow ); + m_pFTHost->Show( bShow ); + m_pHostBox->Show( bShow ); + m_pFTRepository->Show( bShow ); + m_pRepositoryBox->Show( bShow ); + m_pEDRoot->Show( bShow ); + m_pFTRoot->Show( bShow ); } + + DetailsContainer::show( bShow ); + m_pEDPort->Enable( !bShow ); + m_pFTPort->Enable( !bShow ); } INetURLObject CmisDetailsContainer::getUrl( ) { - OUString sBindingUrl = m_pEDBinding->GetText().trim( ); + OUString sBindingUrl = m_pEDHost->GetText().trim( ); OUString sPath = m_pEDRoot->GetText().trim( ); bool bSkip = true; @@ -344,7 +371,7 @@ bool CmisDetailsContainer::setUrl( const INetURLObject& rUrl ) m_sBinding = aHostUrl.GetURLNoMark( ); m_sRepoId = aHostUrl.GetMark( ); - m_pEDBinding->SetText( m_sBinding ); + m_pEDHost->SetText( m_sBinding ); m_pEDRoot->SetText( rUrl.GetURLPath() ); } return bSuccess; @@ -368,7 +395,7 @@ void CmisDetailsContainer::selectRepository( ) IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl ) { - OUString sBindingUrl = m_pEDBinding->GetText().trim( ); + OUString sBindingUrl = m_pEDHost->GetText().trim( ); OUString sEncodedUsername = ""; diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index e2b1c30..ec5c41e 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -162,7 +162,7 @@ </packing> </child> <child> - <object class="GtkGrid" id="HostDetails"> + <object class="GtkGrid" id="Details"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="row_spacing">6</property> @@ -181,21 +181,6 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="webdavs"> - <property name="label" translatable="yes">Secure connection</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="hexpand">True</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - <property name="width">3</property> - </packing> - </child> - <child> <object class="GtkLabel" id="pathLabel"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -206,7 +191,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -218,112 +203,77 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">1</property> - <property name="width">3</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="host"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="invisible_char">â</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="top_attach">6</property> </packing> </child> <child> - <object class="GtkLabel" id="portLabel"> + <object class="GtkLabel" id="shareLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Port:</property> + <property name="label" translatable="yes">Share:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">port-nospin</property> </object> <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> + <property name="left_attach">0</property> + <property name="top_attach">2</property> </packing> </child> <child> - <object class="GtkSpinButton" id="port-nospin"> + <object class="GtkEntry" id="share"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="max_length">4</property> + <property name="hexpand">True</property> <property name="invisible_char">â</property> - <property name="max_width_chars">4</property> - <property name="text" translatable="yes">0</property> - <property name="adjustment">adjustment1</property> - <property name="numeric">True</property> </object> <packing> - <property name="left_attach">3</property> - <property name="top_attach">0</property> + <property name="left_attach">1</property> + <property name="top_attach">2</property> </packing> </child> <child> - <placeholder/> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="SmbDetails"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkLabel" id="label9"> + <object class="GtkLabel" id="repositoryLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Host:</property> + <property name="label" translatable="yes">Repository:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">smbHost</property> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="top_attach">3</property> </packing> </child> <child> - <object class="GtkLabel" id="label10"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <object class="GtkCheckButton" id="webdavs"> + <property name="label" translatable="yes">Secure connection</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="hexpand">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Share:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">smbShare</property> + <property name="draw_indicator">True</property> </object> <packing> - <property name="left_attach">0</property> + <property name="left_attach">1</property> <property name="top_attach">1</property> </packing> </child> <child> - <object class="GtkLabel" id="label11"> + <object class="GtkLabel" id="loginLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Root:</property> + <property name="label" translatable="yes">User:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">smbPath</property> + <property name="mnemonic_widget">login</property> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">4</property> </packing> </child> <child> - <object class="GtkEntry" id="smbHost"> + <object class="GtkEntry" id="login"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -331,23 +281,25 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="top_attach">4</property> </packing> </child> <child> - <object class="GtkEntry" id="smbShare"> + <object class="GtkLabel" id="nameLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="invisible_char">â</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Label:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">name</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="left_attach">0</property> + <property name="top_attach">5</property> </packing> </child> <child> - <object class="GtkEntry" id="smbPath"> + <object class="GtkEntry" id="name"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -355,56 +307,59 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="CmisDetails"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkLabel" id="bindingLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Host:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">binding</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="top_attach">5</property> </packing> </child> <child> - <object class="GtkLabel" id="repositoryLabel"> + <object class="GtkBox" id="HostDetails"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Repository:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">repositories</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="binding"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="invisible_char">â</property> + <property name="spacing">6</property> + <child> + <object class="GtkEntry" id="host"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">â</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="portLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Port:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="port-nospin"> + <property name="width_request">50</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="max_length">4</property> + <property name="invisible_char">â</property> + <property name="max_width_chars">4</property> + <property name="text" translatable="yes">0</property> + <property name="adjustment">adjustment1</property> + <property name="numeric">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="left_attach">1</property> @@ -412,10 +367,10 @@ </packing> </child> <child> - <object class="GtkGrid" id="grid6"> + <object class="GtkBox" id="RepositoryDetails"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="column_spacing">6</property> + <property name="spacing">6</property> <child> <object class="GtkComboBox" id="repositories"> <property name="visible">True</property> @@ -423,8 +378,9 @@ <property name="hexpand">True</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> <child> @@ -435,111 +391,25 @@ <property name="image">image1</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> </packing> </child> </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="rootLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Root:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">cmisPath</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="cmisPath"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">â</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="CommonDetails"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkLabel" id="label16"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">User:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">login</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="login"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="invisible_char">â</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="labelLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Label:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">name</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">3</property> </packing> </child> <child> - <object class="GtkEntry" id="name"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="invisible_char">â</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> + <placeholder/> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">4</property> + <property name="position">1</property> </packing> </child> </object> commit f0ca55508ce15ff731509417a5e20e487b1f57cc Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Aug 5 11:56:06 2015 +0200 Show unavailable services with disabled controls Change-Id: I9fe25bc5e8ce31cd848c4f6434b747be96a8006a diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index 8043d46..16b8e23 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -25,8 +25,10 @@ class DetailsContainer { private: - Link<> m_aChangeHdl; - VclPtr<VclGrid> m_pFrame; + Link<> m_aChangeHdl; + VclPtr<VclGrid> m_pFrame; + VclPtr<VclGrid> m_pCommon; + bool m_bIsActive; public: DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ); @@ -46,6 +48,8 @@ class DetailsContainer virtual void setUsername( const OUString& /*rUsername*/ ) { }; + virtual void setActive( bool bActive = true ); + protected: void notifyChange( ); DECL_LINK ( ValueChangeHdl, void * ); diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index 125a817..8ead056 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -150,18 +150,20 @@ void PlaceEditDialog::InitDetails( ) for ( sal_Int32 i = 0; i < aTypesUrlsList.getLength( ) && aTypesNamesList.getLength( ); ++i ) { OUString sUrl = aTypesUrlsList[i]; - if ( !( sUrl == GDRIVE_BASE_URL && bSkipGDrive ) && - !( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) && - !( sUrl == ONEDRIVE_BASE_URL && bSkipOneDrive ) ) - { - nPos = m_pLBServerType->InsertEntry( aTypesNamesList[i], nPos ); + nPos = m_pLBServerType->InsertEntry( aTypesNamesList[i], nPos ); - std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, sUrl)); - xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) ); - m_aDetailsContainers.push_back(xCmisDetails); + std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, sUrl)); + xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) ); + m_aDetailsContainers.push_back(xCmisDetails); - nPos++; + if ( ( sUrl == GDRIVE_BASE_URL && bSkipGDrive ) || + ( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) || + ( sUrl == ONEDRIVE_BASE_URL && bSkipOneDrive ) ) + { + xCmisDetails->setActive( false ); } + + nPos++; } // Create WebDAV / FTP / SSH details control diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index a5b40e0..f585666 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -31,9 +31,11 @@ using namespace com::sun::star::task; using namespace com::sun::star::ucb; using namespace com::sun::star::uno; -DetailsContainer::DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ) +DetailsContainer::DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ) : + m_bIsActive ( true ) { pBuilder->get( m_pFrame, rFrame ); + pBuilder->get( m_pCommon, "CommonDetails" ); } DetailsContainer::~DetailsContainer( ) @@ -43,6 +45,9 @@ DetailsContainer::~DetailsContainer( ) void DetailsContainer::show( bool bShow ) { m_pFrame->Show( bShow ); + + m_pFrame->Enable( m_bIsActive ); + m_pCommon->Enable( m_bIsActive ); } INetURLObject DetailsContainer::getUrl( ) @@ -63,6 +68,11 @@ void DetailsContainer::notifyChange( ) m_aChangeHdl.Call( this ); } +void DetailsContainer::setActive( bool bActive ) +{ + m_bIsActive = bActive; +} + IMPL_LINK_NOARG( DetailsContainer, ValueChangeHdl ) { notifyChange( ); diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index 4fb556b..e2b1c30 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -478,9 +478,10 @@ </packing> </child> <child> - <object class="GtkGrid" id="UserDetails"> + <object class="GtkGrid" id="CommonDetails"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="row_spacing">6</property> <property name="column_spacing">12</property> <child> <object class="GtkLabel" id="label16"> @@ -508,18 +509,6 @@ <property name="top_attach">0</property> </packing> </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="LabelGrid"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="column_spacing">6</property> <child> <object class="GtkLabel" id="labelLabel"> <property name="visible">True</property> @@ -531,7 +520,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="top_attach">1</property> </packing> </child> <child> @@ -543,14 +532,14 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="top_attach">1</property> </packing> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">4</property> </packing> </child> </object> commit cbc24d2b40d78702f22e168d3889ffe64eaf5232 Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Aug 5 11:13:09 2015 +0200 Port field without buttons, max 4 chars Change-Id: I4ddc294dba5ad66a11ff260e8942977d0a6a292f diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index 71eab33..a5b40e0 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -77,7 +77,7 @@ HostDetailsContainer::HostDetailsContainer( VclBuilderContainer* pBuilder, sal_u pBuilder->get( m_pEDHost, "host" ); m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - pBuilder->get( m_pEDPort, "port" ); + pBuilder->get( m_pEDPort, "port-nospin" ); m_pEDPort->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); pBuilder->get( m_pEDPath, "path" ); diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index 272c096..4fb556b 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -241,7 +241,7 @@ <property name="xalign">0</property> <property name="label" translatable="yes">Port:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">port</property> + <property name="mnemonic_widget">port-nospin</property> </object> <packing> <property name="left_attach">2</property> @@ -249,10 +249,12 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="port"> + <object class="GtkSpinButton" id="port-nospin"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="max_length">4</property> <property name="invisible_char">â</property> + <property name="max_width_chars">4</property> <property name="text" translatable="yes">0</property> <property name="adjustment">adjustment1</property> <property name="numeric">True</property> commit 06d631e6cf058b19d0ec71d03f167f46ce617efc Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Aug 5 10:46:43 2015 +0200 Port field on the same line as Host Change-Id: Iddf611e372772cbe5c38aecc81f4d43412d653da diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index 5434102..272c096 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -191,7 +191,8 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">2</property> + <property name="width">3</property> </packing> </child> <child> @@ -205,7 +206,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">1</property> </packing> </child> <child> @@ -217,7 +218,20 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="top_attach">1</property> + <property name="width">3</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="host"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">â</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> </packing> </child> <child> @@ -230,8 +244,8 @@ <property name="mnemonic_widget">port</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left_attach">2</property> + <property name="top_attach">0</property> </packing> </child> <child> @@ -244,19 +258,7 @@ <property name="numeric">True</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="host"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="invisible_char">â</property> - </object> - <packing> - <property name="left_attach">1</property> + <property name="left_attach">3</property> <property name="top_attach">0</property> </packing> </child> commit 523608392657be6d391b17d8f7f6a2e9b9cf226e Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 4 15:34:51 2015 +0200 The Add Service dialog width changed to 400+ px Change-Id: Ied97043e0649c552190b490d41f60579db523625 diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index f0cf611..5434102 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -33,6 +33,7 @@ </data> </object> <object class="GtkDialog" id="PlaceEditDialog"> + <property name="width_request">400</property> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes">File Services</property> commit b44f1c5f4e44bb9bcdff7af7b41d517d994a87a1 Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 4 15:06:37 2015 +0200 no selection after deletion of a service Change-Id: Id59a55a2af74851ff7b2fa8d6af30350347eb4c6 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index f998633..11278f2 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -719,15 +719,8 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, m_aServices.erase( m_aServices.begin() + nPos ); m_pServices_lb->RemoveEntry( nSelected ); - if( m_pServices_lb->GetEntryCount() > 0 ) - { - m_pServices_lb->SelectEntryPos( 0 ); - } - else - { - m_pServices_lb->SetNoSelection(); - m_pAddService_btn->SetPopupMenu( NULL ); - } + m_pServices_lb->SetNoSelection(); + m_pAddService_btn->SetPopupMenu( NULL ); m_bIsUpdated = true; } commit 7e2ca9752a0439694e6ba6735cbd1a6bb39b5391 Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 4 15:03:19 2015 +0200 do not show Add Service dialog on start Change-Id: I4548856d6df0e1ae7d57850a5e479635c62b97c0 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 0806c81..f998633 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -342,11 +342,6 @@ void RemoteFilesDialog::Resize() short RemoteFilesDialog::Execute() { - if( m_pServices_lb->GetEntryCount() == 0 ) - { - Show(); - AddServiceHdl( NULL ); - } if( m_pServices_lb->GetEntryCount() > 0 ) { Show(); commit 76866c8cf2f89386124b3f03566532c812e68fe2 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 16:47:29 2015 +0200 delete entry in the context menu Change-Id: Ib315dbc27b8b278ffce4bb24f4c4b60e5cb4d709 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 4ec8569..0806c81 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -226,6 +226,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pFileView->EnableAutoResize(); m_pFileView->SetDoubleClickHdl( LINK( this, RemoteFilesDialog, DoubleClickHdl ) ); m_pFileView->SetSelectHdl( LINK( this, RemoteFilesDialog, SelectHdl ) ); + m_pFileView->EnableDelete( true ); m_pSplitter = VclPtr< Splitter >::Create( m_pContainer, WB_HSCROLL ); m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ) ); commit b70bc0c8df4f04cb39bad7cbf2df229ef22edaac Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 16:33:25 2015 +0200 don't show edit menu when there is no selected service Change-Id: I6b5f713926383d776aa687801f6bef239c9675cb diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 5233a62..4ec8569 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -354,6 +354,7 @@ short RemoteFilesDialog::Execute() if( !m_bIsConnected ) { m_pServices_lb->SetNoSelection(); + m_pAddService_btn->SetPopupMenu( NULL ); } short nRet = SvtFileDialog_Base::Execute(); @@ -654,6 +655,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl ) if( nPos >= 0 ) { OUString sURL = m_aServices[nPos]->GetUrl(); + m_pAddService_btn->SetPopupMenu( m_pAddMenu ); m_bServiceChanged = true; OpenURL( sURL ); commit 7f1489240710e0577cac285479b313cc9a30543c Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 14:59:58 2015 +0200 FolderTree: changed root node name ('Root') Change-Id: I495965e065366880b364578a02af7092d6efbad4 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 0e26283..5233a62 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -1099,12 +1099,11 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL ) if( nPos >= 0 && m_bServiceChanged && rURL == m_aServices[nPos]->GetUrl() ) { OUString sURL = m_aServices[nPos]->GetUrl(); - OUString sName = m_aServices[nPos]->GetName(); m_pPath->SetRootName( m_sRootLabel ); m_pTreeView->Clear(); - SvTreeListEntry* pRoot = m_pTreeView->InsertEntry( sName, NULL, true ); + SvTreeListEntry* pRoot = m_pTreeView->InsertEntry( m_sRootLabel, NULL, true ); OUString* sData = new OUString( rURL ); pRoot->SetUserData( static_cast< void* >( sData ) ); commit 0d25155ddfeb7ad7c0bb077506cca14afb30eb63 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 14:56:14 2015 +0200 FolderTree width 100 -> 150 Change-Id: I2d349c19a11679b0c58a1efbd134837f5c3aabdd diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index b32f196..0e26283 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -233,7 +233,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pSplitter->Show(); m_pTreeView = VclPtr< FolderTree >::Create( m_pContainer, WB_BORDER ); - Size aSize( 100, 200 ); + Size aSize( 150, 200 ); m_pTreeView->set_height_request( aSize.Height() ); m_pTreeView->set_width_request( aSize.Width() ); m_pTreeView->SetSizePixel( aSize ); commit 6415b5e15e3bf417b2508cfb43751a22423f30f6 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 14:50:44 2015 +0200 don't invalidate the dialog after every typed character Change-Id: Ib422edf3b615fec6513887283595f647f5bc197e diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 40b9c75..b32f196 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -814,7 +814,8 @@ IMPL_LINK_NOARG( RemoteFilesDialog, FileNameGetFocusHdl ) IMPL_LINK_NOARG( RemoteFilesDialog, FileNameModifyHdl ) { m_pFileView->SetNoSelection(); - EnableControls(); + if( !m_pOk_btn->IsEnabled() ) + EnableControls(); return 1; } commit a05b8c6068f7cbfb17772122acfd695978f8ebdf Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 14:43:32 2015 +0200 Breadcrumb: changed first entry label ('Root') Change-Id: Id15bc1ef92fdab22ba3332dc9b42fb9c785298b4 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index dde7eeb..40b9c75 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -206,6 +206,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pOk_btn->SetClickHdl( LINK( this, RemoteFilesDialog, OkHdl ) ); m_pCancel_btn->SetClickHdl( LINK( this, RemoteFilesDialog, CancelHdl ) ); + m_sRootLabel = ResId( STR_SVT_ROOTLABEL, *ResMgrHolder::getOrCreate() ); m_pPath = VclPtr<Breadcrumb>::Create( get< vcl::Window >( "breadcrumb_container" ) ); m_pPath->set_hexpand( true ); m_pPath->SetClickHdl( LINK( this, RemoteFilesDialog, SelectBreadcrumbHdl ) ); @@ -1099,7 +1100,7 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL ) OUString sURL = m_aServices[nPos]->GetUrl(); OUString sName = m_aServices[nPos]->GetName(); - m_pPath->SetRootName( sName ); + m_pPath->SetRootName( m_sRootLabel ); m_pTreeView->Clear(); SvTreeListEntry* pRoot = m_pTreeView->InsertEntry( sName, NULL, true ); diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index ea6af5f..0d61f41 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -127,6 +127,7 @@ private: OUString m_sPath; OUString m_sStdDir; + OUString m_sRootLabel; OUString m_sLastServiceUrl; unsigned int m_nCurrentFilter; diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index bc43b98..775b6ee 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -110,6 +110,11 @@ String STR_SVT_DELETESERVICE Text [ en-US ] = "Are you sure you want to delete the service?\n\"$servicename$\"" ; }; +String STR_SVT_ROOTLABEL +{ + Text [ en-US ] = "Root" ; +}; + String STR_SVT_NEW_FOLDER { Text [ en-US ] = "Folder" ; diff --git a/include/vcl/fpicker.hrc b/include/vcl/fpicker.hrc index 7d4bd16..896d9c8 100644 --- a/include/vcl/fpicker.hrc +++ b/include/vcl/fpicker.hrc @@ -28,6 +28,7 @@ #define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION (STR_SVT_FILEPICKER_START+13) #define STR_SVT_ALREADYEXISTOVERWRITE (STR_SVT_FILEPICKER_START+14) #define STR_SVT_DELETESERVICE (STR_SVT_FILEPICKER_START+15) +#define STR_SVT_ROOTLABEL (STR_SVT_FILEPICKER_START+16) #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit ec30b64b4cc646ae76e36f83189d06ca78efba14 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 14:28:42 2015 +0200 changed label text (File name) Change-Id: Ida5bcd0287b49b7e6e97a7573e9cf12f25d95f6d diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui index c9a6ac0..8bf57a3 100644 --- a/fpicker/uiconfig/ui/remotefilesdialog.ui +++ b/fpicker/uiconfig/ui/remotefilesdialog.ui @@ -194,7 +194,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Full name</property> + <property name="label" translatable="yes">File name</property> </object> <packing> <property name="left_attach">0</property> commit b706170940c4005f74e71888b11c35dc5bd6232e Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 3 13:19:51 2015 +0200 remember user settings Change-Id: I69c4672646365ca4cbeb04d6956741ffe365ad35 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index cdb38ec..dde7eeb 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -249,6 +249,9 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pContainer->Show(); m_pContainer->Enable( false ); + m_sIniKey = "RemoteFilesDialog"; + InitSize(); + m_pName_ed->SetGetFocusHdl( LINK( this, RemoteFilesDialog, FileNameGetFocusHdl ) ); m_pName_ed->SetModifyHdl( LINK( this, RemoteFilesDialog, FileNameModifyHdl ) ); @@ -273,6 +276,17 @@ void RemoteFilesDialog::dispose() { m_pFileView->SetSelectHdl( Link<>() ); + // save window state + if( !m_sIniKey.isEmpty() ) + { + SvtViewOptions aDlgOpt( E_DIALOG, m_sIniKey ); + aDlgOpt.SetWindowState( OStringToOUString( GetWindowState(), osl_getThreadTextEncoding() ) ); + OUString sUserData = m_pFileView->GetConfigString(); + aDlgOpt.SetUserItem( OUString( "UserData" ), + makeAny( sUserData ) ); + } + + // save services std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_context ) ); officecfg::Office::Common::Misc::FilePickerLastService::set( m_sLastServiceUrl, batch ); @@ -381,6 +395,25 @@ OUString lcl_GetServiceType( ServicePtr pService ) } } +void RemoteFilesDialog::InitSize() +{ + if( m_sIniKey.isEmpty() ) + return; + + // initialize from config + SvtViewOptions aDlgOpt( E_DIALOG, m_sIniKey ); + + if( aDlgOpt.Exists() ) + { + SetWindowState( OUStringToOString( aDlgOpt.GetWindowState(), osl_getThreadTextEncoding() ) ); + + Any aUserData = aDlgOpt.GetUserItem( OUString( "UserData" ) ); + OUString sCfgStr; + if( aUserData >>= sCfgStr ) + m_pFileView->SetConfigString( sCfgStr ); + } +} + void RemoteFilesDialog::FillServicesListbox() { m_pServices_lb->Clear(); diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 2bb7c35..ea6af5f 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -19,6 +19,8 @@ #include <tools/errinf.hxx> #include <tools/resid.hxx> +#include <unotools/viewoptions.hxx> + #include <vcl/button.hxx> #include <vcl/fpicker.hrc> #include <vcl/menubtn.hxx> @@ -121,6 +123,8 @@ private: bool m_bIsConnected; bool m_bServiceChanged; + OUString m_sIniKey; + OUString m_sPath; OUString m_sStdDir; OUString m_sLastServiceUrl; @@ -147,6 +151,8 @@ private: std::vector< ServicePtr > m_aServices; std::vector< std::pair< OUString, OUString > > m_aFilters; + void InitSize(); + void FillServicesListbox(); /* If failure returns < 0 */ commit 647f8d5259e356364c4cc25fd72c81a16fff4617 Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Jul 30 15:11:22 2015 +0200 clear string (cached url) in correct place Change-Id: Ib7ff8200b768ef3a2a50c42f0ebf165185cfeeba diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx index 2f1d7fb..a7185e2 100644 --- a/svtools/source/contnr/foldertree.cxx +++ b/svtools/source/contnr/foldertree.cxx @@ -75,12 +75,12 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry ) } } } - } - else - { - // this dir was updated recently - // next time read this remote folder - m_sLastUpdatedDir = ""; + else + { + // this dir was updated recently + // next time read this remote folder + m_sLastUpdatedDir = ""; + } } } commit 2f0e2ef394540093b2f62991b8e4d8eee4267166 Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Jul 30 13:57:20 2015 +0200 'Wait' cursor while expanding a tree node Change-Id: Iad79fa16bc4c7f7086d2adca6ea417f6e1959e61 diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx index f783a5b..2f1d7fb 100644 --- a/svtools/source/contnr/foldertree.cxx +++ b/svtools/source/contnr/foldertree.cxx @@ -27,7 +27,14 @@ FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits ) void FolderTree::RequestingChildren( SvTreeListEntry* pEntry ) { + EnableChildPointerOverwrite( true ); + SetPointer( PointerStyle::Wait ); + Invalidate(InvalidateFlags::Update); + FillTreeEntry( pEntry ); + + SetPointer( PointerStyle::Arrow ); + EnableChildPointerOverwrite( false ); } void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry ) commit a972bdcfa57f4b1db0a80ea9960e992c91426e70 ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits