[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 7 commits - fpicker/source icon-themes/breeze icon-themes/galaxy icon-themes/hicontrast icon-themes/human icon-themes/tango include/svtools svtools/source

Szymon Kłos eszkadev at gmail.com
Tue Jul 21 07:47:26 PDT 2015


 fpicker/source/office/RemoteFilesDialog.cxx |   80 ++++++++++++++++------------
 icon-themes/breeze/links.txt                |    3 +
 icon-themes/galaxy/links.txt                |    3 +
 icon-themes/hicontrast/links.txt            |    4 +
 icon-themes/human/links.txt                 |    3 +
 icon-themes/tango/links.txt                 |    1 
 include/svtools/foldertree.hxx              |    1 
 include/svtools/svtools.hrc                 |    1 
 svtools/source/contnr/fileview.src          |    6 ++
 svtools/source/contnr/foldertree.cxx        |    3 -
 svtools/source/dialogs/PlaceEditDialog.cxx  |    8 ++
 11 files changed, 79 insertions(+), 34 deletions(-)

New commits:
commit 0235f0ca7a06a30108de691b26c60ad2040dac48
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 16:45:00 2015 +0200

    set pointer to Wait while reading url
    
    Change-Id: I3c0786f8fb20df368cc7c03e35deba51d7ebbecd

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index c67e320..bc19740 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -468,6 +468,10 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
         }
 
         m_pFileView->EndInplaceEditing( false );
+
+        EnableChildPointerOverwrite( true );
+        SetPointer( PointerStyle::Wait );
+
         eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
 
         if( eResult == eSuccess )
@@ -481,6 +485,9 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
             m_bIsConnected = true;
             EnableControls();
         }
+
+        SetPointer( PointerStyle::Arrow );
+        EnableChildPointerOverwrite( false );
     }
 
     return eResult;
commit 6eb95abd9adeb5ce42a361b4ad8195d1cf8f3159
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 15:50:09 2015 +0200

    select recently added service
    
    Change-Id: I55a32eef4a5eb3b9f57cf6d1b8f3cba5a9a14c55

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 4843854..c67e320 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -549,6 +549,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
 
             m_pServices_lb->InsertEntry( sPrefix + newService->GetName() );
             m_pServices_lb->SelectEntryPos( m_pServices_lb->GetEntryCount() - 1 );
+            SelectServiceHdl( NULL );
 
             m_bIsUpdated = true;
 
commit 0450e02bcf6de270cd2412cbaa6e8268aa4263de
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 15:39:08 2015 +0200

    automatically select last used service
    
    Change-Id: Ic66517cd65c28bd7e62e38796cf8580ed31305f7

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 6dbbc62..4843854 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -323,6 +323,11 @@ short RemoteFilesDialog::Execute()
         Show();
         AddServiceHdl( NULL );
     }
+    if( m_pServices_lb->GetEntryCount() > 0 )
+    {
+        Show();
+        SelectServiceHdl( NULL );
+    }
 
     short nRet = SvtFileDialog_Base::Execute();
 
