[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 2 commits - fpicker/source
Szymon Kłos
eszkadev at gmail.com
Mon Jul 20 05:22:05 PDT 2015
fpicker/source/office/RemoteFilesDialog.cxx | 36 ++++++++++++++++++++++++++--
fpicker/source/office/RemoteFilesDialog.hxx | 1
2 files changed, 35 insertions(+), 2 deletions(-)
New commits:
commit 6132917e663d99f746ab037f68c0eadc92983419
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Jul 20 14:19:54 2015 +0200
remember user name in recent files
Change-Id: I55b340e90d51b614b8f46c06e3dc1961b3bac2ba
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index ad673c2..fa110f3 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -692,8 +692,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl )
if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
|| ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
{
+ // url must contain user info, because we need this info in recent files entry
+ // (to fill user field in login box by default)
INetURLObject aURL( pData->maURL );
- m_sPath = pData->maURL;
+ INetURLObject aCurrentURL( m_sLastServiceUrl );
+ aURL.SetUser( aCurrentURL.GetUser() );
+
+ m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
}
@@ -811,6 +816,14 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
m_sPath = sCurrentPath;
else
m_sPath = sSelectedItem;
+
+ // url must contain user info, because we need this info in recent files entry
+ // (to fill user field in login box by default)
+ INetURLObject aURL( m_sPath );
+ INetURLObject aCurrentURL( m_sLastServiceUrl );
+ aURL.SetUser( aCurrentURL.GetUser() );
+
+ m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
}
bool bExists = false;
@@ -969,7 +982,13 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const
while( pEntry )
{
- aList.push_back( SvtFileView::GetURL( pEntry ) );
+ // url must contain user info, because we need this info in recent files entry
+ // (to fill user field in login box by default)
+ INetURLObject aURL( SvtFileView::GetURL( pEntry ) );
+ INetURLObject aCurrentURL( m_sLastServiceUrl );
+ aURL.SetUser( aCurrentURL.GetUser() );
+
+ aList.push_back( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
pEntry = m_pFileView->NextSelected( pEntry );
}
commit 7c309ff3f96cb698b47929ea95d6da31f1c0e853
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Jul 20 11:30:49 2015 +0200
Show 'Add service' dialog when there is no service added yet
Change-Id: I72d294e9c09b0d02b829b91fb188c1c7965d1d45
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 913f4f4..ad673c2 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -316,6 +316,19 @@ void RemoteFilesDialog::Resize()
}
}
+short RemoteFilesDialog::Execute()
+{
+ if( m_pServices_lb->GetEntryCount() == 0 )
+ {
+ Show();
+ AddServiceHdl( NULL );
+ }
+
+ short nRet = SvtFileDialog_Base::Execute();
+
+ return nRet;
+}
+
OUString lcl_GetServiceType( ServicePtr pService )
{
INetProtocol aProtocol = pService->GetUrlObject().GetProtocol();
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index ba48b8e..ede30c7 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -64,6 +64,7 @@ public:
virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
+ virtual short Execute() SAL_OVERRIDE;
OUString GetPath() const;
More information about the Libreoffice-commits
mailing list