diff options
author | Muhammet Kara <muhammet.kara@pardus.org.tr> | 2017-08-18 16:22:31 +0300 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-09-04 22:39:46 +0200 |
commit | 0114ef64fc357a0faa8b32cb1e79c0ed789d0de4 (patch) | |
tree | 8a213e35cac2c0606bfc4af16022be11bab692af /cui/source/inc | |
parent | 60d622d807f4f3bcc8a699458adf5d6690f9dc4b (diff) |
Implement Search/Filter feature in the Customize dialog
Now commands in the list (left box) are filtered/updated
in the Menu, Context Menu, and the Toolbar tabs as you type.
Instead of filling the box, and then removing non-matching
items (as in the current search feature in the keyboard tab),
we filter out items during the Fill process, and don't add them
to the sequence att all. This should give a performance boost
to the filter operations.
Change-Id: I473596a2c897f1cd96a7d55fd3ab11ee3db39863
Reviewed-on: https://gerrit.libreoffice.org/41321
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'cui/source/inc')
-rw-r--r-- | cui/source/inc/CommandCategoryListBox.hxx | 10 | ||||
-rw-r--r-- | cui/source/inc/cfg.hxx | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/cui/source/inc/CommandCategoryListBox.hxx b/cui/source/inc/CommandCategoryListBox.hxx index 5afc4ce798d8..a3480af6ae48 100644 --- a/cui/source/inc/CommandCategoryListBox.hxx +++ b/cui/source/inc/CommandCategoryListBox.hxx @@ -20,6 +20,7 @@ #define INCLUDED_CUI_SOURCE_INC_COMMANDCATEGORYLISTBOX_HXX #include <vcl/lstbox.hxx> +#include <i18nutil/searchopt.hxx> #include "cfgutil.hxx" class CommandCategoryListBox : public ListBox @@ -32,6 +33,9 @@ class CommandCategoryListBox : public ListBox css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo; css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription; + // For search + i18nutil::SearchOptions2 m_searchOptions; + public: CommandCategoryListBox( vcl::Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN ); virtual ~CommandCategoryListBox() override; @@ -44,7 +48,8 @@ public: const OUString& sModuleLongName); void FillFunctionsList( const css::uno::Sequence< css::frame::DispatchInformation >& xCommands, - const VclPtr<SfxConfigFunctionListBox>& pFunctionListBox); + const VclPtr<SfxConfigFunctionListBox>& pFunctionListBox, + const OUString& filterTerm = OUString() ); OUString MapCommand2UIName(const OUString& sCommand); /** @@ -52,7 +57,8 @@ public: And updates the functions list box to include the commands in the selected category. */ - void categorySelected( const VclPtr<SfxConfigFunctionListBox>& pFunctionListBox ); + void categorySelected( const VclPtr<SfxConfigFunctionListBox>& pFunctionListBox, + const OUString& filterTerm = OUString() ); }; #endif // INCLUDED_CUI_SOURCE_INC_COMMANDCATEGORYLISTBOX_HXX diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index f05d8fa74d5c..f951acc8a137 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -379,11 +379,13 @@ private: DECL_LINK( SelectSaveInLocation, ListBox&, void ); DECL_LINK( AsyncInfoMsg, void*, void ); + DECL_LINK( SearchUpdateHdl, Edit&, void ); protected: // Left side of the dialog where command categories and the available // commands in them are displayed as a searchable list + VclPtr<Edit> m_pSearchEdit; VclPtr<CommandCategoryListBox> m_pCommandCategoryListBox; VclPtr<SfxConfigFunctionListBox> m_pFunctions; |