commit 469c20de440151707b288a150ff9be62f3922186
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 13:28:46 2015 +0200

    avoid multiple recursive opening the same url, cleaning
    
    Change-Id: I8a3ae75a64ffcc4879af3e3591b3b433cee1678d

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index d9f0e35..6dbbc62 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -468,7 +468,10 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
         if( eResult == eSuccess )
         {
             m_pPath->SetURL( sURL );
+
+            m_pTreeView->SetSelectHdl( Link<>() );
             m_pTreeView->SetTreePath( sURL );
+            m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
 
             m_bIsConnected = true;
             EnableControls();
@@ -660,24 +663,17 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
 
 IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
 {
-    SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
-
-    if( pEntry )
+    if( m_pFileView->GetSelectionCount() )
     {
-        SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
+        OUString sURL = m_pFileView->GetCurrentURL();
 
-        if( pData )
+        if( ContentIsFolder( sURL ) )
         {
-            if( pData->mbIsFolder )
-            {
-                OUString sURL = m_pFileView->GetCurrentURL();
-
-                OpenURL( sURL );
-            }
-            else
-            {
-                EndDialog( RET_OK );
-            }
+            OpenURL( sURL );
+        }
+        else
+        {
+            EndDialog( RET_OK );
         }
     }
 
commit b322a2ba547014d44a64ce3c9542a574de09ca27
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 12:35:19 2015 +0200

    don't take full email address as a username
    
    Change-Id: Ibc8f951dc3281b0b1d0f4b6783af0dbe2fb75da0

diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index cb90be7..125a817 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -198,7 +198,13 @@ void PlaceEditDialog::UpdateLabel( )
         if( !m_pEDUsername->GetText().isEmpty( ) )
         {
             OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL );
-            sLabel = sLabel.replaceFirst( "$user$", m_pEDUsername->GetText() );
+            OUString sUser = m_pEDUsername->GetText();
+
+            int nLength = sUser.indexOf( '@' );
+            if( nLength < 0 )
+                nLength = sUser.getLength();
+
+            sLabel = sLabel.replaceFirst( "$user$", sUser.copy( 0, nLength ) );
             sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() );
 
             m_pEDServerName->SetText( sLabel );
commit e7113fe5c1d0aea6d12b75620f8b0d54a5add995
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 11:59:45 2015 +0200

    FolderTree: expanded folder icon
    
    Change-Id: If5956b61dec2f00f9233e8f4906bdb9b6f22571d

diff --git a/icon-themes/breeze/links.txt b/icon-themes/breeze/links.txt
index 7ba9f85..9475368 100644
--- a/icon-themes/breeze/links.txt
+++ b/icon-themes/breeze/links.txt
@@ -126,3 +126,6 @@ cmd/sc_showgraphics.png cmd/sc_graphic.png
 # split cells duplicates
 svx/res/zetlhor2.png /sw/res/zetlhor2.png
 svx/res/zetlver2.png /sw/res/zetlver2.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/galaxy/links.txt b/icon-themes/galaxy/links.txt
index 2e42f11..6a68faf 100644
--- a/icon-themes/galaxy/links.txt
+++ b/icon-themes/galaxy/links.txt
@@ -81,3 +81,6 @@ cmd/lc_charbackcolor.png cmd/lc_backcolor.png
 
 # Toggle graphics visibility in Writer
 cmd/sc_showgraphics.png cmd/sc_graphic.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/hicontrast/links.txt b/icon-themes/hicontrast/links.txt
index 3c9fd17..ea11b2a 100644
--- a/icon-themes/hicontrast/links.txt
+++ b/icon-themes/hicontrast/links.txt
@@ -5,3 +5,7 @@ cmd/sc_linespacing.png cmd/sc_spacepara15.png
 # text background colour Impress/Draw
 cmd/sc_charbackcolor.png cmd/sc_backcolor.png
 cmd/lc_charbackcolor.png cmd/lc_backcolor.png
+
+# FolderTree icons
+svtools/res/folder.png formula/res/fapclose.png
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/human/links.txt b/icon-themes/human/links.txt
index 3e7c8a7..5b1aca0 100644
--- a/icon-themes/human/links.txt
+++ b/icon-themes/human/links.txt
@@ -8,3 +8,6 @@ cmd/sc_linespacing.png cmd/sc_spacepara15.png
 # text background colour Impress/Draw
 cmd/sc_charbackcolor.png cmd/sc_backcolor.png
 cmd/lc_charbackcolor.png cmd/lc_backcolor.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt
index 2fc1b96..672e153 100644
--- a/icon-themes/tango/links.txt
+++ b/icon-themes/tango/links.txt
@@ -383,6 +383,7 @@ res/sc10712.png cmd/sc_sortdescending.png
 res/reload.png cmd/sc_reload.png
 res/sc05501.png cmd/sc_open.png
 svtools/res/folder.png formula/res/fapclose.png
+svtools/res/folderop.png formula/res/fapopen.png
 fpicker/res/fp011.png res/sc06303.png
 sfx2/res/styfam1.png sw/imglst/sf01.png
 sfx2/res/styfam2.png sw/imglst/sf02.png
diff --git a/include/svtools/foldertree.hxx b/include/svtools/foldertree.hxx
index e430072..4be22b9 100644
--- a/include/svtools/foldertree.hxx
+++ b/include/svtools/foldertree.hxx
@@ -40,6 +40,7 @@ private:
     ::osl::Mutex m_aMutex;
     Sequence< OUString > m_aBlackList;
     Image m_aFolderImage;
+    Image m_aFolderExpandedImage;
 
 public:
     FolderTree( vcl::Window* pParent, WinBits nBits );
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 5ddb4dd..570809b 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -263,6 +263,7 @@
 #define IMG_TRIANGLE_DOWN               (RID_SVTOOLS_START + 20)
 
 #define IMG_SVT_FOLDER                  (RID_SVTOOLS_START + 42)
+#define IMG_SVT_FOLDER_OPEN             (RID_SVTOOLS_START + 43)
 
 #define RID_IMG_PRNDLG_NOCOLLATE            (STR_SVT_PRNDLG_START + 30)
 
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index c645737..54119f3 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -76,6 +76,12 @@ Image IMG_SVT_FOLDER
     MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
 };
 
