summaryrefslogtreecommitdiff
path: root/include/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-17 16:21:02 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-18 09:57:42 +0200
commit767188fd1b1e1f504864f9489076283ebc413625 (patch)
tree1a0361d69048e9192cfe3c0b56627ed85e576f81 /include/svtools
parente0d856947af9b29ed9cd0df6e59c384e27f96c0b (diff)
make PlaceEditDialog a bit more ordinary
the various part of PlaceEditDialog are unusual in binding multiple things to a set of shared widgets with a bunch of multiple LINKS to the same things and using the most recent one shown to displace the previous handlers End up with multiple notifications in the gtk3 case, rework this to have a single owner of the widgets so it can do what it wants to do. Change-Id: I65826a69ce2f1d4279f6e8091a518777fcfeca07 Reviewed-on: https://gerrit.libreoffice.org/54496 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svtools')
-rw-r--r--include/svtools/PlaceEditDialog.hxx41
-rw-r--r--include/svtools/ServerDetailsControls.hxx40
2 files changed, 38 insertions, 43 deletions
diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx
index ea76c68a1036..55be5d74edb3 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -39,6 +39,7 @@ private:
bool m_bLabelChanged;
bool m_bShowPassword;
+public:
std::unique_ptr<weld::Entry> m_xEDServerName;
std::unique_ptr<weld::ComboBoxText> m_xLBServerType;
std::unique_ptr<weld::Entry> m_xEDUsername;
@@ -52,21 +53,39 @@ private:
std::unique_ptr<weld::Label> m_xFTPasswordLabel;
std::unique_ptr<weld::Widget> m_xTypeGrid;
+ std::unique_ptr<weld::Widget> m_xRepositoryBox;
+ std::unique_ptr<weld::Label> m_xFTRepository;
+ std::unique_ptr<weld::ComboBoxText> m_xLBRepository;
+
+ std::unique_ptr<weld::Entry> m_xEDShare;
+ std::unique_ptr<weld::Label> m_xFTShare;
+
+ std::unique_ptr<weld::Widget> m_xDetailsGrid;
+ std::unique_ptr<weld::Widget> m_xHostBox;
+ std::unique_ptr<weld::Entry> m_xEDHost;
+ std::unique_ptr<weld::Label> m_xFTHost;
+ std::unique_ptr<weld::SpinButton> m_xEDPort;
+ std::unique_ptr<weld::Label> m_xFTPort;
+ std::unique_ptr<weld::Entry> m_xEDRoot;
+ std::unique_ptr<weld::Label> m_xFTRoot;
+
+ std::unique_ptr<weld::CheckButton> m_xCBDavs;
+
public:
- PlaceEditDialog(weld::Window* pParent);
- PlaceEditDialog(weld::Window* pParent, const std::shared_ptr<Place> &rPlace );
- virtual ~PlaceEditDialog() override;
+ PlaceEditDialog(weld::Window* pParent);
+ PlaceEditDialog(weld::Window* pParent, const std::shared_ptr<Place> &rPlace );
+ virtual ~PlaceEditDialog() override;
- // Returns a place instance with given information
- std::shared_ptr<Place> GetPlace();
+ // Returns a place instance with given information
+ std::shared_ptr<Place> GetPlace();
- OUString GetServerName() { return m_xEDServerName->get_text(); }
- OUString GetServerUrl();
- OUString GetPassword() { return m_xEDPassword->get_text(); };
- OUString GetUser() { return m_xEDUsername->get_text(); };
- bool IsRememberChecked() { return m_xCBPassword->get_active(); }
+ OUString GetServerName() { return m_xEDServerName->get_text(); }
+ OUString GetServerUrl();
+ OUString GetPassword() { return m_xEDPassword->get_text(); };
+ OUString GetUser() { return m_xEDUsername->get_text(); };
+ bool IsRememberChecked() { return m_xCBPassword->get_active(); }
- void ShowPasswordControl() { m_bShowPassword = true; }
+ void ShowPasswordControl() { m_bShowPassword = true; }
private:
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
index 28e7bd0fea36..731e238e69a0 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -16,30 +16,18 @@
#include <com/sun/star/task/XPasswordContainer2.hpp>
#include <tools/urlobj.hxx>
-#include <vcl/builder.hxx>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/layout.hxx>
#include <vcl/weld.hxx>
+class PlaceEditDialog;
+
class DetailsContainer
{
protected:
+ PlaceEditDialog* m_pDialog;
Link<DetailsContainer*,void> m_aChangeHdl;
- std::unique_ptr<weld::Widget> m_xDetailsGrid;
- std::unique_ptr<weld::Widget> m_xHostBox;
- std::unique_ptr<weld::Entry> m_xEDHost;
- std::unique_ptr<weld::Label> m_xFTHost;
- std::unique_ptr<weld::SpinButton> m_xEDPort;
- std::unique_ptr<weld::Label> m_xFTPort;
- std::unique_ptr<weld::Entry> m_xEDRoot;
- std::unique_ptr<weld::Label> m_xFTRoot;
public:
- DetailsContainer( weld::Builder* pBuilder );
+ DetailsContainer(PlaceEditDialog* pDialog);
virtual ~DetailsContainer( );
void setChangeHdl( const Link<DetailsContainer*,void>& rLink ) { m_aChangeHdl = rLink; }
@@ -73,7 +61,7 @@ class HostDetailsContainer : public DetailsContainer
OUString m_sHost;
public:
- HostDetailsContainer( weld::Builder* pBuilder, sal_uInt16 nPort, const OUString& sScheme );
+ HostDetailsContainer(PlaceEditDialog* pDialog, sal_uInt16 nPort, const OUString& sScheme);
virtual void show( bool bShow = true ) override;
virtual INetURLObject getUrl( ) override;
@@ -90,11 +78,8 @@ class HostDetailsContainer : public DetailsContainer
class DavDetailsContainer : public HostDetailsContainer
{
- private:
- std::unique_ptr<weld::CheckButton> m_xCBDavs;
-
public:
- DavDetailsContainer(weld::Builder* pBuilder);
+ DavDetailsContainer(PlaceEditDialog* pDialog);
virtual void show( bool bShow = true ) override;
virtual bool enableUserCredentials( ) override { return false; };
@@ -108,12 +93,8 @@ class DavDetailsContainer : public HostDetailsContainer
class SmbDetailsContainer : public DetailsContainer
{
- private:
- std::unique_ptr<weld::Entry> m_xEDShare;
- std::unique_ptr<weld::Label> m_xFTShare;
-
public:
- SmbDetailsContainer(weld::Builder* pBuilder);
+ SmbDetailsContainer(PlaceEditDialog* pDialog);
virtual INetURLObject getUrl( ) override;
virtual bool setUrl( const INetURLObject& rUrl ) override;
@@ -131,13 +112,8 @@ class CmisDetailsContainer : public DetailsContainer
OUString m_sBinding;
css::uno::Reference< css::awt::XWindow > m_xParentDialog;
- std::unique_ptr<weld::Widget> m_xRepositoryBox;
- std::unique_ptr<weld::Label> m_xFTRepository;
- std::unique_ptr<weld::ComboBoxText> m_xLBRepository;
- std::unique_ptr<weld::Button> m_xBTRepoRefresh;
-
public:
- CmisDetailsContainer(weld::Builder* pBuilder, weld::Dialog* pParentDialog, OUString const & sBinding);
+ CmisDetailsContainer(PlaceEditDialog* pDialog, OUString const & sBinding);
virtual void show( bool bShow = true ) override;
virtual INetURLObject getUrl( ) override;