diff options
author | Skyler Grey <skyler.grey@collabora.com> | 2022-08-19 12:23:20 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-11-20 15:34:05 +0100 |
commit | 9a0a7ae8f62cc8233b71057caa6bc88c69ee94a1 (patch) | |
tree | e2021794547bdd6feb28d62917a02b51c933c1d6 /sw/source/ui/frmdlg | |
parent | 930b96dee6250eb8d51f25e2e1020bd1e028db03 (diff) |
Make the insert caption dialog an async jsdialog
- Using StartExecuteAsync instead of Execute to execute the dialog makes
it run asyncly
- We need to add a handler for the OK button, otherwise the event won't
be fired when it's clicked. There seem to be varying names for this
throughout the codebase, I've chosen OKHdl as it's short, appears to
be relatively common and fits well with the existing OptionHdl and
CaptionHdl that the other buttons on the dialog use
- Lastly, we need to enable the JSDialog builder in
vcl/jsdialog/enabled.cxx so that the dialog becomes a JSDialog
Still TODO:
- Convert the dialogs that open when you press "auto" or "options"
buttons (will be in a followup review)
Change-Id: Ieabbc4e69c4aa065506f7dc6c823d83e4d784c2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138313
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142988
Tested-by: Jenkins
Diffstat (limited to 'sw/source/ui/frmdlg')
-rw-r--r-- | sw/source/ui/frmdlg/cption.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index 01ebc9d685c4..8b3c14afe0a6 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -138,6 +138,7 @@ SwCaptionDialog::SwCaptionDialog(weld::Window *pParent, SwView &rV) m_xSepEdit->connect_changed(aLk); m_xFormatBox->connect_changed(LINK(this, SwCaptionDialog, SelectListBoxHdl)); + m_xOKButton->connect_clicked(LINK(this, SwCaptionDialog, OKHdl)); m_xOptionButton->connect_clicked(LINK(this, SwCaptionDialog, OptionHdl)); m_xAutoCaptionButton->connect_clicked(LINK(this, SwCaptionDialog, CaptionHdl)); m_xAutoCaptionButton->set_accessible_description(SwResId(STR_A11Y_DESC_AUTO)); @@ -267,6 +268,12 @@ SwCaptionDialog::SwCaptionDialog(weld::Window *pParent, SwView &rV) DrawSample(); } +IMPL_LINK_NOARG(SwCaptionDialog, OKHdl, weld::Button&, void) +{ + Apply(); + m_xDialog->response(RET_OK); +} + void SwCaptionDialog::Apply() { InsCaptionOpt aOpt; |