diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-12-03 14:07:59 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-01-07 18:58:27 +0100 |
commit | 1d9128b6d712669185f402314e5fb57130d4ba5a (patch) | |
tree | 13d65a7df9abe4394c642231d9e53839494a675b | |
parent | 4d682d5b9343c5d18ee6fc52e20a57644c050603 (diff) |
jsdialog: make source selector dialog buttons work
Make sure buttons are welded so we will be able to
execute actions.
Change-Id: I1cb7bdcd80d1cd4d60751940e4d24ecf8e7be1ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107164
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108881
Tested-by: Jenkins
-rw-r--r-- | sc/source/ui/dbgui/dapitype.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/inc/dapitype.hxx | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx index 9ce2626bb8c4..15acb8c65553 100644 --- a/sc/source/ui/dbgui/dapitype.cxx +++ b/sc/source/ui/dbgui/dapitype.cxx @@ -31,12 +31,17 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b , m_xBtnDatabase(m_xBuilder->weld_radio_button("database")) , m_xBtnExternal(m_xBuilder->weld_radio_button("external")) , m_xLbNamedRange(m_xBuilder->weld_combo_box("rangelb")) + , m_xBtnOk(m_xBuilder->weld_button("ok")) // for LOK jsdialog + , m_xBtnCancel(m_xBuilder->weld_button("cancel")) // for LOK jsdialog { m_xBtnSelection->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); m_xBtnNamedRange->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); m_xBtnDatabase->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); m_xBtnExternal->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); + m_xBtnOk->connect_clicked( LINK(this, ScDataPilotSourceTypeDlg, ResponseHdl ) ); + m_xBtnCancel->connect_clicked( LINK(this, ScDataPilotSourceTypeDlg, ResponseHdl ) ); + if (!bEnableExternal) m_xBtnExternal->set_sensitive(false); @@ -53,6 +58,14 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b m_xBtnDatabase->hide(); } +IMPL_LINK(ScDataPilotSourceTypeDlg, ResponseHdl, weld::Button&, rButton, void) +{ + if (&rButton == m_xBtnOk.get()) + m_xDialog->response(RET_OK); + else + m_xDialog->response(RET_CANCEL); +} + ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg() { } diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx index 436d71c9d7f5..8e65db5bae60 100644 --- a/sc/source/ui/inc/dapitype.hxx +++ b/sc/source/ui/inc/dapitype.hxx @@ -30,6 +30,8 @@ private: std::unique_ptr<weld::RadioButton> m_xBtnDatabase; std::unique_ptr<weld::RadioButton> m_xBtnExternal; std::unique_ptr<weld::ComboBox> m_xLbNamedRange; + std::unique_ptr<weld::Button> m_xBtnOk; + std::unique_ptr<weld::Button> m_xBtnCancel; public: ScDataPilotSourceTypeDlg(weld::Window* pParent, bool bEnableExternal); @@ -42,6 +44,7 @@ public: private: DECL_LINK(RadioClickHdl, weld::ToggleButton&, void); + DECL_LINK(ResponseHdl, weld::Button&, void); }; class ScDataPilotServiceDlg : public weld::GenericDialogController |