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

Szymon Kłos eszkadev at gmail.com
Wed May 27 03:14:39 PDT 2015


 include/svtools/PlaceEditDialog.hxx              |    2 
 include/svtools/ServerDetailsControls.hxx        |    7 -
 svtools/source/dialogs/PlaceEditDialog.cxx       |   40 +++++-
 svtools/source/dialogs/ServerDetailsControls.cxx |   54 ++------
 svtools/uiconfig/ui/placeedit.ui                 |  142 ++++++++---------------
 5 files changed, 106 insertions(+), 139 deletions(-)

New commits:
commit b219a225edc79b9440082396c2e2d385daa5538e
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed May 27 12:12:14 2015 +0200

    CMIS types moved level up to the service type listbox
    
    Change-Id: I8177669e74a452c6022f17ff84b9bfe2c1dddfb7

diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx
index a3e4c2c..9bd32eb 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -21,6 +21,8 @@
 #include <svtools/inettbc.hxx>
 #include <svtools/place.hxx>
 
+#include <config_oauth2.h>
+
 #include <memory>
 #include <vector>
 
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
index 83444ea..2c7f1b2 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -116,27 +116,26 @@ class CmisDetailsContainer : public DetailsContainer
     private:
         OUString m_sUsername;
         com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
-        std::vector< OUString > m_aServerTypesURLs;
         std::vector< OUString > m_aRepoIds;
         OUString m_sRepoId;
+        OUString m_sBinding;
 
         VclPtr<Edit>       m_pEDBinding;
         VclPtr<ListBox>    m_pLBRepository;
         VclPtr<Button>     m_pBTRepoRefresh;
-        VclPtr<ListBox>    m_pLBServerType;
         VclPtr<Edit>       m_pEDPath;
 
     public:
-        CmisDetailsContainer( VclBuilderContainer* pBuilder );
+        CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString sBinding );
         virtual ~CmisDetailsContainer( ) { };
 
+        virtual void show( bool bShow = true );
         virtual INetURLObject getUrl( ) SAL_OVERRIDE;
         virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE;
         virtual void setUsername( const OUString& rUsername ) SAL_OVERRIDE;
 
     private:
         void selectRepository( );
-        DECL_LINK ( SelectServerTypeHdl, void * );
         DECL_LINK ( RefreshReposHdl, void * );
         DECL_LINK ( SelectRepoHdl, void * );
 };
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 90fdea7..886aefd 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -10,10 +10,13 @@
 #include <svtools/PlaceEditDialog.hxx>
 #include <svtools/ServerDetailsControls.hxx>
 
+#include <com/sun/star/uno/Sequence.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <svtools/svtresid.hxx>
 #include <vcl/msgbox.hxx>
 
+using namespace com::sun::star::uno;
+
 PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
     : ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui")
     , m_xCurrentDetails()
@@ -136,10 +139,39 @@ void PlaceEditDialog::InitDetails( )
     xSmbDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
     m_aDetailsContainers.push_back(xSmbDetails);
 
-    // Create CMIS control
-    std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this));
-    xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
-    m_aDetailsContainers.push_back(xCmisDetails);
+    // Create CMIS controls for each server type
+
+    Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+
+    // Load the ServerType entries
+    bool bSkipGDrive = OUString( GDRIVE_CLIENT_ID ).isEmpty() ||
+                       OUString( GDRIVE_CLIENT_SECRET ).isEmpty();
+    bool bSkipAlfresco = OUString( ALFRESCO_CLOUD_CLIENT_ID ).isEmpty() ||
+                       OUString( ALFRESCO_CLOUD_CLIENT_SECRET ).isEmpty();
+    bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() ||
+                       OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty();
+
+
+    Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
+    Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
+
+    unsigned int nPos = 0;
+    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 ) )
+        {
+            m_pLBServerType->InsertEntry( aTypesNamesList[i]);
+
+            std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, sUrl));
+            xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
+            m_aDetailsContainers.push_back(xCmisDetails);
+
+            nPos++;
+        }
+    }
 
     // Set default to first value
     m_pLBServerType->SelectEntryPos( 0 );
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 7a17bfd..c98fb40 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -248,58 +248,38 @@ bool SmbDetailsContainer::setUrl( const INetURLObject& rUrl )
     return bSuccess;
 }
 
-CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
+CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString sBinding ) :
     DetailsContainer( pBuilder, "CmisDetails" ),
     m_sUsername( ),
     m_xCmdEnv( ),
-    m_aServerTypesURLs( ),
     m_aRepoIds( ),
-    m_sRepoId( )
+    m_sRepoId( ),
+    m_sBinding( sBinding )
 {
     Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
     Reference< XInteractionHandler > xGlobalInteractionHandler(
         InteractionHandler::createWithParent(xContext, 0), UNO_QUERY );
     m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() );
 
-    pBuilder->get( m_pLBServerType, "serverType" );
-    m_pLBServerType->SetSelectHdl( LINK( this, CmisDetailsContainer, SelectServerTypeHdl ) );
-
     pBuilder->get( m_pEDBinding, "binding" );
