summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-05-19 21:32:05 +0200
committerAndras Timar <andras.timar@collabora.com>2015-10-18 23:48:59 +0200
commitbf86643b3e71519ae20620fb816b04bba2d99bdb (patch)
treef37b8afc6cd27407bc8738f6599e0c2201c120bc /svtools
parent6cc58b9fa7ed6b5781963427df47b03417f17973 (diff)
RemoteFilesDialog
Change-Id: I296ce6233287dac5447462faa4b7404c25297f8b (cherry picked from commit 87297284782adbf1fcb73663ad2d2a38b5ae1872)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/Library_svt.mk3
-rw-r--r--svtools/source/contnr/fileview.cxx70
-rw-r--r--svtools/source/contnr/fileview.src6
-rw-r--r--svtools/source/contnr/foldertree.cxx161
-rw-r--r--svtools/source/control/autocmpledit.cxx111
-rw-r--r--svtools/source/control/breadcrumb.cxx284
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx178
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx237
-rw-r--r--svtools/source/dialogs/filedlg2.src6
-rw-r--r--svtools/uiconfig/ui/placeedit.ui794
10 files changed, 1211 insertions, 639 deletions
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 07dc321e6314..b877d463e66d 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -92,6 +92,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/contnr/DocumentInfoPreview \
svtools/source/contnr/contentenumeration \
svtools/source/contnr/fileview \
+ svtools/source/contnr/foldertree \
svtools/source/contnr/imivctl1 \
svtools/source/contnr/imivctl2 \
svtools/source/contnr/ivctrl \
@@ -106,6 +107,8 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/contnr/viewdataentry \
svtools/source/control/accessibleruler \
svtools/source/control/asynclink \
+ svtools/source/control/autocmpledit \
+ svtools/source/control/breadcrumb \
svtools/source/control/calendar \
svtools/source/control/collatorres \
svtools/source/control/ctrlbox \
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index ada14a38cf21..f8f19c0ac54e 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -101,6 +101,7 @@ enum class FileViewFlags
NONE = 0x00,
ONLYFOLDER = 0x01,
MULTISELECTION = 0x02,
+ SHOW_TYPE = 0x04,
SHOW_ONLYTITLE = 0x10,
SHOW_NONE = 0x20,
};
@@ -425,10 +426,10 @@ protected:
Link<> m_aSelectHandler;
::rtl::Reference< ::svt::FileViewContentEnumerator >
- m_pContentEnumerator;
+ m_xContentEnumerator;
Link<> m_aCurrentAsyncActionHandler;
::osl::Condition m_aAsyncActionFinished;
- ::rtl::Reference< ::salhelper::Timer > m_pCancelAsyncTimer;
+ ::rtl::Reference< ::salhelper::Timer > m_xCancelAsyncTimer;
::svt::EnumerationResult m_eAsyncActionResult;
bool m_bRunningAsyncAction;
bool m_bAsyncActionCancelled;
@@ -616,7 +617,10 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin,
SetTabJustify(2, AdjustRight); // column "Size"
mpHeaderBar->InsertItem(COLUMN_TITLE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TITLE), 180, nBits | HeaderBarItemBits::UPARROW);
- mpHeaderBar->InsertItem(COLUMN_TYPE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TYPE), 140, nBits);
+ if (nFlags & FileViewFlags::SHOW_TYPE)
+ {
+ mpHeaderBar->InsertItem(COLUMN_TYPE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TYPE), 140, nBits);
+ }
mpHeaderBar->InsertItem(COLUMN_SIZE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_SIZE), 80, nBits);
mpHeaderBar->InsertItem(COLUMN_DATE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_DATE), 500, nBits);
}
@@ -1083,7 +1087,7 @@ bool ViewTabListBox_Impl::Kill( const OUString& rContent )
// class SvtFileView -----------------------------------------------------
SvtFileView::SvtFileView( vcl::Window* pParent, WinBits nBits,
- bool bOnlyFolder, bool bMultiSelection ) :
+ bool bOnlyFolder, bool bMultiSelection, bool bShowType ) :
Control( pParent, nBits )
{
@@ -1092,6 +1096,8 @@ SvtFileView::SvtFileView( vcl::Window* pParent, WinBits nBits,
nFlags |= FileViewFlags::ONLYFOLDER;
if ( bMultiSelection )
nFlags |= FileViewFlags::MULTISELECTION;
+ if ( bShowType )
+ nFlags |= FileViewFlags::SHOW_TYPE;
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
@@ -1472,6 +1478,18 @@ OUString SvtFileView::GetConfigString() const
return sRet;
}
+::std::vector< SvtContentEntry > SvtFileView::GetContent()
+{
+ ::std::vector< SvtContentEntry > aContent;
+
+ for( ::std::vector< SortingData_Impl* >::size_type i = 0; i < mpImp->maContent.size(); i++ )
+ {
+ SvtContentEntry aEntry( mpImp->maContent[i]->maTargetURL, mpImp->maContent[i]->mbIsFolder );
+ aContent.push_back( aEntry );
+ }
+
+ return aContent;
+}
void SvtFileView::SetConfigString( const OUString& rCfgStr )
{
@@ -1644,21 +1662,21 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
DBG_TESTSOLARMUTEX();
::osl::ClearableMutexGuard aGuard( maMutex );
- OSL_ENSURE( !m_pContentEnumerator.is(), "SvtFileView_Impl::GetFolderContent_Impl: still running another enumeration!" );
- m_pContentEnumerator = new ::svt::FileViewContentEnumerator(
- mpView->GetCommandEnvironment(), maContent, maMutex, mbReplaceNames ? mpNameTrans : NULL );
+ OSL_ENSURE( !m_xContentEnumerator.is(), "SvtFileView_Impl::GetFolderContent_Impl: still running another enumeration!" );
+ m_xContentEnumerator.set(new ::svt::FileViewContentEnumerator(
+ mpView->GetCommandEnvironment(), maContent, maMutex, mbReplaceNames ? mpNameTrans : NULL));
// TODO: should we cache and re-use this thread?
if ( !pAsyncDescriptor )
{
- ::svt::EnumerationResult eResult = m_pContentEnumerator->enumerateFolderContentSync( _rFolder, rBlackList );
+ ::svt::EnumerationResult eResult = m_xContentEnumerator->enumerateFolderContentSync( _rFolder, rBlackList );
if ( ::svt::SUCCESS == eResult )
{
implEnumerationSuccess();
- m_pContentEnumerator.clear();
+ m_xContentEnumerator.clear();
return eSuccess;
}
- m_pContentEnumerator.clear();
+ m_xContentEnumerator.clear();
return eFailure;
}
@@ -1681,7 +1699,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
pTimeout->Seconds = nMinTimeout / 1000L;
pTimeout->Nanosec = ( nMinTimeout % 1000L ) * 1000000L;
- m_pContentEnumerator->enumerateFolderContent( _rFolder, this );
+ m_xContentEnumerator->enumerateFolderContent( _rFolder, this );
// wait until the enumeration is finished
// for this, release our own mutex (which is used by the enumerator thread)
@@ -1702,16 +1720,16 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
if ( ::osl::Condition::result_timeout == eResult )
{
// maximum time to wait
- OSL_ENSURE( !m_pCancelAsyncTimer.get(), "SvtFileView_Impl::GetFolderContent_Impl: there's still a previous timer!" );
- m_pCancelAsyncTimer = new CallbackTimer( this );
+ OSL_ENSURE( !m_xCancelAsyncTimer.get(), "SvtFileView_Impl::GetFolderContent_Impl: there's still a previous timer!" );
+ m_xCancelAsyncTimer.set(new CallbackTimer(this));
sal_Int32 nMaxTimeout = pAsyncDescriptor->nMaxTimeout;
OSL_ENSURE( nMaxTimeout > nMinTimeout,
"SvtFileView_Impl::GetFolderContent_Impl: invalid maximum timeout!" );
if ( nMaxTimeout <= nMinTimeout )
nMaxTimeout = nMinTimeout + 5000;
- m_pCancelAsyncTimer->setRemainingTime( salhelper::TTimeValue( nMaxTimeout - nMinTimeout ) );
+ m_xCancelAsyncTimer->setRemainingTime( salhelper::TTimeValue( nMaxTimeout - nMinTimeout ) );
// we already waited for nMinTimeout milliseconds, so take this into account
- m_pCancelAsyncTimer->start();
+ m_xCancelAsyncTimer->start();
m_aCurrentAsyncActionHandler = pAsyncDescriptor->aFinishHandler;
DBG_ASSERT( m_aCurrentAsyncActionHandler.IsSet(), "SvtFileView_Impl::GetFolderContent_Impl: nobody interested when it's finished?" );
@@ -1909,17 +1927,17 @@ void SvtFileView_Impl::CancelRunningAsyncAction()
{
DBG_TESTSOLARMUTEX();
::osl::MutexGuard aGuard( maMutex );
- if ( !m_pContentEnumerator.is() )
+ if ( !m_xContentEnumerator.is() )
return;
m_bAsyncActionCancelled = true;
- m_pContentEnumerator->cancel();
+ m_xContentEnumerator->cancel();
m_bRunningAsyncAction = false;
- m_pContentEnumerator.clear();
- if ( m_pCancelAsyncTimer.is() && m_pCancelAsyncTimer->isTicking() )
- m_pCancelAsyncTimer->stop();
- m_pCancelAsyncTimer = NULL;
+ m_xContentEnumerator.clear();
+ if ( m_xCancelAsyncTimer.is() && m_xCancelAsyncTimer->isTicking() )
+ m_xCancelAsyncTimer->stop();
+ m_xCancelAsyncTimer.clear();
}
@@ -1946,10 +1964,10 @@ void SvtFileView_Impl::enumerationDone( ::svt::EnumerationResult eResult )
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( maMutex );
- m_pContentEnumerator.clear();
- if ( m_pCancelAsyncTimer.is() && m_pCancelAsyncTimer->isTicking() )
- m_pCancelAsyncTimer->stop();
- m_pCancelAsyncTimer = NULL;
+ m_xContentEnumerator.clear();
+ if ( m_xCancelAsyncTimer.is() && m_xCancelAsyncTimer->isTicking() )
+ m_xCancelAsyncTimer->stop();
+ m_xCancelAsyncTimer.clear();
if ( m_bAsyncActionCancelled )
// this is to prevent race conditions
@@ -2022,7 +2040,7 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
aValue += rLocaleData.getDate( (*aIt)->maModDate );
aValue += aDateSep;
- aValue += rLocaleData.getTime( (*aIt)->maModDate );
+ aValue += rLocaleData.getTime( (*aIt)->maModDate, false );
}
(*aIt)->maDisplayText = aValue;
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index c64573717c4e..54119f394d2e 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
new file mode 100644
index 000000000000..daeb9e7fd389
--- /dev/null
+++ b/svtools/source/contnr/foldertree.cxx
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <svtools/foldertree.hxx>
+
+#include "contentenumeration.hxx"
+
+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(
+ InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW );
+ m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
+
+ SetDefaultCollapsedEntryBmp( m_aFolderImage );
+ SetDefaultExpandedEntryBmp( m_aFolderExpandedImage );
+}
+
+void FolderTree::RequestingChildren( SvTreeListEntry* pEntry )
+{
+ EnableChildPointerOverwrite( true );
+ SetPointer( PointerStyle::Wait );
+ Invalidate(INVALIDATE_UPDATE);
+
+ FillTreeEntry( pEntry );
+
+ SetPointer( PointerStyle::Arrow );
+ EnableChildPointerOverwrite( false );
+}
+
+void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
+{
+ if( pEntry )
+ {
+ OUString* pURL = static_cast< OUString* >( pEntry->GetUserData() );
+
+ if( pURL && m_sLastUpdatedDir != *pURL )
+ {
+ while (SvTreeListEntry* pChild = FirstChild(pEntry))
+ {
+ GetModel()->Remove(pChild);
+ }
+
+ ::std::vector< SortingData_Impl* > aContent;
+
+ ::rtl::Reference< ::svt::FileViewContentEnumerator >
+ xContentEnumerator(new FileViewContentEnumerator(
+ m_xEnv, aContent, m_aMutex, NULL));
+
+ FolderDescriptor aFolder( *pURL );
+
+ EnumerationResult eResult =
+ xContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList );
+
+ if ( SUCCESS == eResult )
+ {
+ for( std::vector<SortingData_Impl *>::size_type i = 0; i < aContent.size(); i++ )
+ {
+ if( aContent[i]->mbIsFolder )
+ {
+ SvTreeListEntry* pNewEntry = InsertEntry( aContent[i]->GetTitle(), pEntry, true );
+
+ OUString* sData = new OUString( aContent[i]->maTargetURL );
+ pNewEntry->SetUserData( static_cast< void* >( sData ) );
+ }
+ }
+ }
+ }
+ else
+ {
+ // this dir was updated recently
+ // next time read this remote folder
+ m_sLastUpdatedDir = "";
+ }
+ }
+}
+
+void FolderTree::FillTreeEntry( const OUString & rUrl, const ::std::vector< std::pair< OUString, OUString > >& rFolders )
+{
+ SetTreePath( rUrl );
+
+ SvTreeListEntry* pParent = GetCurEntry();
+
+ if( pParent && !IsExpanded( pParent ) )
+ {
+ while( GetChildCount( pParent ) > 0 )
+ {
+ SvTreeListEntry* pChild = FirstChild( pParent );
+ GetModel()->Remove( pChild );
+ }
+
+ for(::std::vector< std::pair< OUString, OUString > >::const_iterator it = rFolders.begin(); it != rFolders.end() ; ++it)
+ {
+ SvTreeListEntry* pNewEntry = InsertEntry( it->first, pParent, true );
+ OUString* sData = new OUString( it->second );
+ pNewEntry->SetUserData( static_cast< void* >( sData ) );
+ }
+
+ m_sLastUpdatedDir = rUrl;
+ Expand( pParent );
+ }
+}
+
+void FolderTree::SetTreePath( OUString const & sUrl )
+{
+ INetURLObject aUrl( sUrl );
+ aUrl.setFinalSlash();
+
+ OUString sPath = aUrl.GetURLPath( INetURLObject::DECODE_WITH_CHARSET );
+
+ SvTreeListEntry* pEntry = First();
+ bool end = false;
+
+ while( pEntry && !end )
+ {
+ if( pEntry->GetUserData() )
+ {
+ OUString sNodeUrl = *static_cast< OUString* >( pEntry->GetUserData() );
+
+ INetURLObject aUrlObj( sNodeUrl );
+ aUrlObj.setFinalSlash();
+
+ sNodeUrl = aUrlObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET );
+
+ if( sPath == sNodeUrl )
+ {
+ Select( pEntry );
+ end = true;
+ }
+ else if( sPath.startsWith( sNodeUrl ) )
+ {
+ if( !IsExpanded( pEntry ) )
+ Expand( pEntry );
+
+ pEntry = FirstChild( pEntry );
+ }
+ else
+ {
+ pEntry = NextSibling( pEntry );
+ }
+ }
+ else
+ break;
+ }
+}
+
+void FolderTree::SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList )
+{
+ m_aBlackList = rBlackList;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx
new file mode 100644
index 000000000000..70df7408cd3d
--- /dev/null
+++ b/svtools/source/control/autocmpledit.cxx
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <svtools/autocmpledit.hxx>
+#include <vcl/svapp.hxx>
+
+AutocompleteEdit::AutocompleteEdit( vcl::Window* pParent )
+ : Edit( pParent )
+ , m_nCurrent( 0 )
+{
+/* SignalConnectAutocomplete( nullptr,
+ [this] ( Edit *const pEdit ) { this->AutoCompleteHandler( pEdit ); } ); */
+ autocompleteSignal.connect( [this] ( Edit *const pEdit ) { this->AutoCompleteHandler( pEdit ); });
+}
+
+void AutocompleteEdit::AddEntry( const OUString& rEntry )
+{
+ m_aEntries.push_back( rEntry );
+}
+
+void AutocompleteEdit::ClearEntries()
+{
+ m_aEntries.clear();
+ m_aMatching.clear();
+}
+
+void AutocompleteEdit::AutoCompleteHandler( Edit* )
+{
+ if( GetAutocompleteAction() != AUTOCOMPLETE_KEYINPUT )
+ return;
+
+ if( Application::AnyInput( VclInputFlags::KEYBOARD ) )
+ return;
+
+ OUString aCurText = GetText();
+ Selection aSelection( GetSelection() );
+
+ if( aSelection.Max() != aCurText.getLength() )
+ return;
+
+ sal_uInt16 nLen = ( sal_uInt16 )aSelection.Min();
+ aCurText = aCurText.copy( 0, nLen );
+ if( !aCurText.isEmpty() )
+ {
+ if( m_aEntries.size() )
+ {
+ if( Match( aCurText ) )
+ {
+ m_nCurrent = 0;
+ SetText( m_aMatching[0] );
+ sal_uInt16 nNewLen = m_aMatching[0].getLength();
+
+ Selection aSel( nLen, nNewLen );
+ SetSelection( aSel );
+ }
+ }
+ }
+}
+
+bool AutocompleteEdit::Match( const OUString& rText )
+{
+ bool bRet = false;
+
+ m_aMatching.clear();
+
+ for( std::vector< OUString >::size_type i = 0; i < m_aEntries.size(); ++i )
+ {
+ if( m_aEntries[i].startsWithIgnoreAsciiCase( rText ) )
+ {
+ m_aMatching.push_back( m_aEntries[i] );
+ bRet = true;
+ }
+ }
+
+ return bRet;
+}
+
+bool AutocompleteEdit::PreNotify( NotifyEvent& rNEvt )
+{
+ if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
+ {
+ const KeyEvent& rEvent = *rNEvt.GetKeyEvent();
+ const vcl::KeyCode& rKey = rEvent.GetKeyCode();
+ vcl::KeyCode aCode( rKey.GetCode() );
+
+ if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() )
+ {
+ Selection aSelection( GetSelection() );
+ sal_uInt16 nLen = ( sal_uInt16 )aSelection.Min();
+
+ if( m_aMatching.size() &&
+ ( ( aCode == KEY_DOWN && m_nCurrent + 1 < m_aMatching.size() )
+ || ( aCode == KEY_UP && m_nCurrent > 0 ) ) )
+ {
+ SetText( m_aMatching[ aCode == KEY_DOWN ? ++m_nCurrent : --m_nCurrent ] );
+ SetSelection( Selection( nLen, GetText().getLength() ) );
+ return true;
+ }
+ }
+ }
+
+ return Edit::PreNotify( rNEvt );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx
new file mode 100644
index 000000000000..7d4f9178b8fe
--- /dev/null
+++ b/svtools/source/control/breadcrumb.cxx
@@ -0,0 +1,284 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <svtools/breadcrumb.hxx>
+
+class CustomLink : public FixedHyperlink
+{
+public:
+ CustomLink( vcl::Window* pParent, WinBits nWinStyle )
+ : FixedHyperlink( pParent, nWinStyle )
+ {
+ vcl::Font aFont = GetControlFont( );
+ aFont.SetUnderline( UNDERLINE_NONE );
+ SetControlFont( aFont );
+ }
+
+protected:
+ virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE
+ {
+ // changes the style if the control is enabled
+ if ( !rMEvt.IsLeaveWindow() && IsEnabled() )
+ {
+ vcl::Font aFont = GetControlFont( );
+ aFont.SetUnderline( UNDERLINE_SINGLE );
+ SetControlFont( aFont );
+ }
+ else
+ {
+ vcl::Font aFont = GetControlFont( );
+ aFont.SetUnderline( UNDERLINE_NONE );
+ SetControlFont( aFont );
+ }
+
+ FixedHyperlink::MouseMove( rMEvt );
+ }
+};
+
+Breadcrumb::Breadcrumb( vcl::Window* pParent, WinBits nWinStyle ) : VclHBox( pParent, nWinStyle )
+{
+ m_eMode = SvtBreadcrumbMode::ONLY_CURRENT_PATH;
+ set_spacing( SPACING );
+ appendField(); // root
+}
+
+Breadcrumb::~Breadcrumb()
+{
+ disposeOnce();
+}
+
+void Breadcrumb::dispose()
+{
+ for( unsigned int i = 0; i < m_aLinks.size(); i++ )
+ {
+ m_aSeparators[i].disposeAndClear();
+ m_aLinks[i].disposeAndClear();
+ }
+
+ VclHBox::dispose();
+}
+
+void Breadcrumb::EnableFields( bool bEnable )
+{
+ VclHBox::Enable( bEnable, true );
+ if( bEnable )
+ {
+ INetURLObject aURL( m_aCurrentURL );
+ int nSegments = aURL.getSegmentCount();
+ m_aLinks[nSegments]->Enable( false );
+ }
+}
+
+void Breadcrumb::SetClickHdl( const Link<>& rLink )
+{
+ m_aClickHdl = rLink;
+}
+
+OUString Breadcrumb::GetHdlURL()
+{
+ return m_sClickedURL;
+}
+
+void Breadcrumb::SetRootName( const OUString& rURL )
+{
+ m_sRootName = rURL;
+
+ // we changed root - clear all fields
+ for( std::vector<VclPtr<FixedHyperlink>>::size_type i = 1; i < m_aLinks.size(); i++ )
+ {
+ m_aLinks[i]->SetText( "" );
+
+ m_aLinks[i]->Hide();
+ m_aSeparators[i]->Hide();
+ m_aLinks[i]->Enable( true );
+ }
+}
+
+void Breadcrumb::SetURL( const OUString& rURL )
+{
+ m_aCurrentURL = rURL;
+ INetURLObject aURL( rURL );
+ aURL.setFinalSlash();
+
+ OUString sUser = aURL.GetUser( INetURLObject::NO_DECODE );
+ OUString sPath = aURL.GetURLPath(INetURLObject::DECODE_WITH_CHARSET);
+ OUString sRootPath = INetURLObject::GetScheme( aURL.GetProtocol() )
+ + sUser
+ + ( sUser.isEmpty() ? OUString() : "@" )
+ + aURL.GetHost();
+
+ int nSegments = aURL.getSegmentCount();
+ unsigned int nPos = 0;
+
+ bool bClear = ( m_eMode == SvtBreadcrumbMode::ONLY_CURRENT_PATH );
+
+ // root field
+
+ m_aLinks[0]->SetText( m_sRootName );
+ m_aLinks[0]->Enable( true );
+ m_aLinks[0]->SetURL( sRootPath );
+
+ // fill the other fields
+
+ for( unsigned int i = 1; i < (unsigned int)nSegments + 1; i++ )
+ {
+ if( i >= m_aLinks.size() )
+ appendField();
+
+ unsigned int nEnd = sPath.indexOf( '/', nPos + 1 );
+ OUString sLabel = OUString( sPath.getStr() + nPos + 1, nEnd - nPos - 1 );
+
+ if( m_eMode == SvtBreadcrumbMode::ALL_VISITED )
+ {
+ if( m_aLinks[i]->GetText() != sLabel )
+ bClear = true;
+ }
+
+ m_aLinks[i]->SetText( sLabel );
+ m_aLinks[i]->SetURL( sRootPath + OUString( sPath.getStr(), nEnd ) );
+ m_aLinks[i]->Hide();
+ m_aLinks[i]->Enable( true );
+
+ m_aSeparators[i]->Hide();
+
+ nPos = nEnd;
+ }
+
+ // clear unused fields
+
+ for( unsigned int i = nSegments + 1; i < m_aLinks.size(); i++ )
+ {
+ if( bClear )
+ m_aLinks[i]->SetText( "" );
+
+ m_aLinks[i]->Hide();
+ m_aSeparators[i]->Hide();
+ m_aLinks[i]->Enable( true );
+ }
+
+ // show fields
+
+ Resize();
+ unsigned int nMaxWidth = GetSizePixel().Width();
+ unsigned int nSeparatorWidth = m_aSeparators[0]->GetSizePixel().Width();
+ unsigned int nCurrentWidth = 0;
+ unsigned int nLastVisible = nSegments;
+
+ bool bRight = ( m_eMode == SvtBreadcrumbMode::ALL_VISITED );
+ bool bLeft = true;
+
+ int i = 0;
+
+ while( bLeft || bRight )
+ {
+ if( nSegments - i == -1 )
+ bLeft = false;
+
+ if( bLeft )
+ {
+ unsigned int nIndex = nSegments - i;
+
+ if( showField( nIndex, nMaxWidth - nCurrentWidth ) )
+ {
+ nCurrentWidth += m_aLinks[nIndex]->GetSizePixel().Width()
+ + nSeparatorWidth + 2*SPACING;
+ }
+ else
+ {
+ // label is too long
+ if( nSegments != 0 )
+ {
+ m_aLinks[0]->SetText( "..." );
+ m_aLinks[0]->Enable( false );
+ }
+ bLeft = false;
+ }
+ }
+
+ if( nSegments + i == (int)m_aLinks.size() )
+ bRight = false;
+
+ if( i != 0 && bRight )
+ {
+ unsigned int nIndex = nSegments + i;
+
+ if( m_aLinks[nIndex]->GetText() == "" )
+ {
+ bRight = false;
+ }
+ else if( showField( nIndex, nMaxWidth - nCurrentWidth ) )
+ {
+ nCurrentWidth += m_aLinks[nIndex]->GetSizePixel().Width()
+ + nSeparatorWidth + 3*SPACING;
+ nLastVisible = nIndex;
+ }
+ else
+ {
+ bRight = false;
+ }
+ }
+
+ i++;
+ }
+
+ // current dir should be inactive
+ m_aLinks[nSegments]->Enable( false );
+
+ // hide last separator
+ m_aSeparators[nLastVisible]->Hide();
+}
+
+void Breadcrumb::SetMode( SvtBreadcrumbMode eMode )
+{
+ m_eMode = eMode;
+}
+
+void Breadcrumb::appendField()
+{
+ m_aLinks.push_back( VclPtr< CustomLink >::Create( this, WB_TABSTOP ) );
+ m_aLinks[m_aLinks.size() - 1]->Hide();
+ m_aLinks[m_aLinks.size() - 1]->SetClickHdl( LINK( this, Breadcrumb, ClickLinkHdl ) );
+
+ m_aSeparators.push_back( VclPtr< FixedText >::Create( this ) );
+ m_aSeparators[m_aLinks.size() - 1]->SetText( ">" );
+ m_aSeparators[m_aLinks.size() - 1]->Hide();
+}
+
+bool Breadcrumb::showField( unsigned int nIndex, unsigned int nWidthMax )
+{
+ m_aLinks[nIndex]->Show();
+ m_aSeparators[nIndex]->Show();
+
+ unsigned int nSeparatorWidth = m_aSeparators[0]->GetSizePixel().Width();
+ unsigned int nWidth = m_aLinks[nIndex]->GetSizePixel().Width()
+ + nSeparatorWidth + 3*SPACING;
+
+ if( nWidth > nWidthMax )
+ {
+ if( nIndex != 0 )
+ {
+ m_aLinks[nIndex]->Hide();
+ m_aSeparators[nIndex]->Hide();
+ }
+
+ return false;
+ }
+
+ return true;
+}
+
+IMPL_LINK ( Breadcrumb, ClickLinkHdl, FixedHyperlink*, pLink )
+{
+ m_sClickedURL = pLink->GetURL();
+ m_aClickHdl.Call( this );
+
+ return 1;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 90fdea7b0a92..9422a7b55db2 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -10,13 +10,20 @@
#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 <svtools/svtools.hrc>
#include <vcl/msgbox.hxx>
+using namespace com::sun::star::uno;
+
PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
: ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui")
, m_xCurrentDetails()
+ , m_nCurrentType( 0 )
+ , bLabelChanged( false )
+ , m_bShowPassword( true )
{
get( m_pEDServerName, "name" );
get( m_pLBServerType, "type" );
@@ -24,11 +31,15 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
get( m_pBTOk, "ok" );
get( m_pBTCancel, "cancel" );
get( m_pBTDelete, "delete" );
+ get( m_pBTRepoRefresh, "repositoriesRefresh" );
+ get( m_pCBPassword, "rememberPassword" );
+ get( m_pEDPassword, "password" );
+ get( m_pFTPasswordLabel, "passwordLabel" );
m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
m_pBTOk->Enable( false );
- m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
+ m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, EditLabelHdl) );
// This constructor is called when user request a place creation, so
// delete button is hidden.
@@ -36,6 +47,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
m_pLBServerType->SetSelectHdl( LINK( this, PlaceEditDialog, SelectTypeHdl ) );
m_pEDUsername->SetModifyHdl( LINK( this, PlaceEditDialog, EditUsernameHdl ) );
+ m_pEDPassword->SetModifyHdl( LINK( this, PlaceEditDialog, EditUsernameHdl ) );
InitDetails( );
}
@@ -43,6 +55,8 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Place>& rPlace)
: ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui")
, m_xCurrentDetails( )
+ , bLabelChanged( true )
+ , m_bShowPassword( false )
{
get( m_pEDServerName, "name" );
get( m_pLBServerType, "type" );
@@ -50,11 +64,19 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla
get( m_pBTOk, "ok" );
get( m_pBTCancel, "cancel" );
get( m_pBTDelete, "delete" );
+ get( m_pTypeGrid, "TypeGrid" );
+ get( m_pCBPassword, "rememberPassword" );
+ get( m_pEDPassword, "password" );
+ get( m_pFTPasswordLabel, "passwordLabel" );
+
+ m_pEDPassword->Hide();
+ m_pFTPasswordLabel->Hide();
+ m_pCBPassword->Hide();
m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
m_pBTDelete->SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) );
- m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
+ m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, ModifyHdl) );
m_pLBServerType->SetSelectHdl( LINK( this, PlaceEditDialog, SelectTypeHdl ) );
InitDetails( );
@@ -74,9 +96,13 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla
// Fill the Username field
if ( rUrl.HasUserData( ) )
- m_pEDUsername->SetText( rUrl.GetUser( ) );
+ m_pEDUsername->SetText( INetURLObject::decode( rUrl.GetUser( ),
+ INetURLObject::DECODE_WITH_CHARSET ) );
}
}
+
+ // In edit mode user can't change connection type
+ m_pTypeGrid->Hide();
}
PlaceEditDialog::~PlaceEditDialog()
@@ -92,6 +118,8 @@ void PlaceEditDialog::dispose()
m_pBTOk.clear();
m_pBTCancel.clear();
m_pBTDelete.clear();
+ m_pEDPassword.clear();
+ m_pFTPasswordLabel.clear();
ModalDialog::dispose();
}
@@ -118,6 +146,41 @@ std::shared_ptr<Place> PlaceEditDialog::GetPlace()
void PlaceEditDialog::InitDetails( )
{
+ // 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];
+ 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);
+
+ 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
std::shared_ptr<DetailsContainer> xDavDetails(std::make_shared<DavDetailsContainer>(this));
xDavDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
@@ -136,19 +199,75 @@ 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);
-
// Set default to first value
m_pLBServerType->SelectEntryPos( 0 );
+
+ if ( m_pLBServerType->GetSelectEntry() == "--------------------" )
+ m_pLBServerType->SelectEntryPos( 1 );
+
SelectTypeHdl( m_pLBServerType );
}
+void PlaceEditDialog::UpdateLabel( )
+{
+ if( !bLabelChanged )
+ {
+ if( !m_pEDUsername->GetText().isEmpty( ) )
+ {
+ OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL );
+ 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 );
+ bLabelChanged = false;
+ }
+ else
+ {
+ m_pEDServerName->SetText( m_pLBServerType->GetSelectEntry( ) );
+ }
+ }
+}
+
IMPL_LINK ( PlaceEditDialog, OKHdl, Button *, )
{
- EndDialog( RET_OK );
+ if ( m_xCurrentDetails.get() )
+ {
+ OUString sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DECODE_WITH_CHARSET );
+ OUString sGDriveHost( GDRIVE_BASE_URL );
+ OUString sAlfrescoHost( ALFRESCO_CLOUD_BASE_URL );
+ OUString sOneDriveHost( ONEDRIVE_BASE_URL );
+
+ if ( sUrl.compareTo( sGDriveHost, sGDriveHost.getLength() ) == 0
+ || sUrl.compareTo( sAlfrescoHost, sAlfrescoHost.getLength() ) == 0
+ || sUrl.compareTo( sOneDriveHost, sOneDriveHost.getLength() ) == 0 )
+ {
+ m_pBTRepoRefresh->Click();
+
+ sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DECODE_WITH_CHARSET );
+ INetURLObject aHostUrl( sUrl );
+ OUString sRepoId = aHostUrl.GetMark();
+
+ if ( !sRepoId.isEmpty() )
+ {
+ EndDialog( RET_OK );
+ }
+ else
+ {
+ // TODO: repository id missing. Auth error?
+ }
+ }
+ else
+ {
+ EndDialog( RET_OK );
+ }
+ }
+
return 1;
}
@@ -159,11 +278,26 @@ IMPL_LINK ( PlaceEditDialog, DelHdl, Button *, )
return 1;
}
-IMPL_LINK_NOARG( PlaceEditDialog, EditHdl )
+IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditHdl, DetailsContainer*, void )
{
+ UpdateLabel( );
+
OUString sUrl = GetServerUrl( );
OUString sName = OUString( m_pEDServerName->GetText() ).trim( );
m_pBTOk->Enable( !sName.isEmpty( ) && !sUrl.isEmpty( ) );
+}
+
+IMPL_LINK_NOARG( PlaceEditDialog, ModifyHdl )
+{
+ EditHdl(nullptr);
+ return 1;
+}
+
+IMPL_LINK_NOARG( PlaceEditDialog, EditLabelHdl )
+{
+ bLabelChanged = true;
+ EditHdl(NULL);
+
return 1;
}
@@ -173,21 +307,43 @@ IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
it != m_aDetailsContainers.end( ); ++it )
{
( *it )->setUsername( OUString( m_pEDUsername->GetText() ) );
+ ( *it )->setPassword( m_pEDPassword->GetText() );
}
+
+ EditHdl(NULL);
+
return 1;
}
IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl )
{
+ if ( m_pLBServerType->GetSelectEntry() == "--------------------" )
+ {
+ if( !m_pLBServerType->IsTravelSelect() )
+ m_pLBServerType->SelectEntryPos( m_nCurrentType );
+ else
+ m_pLBServerType->SetNoSelection();
+
+ return 0;
+ }
+
if (m_xCurrentDetails.get())
m_xCurrentDetails->show(false);
sal_uInt16 nPos = m_pLBServerType->GetSelectEntryPos( );
m_xCurrentDetails = m_aDetailsContainers[nPos];
+ m_nCurrentType = nPos;
- m_xCurrentDetails->show(true);
+ m_xCurrentDetails->show();
+
+ m_pCBPassword->Show( m_bShowPassword );
+ m_pEDPassword->Show( m_bShowPassword );
+ m_pFTPasswordLabel->Show( m_bShowPassword );
SetSizePixel(GetOptimalSize());
+
+ EditHdl(NULL);
+
return 0;
}
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 7a17bfde68c6..54c8e0404617 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -31,18 +31,30 @@ 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 ) :
+ m_bIsActive ( true )
{
- pBuilder->get( m_pFrame, rFrame );
+ pBuilder->get( m_pDetailsGrid, "Details" );
+ pBuilder->get( m_pHostBox, "HostDetails" );
+ pBuilder->get( m_pEDHost, "host" );
+ pBuilder->get( m_pFTHost, "hostLabel" );
+ pBuilder->get( m_pEDPort, "port-nospin" );
+ pBuilder->get( m_pFTPort, "portLabel" );
+ pBuilder->get( m_pEDRoot, "path" );
+ pBuilder->get( m_pFTRoot, "pathLabel" );
}
DetailsContainer::~DetailsContainer( )
{
}
-void DetailsContainer::show( bool bShow )
+void DetailsContainer::show( bool )
{
- m_pFrame->Show( bShow );
+ m_pDetailsGrid->Enable( m_bIsActive );
+
+ m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
+ m_pEDPort->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
+ m_pEDRoot->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
}
INetURLObject DetailsContainer::getUrl( )
@@ -63,6 +75,11 @@ void DetailsContainer::notifyChange( )
m_aChangeHdl.Call( this );
}
+void DetailsContainer::setActive( bool bActive )
+{
+ m_bIsActive = bActive;
+}
+
IMPL_LINK_NOARG( DetailsContainer, ValueChangeHdl )
{
notifyChange( );
@@ -70,34 +87,34 @@ IMPL_LINK_NOARG( DetailsContainer, ValueChangeHdl )
}
HostDetailsContainer::HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ) :
- DetailsContainer( pBuilder, "HostDetails" ),
+ DetailsContainer( pBuilder ),
m_nDefaultPort( nPort ),
m_sScheme( sScheme )
{
- pBuilder->get( m_pEDHost, "host" );
- m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
-
- pBuilder->get( m_pEDPort, "port" );
- m_pEDPort->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
-
- pBuilder->get( m_pEDPath, "path" );
- m_pEDPath->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
-
show( false );
}
void HostDetailsContainer::show( bool bShow )
{
+ m_pFTHost->Show( bShow );
+ m_pHostBox->Show( bShow );
+ m_pEDRoot->Show( bShow );
+ m_pFTRoot->Show( bShow );
+
DetailsContainer::show( bShow );
+
if ( bShow )
+ {
m_pEDPort->SetValue( m_nDefaultPort );
+ m_pEDHost->SetText( m_sHost );
+ }
}
INetURLObject HostDetailsContainer::getUrl( )
{
OUString sHost = m_pEDHost->GetText().trim( );
sal_Int64 nPort = m_pEDPort->GetValue();
- OUString sPath = m_pEDPath->GetText().trim( );
+ OUString sPath = m_pEDRoot->GetText().trim( );
OUString sUrl;
if ( !sHost.isEmpty( ) )
@@ -122,7 +139,7 @@ bool HostDetailsContainer::setUrl( const INetURLObject& rUrl )
{
m_pEDHost->SetText( rUrl.GetHost( ) );
m_pEDPort->SetValue( rUrl.GetPort( ) );
- m_pEDPath->SetText( rUrl.GetURLPath() );
+ m_pEDRoot->SetText( rUrl.GetURLPath() );
}
return bSuccess;
@@ -188,17 +205,13 @@ IMPL_LINK( DavDetailsContainer, ToggledDavsHdl, CheckBox*, pCheckBox )
}
SmbDetailsContainer::SmbDetailsContainer( VclBuilderContainer* pBuilder ) :
- DetailsContainer( pBuilder, "SmbDetails" )
+ DetailsContainer( pBuilder )
{
- pBuilder->get( m_pEDHost, "smbHost" );
- m_pEDHost->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
+ pBuilder->get( m_pEDShare, "share" );
+ pBuilder->get( m_pFTShare, "shareLabel" );
- pBuilder->get( m_pEDShare, "smbShare" );
m_pEDShare->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
- pBuilder->get( m_pEDPath, "smbPath" );
- m_pEDPath->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
-
show( false );
}
@@ -206,7 +219,7 @@ INetURLObject SmbDetailsContainer::getUrl( )
{
OUString sHost = m_pEDHost->GetText().trim( );
OUString sShare = m_pEDShare->GetText().trim( );
- OUString sPath = m_pEDPath->GetText().trim( );
+ OUString sPath = m_pEDRoot->GetText().trim( );
OUString sUrl;
if ( !sHost.isEmpty( ) )
@@ -242,73 +255,98 @@ bool SmbDetailsContainer::setUrl( const INetURLObject& rUrl )
m_pEDHost->SetText( rUrl.GetHost( ) );
m_pEDShare->SetText( sShare );
- m_pEDPath->SetText( sPath );
+ m_pEDRoot->SetText( sPath );
}
return bSuccess;
}
-CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
- DetailsContainer( pBuilder, "CmisDetails" ),
+void SmbDetailsContainer::show( bool bShow )
+{
+ m_pEDShare->Show( bShow );
+ m_pFTShare->Show( bShow );
+ m_pEDRoot->Show( bShow );
+ m_pFTRoot->Show( bShow );
+
+ m_pFTHost->Show( bShow );
+ m_pHostBox->Show( bShow );
+ m_pEDPort->Enable( !bShow );
+ m_pFTPort->Enable( !bShow );
+}
+
+CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding ) :
+ DetailsContainer( pBuilder ),
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_pFTRepository, "repositoryLabel" );
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 ) );
+ pBuilder->get( m_pRepositoryBox, "RepositoryDetails" );
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 )
+{
+ m_pLBRepository->SetSelectHdl( LINK( this, CmisDetailsContainer, SelectRepoHdl ) );
+ m_pBTRepoRefresh->SetClickHdl( LINK( this, CmisDetailsContainer, RefreshReposHdl ) );
+ m_pEDHost->SetText( m_sBinding );
- 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 )
+ if( ( m_sBinding == GDRIVE_BASE_URL )
+ || m_sBinding.startsWith( ALFRESCO_CLOUD_BASE_URL )
+ || ( m_sBinding == ONEDRIVE_BASE_URL ) )
{
- 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_pFTHost->Show( false );
+ m_pHostBox->Show( false );
+ m_pFTRepository->Show( false );
+ m_pRepositoryBox->Show( false );
+ m_pEDRoot->Show( false );
+ m_pFTRoot->Show( false );
+ }
+ else
+ {
+ m_pFTHost->Show( bShow );
+ m_pHostBox->Show( bShow );
+ m_pFTRepository->Show( bShow );
+ m_pRepositoryBox->Show( bShow );
+ m_pEDRoot->Show( bShow );
+ m_pFTRoot->Show( bShow );
}
+
+ DetailsContainer::show( bShow );
+ m_pEDPort->Enable( !bShow );
+ m_pFTPort->Enable( !bShow );
}
INetURLObject CmisDetailsContainer::getUrl( )
{
- OUString sBindingUrl = m_pEDBinding->GetText().trim( );
- OUString sPath = m_pEDPath->GetText().trim( );
+ OUString sBindingUrl = m_pEDHost->GetText().trim( );
+ OUString sPath = m_pEDRoot->GetText().trim( );
+
+ bool bSkip = true;
+ if( ( m_sBinding == GDRIVE_BASE_URL )
+ || m_sBinding.startsWith( ALFRESCO_CLOUD_BASE_URL )
+ || ( m_sBinding == ONEDRIVE_BASE_URL ) )
+ {
+ bSkip = m_sUsername.isEmpty();
+ }
+ else
+ {
+ bSkip = m_sRepoId.isEmpty();
+ }
OUString sUrl;
- if ( !sBindingUrl.isEmpty( ) && !m_sRepoId.isEmpty() )
+ if ( !sBindingUrl.isEmpty( ) && !bSkip )
{
OUString sEncodedBinding = rtl::Uri::encode(
sBindingUrl + "#" + m_sRepoId,
@@ -328,16 +366,13 @@ bool CmisDetailsContainer::setUrl( const INetURLObject& rUrl )
if ( bSuccess )
{
- OUString sBindingUrl;
- OUString sRepositoryId;
-
OUString sDecodedHost = rUrl.GetHost( INetURLObject::DECODE_WITH_CHARSET );
INetURLObject aHostUrl( sDecodedHost );
- sBindingUrl = aHostUrl.GetURLNoMark( );
- sRepositoryId = aHostUrl.GetMark( );
+ m_sBinding = aHostUrl.GetURLNoMark( );
+ m_sRepoId = aHostUrl.GetMark( );
- m_pEDBinding->SetText( sBindingUrl );
- m_pEDPath->SetText( rUrl.GetURLPath() );
+ m_pEDHost->SetText( m_sBinding );
+ m_pEDRoot->SetText( rUrl.GetURLPath() );
}
return bSuccess;
}
@@ -347,26 +382,40 @@ void CmisDetailsContainer::setUsername( const OUString& rUsername )
m_sUsername = rUsername;
}
-void CmisDetailsContainer::selectRepository( )
+void CmisDetailsContainer::setPassword( const OUString& rPass )
{
- // Get the repo ID and call the Change listener
- sal_uInt16 nPos = m_pLBRepository->GetSelectEntryPos( );
- m_sRepoId = m_aRepoIds[nPos];
-
- notifyChange( );
+ m_sPassword = rPass;
}
-IMPL_LINK_NOARG( CmisDetailsContainer, SelectServerTypeHdl )
+void CmisDetailsContainer::selectRepository( )
{
- // Set a sample URL for the server
- sal_uInt16 nId = m_pLBServerType->GetSelectEntryPos( );
- m_pEDBinding->SetText( m_aServerTypesURLs[nId] );
- return 0;
+ // Get the repo ID and call the Change listener
+ sal_uInt16 nPos = m_pLBRepository->GetSelectEntryPos( );
+ if( nPos < m_aRepoIds.size() )
+ {
+ m_sRepoId = m_aRepoIds[nPos];
+ notifyChange( );
+ }
}
IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl )
{
- OUString sBindingUrl = m_pEDBinding->GetText().trim( );
+ Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ Reference< XPasswordContainer2 > xMasterPasswd = PasswordContainer::create( xContext );
+
+
+ OUString sBindingUrl = m_pEDHost->GetText().trim( );
+
+ OUString sEncodedUsername = "";
+
+ if ( !m_sUsername.isEmpty( ) )
+ {
+ sEncodedUsername = rtl::Uri::encode(m_sUsername,
+ rtl_UriCharClassUserinfo,
+ rtl_UriEncodeKeepEscapes,
+ RTL_TEXTENCODING_UTF8 );
+ sEncodedUsername += "@";
+ }
// Clean the listbox
m_pLBRepository->Clear( );
@@ -381,8 +430,27 @@ IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl )
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
RTL_TEXTENCODING_UTF8 );
- sUrl = "vnd.libreoffice.cmis://" + sEncodedBinding;
+ sUrl = "vnd.libreoffice.cmis://" + sEncodedUsername + sEncodedBinding;
+ }
+
+ // temporary remember the password
+ try
+ {
+ if( !sUrl.isEmpty() && !m_sUsername.isEmpty() && !m_sPassword.isEmpty() )
+ {
+ Reference< XInteractionHandler > xInteractionHandler(
+ InteractionHandler::createWithParent( xContext, 0 ),
+ UNO_QUERY );
+
+ Sequence< OUString > aPasswd( 1 );
+ aPasswd[0] = m_sPassword;
+
+ xMasterPasswd->add(
+ sUrl, m_sUsername, aPasswd, xInteractionHandler );
+ }
}
+ catch( const Exception& )
+ {}
// Get the Content
::ucbhelper::Content aCnt( sUrl, m_xCmdEnv, comphelper::getProcessComponentContext() );
@@ -417,6 +485,11 @@ IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl )
selectRepository( );
}
+ // remove temporary password
+ {
+ xMasterPasswd->remove( sUrl, m_sUsername );
+ }
+
return 0;
}
diff --git a/svtools/source/dialogs/filedlg2.src b/svtools/source/dialogs/filedlg2.src
index 6e68db0ff4c1..795da0e54362 100644
--- a/svtools/source/dialogs/filedlg2.src
+++ b/svtools/source/dialogs/filedlg2.src
@@ -18,6 +18,7 @@
*/
#include <svtools/filedlg2.hrc>
+#include <svtools/svtools.hrc>
String STR_FILEDLG_OPEN
{
@@ -32,4 +33,9 @@ String STR_FILEDLG_SAVE
Text [ en-US ] = "Save" ;
};
+String STR_SVT_DEFAULT_SERVICE_LABEL
+{
+ Text [ en-US ] = "$user$'s $service$" ;
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 3941f06e3e66..e3c0d3cd64c0 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -30,12 +30,10 @@
<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="width_request">400</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">File Services</property>
@@ -115,98 +113,46 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
- <property name="position">3</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkFrame" id="FileServices">
+ <object class="GtkGrid" id="TypeGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
<child>
- <object class="GtkAlignment" id="alignment5">
+ <object class="GtkLabel" id="typeLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkGrid" id="grid1">
- <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="label2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Name:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">name</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Type:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">type</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="name">
- <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>
- <object class="GtkComboBox" id="type">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="model">liststore1</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- </object>
- </child>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Type:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">type</property>
</object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel" id="label1">
+ <child>
+ <object class="GtkComboBox" id="type">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">File Service</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="hexpand">True</property>
+ <property name="model">liststore1</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
</object>
<packing>
@@ -216,492 +162,300 @@
</packing>
</child>
<child>
- <object class="GtkFrame" id="HostDetails">
+ <object class="GtkGrid" id="Details">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
<child>
- <object class="GtkAlignment" id="alignment1">
+ <object class="GtkLabel" id="hostLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkGrid" id="grid2">
- <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="hostLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <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>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="pathLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Path:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">path</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid3">
- <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>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="path">
- <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">1</property>
- </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">2</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
+ <property name="xalign">0</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>
+ <property name="top_attach">0</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel" id="label4">
+ <child>
+ <object class="GtkLabel" id="pathLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Server Details</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Root:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">path</property>
</object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">8</property>
+ </packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <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="alignment3">
+ <object class="GtkEntry" id="path">
+ <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">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="shareLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
- <child>
- <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">12</property>
- <child>
- <object class="GtkLabel" id="bindingLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Binding URL:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">binding</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="repositoryLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Repository:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">repositories</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="binding">
- <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">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid6">
- <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>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="repositoriesRefresh">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">image1</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- </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>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Path:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">cmisPath</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="cmisPath">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- </object>
- </child>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Share:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">share</property>
</object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel" id="label12">
+ <child>
+ <object class="GtkEntry" id="share">
+ <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>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="repositoryLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Server Details</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Repository:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">repositories</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="webdavs">
+ <property name="label" translatable="yes">Secure connection</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">1</property>
+ </packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <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="alignment2">
+ <object class="GtkLabel" id="loginLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">User:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">login</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="login">
+ <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">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="nameLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Label:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="name">
+ <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">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="HostDetails">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</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="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
- <object class="GtkGrid" id="grid4">
+ <object class="GtkLabel" id="portLabel">
<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="label9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Host:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">smbHost</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Share:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">smbShare</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Path:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">smbPath</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</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>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="smbShare">
- <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">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>
- </packing>
- </child>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Port:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">port-nospin</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="port-nospin">
+ <property name="width_request">50</property>
+ <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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Server Details</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkFrame" id="UserDetails">
- <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="alignment4">
+ <object class="GtkBox" id="RepositoryDetails">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkGrid" id="grid7">
+ <object class="GtkComboBox" id="repositories">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="column_spacing">12</property>
- <child>
- <object class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Login:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">login</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="login">
- <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>
+ <property name="hexpand">True</property>
</object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="repositoriesRefresh">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image1</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">6</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel" id="label15">
+ <child>
+ <object class="GtkLabel" id="passwordLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">User Details</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Password:</property>
+ <property name="mnemonic_widget">password</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="password">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">●</property>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="rememberPassword">
+ <property name="label" translatable="yes">Remember password</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">1</property>
</packing>
</child>
</object>