summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-12-03 14:07:59 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-12-03 15:46:54 +0100
commitcb6fd518eccd2e121da39ec1a544d6dd8aee0af0 (patch)
tree9d8ebe0ffdfca4b8fcf0efc9e8a31be2f5ad2c74
parent393a3d5c586cc54c144922806abc05ce984f64ed (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>
-rw-r--r--sc/source/ui/dbgui/dapitype.cxx13
-rw-r--r--sc/source/ui/inc/dapitype.hxx3
2 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index d4e817b2404d..411ff96872c0 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -30,12 +30,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);
@@ -49,6 +54,14 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b
m_xBtnExternal->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 2fea18054c62..171f724d1bda 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