-    m_pEDBinding->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
-
     pBuilder->get( m_pLBRepository, "repositories" );
-    m_pLBRepository->SetSelectHdl( LINK( this, CmisDetailsContainer, SelectRepoHdl ) );
-
     pBuilder->get( m_pBTRepoRefresh, "repositoriesRefresh" );
-    m_pBTRepoRefresh->SetClickHdl( LINK( this, CmisDetailsContainer, RefreshReposHdl ) );
-
     pBuilder->get( m_pEDPath, "cmisPath" );
-    m_pEDPath->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
+
 
     show( false );
+}
 
-    // Load the ServerType entries
-    bool bSkipGDrive = OUString( GDRIVE_CLIENT_ID ).isEmpty() ||
-                       OUString( GDRIVE_CLIENT_SECRET ).isEmpty();
-    bool bSkipAlfresco = OUString( ALFRESCO_CLOUD_CLIENT_ID ).isEmpty() ||
-                       OUString( ALFRESCO_CLOUD_CLIENT_SECRET ).isEmpty();
-    bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() ||
-                       OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty();
+void CmisDetailsContainer::show( bool bShow )
+{
+    DetailsContainer::show( bShow );
 
+    m_pEDBinding->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
+    m_pLBRepository->SetSelectHdl( LINK( this, CmisDetailsContainer, SelectRepoHdl ) );
+    m_pBTRepoRefresh->SetClickHdl( LINK( this, CmisDetailsContainer, RefreshReposHdl ) );
+    m_pEDPath->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
 
-    Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
-    Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
-    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 ) )
-        {
-            m_pLBServerType->InsertEntry( aTypesNamesList[i] );
-            m_aServerTypesURLs.push_back( sUrl );
-        }
-    }
+    m_pEDBinding->SetText( m_sBinding );
 }
 
 INetURLObject CmisDetailsContainer::getUrl( )
@@ -356,14 +336,6 @@ void CmisDetailsContainer::selectRepository( )
     notifyChange( );
 }
 
-IMPL_LINK_NOARG( CmisDetailsContainer, SelectServerTypeHdl  )
-{
-    // Set a sample URL for the server
-    sal_uInt16 nId = m_pLBServerType->GetSelectEntryPos( );
-    m_pEDBinding->SetText( m_aServerTypesURLs[nId] );
-    return 0;
-}
-
 IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl  )
 {
     OUString sBindingUrl = m_pEDBinding->GetText().trim( );
diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 3941f06..7d32d20 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -30,9 +30,6 @@
       <row>
         <col id="0" translatable="yes">Windows Share</col>
       </row>
-      <row>
-        <col id="0" translatable="yes">CMIS</col>
-      </row>
     </data>
   </object>
   <object class="GtkDialog" id="PlaceEditDialog">
@@ -147,7 +144,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
@@ -161,7 +158,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
@@ -173,7 +170,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
@@ -191,7 +188,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="top_attach">1</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                   </object>
@@ -240,7 +237,6 @@
                         <property name="xalign">1</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>
@@ -248,6 +244,20 @@
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkCheckButton" id="webdavs">
+                        <property name="label" translatable="yes">Secured WebDAV (HTTPS)</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">3</property>
+                      </packing>
+                    </child>
+                    <child>
                       <object class="GtkLabel" id="pathLabel">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -258,65 +268,43 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
+                        <property name="top_attach">2</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkGrid" id="grid3">
+                      <object class="GtkEntry" id="path">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="column_spacing">12</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="left_attach">0</property>
-                            <property name="top_attach">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>
-                            <property name="mnemonic_widget">port</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkSpinButton" id="port">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="invisible_char">●</property>
-                            <property name="adjustment">adjustment1</property>
-                            <property name="numeric">True</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">2</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
+                        <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">2</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkEntry" id="path">
+                      <object class="GtkLabel" id="portLabel">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">1</property>
+                        <property name="label" translatable="yes">Port:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">port</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkSpinButton" id="port">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="hexpand">True</property>
                         <property name="invisible_char">●</property>
+                        <property name="text" translatable="yes">0</property>
+                        <property name="adjustment">adjustment1</property>
+                        <property name="numeric">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -324,17 +312,15 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkCheckButton" id="webdavs">
-                        <property name="label" translatable="yes">Secured WebDAV (HTTPS)</property>
+                      <object class="GtkEntry" id="host">
+                        <property name="visible">True</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>
+                        <property name="invisible_char">●</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="top_attach">2</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
@@ -390,7 +376,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
@@ -404,7 +390,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">2</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
@@ -416,7 +402,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="top_attach">1</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
@@ -450,31 +436,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="top_attach">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label3">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Server type:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">serverType</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="serverType">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
@@ -488,7 +450,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">3</property>
+                        <property name="top_attach">2</property>
                       </packing>
                     </child>
                     <child>
@@ -499,7 +461,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="top_attach">3</property>
+                        <property name="top_attach">2</property>
                       </packing>
                     </child>
                   </object>


More information about the Libreoffice-commits mailing list