summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-11-14 10:25:55 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-11-15 13:13:11 +0100
commitb4fc58675b98d68544acc4aaa292548f10cb5c3b (patch)
treeac564e4c6a9ad36e8602923a253b540fd4641784 /svtools
parentc78d7a8a0e255d6603f8ce2e7f5566e127b0f0ef (diff)
PlaceEditDialog: simplified CMIS by adding template URLs for common servers
Change-Id: I041d58d09e132e481cfa278300c494c9f1d75f29
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/ServerDetailsControls.hxx3
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx26
-rw-r--r--svtools/uiconfig/ui/placeedit.ui220
3 files changed, 151 insertions, 98 deletions
diff --git a/svtools/inc/svtools/ServerDetailsControls.hxx b/svtools/inc/svtools/ServerDetailsControls.hxx
index f29ec4473b54..c6ab63f36637 100644
--- a/svtools/inc/svtools/ServerDetailsControls.hxx
+++ b/svtools/inc/svtools/ServerDetailsControls.hxx
@@ -135,12 +135,14 @@ class CmisDetailsContainer : public DetailsContainer
private:
rtl::OUString m_sUsername;
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
+ std::vector< rtl::OUString > m_aServerTypesURLs;
std::vector< rtl::OUString > m_aRepoIds;
rtl::OUString m_sRepoId;
Edit* m_pEDBinding;
ListBox* m_pLBRepository;
Button* m_pBTRepoRefresh;
+ ListBox* m_pLBServerType;
public:
CmisDetailsContainer( VclBuilderContainer* pBuilder );
@@ -152,6 +154,7 @@ class CmisDetailsContainer : public DetailsContainer
private:
void selectRepository( );
+ DECL_LINK ( SelectServerTypeHdl, void * );
DECL_LINK ( RefreshReposHdl, void * );
DECL_LINK ( SelectRepoHdl, void * );
};
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 297e750171f9..88f57e67ce8c 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <comphelper/processfactory.hxx>
+#include <officecfg/Office/Common.hxx>
#include <rtl/uri.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
@@ -270,13 +271,19 @@ bool SmbDetailsContainer::setUrl( const INetURLObject& rUrl )
CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
DetailsContainer( pBuilder, "CmisDetails" ),
m_sUsername( ),
- m_xCmdEnv( )
+ m_xCmdEnv( ),
+ m_aServerTypesURLs( ),
+ m_aRepoIds( ),
+ m_sRepoId( )
{
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 ) );
@@ -287,6 +294,15 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
m_pBTRepoRefresh->SetClickHdl( LINK( this, CmisDetailsContainer, RefreshReposHdl ) );
show( false );
+
+ // Load the ServerType entries
+ Sequence< ::rtl::OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
+ Sequence< ::rtl::OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
+ for ( sal_Int32 i = 0; i < aTypesUrlsList.getLength( ) && aTypesNamesList.getLength( ); ++i )
+ {
+ m_pLBServerType->InsertEntry( aTypesNamesList[i] );
+ m_aServerTypesURLs.push_back( aTypesUrlsList[i] );
+ }
}
INetURLObject CmisDetailsContainer::getUrl( )
@@ -341,6 +357,14 @@ void CmisDetailsContainer::selectRepository( )
notifyChange( );
}
+IMPL_LINK( CmisDetailsContainer, SelectServerTypeHdl, void *, EMPTYARG )
+{
+ // Set a sample URL for the server
+ sal_uInt16 nId = m_pLBServerType->GetSelectEntryPos( );
+ m_pEDBinding->SetText( m_aServerTypesURLs[nId] );
+ return 0;
+}
+
IMPL_LINK( CmisDetailsContainer, RefreshReposHdl, void *, EMPTYARG )
{
rtl::OUString sBindingUrl = rtl::OUString( m_pEDBinding->GetText() ).trim( );
diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 2f0a2aa8bcdc..285b0234e6df 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -6,29 +6,6 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="ServerTypes">
- <columns>
- <!-- column-name ServerType -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">WebDAV</col>
- </row>
- <row>
- <col id="0" translatable="yes">FTP</col>
- </row>
- <row>
- <col id="0" translatable="yes">SSH</col>
- </row>
- <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">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@@ -92,7 +69,7 @@
<property name="can_focus">False</property>
<property name="margin_top">6</property>
<property name="hexpand">True</property>
- <property name="model">ServerTypes</property>
+ <property name="model">liststore1</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
@@ -273,102 +250,128 @@
</packing>
</child>
<child>
- <object class="GtkFrame" id="SmbDetails">
+ <object class="GtkFrame" id="CmisDetails">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment2">
+ <object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkGrid" id="grid4">
+ <object class="GtkGrid" id="grid5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
- <object class="GtkLabel" id="label9">
+ <object class="GtkLabel" id="bindingLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes">Host</property>
+ <property name="label" translatable="yes">Binding URL</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label10">
+ <object class="GtkLabel" id="repositoryLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes">Share</property>
+ <property name="label" translatable="yes">Repository</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label11">
+ <object class="GtkEntry" id="binding">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Path</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">2</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="smbHost">
+ <object class="GtkGrid" id="grid6">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="invisible_char">●</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkComboBox" id="repositories">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="repositoriesRefresh">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">image1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="smbShare">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="invisible_char">●</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Server Type</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="smbPath">
+ <object class="GtkComboBox" id="serverType">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="invisible_char">●</property>
+ <property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -378,7 +381,7 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="label8">
+ <object class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Server Details</property>
@@ -395,28 +398,28 @@
</packing>
</child>
<child>
- <object class="GtkFrame" id="CmisDetails">
+ <object class="GtkFrame" id="SmbDetails">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment3">
+ <object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkGrid" id="grid5">
+ <object class="GtkGrid" id="grid4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
- <object class="GtkLabel" id="bindingLabel">
+ <object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes">Binding URL</property>
+ <property name="label" translatable="yes">Host</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -426,11 +429,11 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="repositoryLabel">
+ <object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes">Repository</property>
+ <property name="label" translatable="yes">Share</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -440,7 +443,21 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="binding">
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Path</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="smbHost">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
@@ -454,39 +471,11 @@
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid6">
+ <object class="GtkEntry" id="smbShare">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkComboBox" id="repositories">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="repositoriesRefresh">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="image">image1</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</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>
@@ -495,12 +484,26 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkEntry" id="smbPath">
+ <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">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
</child>
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="label12">
+ <object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Server Details</property>
@@ -657,4 +660,27 @@
<property name="can_focus">False</property>
<property name="stock">gtk-refresh</property>
</object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name type -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">WebDAV</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">FTP</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">SSH</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Windows Share</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">CMIS</col>
+ </row>
+ </data>
+ </object>
</interface>