fpicker/source/office/RemoteFilesDialog.cxx | 298 +++++++-- fpicker/source/office/RemoteFilesDialog.hxx | 26 fpicker/source/office/fpsofficeResMgr.hxx | 2 fpicker/source/office/iodlg.cxx | 1 fpicker/source/office/iodlg.src | 5 fpicker/uiconfig/ui/remotefilesdialog.ui | 48 + framework/inc/classes/resource.hrc | 1 framework/source/classes/resource.src | 5 framework/source/fwe/helper/titlehelper.cxx | 13 include/svtools/PlaceEditDialog.hxx | 9 include/svtools/ServerDetailsControls.hxx | 35 - include/svtools/fileview.hxx | 2 include/svtools/foldertree.hxx | 3 include/vcl/fpicker.hrc | 1 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 2 sc/source/ui/app/scdll.cxx | 2 sc/uiconfig/scalc/menubar/menubar.xml | 2 sc/uiconfig/scalc/toolbar/standardbar.xml | 4 sd/source/ui/app/sddll.cxx | 2 sd/uiconfig/sdraw/menubar/menubar.xml | 2 sd/uiconfig/sdraw/toolbar/standardbar.xml | 4 sd/uiconfig/simpress/menubar/menubar.xml | 2 sd/uiconfig/simpress/toolbar/standardbar.xml | 4 svtools/source/contnr/fileview.cxx | 15 svtools/source/contnr/foldertree.cxx | 61 + svtools/source/control/breadcrumb.cxx | 6 svtools/source/dialogs/PlaceEditDialog.cxx | 60 + svtools/source/dialogs/ServerDetailsControls.cxx | 111 ++- svtools/uiconfig/ui/placeedit.ui | 312 +++------- sw/source/uibase/app/swmodule.cxx | 2 sw/uiconfig/swriter/menubar/menubar.xml | 2 sw/uiconfig/swriter/toolbar/standardbar.xml | 4 ucb/source/ucp/cmis/cmis_content.cxx | 10 ucb/source/ucp/cmis/cmis_provider.cxx | 13 ucb/source/ucp/cmis/cmis_provider.hxx | 6 ucb/source/ucp/cmis/cmis_url.cxx | 9 ucb/source/ucp/cmis/cmis_url.hxx | 1 uui/uiconfig/ui/logindialog.ui | 8 38 files changed, 732 insertions(+), 361 deletions(-)
New commits: commit 225f2ebcda079be170831552a764d884e0b55249 Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Aug 13 16:28:14 2015 +0200 Move dropdown menu from 'Save As' to 'Save' button Change-Id: I24e9b16ea38811791804e6c85205b304bd781617 diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 33e035e..8523868 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -149,7 +149,7 @@ void ScDLL::Init() ScPageBreakShell ::RegisterInterface(pMod); SfxRecentFilesToolBoxControl::RegisterControl(SID_OPEN_CALC, pMod); - SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEASDOC, pMod ); + SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEDOC, pMod ); // Own Controller ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod); diff --git a/sc/uiconfig/scalc/toolbar/standardbar.xml b/sc/uiconfig/scalc/toolbar/standardbar.xml index 6c19cbd..43a997a 100644 --- a/sc/uiconfig/scalc/toolbar/standardbar.xml +++ b/sc/uiconfig/scalc/toolbar/standardbar.xml @@ -23,8 +23,8 @@ <toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:OpenFromCalc" toolbar:style="dropdown"/> <toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/> - <toolbar:toolbaritem xlink:href=".uno:Save"/> - <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown"/> + <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:style="dropdown"/> + <toolbar:toolbaritem xlink:href=".uno:SaveAs"/> <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/> diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 1564f37..32badfe 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -244,7 +244,7 @@ void SdDLL::RegisterControllers() SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod ); SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod ); - SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEASDOC, pMod ); + SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEDOC, pMod ); } void SdDLL::Init() diff --git a/sd/uiconfig/sdraw/toolbar/standardbar.xml b/sd/uiconfig/sdraw/toolbar/standardbar.xml index 49b95b4..63d93ea 100644 --- a/sd/uiconfig/sdraw/toolbar/standardbar.xml +++ b/sd/uiconfig/sdraw/toolbar/standardbar.xml @@ -23,8 +23,8 @@ <toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/> <toolbar:toolbaritem xlink:href=".uno:Open" toolbar:style="dropdown"/> <toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/> - <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/> - <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown" toolbar:helpid="5502"/> + <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:style="dropdown" toolbar:helpid="5505"/> + <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/> <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/> diff --git a/sd/uiconfig/simpress/toolbar/standardbar.xml b/sd/uiconfig/simpress/toolbar/standardbar.xml index bbcc000..96189f3 100644 --- a/sd/uiconfig/simpress/toolbar/standardbar.xml +++ b/sd/uiconfig/simpress/toolbar/standardbar.xml @@ -23,8 +23,8 @@ <toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:Open" toolbar:style="dropdown"/> <toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/> - <toolbar:toolbaritem xlink:href=".uno:Save"/> - <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown"/> + <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:style="dropdown"/> + <toolbar:toolbaritem xlink:href=".uno:SaveAs"/> <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/> diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 5236516..3f768c3 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -292,7 +292,7 @@ void SwDLL::RegisterControls() SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod ); - SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEASDOC, pMod ); + SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEDOC, pMod ); SvxClipBoardControl::RegisterControl(SID_PASTE, pMod ); SvxUndoRedoControl::RegisterControl(SID_UNDO, pMod ); SvxUndoRedoControl::RegisterControl(SID_REDO, pMod ); diff --git a/sw/uiconfig/swriter/toolbar/standardbar.xml b/sw/uiconfig/swriter/toolbar/standardbar.xml index b1f7d45..1a9a955 100644 --- a/sw/uiconfig/swriter/toolbar/standardbar.xml +++ b/sw/uiconfig/swriter/toolbar/standardbar.xml @@ -23,8 +23,8 @@ <toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/> <toolbar:toolbaritem xlink:href=".uno:OpenFromWriter" toolbar:style="dropdown"/> <toolbar:toolbaritem xlink:href=".uno:OpenRemote" toolbar:visible="false"/> - <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/> - <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown" toolbar:helpid="5502"/> + <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:style="dropdown" toolbar:helpid="5505"/> + <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/> <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/> commit 2f6d670ddae159983ac2235cb2434fbb31b1839d Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Aug 13 14:37:13 2015 +0200 Rename 'Save as Remote File' to 'Save to Remote Server' Change-Id: Ifc2ac4df5b1800dbc1890c44c86fdfb5bcf2478f diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index cfc3908..f04ad6d 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1979,7 +1979,7 @@ </node> <node oor:name=".uno:SaveAsRemote" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">~Save As Remote File...</value> + <value xml:lang="en-US">~Save to Remote Server</value> </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> commit bc8d7cda9dcfd9308dd92ccc85e04a37610aaff2 Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Aug 13 14:34:27 2015 +0200 reorder of File menu Change-Id: I8265b291554765775871905b0349564131dfa8c7 diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 593f71c..09e63ec 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -38,9 +38,9 @@ <!-- .uno:Collaborate menuitem, see CustomTarget_uiconfig.mk --> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Save"/> + <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveACopy"/> - <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAll"/> <menu:menuitem menu:id=".uno:CheckOut"/> <menu:menuitem menu:id=".uno:CancelCheckOut"/> diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index c1a9be9..13ee972 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -35,9 +35,9 @@ <menu:menuseparator/> <menu:menuitem menu:id=".uno:CloseDoc"/> <menu:menuitem menu:id=".uno:Save"/> + <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveACopy"/> - <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAll"/> <menu:menuitem menu:id=".uno:CheckOut"/> <menu:menuitem menu:id=".uno:CancelCheckOut"/> diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml index ef87919..42b81b2 100644 --- a/sd/uiconfig/simpress/menubar/menubar.xml +++ b/sd/uiconfig/simpress/menubar/menubar.xml @@ -37,9 +37,9 @@ <menu:menuitem menu:id=".uno:VersionDialog"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Save"/> + <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveACopy"/> - <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAll"/> <menu:menuitem menu:id=".uno:CheckOut"/> <menu:menuitem menu:id=".uno:CancelCheckOut"/> diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index 8300196..972a1b0 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -37,9 +37,9 @@ <menu:menuitem menu:id=".uno:VersionDialog"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Save"/> + <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveACopy"/> - <menu:menuitem menu:id=".uno:SaveAsRemote"/> <menu:menuitem menu:id=".uno:SaveAll"/> <menu:menuitem menu:id=".uno:CheckOut"/> <menu:menuitem menu:id=".uno:CancelCheckOut"/> commit f1c5275475743b1bcd4d22a5be2a9be9e92404dd Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Aug 13 14:00:16 2015 +0200 left align in the login box Change-Id: I77248f371ffb714a09cce0ef72e1018b4bbc7498 diff --git a/uui/uiconfig/ui/logindialog.ui b/uui/uiconfig/ui/logindialog.ui index 6ce2dea..ca47ea5 100644 --- a/uui/uiconfig/ui/logindialog.ui +++ b/uui/uiconfig/ui/logindialog.ui @@ -123,7 +123,7 @@ <object class="GtkLabel" id="accountft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">1</property> + <property name="xalign">0</property> <property name="label" translatable="yes">A_ccount:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">accounted</property> @@ -137,7 +137,7 @@ <object class="GtkLabel" id="passwordft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">1</property> + <property name="xalign">0</property> <property name="label" translatable="yes">Pass_word:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">passworded</property> @@ -176,7 +176,7 @@ <object class="GtkLabel" id="nameft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">1</property> + <property name="xalign">0</property> <property name="label" translatable="yes">_User name:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">nameed</property> @@ -190,7 +190,7 @@ <object class="GtkLabel" id="pathft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">1</property> + <property name="xalign">0</property> <property name="label" translatable="yes">_Path:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">pathed</property> commit 0c71dc22072ac061cc24c77a0daaa4f1308c1d4b Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Aug 12 18:02:48 2015 +0200 don't show remember password in the CMIS connections Change-Id: Ie84c1c3049d9864fce550bdf5745c18d72d740d5 diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index c8cdabe..c15735e 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -57,6 +57,7 @@ private: unsigned int m_nCurrentType; bool bLabelChanged; + bool m_bShowPassword; public : @@ -73,7 +74,7 @@ public : OUString GetPassword() { return m_pEDPassword->GetText(); }; OUString GetUser() { return m_pEDUsername->GetText(); }; - void ShowPasswordControl( bool bShow = true ); + void ShowPasswordControl( bool bShow = true ) { m_bShowPassword = bShow; } private: diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index 20e69f6..691f528 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -56,6 +56,8 @@ class DetailsContainer virtual void setActive( bool bActive = true ); + virtual bool hasPassEntry() { return true; } + protected: void notifyChange( ); DECL_LINK ( ValueChangeHdl, void * ); @@ -140,6 +142,7 @@ class CmisDetailsContainer : public DetailsContainer virtual INetURLObject getUrl( ) SAL_OVERRIDE; virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE; virtual void setUsername( const OUString& rUsername ) SAL_OVERRIDE; + virtual bool hasPassEntry() SAL_OVERRIDE { return false; } private: void selectRepository( ); diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index f45a238..77526de 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -23,6 +23,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent) , m_xCurrentDetails() , m_nCurrentType( 0 ) , bLabelChanged( false ) + , m_bShowPassword( false ) { get( m_pEDServerName, "name" ); get( m_pLBServerType, "type" ); @@ -59,6 +60,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla : ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui") , m_xCurrentDetails( ) , bLabelChanged( true ) + , m_bShowPassword( false ) { get( m_pEDServerName, "name" ); get( m_pLBServerType, "type" ); @@ -147,15 +149,6 @@ std::shared_ptr<Place> PlaceEditDialog::GetPlace() return std::make_shared<Place>(m_pEDServerName->GetText(), GetServerUrl(), true); } -void PlaceEditDialog::ShowPasswordControl( bool bShow ) -{ - m_pCBPassword->Show( bShow ); - m_pEDPassword->Show( bShow ); - m_pFTPasswordLabel->Show( bShow ); - - ToggledPassHdl( m_pCBPassword ); -} - IMPL_LINK( PlaceEditDialog, ToggledPassHdl, CheckBox*, pCheckBox ) { bool bChecked = pCheckBox->IsEnabled() && pCheckBox->IsChecked(); @@ -354,6 +347,12 @@ IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl ) m_nCurrentType = nPos; m_xCurrentDetails->show(); + + bool bShowPass = m_xCurrentDetails->hasPassEntry(); + m_pCBPassword->Show( bShowPass ); + m_pEDPassword->Show( bShowPass ); + m_pFTPasswordLabel->Show( bShowPass ); + ToggledPassHdl( m_pCBPassword ); SetSizePixel(GetOptimalSize()); commit f083c5157a02b42fc7ba5e778aa63799baf85d11 Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Aug 12 14:23:47 2015 +0200 User field before Refresh Repos button in the form Change-Id: I2a1aa420c1a0537b80aee3ef2602b1892a131919 diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index eb769f8..8f4e0e5 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -244,7 +244,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -272,7 +272,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -284,7 +284,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">4</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -403,7 +403,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -416,7 +416,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -428,7 +428,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">6</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -442,7 +442,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">5</property> + <property name="top_attach">4</property> </packing> </child> <child> commit a62dec01fccf1b957b2a5bf4c8abb3791d8e8b79 Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Aug 12 12:34:42 2015 +0200 don't enable password control, when whole frame is inactive Change-Id: I165f08a3709b1d32ddab4632342d21b43d3f8ff1 diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index fd42cf7..f45a238 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -158,7 +158,7 @@ void PlaceEditDialog::ShowPasswordControl( bool bShow ) IMPL_LINK( PlaceEditDialog, ToggledPassHdl, CheckBox*, pCheckBox ) { - bool bChecked = pCheckBox->IsChecked(); + bool bChecked = pCheckBox->IsEnabled() && pCheckBox->IsChecked(); m_pEDPassword->Enable( bChecked ); m_pFTPasswordLabel->Enable( bChecked ); commit 87cf343f909bd3034239eb10d1eb88a10994ab15 Author: Szymon KÅos <eszka...@gmail.com> Date: Wed Aug 12 11:05:17 2015 +0200 added 'Remember password' checkbox Change-Id: I4231acd92d263ca772a1aa7b3e178c5681ee86e0 diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index 79ec348..c8cdabe 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -34,6 +34,7 @@ private: std::shared_ptr< DetailsContainer > m_xCurrentDetails; VclPtr<Edit> m_pEDUsername; + VclPtr<CheckBox> m_pCBPassword; VclPtr<Edit> m_pEDPassword; VclPtr<FixedText> m_pFTPasswordLabel; VclPtr<OKButton> m_pBTOk; @@ -72,7 +73,7 @@ public : OUString GetPassword() { return m_pEDPassword->GetText(); }; OUString GetUser() { return m_pEDUsername->GetText(); }; - void ShowPasswordControl( bool bShow = true ) { m_pEDPassword->Show( bShow ); m_pFTPasswordLabel->Show( bShow ); } + void ShowPasswordControl( bool bShow = true ); private: @@ -85,6 +86,7 @@ private: DECL_LINK ( SelectTypeHdl, void * ); DECL_LINK ( EditLabelHdl, void * ); DECL_LINK ( EditUsernameHdl, void * ); + DECL_LINK ( ToggledPassHdl, CheckBox * pCheckBox ); }; diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index a297e9b..fd42cf7 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -31,11 +31,14 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent) 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_pEDPassword->Hide(); m_pFTPasswordLabel->Hide(); + m_pCBPassword->Hide(); + m_pCBPassword->SetToggleHdl( LINK( this, PlaceEditDialog, ToggledPassHdl ) ); m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); m_pBTOk->Enable( false ); @@ -64,11 +67,14 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla 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_pCBPassword->SetToggleHdl( LINK( this, PlaceEditDialog, ToggledPassHdl ) ); m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); m_pBTDelete->SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) ); @@ -141,6 +147,28 @@ std::shared_ptr<Place> PlaceEditDialog::GetPlace() return std::make_shared<Place>(m_pEDServerName->GetText(), GetServerUrl(), true); } +void PlaceEditDialog::ShowPasswordControl( bool bShow ) +{ + m_pCBPassword->Show( bShow ); + m_pEDPassword->Show( bShow ); + m_pFTPasswordLabel->Show( bShow ); + + ToggledPassHdl( m_pCBPassword ); +} + +IMPL_LINK( PlaceEditDialog, ToggledPassHdl, CheckBox*, pCheckBox ) +{ + bool bChecked = pCheckBox->IsChecked(); + + m_pEDPassword->Enable( bChecked ); + m_pFTPasswordLabel->Enable( bChecked ); + + if ( !bChecked ) + m_pEDPassword->SetText( "" ); + + return 0; +} + void PlaceEditDialog::InitDetails( ) { // Create CMIS controls for each server type @@ -326,6 +354,7 @@ IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl ) m_nCurrentType = nPos; m_xCurrentDetails->show(); + ToggledPassHdl( m_pCBPassword ); SetSizePixel(GetOptimalSize()); diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index 07b0835..eb769f8 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -192,7 +192,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">7</property> + <property name="top_attach">8</property> </packing> </child> <child> @@ -204,7 +204,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">7</property> + <property name="top_attach">8</property> </packing> </child> <child> @@ -298,7 +298,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -310,7 +310,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -411,12 +411,12 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Password*:</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">5</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -428,12 +428,29 @@ </object> <packing> <property name="left_attach">1</property> + <property name="top_attach">6</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> commit a38e2ff72079a392a0f1c419ee9cfce472dca6e1 Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 11 11:26:24 2015 +0200 store password for service if filled Change-Id: I99ce30516a3d8859c060c8e85f8f8ea5e5217d61 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 6cf9994..98ef36f 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -650,6 +650,27 @@ void RemoteFilesDialog::DisableControls() m_pCancel_btn->Enable( true ); } +void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUser, const OUString& rPassword ) +{ + try + { + if( m_xMasterPasswd->isPersistentStoringAllowed() && m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) + { + Reference< XInteractionHandler > xInteractionHandler( + InteractionHandler::createWithParent( m_xContext, 0 ), + UNO_QUERY ); + + Sequence< OUString > aPasswd( 1 ); + aPasswd[0] = rPassword; + + m_xMasterPasswd->addPersistent( + rURL, rUser, aPasswd, xInteractionHandler ); + } + } + catch( const Exception& ) + {} +} + IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl ) { ScopedVclPtrInstance< PlaceEditDialog > aDlg( this ); @@ -663,6 +684,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl ) ServicePtr newService = aDlg->GetPlace(); m_aServices.push_back( newService ); + OUString sPassword = aDlg->GetPassword(); + OUString sUser = aDlg->GetUser(); + if( !sUser.isEmpty() && !sPassword.isEmpty() ) + { + SavePassword( newService->GetUrl(), sUser, sPassword ); + } + OUString sPrefix = lcl_GetServiceType( newService ); if(!sPrefix.isEmpty()) @@ -803,9 +831,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, Sequence< OUString > aPasswd( 1 ); aPasswd[0] = aNewPass; - Reference< XPasswordContainer2 > xPasswdContainer( - PasswordContainer::create( m_xContext ) ); - xPasswdContainer->addPersistent( + m_xMasterPasswd->addPersistent( sUrl, sUserName, aPasswd, xInteractionHandler ); } } diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index f35d64c..4fe1188 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -178,6 +178,8 @@ private: void EnableControls(); void DisableControls(); + void SavePassword( const OUString& rURL, const OUString& rUser, const OUString& rPassword ); + DECL_LINK ( AddServiceHdl, void * ); DECL_LINK ( SelectServiceHdl, void * ); DECL_LINK_TYPED ( EditServiceMenuHdl, MenuButton *, void ); diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index cfcfe67..79ec348 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -70,6 +70,7 @@ public : OUString GetServerName() { return m_pEDServerName->GetText(); } OUString GetServerUrl(); OUString GetPassword() { return m_pEDPassword->GetText(); }; + OUString GetUser() { return m_pEDUsername->GetText(); }; void ShowPasswordControl( bool bShow = true ) { m_pEDPassword->Show( bShow ); m_pFTPasswordLabel->Show( bShow ); } commit b5be942585db167aae58a4b820e9786f80a84096 Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 11 10:19:08 2015 +0200 use shared context Change-Id: I513a07e8e8d361b8f9c9695ddc8d283ee62b565d diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index ade4e23..6cf9994 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -170,8 +170,8 @@ class FileViewContainer : public vcl::Window RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) : SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" ) - , m_context( comphelper::getProcessComponentContext() ) - , m_xMasterPasswd( PasswordContainer::create( m_context ) ) + , m_xContext( comphelper::getProcessComponentContext() ) + , m_xMasterPasswd( PasswordContainer::create( m_xContext ) ) , m_pCurrentAsyncAction( NULL ) , m_pFileNotifier( NULL ) , m_pSplitter( NULL ) @@ -301,7 +301,7 @@ void RemoteFilesDialog::dispose() } // save services - std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_context ) ); + std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_xContext ) ); officecfg::Office::Common::Misc::FilePickerLastService::set( m_sLastServiceUrl, batch ); @@ -431,13 +431,13 @@ void RemoteFilesDialog::FillServicesListbox() m_aServices.clear(); // Load from user settings - Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get( m_context ) ); - Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get( m_context ) ); + Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get( m_xContext ) ); + Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get( m_xContext ) ); unsigned int nPos = 0; unsigned int i = 0; - m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get( m_context ); + m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get( m_xContext ); for( sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace ) { @@ -782,7 +782,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, OUString sUrl( m_aServices[nPos]->GetUrl() ); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), 0 ), + InteractionHandler::createWithParent( m_xContext, 0 ), UNO_QUERY ); UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler ); @@ -804,7 +804,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, aPasswd[0] = aNewPass; Reference< XPasswordContainer2 > xPasswdContainer( - PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + PasswordContainer::create( m_xContext ) ); xPasswdContainer->addPersistent( sUrl, sUserName, aPasswd, xInteractionHandler ); } @@ -1284,11 +1284,10 @@ bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL ) { try { - Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW ); + InteractionHandler::createWithParent( m_xContext, 0 ), UNO_QUERY_THROW ); Reference< XCommandEnvironment > xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); - ::ucbhelper::Content aContent( rURL, xEnv, xContext ); + ::ucbhelper::Content aContent( rURL, xEnv, m_xContext ); return aContent.isFolder(); } @@ -1304,11 +1303,10 @@ bool RemoteFilesDialog::ContentIsDocument( const OUString& rURL ) { try { - Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW ); + InteractionHandler::createWithParent( m_xContext, 0 ), UNO_QUERY_THROW ); Reference< XCommandEnvironment > xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); - ::ucbhelper::Content aContent( rURL, xEnv, xContext ); + ::ucbhelper::Content aContent( rURL, xEnv, m_xContext ); return aContent.isDocument(); } diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 12751d0..f35d64c 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -122,7 +122,7 @@ public: virtual OUString getCurFilter( ) const SAL_OVERRIDE; private: - Reference< com::sun::star::uno::XComponentContext > m_context; + Reference< XComponentContext > m_xContext; Reference< XPasswordContainer2 > m_xMasterPasswd; SvtRemoteDlgMode m_eMode; commit bb924a8176a04ad356599cbcdfca9e4686b7fa67 Author: Szymon KÅos <eszka...@gmail.com> Date: Tue Aug 11 10:11:06 2015 +0200 shared PasswordContainer Change-Id: I73d4532cd9e6f811e32d46738808c81a03c2e895 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 37c9535..ade4e23 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -171,6 +171,7 @@ class FileViewContainer : public vcl::Window RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) : SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" ) , m_context( comphelper::getProcessComponentContext() ) + , m_xMasterPasswd( PasswordContainer::create( m_context ) ) , m_pCurrentAsyncAction( NULL ) , m_pFileNotifier( NULL ) , m_pSplitter( NULL ) @@ -587,10 +588,7 @@ void RemoteFilesDialog::EnableControls() try { - Reference< XPasswordContainer2 > xMasterPasswd( - PasswordContainer::create( comphelper::getProcessComponentContext() ) ); - - if( xMasterPasswd->isPersistentStoringAllowed() ) + if( m_xMasterPasswd->isPersistentStoringAllowed() ) { int nPos = GetSelectedServicePos(); @@ -598,7 +596,7 @@ void RemoteFilesDialog::EnableControls() { OUString sUrl( m_aServices[nPos]->GetUrl() ); - UrlRecord aURLEntries = xMasterPasswd->find( sUrl, Reference< XInteractionHandler>() ); + UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, Reference< XInteractionHandler>() ); if( aURLEntries.UserList.getLength() ) { @@ -775,10 +773,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, { try { - Reference< XPasswordContainer2 > xMasterPasswd( - PasswordContainer::create( comphelper::getProcessComponentContext() ) ); - - if( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) + if( m_xMasterPasswd->isPersistentStoringAllowed() && m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) { int nPos = GetSelectedServicePos(); @@ -790,7 +785,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), 0 ), UNO_QUERY ); - UrlRecord aURLEntries = xMasterPasswd->find( sUrl, xInteractionHandler ); + UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler ); if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() ) { diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 740262a..12751d0 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -122,7 +122,8 @@ public: virtual OUString getCurFilter( ) const SAL_OVERRIDE; private: - ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_context; + Reference< com::sun::star::uno::XComponentContext > m_context; + Reference< XPasswordContainer2 > m_xMasterPasswd; SvtRemoteDlgMode m_eMode; SvtRemoteDlgType m_eType; commit 9bb6fc8969b38d657c80138900ed4f93afebb0f2 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 16:17:23 2015 +0200 added mnemonic_widget properties Change-Id: I36b2b5bdbc597b82e746c5f81b99064efb06da75 diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index 55867ff..07b0835 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -174,6 +174,7 @@ <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> @@ -213,6 +214,7 @@ <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> @@ -238,6 +240,7 @@ <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> @@ -335,6 +338,7 @@ <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> @@ -408,9 +412,7 @@ <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Password*:</property> - <accessibility> - <relation type="description-for" target="password"/> - </accessibility> + <property name="mnemonic_widget">password</property> </object> <packing> <property name="left_attach">0</property> @@ -423,9 +425,6 @@ <property name="can_focus">True</property> <property name="visibility">False</property> <property name="invisible_char">â</property> - <accessibility> - <relation type="described-by" target="passwordLabel"/> - </accessibility> </object> <packing> <property name="left_attach">1</property> commit 98a5c264b79998b6ec83e3fb18c4c33a1512a7ca Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 16:07:40 2015 +0200 added password field in the Add service dialog Change-Id: I1074a3a2980e939de3f578cb566bab1e0ed96aed diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 7b90ae0..37c9535 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -655,6 +655,7 @@ void RemoteFilesDialog::DisableControls() IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl ) { ScopedVclPtrInstance< PlaceEditDialog > aDlg( this ); + aDlg->ShowPasswordControl(); short aRetCode = aDlg->Execute(); switch( aRetCode ) diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index e492978..cfcfe67 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -34,6 +34,8 @@ private: std::shared_ptr< DetailsContainer > m_xCurrentDetails; VclPtr<Edit> m_pEDUsername; + VclPtr<Edit> m_pEDPassword; + VclPtr<FixedText> m_pFTPasswordLabel; VclPtr<OKButton> m_pBTOk; VclPtr<CancelButton> m_pBTCancel; @@ -67,6 +69,9 @@ public : OUString GetServerName() { return m_pEDServerName->GetText(); } OUString GetServerUrl(); + OUString GetPassword() { return m_pEDPassword->GetText(); }; + + void ShowPasswordControl( bool bShow = true ) { m_pEDPassword->Show( bShow ); m_pFTPasswordLabel->Show( bShow ); } private: diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index fdb385e..a297e9b 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -31,6 +31,11 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent) get( m_pBTCancel, "cancel" ); get( m_pBTDelete, "delete" ); get( m_pBTRepoRefresh, "repositoriesRefresh" ); + get( m_pEDPassword, "password" ); + get( m_pFTPasswordLabel, "passwordLabel" ); + + m_pEDPassword->Hide(); + m_pFTPasswordLabel->Hide(); m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); m_pBTOk->Enable( false ); @@ -59,6 +64,11 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla get( m_pBTCancel, "cancel" ); get( m_pBTDelete, "delete" ); get( m_pTypeGrid, "TypeGrid" ); + get( m_pEDPassword, "password" ); + get( m_pFTPasswordLabel, "passwordLabel" ); + + m_pEDPassword->Hide(); + m_pFTPasswordLabel->Hide(); m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) ); m_pBTDelete->SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) ); @@ -105,6 +115,8 @@ void PlaceEditDialog::dispose() m_pBTOk.clear(); m_pBTCancel.clear(); m_pBTDelete.clear(); + m_pEDPassword.clear(); + m_pFTPasswordLabel.clear(); ModalDialog::dispose(); } diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index ec5c41e..55867ff 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -191,7 +191,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -203,7 +203,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -295,7 +295,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -307,7 +307,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -403,6 +403,36 @@ </packing> </child> <child> + <object class="GtkLabel" id="passwordLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Password*:</property> + <accessibility> + <relation type="description-for" target="password"/> + </accessibility> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</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> + <accessibility> + <relation type="described-by" target="passwordLabel"/> + </accessibility> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> <placeholder/> </child> </object> commit bd277973b2e3e467b665e30c0ba56ad372d3d233 Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 14:15:59 2015 +0200 Show 'change password' only if is password is stored Change-Id: I04275d2e45ff32ed003a2487cd87500d550e9d73 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index c90175d..7b90ae0 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -578,7 +578,39 @@ void RemoteFilesDialog::AddFileExtension() void RemoteFilesDialog::EnableControls() { if( m_pServices_lb->GetEntryCount() > 0 ) + { m_pServices_lb->Enable( true ); + + if( m_pServices_lb->GetSelectEntryCount() ) + { + m_pAddMenu->EnableItem( "change_password", false ); + + try + { + Reference< XPasswordContainer2 > xMasterPasswd( + PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + + if( xMasterPasswd->isPersistentStoringAllowed() ) + { + int nPos = GetSelectedServicePos(); + + if( nPos >= 0 ) + { + OUString sUrl( m_aServices[nPos]->GetUrl() ); + + UrlRecord aURLEntries = xMasterPasswd->find( sUrl, Reference< XInteractionHandler>() ); + + if( aURLEntries.UserList.getLength() ) + { + m_pAddMenu->EnableItem( "change_password" ); + } + } + } + } + catch( const Exception& ) + {} + } + } else m_pServices_lb->Enable( false ); @@ -745,7 +777,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, Reference< XPasswordContainer2 > xMasterPasswd( PasswordContainer::create( comphelper::getProcessComponentContext() ) ); - if( xMasterPasswd->isPersistentStoringAllowed() ) + if( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) { int nPos = GetSelectedServicePos(); @@ -759,29 +791,26 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, UrlRecord aURLEntries = xMasterPasswd->find( sUrl, xInteractionHandler ); - if( aURLEntries.Url == sUrl ) + if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() ) { - if( aURLEntries.UserList.getLength() ) - { - OUString sUserName = aURLEntries.UserList[0].UserName; + OUString sUserName = aURLEntries.UserList[0].UserName; - ::comphelper::SimplePasswordRequest* pPasswordRequest - = new ::comphelper::SimplePasswordRequest( PasswordRequestMode_PASSWORD_CREATE ); - Reference< XInteractionRequest > rRequest( pPasswordRequest ); + ::comphelper::SimplePasswordRequest* pPasswordRequest + = new ::comphelper::SimplePasswordRequest( PasswordRequestMode_PASSWORD_CREATE ); + Reference< XInteractionRequest > rRequest( pPasswordRequest ); - xInteractionHandler->handle( rRequest ); + xInteractionHandler->handle( rRequest ); - if ( pPasswordRequest->isPassword() ) - { - OUString aNewPass = pPasswordRequest->getPassword(); - Sequence< OUString > aPasswd( 1 ); - aPasswd[0] = aNewPass; - - Reference< XPasswordContainer2 > xPasswdContainer( - PasswordContainer::create(comphelper::getProcessComponentContext())); - xPasswdContainer->addPersistent( - sUrl, sUserName, aPasswd, xInteractionHandler ); - } + if ( pPasswordRequest->isPassword() ) + { + OUString aNewPass = pPasswordRequest->getPassword(); + Sequence< OUString > aPasswd( 1 ); + aPasswd[0] = aNewPass; + + Reference< XPasswordContainer2 > xPasswdContainer( + PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + xPasswdContainer->addPersistent( + sUrl, sUserName, aPasswd, xInteractionHandler ); } } } commit 0ab1f6a024651d09b619c2864cee1ecc0c7968db Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 13:49:18 2015 +0200 added change password entry in the split button menu Change-Id: I68e76e346ec6d704c27fe6f4031453dd44dbc983 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index a85c40d..c90175d 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -738,6 +738,58 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, } } } + else if( sIdent == "change_password" ) + { + try + { + Reference< XPasswordContainer2 > xMasterPasswd( + PasswordContainer::create( comphelper::getProcessComponentContext() ) ); + + if( xMasterPasswd->isPersistentStoringAllowed() ) + { + int nPos = GetSelectedServicePos(); + + if( nPos >= 0 ) + { + OUString sUrl( m_aServices[nPos]->GetUrl() ); + + Reference< XInteractionHandler > xInteractionHandler( + InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), 0 ), + UNO_QUERY ); + + UrlRecord aURLEntries = xMasterPasswd->find( sUrl, xInteractionHandler ); + + if( aURLEntries.Url == sUrl ) + { + if( aURLEntries.UserList.getLength() ) + { + OUString sUserName = aURLEntries.UserList[0].UserName; + + ::comphelper::SimplePasswordRequest* pPasswordRequest + = new ::comphelper::SimplePasswordRequest( PasswordRequestMode_PASSWORD_CREATE ); + Reference< XInteractionRequest > rRequest( pPasswordRequest ); + + xInteractionHandler->handle( rRequest ); + + if ( pPasswordRequest->isPassword() ) + { + OUString aNewPass = pPasswordRequest->getPassword(); + Sequence< OUString > aPasswd( 1 ); + aPasswd[0] = aNewPass; + + Reference< XPasswordContainer2 > xPasswdContainer( + PasswordContainer::create(comphelper::getProcessComponentContext())); + xPasswdContainer->addPersistent( + sUrl, sUserName, aPasswd, xInteractionHandler ); + } + } + } + } + } + } + catch( const Exception& ) + {} + } EnableControls(); } diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index a63bef3..740262a 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -10,6 +10,8 @@ #ifndef INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX #define INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX +#include <comphelper/docpasswordrequest.hxx> + #include <svtools/foldertree.hxx> #include <svtools/place.hxx> #include <svtools/PlaceEditDialog.hxx> @@ -32,6 +34,8 @@ #include <officecfg/Office/Common.hxx> #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/task/PasswordContainer.hpp> +#include <com/sun/star/task/XPasswordContainer2.hpp> #include <vector> @@ -42,6 +46,7 @@ #include "iodlg.hrc" using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::task; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ui::dialogs; diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui index 7c0c923..e0699a5 100644 --- a/fpicker/uiconfig/ui/remotefilesdialog.ui +++ b/fpicker/uiconfig/ui/remotefilesdialog.ui @@ -285,5 +285,13 @@ <property name="use_underline">True</property> </object> </child> + <child> + <object class="GtkMenuItem" id="change_password"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_Change password</property> + <property name="use_underline">True</property> + </object> + </child> </object> </interface> commit 2b0e0ffc1562e3f939833b9dfc3c52eea847bd4d Author: Szymon KÅos <eszka...@gmail.com> Date: Mon Aug 10 12:02:55 2015 +0200 when user typed a folder name, open it Change-Id: I800f97bfd9f564c065ca7e59f5751768f2f2bd0d diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 20ce343..a85c40d 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -914,6 +914,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl ) IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) { + OUString sNameNoExt = m_pName_ed->GetText(); + OUString sPathNoExt; + // auto extension if( m_eMode == REMOTEDLG_MODE_SAVE ) AddFileExtension(); @@ -933,6 +936,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) if( !bSelected ) { m_sPath = sCurrentPath + INetURLObject::encode( sName, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL ); + sPathNoExt = sCurrentPath + INetURLObject::encode( sNameNoExt, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL ); } else { @@ -953,11 +957,11 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) bool bExists = false; if( bFileDlg ) - bExists = ContentIsDocument(m_sPath); + bExists = ContentIsDocument( m_sPath ); else - bExists = ContentIsFolder(m_sPath); + bExists = ContentIsFolder( m_sPath ); - if ( bExists ) + if( bExists ) { if( m_eMode == REMOTEDLG_MODE_SAVE ) { @@ -970,9 +974,15 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) } else { - if( m_eMode == REMOTEDLG_MODE_OPEN ) + if( ContentIsFolder( sPathNoExt ) ) + { + OpenURL( sPathNoExt ); + m_pName_ed->SetText( "" ); + return 0; - if( m_eMode == REMOTEDLG_MODE_SAVE && ContentIsFolder(m_sPath) ) + } + + if( m_eMode == REMOTEDLG_MODE_OPEN ) return 0; } commit 41102d9fcd99416734c527bfd488377d09caf13c Author: Szymon KÅos <eszka...@gmail.com> Date: Fri Aug 7 18:32:32 2015 +0200 added New Folder button Change-Id: I4b1ef03e707fdfb3d1968dca9f48c548f872612c diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 80abcac..20ce343 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -183,6 +183,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) get( m_pServices_lb, "services_lb" ); get( m_pFilter_lb, "filter_lb" ); get( m_pName_ed, "name_ed" ); + get( m_pNewFolder, "new_folder" ); m_eMode = ( nBits & WB_SAVEAS ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN; m_eType = ( nBits & WB_PATH ) ? REMOTEDLG_TYPE_PATHDLG : REMOTEDLG_TYPE_FILEDLG; @@ -196,10 +197,20 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pName_ed->Enable( false ); if( m_eMode == REMOTEDLG_MODE_OPEN ) + { get( m_pOk_btn, "open" ); + + m_pNewFolder->Hide(); + } else + { get( m_pOk_btn, "save" ); + m_aImages = ImageList( fpicker::SvtResId( RID_FILEPICKER_IMAGES ) ); + m_pNewFolder->SetModeImage( m_aImages.GetImage( IMG_FILEDLG_CREATEFOLDER ) ); + m_pNewFolder->SetClickHdl( LINK( this, RemoteFilesDialog, NewFolderHdl ) ); + } + m_pOk_btn->Show(); m_pOk_btn->Enable( false ); @@ -324,6 +335,7 @@ void RemoteFilesDialog::dispose() m_pServices_lb.clear(); m_pFilter_lb.clear(); m_pName_ed.clear(); + m_pNewFolder.clear(); ModalDialog::dispose(); } @@ -872,6 +884,34 @@ IMPL_LINK ( RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr ) return 1; } +IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl ) +{ + m_pFileView->EndInplaceEditing( false ); + + SmartContent aContent( m_pFileView->GetViewURL() ); + OUString aTitle; + aContent.getTitle( aTitle ); + ScopedVclPtrInstance< QueryFolderNameDialog > aDlg( this, aTitle, fpicker::SVT_RESSTR( STR_SVT_NEW_FOLDER ) ); + bool bHandled = false; + + while( !bHandled ) + { + if( aDlg->Execute() == RET_OK ) + { + OUString aUrl = aContent.createFolder( aDlg->GetName() ); + if( !aUrl.isEmpty() ) + { + m_pFileView->CreatedFolder( aUrl, aDlg->GetName() ); + bHandled = true; + } + } + else + bHandled = true; + } + + return 1; +} + IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) { // auto extension diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 0d61f41..a63bef3 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -37,6 +37,9 @@ #include "fpdialogbase.hxx" #include "fpsofficeResMgr.hxx" +#include "OfficeFilePicker.hrc" +#include "QueryFolderName.hxx" +#include "iodlg.hrc" using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; @@ -141,6 +144,7 @@ private: VclPtr< MenuButton > m_pAddService_btn; VclPtr< ListBox > m_pServices_lb; VclPtr< Breadcrumb > m_pPath; + VclPtr<PushButton> m_pNewFolder; VclPtr< Splitter > m_pSplitter; VclPtr< FolderTree > m_pTreeView; VclPtr< SvtFileView > m_pFileView; @@ -149,6 +153,8 @@ private: VclPtr< Edit > m_pName_ed; PopupMenu* m_pAddMenu; + ImageList m_aImages; + std::vector< ServicePtr > m_aServices; std::vector< std::pair< OUString, OUString > > m_aFilters; @@ -184,6 +190,8 @@ private: DECL_LINK( SelectBreadcrumbHdl, Breadcrumb * ); + DECL_LINK( NewFolderHdl, void * ); + DECL_LINK( OkHdl, void * ); DECL_LINK( CancelHdl, void * ); }; diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui index 8bf57a3..7c0c923 100644 --- a/fpicker/uiconfig/ui/remotefilesdialog.ui +++ b/fpicker/uiconfig/ui/remotefilesdialog.ui @@ -138,12 +138,44 @@ </packing> </child> <child> - <object class="GtkBox" id="breadcrumb_container"> + <object class="GtkBox" id="box2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> + <property name="spacing">6</property> <child> - <placeholder/> + <object class="GtkBox" id="breadcrumb_container"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="new_folder"> + <property name="use_action_appearance">False</property> + <property name="width_request">25</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Create New Folder</property> + <property name="tooltip_text" translatable="yes">Create New Folder</property> + <property name="margin_left">6</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> commit 5c2a0cbb4825a658abbe0c915708eba28cd08ca9 Author: Szymon KÅos <eszka...@gmail.com> Date: Fri Aug 7 14:54:39 2015 +0200 avoid name conflict: SvtResId Change-Id: I5fbde751c9d6b0d9be7d6dd50abfb99bb14a3512 diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 11278f2..80abcac 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -206,7 +206,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_pOk_btn->SetClickHdl( LINK( this, RemoteFilesDialog, OkHdl ) ); m_pCancel_btn->SetClickHdl( LINK( this, RemoteFilesDialog, CancelHdl ) ); - m_sRootLabel = ResId( STR_SVT_ROOTLABEL, *ResMgrHolder::getOrCreate() ); + m_sRootLabel = fpicker::SvtResId( STR_SVT_ROOTLABEL ); m_pPath = VclPtr<Breadcrumb>::Create( get< vcl::Window >( "breadcrumb_container" ) ); m_pPath->set_hexpand( true ); m_pPath->SetClickHdl( LINK( this, RemoteFilesDialog, SelectBreadcrumbHdl ) ); @@ -710,7 +710,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, if( nPos >= 0 ) { - OUString sMsg = ResId( STR_SVT_DELETESERVICE, *ResMgrHolder::getOrCreate() ); + OUString sMsg = fpicker::SvtResId( STR_SVT_DELETESERVICE ); sMsg = sMsg.replaceFirst( "$servicename$", m_pServices_lb->GetSelectEntry() ); ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO ); @@ -921,7 +921,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) { if( m_eMode == REMOTEDLG_MODE_SAVE ) { - OUString sMsg = ResId( STR_SVT_ALREADYEXISTOVERWRITE, *ResMgrHolder::getOrCreate() ); + OUString sMsg = fpicker::SvtResId( STR_SVT_ALREADYEXISTOVERWRITE ); sMsg = sMsg.replaceFirst( "$filename$", sName ); ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO ); if( aBox->Execute() != RET_YES ) diff --git a/fpicker/source/office/fpsofficeResMgr.hxx b/fpicker/source/office/fpsofficeResMgr.hxx index 76b4538..359fc88 100644 --- a/fpicker/source/office/fpsofficeResMgr.hxx +++ b/fpicker/source/office/fpsofficeResMgr.hxx @@ -13,7 +13,7 @@ #include <osl/getglobalmutex.hxx> #include <tools/resmgr.hxx> -namespace +namespace fpicker { struct ResMgrHolder { diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 6b5eaa7..6d1e1a1 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -100,6 +100,7 @@ using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::container; using namespace ::com::sun::star::task; using namespace ::com::sun::star::sdbc; +using namespace ::fpicker; using namespace ::utl; using namespace ::svt; commit 8fda7834d98602c59776eddfe036d98eb7af1305 Author: Szymon KÅos <eszka...@gmail.com> Date: Thu Aug 6 11:11:00 2015 +0200 Rework of the 'Add service' dialog Change-Id: Ie53352367a92468fb7b1bfbe106230327e4a6599 diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index 16b8e23..20e69f6 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -24,14 +24,20 @@ class DetailsContainer { - private: - Link<> m_aChangeHdl; - VclPtr<VclGrid> m_pFrame; - VclPtr<VclGrid> m_pCommon; - bool m_bIsActive; + protected: + Link<> m_aChangeHdl; + VclPtr<VclGrid> m_pDetailsGrid; + VclPtr<VclHBox> m_pHostBox; + VclPtr<Edit> m_pEDHost; + VclPtr<FixedText> m_pFTHost; + VclPtr<NumericField> m_pEDPort; + VclPtr<FixedText> m_pFTPort; + VclPtr<Edit> m_pEDRoot; + VclPtr<FixedText> m_pFTRoot; + bool m_bIsActive; public: - DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ); + DetailsContainer( VclBuilderContainer* pBuilder ); virtual ~DetailsContainer( ); void setChangeHdl( const Link<>& rLink ) { m_aChangeHdl = rLink; } @@ -60,11 +66,7 @@ class HostDetailsContainer : public DetailsContainer private: sal_uInt16 m_nDefaultPort; OUString m_sScheme; - - protected: - VclPtr<Edit> m_pEDHost; - VclPtr<NumericField> m_pEDPort; - VclPtr<Edit> m_pEDPath; + OUString m_sHost; public: HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ); @@ -104,9 +106,8 @@ class DavDetailsContainer : public HostDetailsContainer class SmbDetailsContainer : public DetailsContainer { private: - VclPtr<Edit> m_pEDHost; VclPtr<Edit> m_pEDShare; - VclPtr<Edit> m_pEDPath; + VclPtr<FixedText> m_pFTShare; public: SmbDetailsContainer( VclBuilderContainer* pBuilder ); @@ -114,6 +115,7 @@ class SmbDetailsContainer : public DetailsContainer virtual INetURLObject getUrl( ) SAL_OVERRIDE; virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE; + virtual void show( bool bShow = true ) SAL_OVERRIDE; }; class CmisDetailsContainer : public DetailsContainer @@ -125,10 +127,10 @@ class CmisDetailsContainer : public DetailsContainer OUString m_sRepoId; OUString m_sBinding; - VclPtr<Edit> m_pEDBinding; + VclPtr<VclHBox> m_pRepositoryBox; + VclPtr<FixedText> m_pFTRepository; VclPtr<ListBox> m_pLBRepository; VclPtr<Button> m_pBTRepoRefresh; - VclPtr<Edit> m_pEDRoot; public: CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding ); diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index ccb08ac..ad4750e 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -31,23 +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_pCommon, "CommonDetails" ); + 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_pFrame->Enable( m_bIsActive ); - m_pCommon->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( ) @@ -80,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-nospin" ); - 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( ) ) @@ -132,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; @@ -198,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 ); } @@ -216,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( ) ) @@ -252,14 +255,27 @@ 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; } +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, "CmisDetails" ), + DetailsContainer( pBuilder ), m_sUsername( ), m_xCmdEnv( ), m_aRepoIds( ), @@ -271,39 +287,50 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder, OUStr InteractionHandler::createWithParent(xContext, 0), UNO_QUERY ); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); - pBuilder->get( m_pEDBinding, "binding" ); + pBuilder->get( m_pFTRepository, "repositoryLabel" ); pBuilder->get( m_pLBRepository, "repositories" ); pBuilder->get( m_pBTRepoRefresh, "repositoriesRefresh" ); - - pBuilder->get( m_pEDRoot, "cmisPath" ); + pBuilder->get( m_pRepositoryBox, "RepositoryDetails" ); show( false ); } void CmisDetailsContainer::show( bool bShow ) { - m_pEDBinding->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); m_pLBRepository->SetSelectHdl( LINK( this, CmisDetailsContainer, SelectRepoHdl ) ); m_pBTRepoRefresh->SetClickHdl( LINK( this, CmisDetailsContainer, RefreshReposHdl ) ); - m_pEDRoot->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) ); - m_pEDBinding->SetText( m_sBinding ); + m_pEDHost->SetText( m_sBinding ); if( ( m_sBinding == GDRIVE_BASE_URL ) || m_sBinding.startsWith( ALFRESCO_CLOUD_BASE_URL ) || ( m_sBinding == ONEDRIVE_BASE_URL ) ) { - DetailsContainer::show( false ); + 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 { - DetailsContainer::show( bShow ); + 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 sBindingUrl = m_pEDHost->GetText().trim( ); OUString sPath = m_pEDRoot->GetText().trim( ); bool bSkip = true; @@ -344,7 +371,7 @@ bool CmisDetailsContainer::setUrl( const INetURLObject& rUrl ) m_sBinding = aHostUrl.GetURLNoMark( ); m_sRepoId = aHostUrl.GetMark( ); - m_pEDBinding->SetText( m_sBinding ); + m_pEDHost->SetText( m_sBinding ); m_pEDRoot->SetText( rUrl.GetURLPath() ); } return bSuccess; @@ -368,7 +395,7 @@ void CmisDetailsContainer::selectRepository( ) IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl ) { - OUString sBindingUrl = m_pEDBinding->GetText().trim( ); + OUString sBindingUrl = m_pEDHost->GetText().trim( ); OUString sEncodedUsername = ""; diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui index e2b1c30..ec5c41e 100644 --- a/svtools/uiconfig/ui/placeedit.ui +++ b/svtools/uiconfig/ui/placeedit.ui @@ -162,7 +162,7 @@ </packing> </child> <child> - <object class="GtkGrid" id="HostDetails"> + <object class="GtkGrid" id="Details"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="row_spacing">6</property> @@ -181,21 +181,6 @@ </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">2</property> - <property name="width">3</property> - </packing> - </child> - <child> <object class="GtkLabel" id="pathLabel"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -206,7 +191,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -218,112 +203,77 @@ </object> <packing> <property name="left_attach">1</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> + <property name="top_attach">6</property> </packing> </child> <child> - <object class="GtkLabel" id="portLabel"> + <object class="GtkLabel" id="shareLabel"> <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="label" translatable="yes">Share:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">port-nospin</property> </object> <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> + <property name="left_attach">0</property> + <property name="top_attach">2</property> </packing> </child> <child> - <object class="GtkSpinButton" id="port-nospin"> + <object class="GtkEntry" id="share"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="max_length">4</property> + <property name="hexpand">True</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="left_attach">3</property> - <property name="top_attach">0</property> + <property name="left_attach">1</property> + <property name="top_attach">2</property> </packing> </child> <child> - <placeholder/> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="SmbDetails"> - <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"> + <object class="GtkLabel" id="repositoryLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Host:</property> + <property name="label" translatable="yes">Repository:</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> + <property name="top_attach">3</property> </packing> </child> <child> - <object class="GtkLabel" id="label10"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <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="label" translatable="yes">Share:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">smbShare</property> + <property name="draw_indicator">True</property> </object> <packing> - <property name="left_attach">0</property> + <property name="left_attach">1</property> <property name="top_attach">1</property> </packing> </child> <child> - <object class="GtkLabel" id="label11"> + <object class="GtkLabel" id="loginLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Root:</property> + <property name="label" translatable="yes">User:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">smbPath</property> + <property name="mnemonic_widget">login</property> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">4</property> </packing> </child> <child> - <object class="GtkEntry" id="smbHost"> + <object class="GtkEntry" id="login"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -331,23 +281,25 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="top_attach">4</property> </packing> </child> <child> - <object class="GtkEntry" id="smbShare"> + <object class="GtkLabel" id="nameLabel"> <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="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">1</property> - <property name="top_attach">1</property> + <property name="left_attach">0</property> + <property name="top_attach">5</property> </packing> </child> <child> - <object class="GtkEntry" id="smbPath"> + <object class="GtkEntry" id="name"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -355,56 +307,59 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="CmisDetails"> - <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">0</property> - <property name="label" translatable="yes">Host:</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">0</property> + <property name="top_attach">5</property> </packing> </child> <child> - <object class="GtkLabel" id="repositoryLabel"> + <object class="GtkBox" id="HostDetails"> <property name="visible">True</property> <property name="can_focus">False</property> - <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">1</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> + <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="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> + </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> @@ -412,10 +367,10 @@ </packing> </child> <child> - <object class="GtkGrid" id="grid6"> + <object class="GtkBox" id="RepositoryDetails"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="column_spacing">6</property> + <property name="spacing">6</property> <child> <object class="GtkComboBox" id="repositories"> <property name="visible">True</property> @@ -423,8 +378,9 @@ <property name="hexpand">True</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> <child> @@ -435,111 +391,25 @@ <property name="image">image1</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <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">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="rootLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Root:</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">2</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">2</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="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"> - <property name="visible">True</property> - <property name="can_focus">False</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> ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits