Week #4 - GSoC 2023 Weekly Report - Search Field in Options
Thanks to my ‘Search Field in Options’ project mentors Andreas Heinisch and Heiko Tietze for their time and guidance. Additionally, thanks to Caolán McNamara for giving me the ‘generating ui strings at build-time’ idea.
I added new python script called ./solenv/bin/uiex_options to extract strings(labels, accessible-names, accessible-descriptions and tooltip-texts) from ui files. This script is almost the same with ./solenv/bin/uiex. The only difference is the new script extracts only entry.msgid which contains the strings we need. Any other outputs like entry.msgctxt is not needed so I kept only entry.msgid in the new script.
Allow use of OpenCL
OpenCL is available for use.
OpenCL is not used.
OpenCL Options
Extraction at build-time
Added all ui files that belong to Options dialog, inside cui/UIConfig_cui.mk file:
this calls gb_UIConfig_generate_options_uifiles function with cui/uiconfig/uioptions as first parameter and list of ui files as second parameter.
solenv/gbuild/UIConfig.mk:
Extracted file location
All extracted files located in cui/uiconfig/uioptions/*.
cui/uiconfig/uioptions/cui/* for ui files in ./cui/uiconfig/ui/*.ui
cui/uiconfig/uioptions/sc/* for ui files in ./sc/uiconfig/scalc/ui/*.ui
cui/uiconfig/uioptions/sd/* for ui files in ./sd/uiconfig/simpress/ui/*.ui
cui/uiconfig/uioptions/sfx2/* for ui files in ./sfx2/uiconfig/ui/*.ui
cui/uiconfig/uioptions/starmath/* for ui files in ./starmath/uiconfig/smath/ui/*.ui
cui/uiconfig/uioptions/svx/* for ui files in ./svx/uiconfig/ui/*.ui
cui/uiconfig/uioptions/sw/* for ui files in ./sw/uiconfig/ui/*.ui
and all of sub-directories contain a README.md file.
e.g. cui/uiconfig/uioptions/sfx2/README.md:
This directory contains txt files that extracted form build-time. All files contains labels, accessible-names, accessible-descriptions and tooltip-texts from all ./sfx2/uiconfig/ui/*.ui files that exist in Tools-Options dialog.
All .txt file names is the same as their .ui names.
e.g.: optprintpage.txt has strings from ./sfx2/uiconfig/ui/optprintpage.ui
Created new class to fetch the extracted strings and use them in searching.
Vector std::vector< OptionsPageIdInfo* > m_aTreePageIds contains all informatin related to extracted strings.
Added new cxx file cui/source/options/treeopthelper.cxx
This file contains the file path of extracted strings with thair page-id and strings.
The function storeStringsFromUiFile(sal_uInt16 nPageId) reads the data inside txt files and fetch them into PageIdToFileNameMap_Impl struct as rEntry.m_sContent += sLine + " ";
The function getAllStringsFrom(sal_uInt16 nPageId) gets the strings from the given pageId:
Some screenshots from the development
Summary
Strings in ui files are now can be generated at build-time.
labels, accessible-names, accessible-descriptions and tooltip-texts from all ui files that resides inside Options dialog, are now included in searching.
***
Steps for implementing search functionality in “Tools > Options”:
1) Add Search field to “Tools > Options” dialog.
DONE - week #1
2) Include Options treeview into searching.
DONE - week #1
3) Include Sub-tree elements (child nodes) into searching.
DONE - week #2
4) Generate all strings(labels), accessible-names, accessible-descriptions and tooltip-texts of all .ui files in ./cui/* directory, at build-time.
DONE - week #3, #4 (most challenging part)
5) Fetch the generated data - at run-time.
DONE - week #3, #4
6) Include strings(labels), accessible-names, accessible-descriptions and tooltip-texts into searching.