+Image IMG_SVT_FOLDER_OPEN
+{
+    ImageBitmap = Bitmap { File = "folderop.png" ; };
+    MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
+};
+
 // Menus -----------------------------------------------------------------
 
 Menu RID_FILEVIEW_CONTEXTMENU
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 5c8ee46..f54031a 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -14,6 +14,7 @@
 FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
     : SvTreeListBox( pParent, nBits | WB_SORT | WB_TABSTOP )
     , m_aFolderImage( SvtResId( IMG_SVT_FOLDER ) )
+    , m_aFolderExpandedImage( SvtResId( IMG_SVT_FOLDER_OPEN ) )
 {
     Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
     Reference< XInteractionHandler > xInteractionHandler(
@@ -21,7 +22,7 @@ FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
     m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
 
     SetDefaultCollapsedEntryBmp( m_aFolderImage );
-    SetDefaultExpandedEntryBmp( m_aFolderImage );
+    SetDefaultExpandedEntryBmp( m_aFolderExpandedImage );
 }
 
 void FolderTree::RequestingChildren( SvTreeListEntry* pEntry )
commit 54fdf7239e454df7fd024fa6de44667f33789742
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 09:40:49 2015 +0200

    check pointers
    
    Change-Id: Iacf9213d833a0a3c2d951c667108a5e2538f4215

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index fa110f3..d9f0e35 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -687,28 +687,35 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
 IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl )
 {
     SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
-    SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
 
-    if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
-       || ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
+    if( 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( pData->maURL );
-        INetURLObject aCurrentURL( m_sLastServiceUrl );
-        aURL.SetUser( aCurrentURL.GetUser() );
+        SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
 
-        m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
+        if( pData )
+        {
+            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 );
+                INetURLObject aCurrentURL( m_sLastServiceUrl );
+                aURL.SetUser( aCurrentURL.GetUser() );
 
-        m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
-    }
-    else
-    {
-        m_sPath.clear();
-        m_pName_ed->SetText( "" );
-    }
+                m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
 
-    EnableControls();
+                m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
+            }
+            else
+            {
+                m_sPath.clear();
+                m_pName_ed->SetText( "" );
+            }
+
+            EnableControls();
+        }
+    }
 
     return 1;
 }


More information about the Libreoffice-commits mailing list