cui/source/inc/cuitabarea.hxx | 2 +- cui/source/inc/optlingu.hxx | 4 ++-- cui/source/options/appearance.cxx | 14 +++++--------- cui/source/options/appearance.hxx | 4 ++-- cui/source/options/optlingu.cxx | 11 ++++++----- cui/source/tabpages/tpcolor.cxx | 9 ++++----- include/sfx2/AdditionsDialogHelper.hxx | 3 ++- sfx2/source/appl/appserv.cxx | 4 +--- 8 files changed, 23 insertions(+), 28 deletions(-)
New commits: commit cdb2e81947c06001b0682ec6be4b91e174720d43 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Oct 7 01:57:05 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Oct 7 08:27:30 2025 +0200 additions dialog: Set parent when run to install dicts This is similar to previous commit Change-Id: I480f5275f13c0908372e1a38ef64daca7a27cbfb Author: Michael Weghorn <[email protected]> Date: Tue Oct 7 01:29:23 2025 +0200 additions dialog: Set proper parent when run from area tab page , but now covers the case where the dialog is run to install new dictionaries. Sample scenario: * start Writer * "Tools" -> "Spelling" * press "Options" button * click on the "Get more dictionaries online..." link With this commit in place, the dialog now stays correctly modally on top of the dialog it was run from. Also use the helper in SfxApplication::OfaExec_Impl, which shouldn't cause any change in behavior, but simplifies and aligns it with the SID_ADDITIONS_DIALOG case above. Change-Id: Ib869d9048fd9fc2dbac9768c22e5c3085bcac044 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191993 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx index e41f1ce67cf0..fcc008deb356 100644 --- a/cui/source/inc/optlingu.hxx +++ b/cui/source/inc/optlingu.hxx @@ -60,7 +60,7 @@ class SvxEditModulesDlg : public weld::GenericDialogController DECL_LINK( BackHdl_Impl, weld::Button&, void ); DECL_LINK( LangSelectListBoxHdl_Impl, weld::ComboBox&, void ); DECL_LINK( BoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void ); - DECL_STATIC_LINK( SvxEditModulesDlg, OnLinkClick, weld::LinkButton&, bool); + DECL_LINK(OnLinkClick, weld::LinkButton&, bool); void LangSelectHdl_Impl(const SvxLanguageBox* pBox); public: @@ -126,7 +126,7 @@ private: DECL_LINK( ModulesBoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void ); DECL_LINK( DicsBoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void ); DECL_LINK( PostDblClickHdl_Impl, void *, void); - DECL_STATIC_LINK( SvxLinguTabPage, OnLinkClick, weld::LinkButton&, bool); + DECL_LINK(OnLinkClick, weld::LinkButton&, bool); void UpdateModulesBox_Impl(); void UpdateDicBox_Impl(); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index ee525f381267..2a34e669508c 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -29,11 +29,11 @@ #include <unotools/linguprops.hxx> #include <editeng/unolingu.hxx> #include <linguistic/misc.hxx> +#include <sfx2/AdditionsDialogHelper.hxx> #include <sfx2/sfxsids.hrc> #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/dispatchcommand.hxx> #include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/configuration/ReadWriteAccess.hpp> @@ -1545,9 +1545,10 @@ void SvxLinguTabPage::HideModulesGroup() } } -IMPL_STATIC_LINK_NOARG(SvxLinguTabPage, OnLinkClick, weld::LinkButton&, bool) +IMPL_LINK_NOARG(SvxLinguTabPage, OnLinkClick, weld::LinkButton&, bool) { - comphelper::dispatchCommand(u".uno:MoreDictionaries"_ustr, {}); + AdditionsDialogHelper::RunAdditionsDialog(GetDialogController()->getDialog(), + u"Dictionary"_ustr); return true; } @@ -2001,9 +2002,9 @@ IMPL_LINK_NOARG(SvxEditModulesDlg, BackHdl_Impl, weld::Button&, void) LangSelectHdl_Impl(nullptr); } -IMPL_STATIC_LINK_NOARG(SvxEditModulesDlg, OnLinkClick, weld::LinkButton&, bool) +IMPL_LINK_NOARG(SvxEditModulesDlg, OnLinkClick, weld::LinkButton&, bool) { - comphelper::dispatchCommand(u".uno:MoreDictionaries"_ustr, {}); + AdditionsDialogHelper::RunAdditionsDialog(getDialog(), u"Dictionary"_ustr); return true; } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 53c4c9e9f5cb..d51c0cdb374e 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1711,9 +1711,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) case SID_MORE_DICTIONARIES: { - uno::Sequence<beans::PropertyValue> aArgs{ comphelper::makePropertyValue( - u"AdditionsTag"_ustr, u"Dictionary"_ustr) }; - comphelper::dispatchCommand(u".uno:AdditionsDialog"_ustr, aArgs); + AdditionsDialogHelper::RunAdditionsDialog(rReq.GetFrameWeld(), u"Dictionary"_ustr); break; } #if HAVE_FEATURE_SCRIPTING commit 5c4af7ed83fc36029d408d641c2afcd395f7ac82 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Oct 7 01:41:30 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Oct 7 08:27:24 2025 +0200 additions dialog: Set proper parent when run from Options -> Appearance This is similar to previous commit Change-Id: I480f5275f13c0908372e1a38ef64daca7a27cbfb Author: Michael Weghorn <[email protected]> Date: Tue Oct 7 01:29:23 2025 +0200 additions dialog: Set proper parent when run from area tab page , but now covers the case where the dialog is run from "Tools" -> "Options" -> "LibreOfficDev" -> "Appearance", by clicking on one of the two buttons to install new themes or icons. With this in place, the dialog shows and stays on top of the options dialog as expected. Change-Id: I04f97c4496f4a87c48bae098dcbfe6864c7c637f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191992 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/cui/source/options/appearance.cxx b/cui/source/options/appearance.cxx index 80063c0a4237..ed46b387ebc9 100644 --- a/cui/source/options/appearance.cxx +++ b/cui/source/options/appearance.cxx @@ -13,13 +13,13 @@ #include <editeng/editids.hrc> #include <officecfg/Office/Common.hxx> #include <strings.hrc> +#include <sfx2/AdditionsDialogHelper.hxx> #include <svtools/colorcfg.hxx> #include <svtools/imgdef.hxx> #include <svtools/miscopt.hxx> #include <svtools/restartdialog.hxx> #include <vcl/svapp.hxx> #include <vcl/themecolors.hxx> -#include <comphelper/dispatchcommand.hxx> #include <comphelper/propertyvalue.hxx> #include <map> @@ -403,11 +403,9 @@ IMPL_LINK_NOARG(SvxAppearanceTabPage, SchemeListToggleHdl, weld::ComboBox&, void LoadSchemeList(); } -IMPL_STATIC_LINK_NOARG(SvxAppearanceTabPage, MoreThemesHdl, weld::Button&, void) +IMPL_LINK_NOARG(SvxAppearanceTabPage, MoreThemesHdl, weld::Button&, void) { - css::uno::Sequence<css::beans::PropertyValue> aArgs{ comphelper::makePropertyValue( - u"AdditionsTag"_ustr, u"Themes"_ustr) }; - comphelper::dispatchCommand(u".uno:AdditionsDialog"_ustr, aArgs); + AdditionsDialogHelper::RunAdditionsDialog(GetDialogController()->getDialog(), u"Themes"_ustr); } IMPL_LINK_NOARG(SvxAppearanceTabPage, ResetAllBtnHdl, weld::Button&, void) @@ -697,11 +695,9 @@ IMPL_LINK_NOARG(SvxAppearanceTabPage, OnNotebookbarIconSizeChange, weld::ComboBo } } -IMPL_STATIC_LINK_NOARG(SvxAppearanceTabPage, OnMoreIconsClick, weld::Button&, void) +IMPL_LINK_NOARG(SvxAppearanceTabPage, OnMoreIconsClick, weld::Button&, void) { - css::uno::Sequence<css::beans::PropertyValue> aArgs{ comphelper::makePropertyValue( - u"AdditionsTag"_ustr, u"Icons"_ustr) }; - comphelper::dispatchCommand(u".uno:AdditionsDialog"_ustr, aArgs); + AdditionsDialogHelper::RunAdditionsDialog(GetDialogController()->getDialog(), u"Icons"_ustr); } void SvxAppearanceTabPage::UpdateColorDropdown() diff --git a/cui/source/options/appearance.hxx b/cui/source/options/appearance.hxx index 25b2057c2cb5..15cf0df176a3 100644 --- a/cui/source/options/appearance.hxx +++ b/cui/source/options/appearance.hxx @@ -60,7 +60,7 @@ private: DECL_LINK(UseOnlyWhiteDocBackgroundHdl, weld::Toggleable&, void); DECL_LINK(SchemeChangeHdl, weld::ComboBox&, void); DECL_LINK(SchemeListToggleHdl, weld::ComboBox&, void); - DECL_STATIC_LINK(SvxAppearanceTabPage, MoreThemesHdl, weld::Button&, void); + DECL_LINK(MoreThemesHdl, weld::Button&, void); DECL_LINK(ResetAllBtnHdl, weld::Button&, void); DECL_LINK(BitmapDropDownHdl, weld::ComboBox&, void); @@ -68,7 +68,7 @@ private: DECL_LINK(UseBmpForAppBackHdl, weld::Toggleable&, void); DECL_LINK(OnIconThemeChange, weld::ComboBox&, void); - DECL_STATIC_LINK(SvxAppearanceTabPage, OnMoreIconsClick, weld::Button&, void); + DECL_LINK(OnMoreIconsClick, weld::Button&, void); DECL_LINK(OnToolbarIconSizeChange, weld::ComboBox&, void); DECL_LINK(OnSidebarIconSizeChange, weld::ComboBox&, void); DECL_LINK(OnNotebookbarIconSizeChange, weld::ComboBox&, void); commit f4df9c4e05bec7555858d211e8b94ebf06cc5366 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Oct 7 01:29:23 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Oct 7 08:27:17 2025 +0200 additions dialog: Set proper parent when run from area tab page Use the new helper introduced in previous commit Change-Id: I41c9d9d639bc6e9f523ed2eb74975e2e829836d9 Author: Michael Weghorn <[email protected]> Date: Tue Oct 7 01:19:03 2025 +0200 additions dialog: Extract sfx2 helper to run the dialog to run the additions dialog from the "Area" tab page. Specify the current dialog as the additions dialog parent, which ensures that the modal additions dialog stays on top of its parent dialog as expected for all of gtk3, gen and qt6, while that was not the case previously when using the approach of dispatching the ".uno:AdditionsDialog" command. The dialog can be triggered as follows: * start Writer * "Format" -> "Page Style" * in the "Area" tab, enable "Color" * click on the "Add color palettes via extension" button in the "Colors" section to open the dialog Similar cases still dispatching the UNO command exist elsewhere and should be looked into separately. Change-Id: I480f5275f13c0908372e1a38ef64daca7a27cbfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191991 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 7db9826360e1..bb7e897846db 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -731,7 +731,7 @@ private: DECL_LINK(ClickAddHdl_Impl, weld::Button&, void); DECL_LINK(ClickWorkOnHdl_Impl, weld::Button&, void); DECL_LINK(ClickDeleteHdl_Impl, weld::Button&, void); - DECL_STATIC_LINK(SvxColorTabPage, OnMoreColorsClick, weld::Button&, void); + DECL_LINK(OnMoreColorsClick, weld::Button&, void); DECL_LINK(SelectPaletteLBHdl, weld::ComboBox&, void); DECL_LINK( SelectValSetHdl_Impl, ValueSet*, void ); diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 867a199159e5..7f00956e1844 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -31,6 +31,7 @@ #include <svx/svxdlg.hxx> #include <dialmgr.hxx> #include <cuitabline.hxx> +#include <sfx2/AdditionsDialogHelper.hxx> #include <svx/dialmgr.hxx> #include <svx/strings.hrc> #include <officecfg/Office/Common.hxx> @@ -568,12 +569,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModeHdl_Impl, weld::Toggleable&, voi UpdateColorValues(); } - -IMPL_STATIC_LINK_NOARG(SvxColorTabPage, OnMoreColorsClick, weld::Button&, void) +IMPL_LINK_NOARG(SvxColorTabPage, OnMoreColorsClick, weld::Button&, void) { - css::uno::Sequence<css::beans::PropertyValue> aArgs{ comphelper::makePropertyValue( - u"AdditionsTag"_ustr, u"Color Palette"_ustr) }; - comphelper::dispatchCommand(u".uno:AdditionsDialog"_ustr, aArgs); + AdditionsDialogHelper::RunAdditionsDialog(GetDialogController()->getDialog(), + u"Color Palette"_ustr); } void SvxColorTabPage::ChangeColor(const NamedColor &rNewColor, bool bUpdatePreset ) diff --git a/include/sfx2/AdditionsDialogHelper.hxx b/include/sfx2/AdditionsDialogHelper.hxx index b29ed8b14009..f8435c8eef43 100644 --- a/include/sfx2/AdditionsDialogHelper.hxx +++ b/include/sfx2/AdditionsDialogHelper.hxx @@ -9,9 +9,10 @@ #pragma once +#include <sfx2/dllapi.h> #include <vcl/weld.hxx> -class AdditionsDialogHelper +class SFX2_DLLPUBLIC AdditionsDialogHelper { public: AdditionsDialogHelper() = delete;
