[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 4 commits - include/svtools svtools/source

Szymon Kłos eszkadev at gmail.com
Fri Jul 10 04:00:51 PDT 2015


 include/svtools/RemoteFilesDialog.hxx            |    2 
 svtools/source/dialogs/RemoteFilesDialog.cxx     |   52 +++++++++++++++++++----
 svtools/source/dialogs/ServerDetailsControls.cxx |    4 -
 3 files changed, 46 insertions(+), 12 deletions(-)

New commits:
commit dd4b9e587debaf92e2681590405b6dacc8bddb49
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 10 12:58:58 2015 +0200

    Add prefix to the name after editing service
    
    Change-Id: Icca2436e5a3782829971bf9e672bbddab81cc97f

diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index d27fccc..4d5c619 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -643,7 +643,13 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
 
                     m_aServices[nPos] = pEditedService;
                     m_pServices_lb->RemoveEntry( nSelected );
-                    m_pServices_lb->InsertEntry( pEditedService->GetName(), nSelected );
+
+                    OUString sPrefix = lcl_GetServiceType( pEditedService );
+
+                    if(!sPrefix.isEmpty())
+                        sPrefix += ": ";
+
+                    m_pServices_lb->InsertEntry( sPrefix + pEditedService->GetName(), nSelected );
                     m_pServices_lb->SelectEntryPos( nSelected );
 
                     m_bIsUpdated = true;
commit 946079092cf79e49e8d6fd07fe37fb993cbf4464
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 10 12:46:58 2015 +0200

    PlaceEditDialog: Remember the repository id if wasn't changed
    
    Change-Id: Ib5e63bec0b6b3c2d7d0dc2c114656737979ef6d0

diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 3fc26c4..46b5b05 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -329,12 +329,10 @@ bool CmisDetailsContainer::setUrl( const INetURLObject& rUrl )
 
     if ( bSuccess )
     {
-        OUString sRepositoryId;
-
         OUString sDecodedHost = rUrl.GetHost( INetURLObject::DECODE_WITH_CHARSET );
         INetURLObject aHostUrl( sDecodedHost );
         m_sBinding = aHostUrl.GetURLNoMark( );
-        sRepositoryId = aHostUrl.GetMark( );
+        m_sRepoId = aHostUrl.GetMark( );
 
         m_pEDBinding->SetText( m_sBinding );
         m_pEDRoot->SetText( rUrl.GetURLPath() );
commit e19670f542a85d4815be03c428eb835935747d20
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 10 11:52:17 2015 +0200

    RemoteFilesDialog: safe doubleclick on file view
    
    Change-Id: I651c8274dfb2776e63c32f0b45d9daf57e5970c6

diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index 869fcdf..d27fccc 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -687,17 +687,24 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
 IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
 {
     SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
-    SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
 
-    if( pData->mbIsFolder )
+    if( pEntry )
     {
-        OUString sURL = m_pFileView->GetCurrentURL();
+        SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
 
-        OpenURL( sURL );
-    }
-    else
-    {
-        EndDialog( RET_OK );
+        if( pData )
+        {
+            if( pData->mbIsFolder )
+            {
+                OUString sURL = m_pFileView->GetCurrentURL();
+
+                OpenURL( sURL );
+            }
+            else
+            {
+                EndDialog( RET_OK );
+            }
+        }
     }
 
     return 1;
commit d2120955b794b06c006838979059941aa53cc4d3
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 10 11:33:23 2015 +0200

    RemoteFilesDialog: auto file extension in the save mode
    
    Change-Id: I7b1dd5cc330de0c1ad713d68d93e7d12375033c6

diff --git a/include/svtools/RemoteFilesDialog.hxx b/include/svtools/RemoteFilesDialog.hxx
index 44fce0c..f1dc755 100644
--- a/include/svtools/RemoteFilesDialog.hxx
+++ b/include/svtools/RemoteFilesDialog.hxx
@@ -153,6 +153,8 @@ private:
 
     FileViewResult OpenURL( OUString sURL );
 
+    void AddFileExtension();
+
     void EnableControls();
 
     DECL_LINK ( AddServiceHdl, void * );
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index 03fa023..869fcdf 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -517,6 +517,23 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString sURL )
     return eResult;
 }
 
+void RemoteFilesDialog::AddFileExtension()
+{
+    if( m_nCurrentFilter != LISTBOX_ENTRY_NOTFOUND )
+    {
+        OUString sExt = m_aFilters[m_nCurrentFilter].second;
+        OUString sFileName = m_pName_ed->GetText();
+
+        sal_Int32 nDotPos = sFileName.lastIndexOf( '.' );
+
+        if ( nDotPos == -1 )
+        {
+            sFileName += sExt.copy( 1 ); // without '*'
+            m_pName_ed->SetText( sFileName );
+        }
+    }
+}
+
 void RemoteFilesDialog::EnableControls()
 {
     if( m_pServices_lb->GetEntryCount() > 0 )
@@ -787,6 +804,10 @@ IMPL_LINK ( RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr )
 
 IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
 {
+    // auto extension
+    if( m_eMode == REMOTEDLG_MODE_SAVE )
+        AddFileExtension();
+
     // check if file/path exists
 
     OUString sCurrentPath = m_pFileView->GetViewURL();


More information about the Libreoffice-commits mailing list