Kaydet (Commit) 2b0e0ffc authored tarafından Szymon Kłos's avatar Szymon Kłos

when user typed a folder name, open it

Change-Id: I800f97bfd9f564c065ca7e59f5751768f2f2bd0d
üst 41102d9f
...@@ -914,6 +914,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl ) ...@@ -914,6 +914,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl )
IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
{ {
OUString sNameNoExt = m_pName_ed->GetText();
OUString sPathNoExt;
// auto extension // auto extension
if( m_eMode == REMOTEDLG_MODE_SAVE ) if( m_eMode == REMOTEDLG_MODE_SAVE )
AddFileExtension(); AddFileExtension();
...@@ -933,6 +936,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) ...@@ -933,6 +936,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
if( !bSelected ) if( !bSelected )
{ {
m_sPath = sCurrentPath + INetURLObject::encode( sName, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL ); m_sPath = sCurrentPath + INetURLObject::encode( sName, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL );
sPathNoExt = sCurrentPath + INetURLObject::encode( sNameNoExt, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL );
} }
else else
{ {
...@@ -953,11 +957,11 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) ...@@ -953,11 +957,11 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
bool bExists = false; bool bExists = false;
if( bFileDlg ) if( bFileDlg )
bExists = ContentIsDocument(m_sPath); bExists = ContentIsDocument( m_sPath );
else else
bExists = ContentIsFolder(m_sPath); bExists = ContentIsFolder( m_sPath );
if ( bExists ) if( bExists )
{ {
if( m_eMode == REMOTEDLG_MODE_SAVE ) if( m_eMode == REMOTEDLG_MODE_SAVE )
{ {
...@@ -970,9 +974,15 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) ...@@ -970,9 +974,15 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
} }
else else
{ {
if( m_eMode == REMOTEDLG_MODE_OPEN ) if( ContentIsFolder( sPathNoExt ) )
{
OpenURL( sPathNoExt );
m_pName_ed->SetText( "" );
return 0; return 0;
if( m_eMode == REMOTEDLG_MODE_SAVE && ContentIsFolder(m_sPath) ) }
if( m_eMode == REMOTEDLG_MODE_OPEN )
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment