[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - cui/source vcl/jsdialog

2023-03-21 Thread Szymon Kłos (via logerrit)
 cui/source/dialogs/SpellDialog.cxx |   30 +++---
 cui/source/inc/SpellDialog.hxx |1 +
 vcl/jsdialog/enabled.cxx   |2 ++
 3 files changed, 22 insertions(+), 11 deletions(-)

New commits:
commit ac46f272a4946a8f18a89ba08fa376a3e879b276
Author: Szymon Kłos 
AuthorDate: Tue Mar 21 09:51:31 2023 +0100
Commit: Szymon Kłos 
CommitDate: Tue Mar 21 12:37:17 2023 +

jsdialog: enable spelling options dialog

and make it async

Change-Id: Idbf8661aa106d69e60ab6037052fd3d6dec28c06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149205
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index f443aa4f..34564c712ee7 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -225,6 +225,12 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* 
pChildWindow,
 
 SpellDialog::~SpellDialog()
 {
+if (m_xOptionsDlg)
+{
+m_xOptionsDlg->response(RET_CANCEL);
+m_xOptionsDlg.reset();
+}
+
 if (m_pInitHdlEvent)
 Application::RemoveUserEvent(m_pInitHdlEvent);
 if (pImpl)
@@ -462,19 +468,21 @@ IMPL_LINK_NOARG(SpellDialog, CheckGrammarHdl, 
weld::Toggleable&, void)
 
 void SpellDialog::StartSpellOptDlg_Impl()
 {
-SfxItemSetFixed aSet( 
SfxGetpApp()->GetPool() );
-SfxSingleTabDialogController aDlg(m_xDialog.get(), , 
"cui/ui/spelloptionsdialog.ui", "SpellOptionsDialog");
+auto xSet = 
std::make_shared>( 
SfxGetpApp()->GetPool() );
+m_xOptionsDlg = 
std::make_shared(m_xDialog.get(), xSet.get(), 
"cui/ui/spelloptionsdialog.ui", "SpellOptionsDialog");
 
-std::unique_ptr xPage = 
SvxLinguTabPage::Create(aDlg.get_content_area(), , );
+std::unique_ptr xPage = 
SvxLinguTabPage::Create(m_xOptionsDlg->get_content_area(), m_xOptionsDlg.get(), 
xSet.get());
 static_cast(xPage.get())->HideGroups( GROUP_MODULES );
-aDlg.SetTabPage(std::move(xPage));
-if (RET_OK == aDlg.run())
-{
-InitUserDicts();
-const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
-if(pOutSet)
-OfaTreeOptionsDialog::ApplyLanguageOptions(*pOutSet);
-}
+m_xOptionsDlg->SetTabPage(std::move(xPage));
+weld::GenericDialogController::runAsync(m_xOptionsDlg, [this, xSet] 
(sal_uInt32 nResult) {
+if (RET_OK == nResult)
+{
+InitUserDicts();
+const SfxItemSet* pOutSet = m_xOptionsDlg->GetOutputItemSet();
+if(pOutSet)
+OfaTreeOptionsDialog::ApplyLanguageOptions(*pOutSet);
+}
+});
 }
 
 namespace
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 3c6a7b229ebb..a7e6cd398e2f 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -165,6 +165,7 @@ private:
 std::unique_ptr m_xClosePB;
 std::unique_ptr m_xToolbar;
 std::unique_ptr m_xSentenceEDWeld;
+std::shared_ptr m_xOptionsDlg;
 
 DECL_LINK(ChangeHdl, weld::Button&, void);
 DECL_LINK(DoubleClickChangeHdl, weld::TreeView&, bool);
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 4e5c79c1bf9b..935a81ba6e6d 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -44,6 +44,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"cui/ui/imagetabpage.ui"
 || rUIFile == u"cui/ui/macroselectordialog.ui"
 || rUIFile == u"cui/ui/numberingformatpage.ui"
+|| rUIFile == u"cui/ui/optlingupage.ui"
 || rUIFile == u"cui/ui/pageformatpage.ui"
 || rUIFile == u"cui/ui/paragalignpage.ui"
 || rUIFile == u"cui/ui/paraindentspacing.ui"
@@ -56,6 +57,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"cui/ui/similaritysearchdialog.ui"
 || rUIFile == u"cui/ui/specialcharacters.ui"
 || rUIFile == u"cui/ui/spellingdialog.ui"
+|| rUIFile == u"cui/ui/spelloptionsdialog.ui"
 || rUIFile == u"cui/ui/splitcellsdialog.ui"
 || rUIFile == u"cui/ui/textflowpage.ui"
 || rUIFile == u"cui/ui/transparencytabpage.ui"


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - cui/source vcl/jsdialog

2023-01-31 Thread Hannah Meeks (via logerrit)
 cui/source/dialogs/cuifmsearch.cxx |9 +++--
 vcl/jsdialog/enabled.cxx   |1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit a883f757573182c4f81625abc178edab2b4adf66
Author: Hannah Meeks 
AuthorDate: Wed Jan 25 11:07:28 2023 +
Commit: Michael Meeks 
CommitDate: Tue Jan 31 14:49:16 2023 +

cui: Make SimilaritySearch dialog async and enable use for jsdialog

Change-Id: I89c6665138c94aa355efbbc4aa0947226c68af5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146326
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/cui/source/dialogs/cuifmsearch.cxx 
b/cui/source/dialogs/cuifmsearch.cxx
index f1af2838c4b8..bb3bfaf5cac5 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -312,15 +312,20 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, 
weld::Button&, rButton, void
 if (m_ppbApproxSettings.get() == )
 {
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-ScopedVclPtr 
pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), 
m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(),
+
+VclPtr 
pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), 
m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(),
 m_pSearchEngine->GetLevShorter(), 
m_pSearchEngine->GetLevLonger() ));
-if (pDlg->Execute() == RET_OK)
+pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){
+
+if (nResult == RET_OK)
 {
 m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() );
 m_pSearchEngine->SetLevOther( pDlg->GetOther() );
 m_pSearchEngine->SetLevShorter(pDlg->GetShorter() );
 m_pSearchEngine->SetLevLonger( pDlg->GetLonger() );
 }
+pDlg->disposeOnce();
+});
 }
 else if (m_pSoundsLikeCJKSettings.get() == )
 {
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index e0791954d5f8..c11365d6dcbc 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -39,6 +39,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"cui/ui/numberingformatpage.ui"
 || rUIFile == u"cui/ui/password.ui"
 || rUIFile == u"cui/ui/splitcellsdialog.ui"
+|| rUIFile == u"cui/ui/similaritysearchdialog.ui"
 || rUIFile == u"cui/ui/widgettestdialog.ui"
 // scalc
 || rUIFile == u"modules/scalc/ui/analysisofvariancedialog.ui"