cui/source/dialogs/SpellDialog.cxx | 3 ++- cui/uiconfig/ui/spelloptionsdialog.ui | 20 +++++++++++++++++--- include/sfx2/basedlgs.hxx | 4 ++++ sc/qa/uitest/calc_tests8/tdf125051.py | 3 +-- sfx2/source/dialog/basedlgs.cxx | 11 +++++++++++ 5 files changed, 35 insertions(+), 6 deletions(-)
New commits: commit a1775337a5cd28135248486fe142e6b4718d5db3 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Mar 21 17:47:01 2023 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Mar 22 12:35:19 2023 +0000 jsdialog: keep button under content in SpellCheck Options Change-Id: I75b1424fe688f975b88634d6355cd0311fc07057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149227 Tested-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 34564c712ee7..3a735afa38ae 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -469,7 +469,8 @@ IMPL_LINK_NOARG(SpellDialog, CheckGrammarHdl, weld::Toggleable&, void) void SpellDialog::StartSpellOptDlg_Impl() { auto xSet = std::make_shared<SfxItemSetFixed<SID_AUTOSPELL_CHECK,SID_AUTOSPELL_CHECK>>( SfxGetpApp()->GetPool() ); - m_xOptionsDlg = std::make_shared<SfxSingleTabDialogController>(m_xDialog.get(), xSet.get(), "cui/ui/spelloptionsdialog.ui", "SpellOptionsDialog"); + m_xOptionsDlg = std::make_shared<SfxSingleTabDialogController>( + m_xDialog.get(), xSet.get(), "content", "cui/ui/spelloptionsdialog.ui", "SpellOptionsDialog"); std::unique_ptr<SfxTabPage> xPage = SvxLinguTabPage::Create(m_xOptionsDlg->get_content_area(), m_xOptionsDlg.get(), xSet.get()); static_cast<SvxLinguTabPage*>(xPage.get())->HideGroups( GROUP_MODULES ); diff --git a/cui/uiconfig/ui/spelloptionsdialog.ui b/cui/uiconfig/ui/spelloptionsdialog.ui index ef690fd7da60..d5e80649731d 100644 --- a/cui/uiconfig/ui/spelloptionsdialog.ui +++ b/cui/uiconfig/ui/spelloptionsdialog.ui @@ -17,6 +17,23 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> + <child> + <object class="GtkBox" id="content"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="pack_type">begin</property> + <property name="position">0</property> + </packing> + </child> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="can_focus">False</property> @@ -74,9 +91,6 @@ <property name="position">0</property> </packing> </child> - <child> - <placeholder/> - </child> </object> </child> <action-widgets> diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index b753569efce6..64b36cf31859 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -107,6 +107,10 @@ public: const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"), const OString& rID = OString("SingleTabDialog")); + SfxSingleTabDialogController(weld::Widget* pParent, const SfxItemSet* pOptionsSet, + const OString& rContainerId, const OUString& rUIXMLDescription, + const OString& rID); + weld::Container* get_content_area() { return m_xContainer.get(); } virtual ~SfxSingleTabDialogController() override; diff --git a/sc/qa/uitest/calc_tests8/tdf125051.py b/sc/qa/uitest/calc_tests8/tdf125051.py index 5b8ccd15bb03..89314b2690e9 100644 --- a/sc/qa/uitest/calc_tests8/tdf125051.py +++ b/sc/qa/uitest/calc_tests8/tdf125051.py @@ -28,8 +28,7 @@ class tdf125051(UITestCase): #open options optionsBtn = xDialog.getChild("options") - with self.ui_test.execute_blocking_action(optionsBtn.executeAction, args=('CLICK', ()), close_button="cancel"): - pass + self.ui_test.execute_dialog_through_action(optionsBtn, "CLICK", None, "DialogExecute", "cancel") closeBtn = xDialog.getChild("close") #close Spelling dialog self.ui_test.close_dialog_through_button(closeBtn) diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index ab976093025a..297dbe524acb 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -233,6 +233,17 @@ SfxSingleTabDialogController::SfxSingleTabDialogController(weld::Widget *pParent m_xOKBtn->connect_clicked(LINK(this, SfxSingleTabDialogController, OKHdl_Impl)); } +SfxSingleTabDialogController::SfxSingleTabDialogController(weld::Widget *pParent, const SfxItemSet* pSet, + const OString& rContainerId, const OUString& rUIXMLDescription, const OString& rID) + : SfxOkDialogController(pParent, rUIXMLDescription, rID) + , m_pInputSet(pSet) + , m_xContainer(m_xBuilder->weld_container(rContainerId)) + , m_xOKBtn(m_xBuilder->weld_button("ok")) + , m_xHelpBtn(m_xBuilder->weld_button("help")) +{ + m_xOKBtn->connect_clicked(LINK(this, SfxSingleTabDialogController, OKHdl_Impl)); +} + SfxSingleTabDialogController::~SfxSingleTabDialogController() { }