diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2020-10-13 18:10:55 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2020-10-14 19:43:02 +0200 |
commit | 13838d4cc83dd69c5b1679eb62ee36ba3237f6b2 (patch) | |
tree | 58191f1c6547d18c9e183a5220ee7cf9b80b501a /svx/source | |
parent | de6d4759b3e222b1ccb608d2be51c9476b2ee281 (diff) |
Resolves tdf#137447 - Access galleries via tight extensions
Button and code added to galbrws1
Change-Id: Ic599cc32980f9a3ee297891f80cefe478c28c302
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104248
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/gallery2/galbrws1.cxx | 15 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws1.hxx | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 3ac8bd8ff46b..6cf14753e524 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -38,7 +38,8 @@ #include <svx/strings.hrc> #include <algorithm> #include <svx/dialmgr.hxx> - +#include <comphelper/dispatchcommand.hxx> +#include <com/sun/star/beans/PropertyValue.hpp> #include <svx/svxdlg.hxx> #include <memory> #include <bitmaps.hlst> @@ -52,6 +53,7 @@ GalleryBrowser1::GalleryBrowser1( : mxNewTheme(rBuilder.weld_button("insert")), mxThemes(rBuilder.weld_tree_view("themelist")), + mxMoreGalleries(rBuilder.weld_button("btnMoreGalleries")), mpGallery ( pGallery ), mpExchangeData ( new ExchangeData ), aImgNormal ( RID_SVXBMP_THEME_NORMAL ), @@ -69,6 +71,9 @@ GalleryBrowser1::GalleryBrowser1( mxThemes->connect_key_press(LINK(this, GalleryBrowser1, KeyInputHdl)); mxThemes->set_size_request(-1, mxThemes->get_height_rows(6)); + mxMoreGalleries->set_from_icon_name("cmd/sc_additionsdialog.png"); + mxMoreGalleries->connect_clicked(LINK(this, GalleryBrowser1, OnMoreGalleriesClick)); + // disable creation of new themes if a writable directory is not available if( mpGallery->GetUserURL().GetProtocol() == INetProtocol::NotValid ) mxNewTheme->set_sensitive(false); @@ -367,6 +372,14 @@ void GalleryBrowser1::Notify( SfxBroadcaster&, const SfxHint& rHint ) } } +IMPL_STATIC_LINK_NOARG( GalleryBrowser1, OnMoreGalleriesClick, weld::Button&, void) +{ + css::uno::Sequence<css::beans::PropertyValue> aArgs(1); + aArgs[0].Name = "AdditionsTag"; + aArgs[0].Value <<= OUString("Gallery"); + comphelper::dispatchCommand(".uno:AdditionsDialog", aArgs); +} + IMPL_LINK(GalleryBrowser1, KeyInputHdl, const KeyEvent&, rKEvt, bool) { bool bRet = false; diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx index 835a0db4ec9a..222237a72a74 100644 --- a/svx/source/gallery2/galbrws1.hxx +++ b/svx/source/gallery2/galbrws1.hxx @@ -45,6 +45,7 @@ private: std::unique_ptr<weld::Button> mxNewTheme; std::unique_ptr<weld::TreeView> mxThemes; + std::unique_ptr<weld::Button> mxMoreGalleries; Gallery* mpGallery; std::unique_ptr<ExchangeData> mpExchangeData; std::unique_ptr<SfxItemSet> mpThemePropsDlgItemSet; @@ -71,6 +72,7 @@ private: DECL_LINK( SelectThemeHdl, weld::TreeView&, void ); DECL_LINK( PopupMenuHdl, const CommandEvent&, bool ); DECL_LINK( KeyInputHdl, const KeyEvent&, bool ); + DECL_STATIC_LINK( GalleryBrowser1, OnMoreGalleriesClick, weld::Button&, void ); public: |