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

Szymon Kłos eszkadev at gmail.com
Wed Aug 5 02:58:00 PDT 2015


 include/svtools/ServerDetailsControls.hxx        |    8 ++
 svtools/source/dialogs/PlaceEditDialog.cxx       |   20 +++----
 svtools/source/dialogs/ServerDetailsControls.cxx |   14 ++++
 svtools/uiconfig/ui/placeedit.ui                 |   65 ++++++++++-------------
 4 files changed, 58 insertions(+), 49 deletions(-)

New commits:
commit 7d8c8327a641b4aae5394e19f8c4a7d36adf9d23
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Aug 5 11:56:06 2015 +0200

    Show unavailable services with disabled controls
    
    Change-Id: I9fe25bc5e8ce31cd848c4f6434b747be96a8006a

diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
index 8043d46..16b8e23 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -25,8 +25,10 @@
 class DetailsContainer
 {
     private:
-        Link<> m_aChangeHdl;
-        VclPtr<VclGrid>       m_pFrame;
+        Link<>             m_aChangeHdl;
+        VclPtr<VclGrid>    m_pFrame;
+        VclPtr<VclGrid>    m_pCommon;
+        bool               m_bIsActive;
 
     public:
         DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame );
@@ -46,6 +48,8 @@ class DetailsContainer
 
         virtual void setUsername( const OUString& /*rUsername*/ ) { };
 
+        virtual void setActive( bool bActive = true );
+
     protected:
         void notifyChange( );
         DECL_LINK ( ValueChangeHdl, void * );
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 125a817..8ead056 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -150,18 +150,20 @@ void PlaceEditDialog::InitDetails( )
     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 ) )
-        {
-            nPos = m_pLBServerType->InsertEntry( aTypesNamesList[i], nPos );
+        nPos = m_pLBServerType->InsertEntry( aTypesNamesList[i], nPos );
 
-            std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, sUrl));
-            xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
-            m_aDetailsContainers.push_back(xCmisDetails);
+        std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, sUrl));
+        xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
+        m_aDetailsContainers.push_back(xCmisDetails);
 
-            nPos++;
+        if ( ( sUrl == GDRIVE_BASE_URL && bSkipGDrive ) ||
+             ( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) ||
+             ( sUrl == ONEDRIVE_BASE_URL && bSkipOneDrive ) )
+        {
+            xCmisDetails->setActive( false );
         }
+
+        nPos++;
     }
 
     // Create WebDAV / FTP / SSH details control
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index a5b40e0..f585666 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -31,9 +31,11 @@ using namespace com::sun::star::task;
 using namespace com::sun::star::ucb;
 using namespace com::sun::star::uno;
 
-DetailsContainer::DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame )
+DetailsContainer::DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ) :
+    m_bIsActive ( true )
 {
     pBuilder->get( m_pFrame, rFrame );
+    pBuilder->get( m_pCommon, "CommonDetails" );
 }
 
 DetailsContainer::~DetailsContainer( )
@@ -43,6 +45,9 @@ DetailsContainer::~DetailsContainer( )
 void DetailsContainer::show( bool bShow )
 {
     m_pFrame->Show( bShow );
+
+    m_pFrame->Enable( m_bIsActive );
+    m_pCommon->Enable( m_bIsActive );
 }
 
 INetURLObject DetailsContainer::getUrl( )
@@ -63,6 +68,11 @@ void DetailsContainer::notifyChange( )
     m_aChangeHdl.Call( this );
 }
 
+void DetailsContainer::setActive( bool bActive )
+{
+    m_bIsActive = bActive;
+}
+
 IMPL_LINK_NOARG( DetailsContainer, ValueChangeHdl )
 {
     notifyChange( );
diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 4fb556b..e2b1c30 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -478,9 +478,10 @@
           </packing>
         </child>
         <child>
-          <object class="GtkGrid" id="UserDetails">
+          <object class="GtkGrid" id="CommonDetails">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="row_spacing">6</property>
             <property name="column_spacing">12</property>
             <child>
               <object class="GtkLabel" id="label16">
@@ -508,18 +509,6 @@
                 <property name="top_attach">0</property>
               </packing>
             </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">4</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkGrid" id="LabelGrid">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="column_spacing">6</property>
             <child>
               <object class="GtkLabel" id="labelLabel">
                 <property name="visible">True</property>
@@ -531,7 +520,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
+                <property name="top_attach">1</property>
               </packing>
             </child>
             <child>
@@ -543,14 +532,14 @@
               </object>
               <packing>
                 <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
+                <property name="top_attach">1</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">5</property>
+            <property name="position">4</property>
           </packing>
         </child>
       </object>
commit d0fcc0ee22ddd70318cb8d0ada48ee9da22b037d
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Aug 5 11:13:09 2015 +0200

    Port field without buttons, max 4 chars
    
    Change-Id: I4ddc294dba5ad66a11ff260e8942977d0a6a292f

diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 71eab33..a5b40e0 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -77,7 +77,7 @@ HostDetailsContainer::HostDetailsContainer( VclBuilderContainer* pBuilder, sal_u
     pBuilder->get( m_pEDHost, "host" );
     m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
 
-    pBuilder->get( m_pEDPort, "port" );
+    pBuilder->get( m_pEDPort, "port-nospin" );
     m_pEDPort->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
 
     pBuilder->get( m_pEDPath, "path" );
diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 272c096..4fb556b 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -241,7 +241,7 @@
                 <property name="xalign">0</property>
                 <property name="label" translatable="yes">Port:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">port</property>
+                <property name="mnemonic_widget">port-nospin</property>
               </object>
               <packing>
                 <property name="left_attach">2</property>
@@ -249,10 +249,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkSpinButton" id="port">
+              <object class="GtkSpinButton" id="port-nospin">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="max_length">4</property>
                 <property name="invisible_char">●</property>
+                <property name="max_width_chars">4</property>
                 <property name="text" translatable="yes">0</property>
                 <property name="adjustment">adjustment1</property>
                 <property name="numeric">True</property>
commit 021d35d2773aa1f3eb96173f2d38943169e1d514
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Aug 5 10:46:43 2015 +0200

    Port field on the same line as Host
    
    Change-Id: Iddf611e372772cbe5c38aecc81f4d43412d653da

diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 5434102..272c096 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -191,7 +191,8 @@
               </object>
               <packing>
                 <property name="left_attach">1</property>
-                <property name="top_attach">3</property>
+                <property name="top_attach">2</property>
+                <property name="width">3</property>
               </packing>
             </child>
             <child>
@@ -205,7 +206,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">2</property>
+                <property name="top_attach">1</property>
               </packing>
             </child>
             <child>
@@ -217,7 +218,20 @@
               </object>
               <packing>
                 <property name="left_attach">1</property>
-                <property name="top_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="width">3</property>
+              </packing>
+            </child>
+            <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">1</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
@@ -230,8 +244,8 @@
                 <property name="mnemonic_widget">port</property>
               </object>
               <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">1</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
@@ -244,19 +258,7 @@
                 <property name="numeric">True</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">1</property>
-              </packing>
-            </child>
-            <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">1</property>
+                <property name="left_attach">3</property>
                 <property name="top_attach">0</property>
               </packing>
             </child>


More information about the Libreoffice-commits mailing list