diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-05-20 12:56:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-05-20 17:02:12 +0200 |
commit | 253f7af7bcd2337a06c027852286616ff91d2e3f (patch) | |
tree | c60d9f3b377ddb3f1a0e5ec6958845077b0e5378 /sw/source/ui/fldui/javaedit.cxx | |
parent | 48182506886230a70cfa2ce3c61470701cb1138e (diff) |
use toggle instead of click for RadioButton
Change-Id: Ia43c3ccae0dcbfb0c522a8c13db6fbfb72bfa4f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115877
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/fldui/javaedit.cxx')
-rw-r--r-- | sw/source/ui/fldui/javaedit.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index bfec3202309c..4cd9f3a39c85 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -53,9 +53,9 @@ SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh) m_xNextBtn->connect_clicked( LINK( this, SwJavaEditDialog, NextHdl ) ); m_xOKBtn->connect_clicked( LINK( this, SwJavaEditDialog, OKHdl ) ); - Link<weld::Button&,void> aLk = LINK(this, SwJavaEditDialog, RadioButtonHdl); - m_xUrlRB->connect_clicked(aLk); - m_xEditRB->connect_clicked(aLk); + Link<weld::ToggleButton&,void> aLk = LINK(this, SwJavaEditDialog, RadioButtonHdl); + m_xUrlRB->connect_toggled(aLk); + m_xEditRB->connect_toggled(aLk); m_xUrlPB->connect_clicked(LINK(this, SwJavaEditDialog, InsertFileHdl)); m_pMgr.reset(new SwFieldMgr(m_pSh)); @@ -68,7 +68,7 @@ SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh) if (!m_bNew) m_xDialog->set_title(SwResId(STR_JAVA_EDIT)); - RadioButtonHdl(*m_xUrlRB); + UpdateFromRadioButtons(); } SwJavaEditDialog::~SwJavaEditDialog() @@ -86,7 +86,7 @@ IMPL_LINK_NOARG(SwJavaEditDialog, PrevHdl, weld::Button&, void) m_pMgr->GoPrev(); m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField()); CheckTravel(); - RadioButtonHdl(*m_xUrlRB); + UpdateFromRadioButtons(); } IMPL_LINK_NOARG(SwJavaEditDialog, NextHdl, weld::Button&, void) @@ -97,7 +97,7 @@ IMPL_LINK_NOARG(SwJavaEditDialog, NextHdl, weld::Button&, void) m_pMgr->GoNext(); m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField()); CheckTravel(); - RadioButtonHdl(*m_xUrlRB); + UpdateFromRadioButtons(); } IMPL_LINK_NOARG(SwJavaEditDialog, OKHdl, weld::Button&, void) @@ -197,7 +197,14 @@ bool SwJavaEditDialog::IsUpdate() const return m_pField && ( sal_uInt32(m_bIsUrl ? 1 : 0) != m_pField->GetFormat() || m_pField->GetPar2() != m_aType || m_pField->GetPar1() != m_aText ); } -IMPL_LINK_NOARG(SwJavaEditDialog, RadioButtonHdl, weld::Button&, void) +IMPL_LINK(SwJavaEditDialog, RadioButtonHdl, weld::ToggleButton&, rButton, void) +{ + if (!rButton.get_active()) + return; + UpdateFromRadioButtons(); +} + +void SwJavaEditDialog::UpdateFromRadioButtons() { bool bEnable = m_xUrlRB->get_active(); m_xUrlPB->set_sensitive(bEnable); |