┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search/dolphinsearchbox.h
AgeCommit message (Collapse)Author
2025-04-07Rewrite search integrationFelix Ernst
This huge commit is a nearly complete rewrite of the Dolphin search code. It implements most of the improved Dolphin search UI/UX as designed and discussed in a collaborative effort by Kristen McWilliam, Jin Liu, Andy Betts, Tagwerk, a few others and me. See https://invent.kde.org/system/dolphin/-/issues/46. # Notable changes - A toggle to change the search tool is provided as most contributors deemed that useful in https://invent.kde.org/system/dolphin/-/merge_requests/642#note_985112. - The default search is changed to filenamesearch for maximum reliability. - Removing all search parameters will take users back to the view state prior to starting a search instead of keeping the search results open. - The UI for choosing file types or modification dates has been made more powerful with more granularity and more options. - Most search parameters can be configured from a popup menu which gives us extra space for extra clarity. - Labels and help buttons as well as hyperlinks to settings makes sure the user always knows why some search parameters are unavailable in some contexts. - Chips show important search parameters while the popup is closed. They allow quickly removing filters. - The titles of the search and the input field placeholder message change to make clear whether file names or file contents are searched. - When the user actively switches the search tool, whether content should be searched, or whether to search everywhere, this is preserved for the initial state of the search bar when the user opens it the next time after restarting Dolphin. # Architecture - The new DolphinQuery class is independent of the UI and contains all search parameters modifiable in Dolphin as easy setters and getters. - DolphinQuery objects are also used to update the states of every component in the search UI. There is now a clear separation of UI and search configuration/DolphinQuery. - DolphinQuery is responsible for exporting to and importing from search URLs. - The search UI always reflects the currently configured DolphinQuery no matter if the user changed the UI to change the DolphinQuery or loaded a DolphinQuery/older search URL which then is reflected in the UI. - I tried to simplify all classes and their interaction between each other as much as possible. - I added some tests BUG: 386754 CCBUG: 435119 CCBUG: 458761 BUG: 446387 BUG: 470136 CCBUG: 471556 CCBUG: 475439 CCBUG: 477969 BUG: 480001 BUG: 483578 BUG: 488047 BUG: 488845 BUG: 500103 FIXED-IN: 25.08
2024-03-13Animate most of the barsFelix Ernst
When a bar is toggled visible this usually happens because the user might want to use its functionality now. However, if bars appear without animation or at a location the user is not currently looking at, they might not notice that they have appeared at all. An animation makes it more likely that the user notices the change and can then use the newly made visible component. Another reason for animations for showing or hiding of components is that it can be disorienting for users when panels or bars suddenly appear or disappear without animation. There is no visible movement then, so the user might not know what happened if they didn't concentrate or blink at that moment. The newly appearing or disappearing component might also displace other components which can make it difficult to find what one was just looking at. These bars animate now after this change: - Search panel - Filter bar - Status bar This is implemented by extracting the animation code from SelectionMode::TopBar into a new abstract base class AnimatedHeightWidget. This class is now also used in SelectionMode::BottomBar and the animating code there was removed. These bars are left in Dolphin that stay without animation: - Menu bar (Would probably need to be implemented in KXmlGui) - Tool bar (Would probably need to be implemented in KXmlGui) - Tab bar (Needs a different appraoch because it already inherits QTabBar and therefore can not inherit AnimatedHeightWidget)
2023-11-08Port away from KMoreToolsNicolas Fella
The idea behind KMoreTools was to point the user at external tools for a given job. It provides a rather complex framework for that, including suggesting not-yet-installed tools. The UX behind that isn't great though, which somewhat deep menu hierarchies and a somewhat arbitrary list of tools. Most KDE apps have moved away from it, with only Dolphin remaining. Instead provide direct integration with relevant KDE tools (Filelight, KDiskFree, KFind)
2023-09-04Restore the URL when DolphinSearchBox is clearedAmol Godbole
Currently, the URL navigator is not updated when the search box is cleared. This MR restores the URL, by closing and reopening the box. The call for emitting closeRequest() on pressing Esc has been replaced with emitCloseRequest(). The wait duration before starting a search has been reduced to 500ms to increase responsiveness. Also, the bugfix for BUG: 423328 is slightly incorrect and causes the search term to not be displayed when opening a saved search for the first time. As a better solution for this bug, DolphinSearchBox::setText() now updates the text only if the text has changed. BUG: 473775
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2021-02-09Build with QT_NO_KEYWORDSNicolas Fella
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2020-05-03filenamesearch:/ define a title for the queryMéven Car
Summary: CCBUG: 420354 Reviewers: ngraham, elvisangelaccio, #dolphin, #frameworks, iasensio Reviewed By: elvisangelaccio, #dolphin, iasensio Subscribers: iasensio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D29198
2020-04-18Move from the searchbox to the results with the down arrow keyShlomi Fish
Summary: Move from the searchbox to the search results listbox/view using the down arrow key in addition to the existing methods using the tab key, return key, or the mouse. Test Plan: use ctrl+f to search in a directory tree, press down arrow key to go to the results Reviewers: ngraham, #dolphin Reviewed By: ngraham, #dolphin Subscribers: meven, elvisangelaccio, ngraham, iasensio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D26362
2019-11-13refactor(search): De-couple baloo URL parsing logic from UIIsmael Asensio
Summary: Extracts the logic that parses `baloosearch:` urls into a new model class. The parser logic itself is kept as is. The search box UI is later updated using the model fields. This refactor has been proposed by @bruns in the review of D24422, as it largely simplifies the unit tests and further expansion/improvements. Test Plan: No behavior changes. Test case is added in the follow-up revision: D25258 Reviewers: #dolphin, elvisangelaccio, bruns Reviewed By: #dolphin, elvisangelaccio, bruns Subscribers: ngraham, bruns, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25257
2019-11-03Get rid of search "More Options" toggle buttonIsmael Asensio
Summary: With the new compact search filters (type/date/rating) it makes sense to show these options whenever available, and save some horizontal space on the main bar (specially for verbose languages). These options will be hidden nevertheless if the search is non-indexed or Baloo is disabled. For some nicer aesthetics D25029 should be also applied. CCBUG: 386754 Test Plan: Current: {F7681182} After: {F7687380} Along with D25029: {F7687385} Reviewers: elvisangelaccio, ngraham, #dolphin, #vdg Reviewed By: ngraham, #vdg Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25057
2019-10-20[dolphin/search] Fix search behavior when selecting "Your Files"Ismael Asensio
Summary: Fix the search box forgetting the location where the user was previously searching into. To do a search on "All Files" instead of setting the `m_searchPath` to `$HOME`, it checks the button state, so the "From Here" location is not lost. As an added benefit, selecting "Your Files" when in a non-indexed folder will use the baloo search instead of a fully non-indexed search from $HOME. This issue is the last remaining one of the series started with D24422, with the purpose of fixing the searchbox parsing and update. Test Plan: - Toggle between "From Here/Your Files" and navigate between locations - The search box remembers the location and keeps a coherent state {F7575402} Reviewers: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24577
2019-10-13Hide search extra options when not availableIsmael Asensio
Summary: Hide the search extra options when they are not available, because the current location is not indexed or Baloo is not enabled. The button is disabled and shows a tooltip to provide feedback of why it's not available. Depends on D24478 {F7531893} CCBUG: 396898 FEATURE: 318580 FEATURE: 408680 FIXED-IN: 19.11.80 Test Plan: - `Ctrl-F` on a non-indexed location - `balooctl disable` and `Ctrl-F` on an indexed location On both cases the extra options are not shown, the button is disabled and the reason is shown in the tooltip The user selection is remembered between indexed locations. Reviewers: #dolphin, elvisangelaccio, meven, ngraham Reviewed By: meven Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24446
2019-10-08[dolphin/search] Add method isIndexEnabled()Ismael Asensio
Summary: Extracts the logic for checking if the current path is indexed to its own method. Test Plan: No behavior changes Reviewers: elvisangelaccio, ngraham, meven Reviewed By: ngraham, meven Subscribers: meven, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24478
2019-04-22Use placeholder for search actionCarl Schwan
Summary: See https://hig.kde.org/style/writing/placeholder.html Screenshot: Old: {F6691712} New: {F6698685} Test Plan: Compile and run Reviewers: #dolphin, #vdg, ngraham, elvisangelaccio Reviewed By: #dolphin, #vdg, ngraham Subscribers: GB_2, kde-doc-english, elvisangelaccio, ngraham, yurchor, kfm-devel Tags: #dolphin, #documentation Maniphest Tasks: T10258 Differential Revision: https://phabricator.kde.org/D19770
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-20Modernize: Use override where possibleKevin Funk
Also use override instead of Q_DECL_OVERRIDE
2017-11-01Make Saved Search feature discoverableNathaniel Graham
Summary: FEATURE: 269332 Make Dolphin's Saved Search feature discoverable by adding a button inside the search field. The button only becomes enabled when there is a valid search term. When pushed, it saves the search to the Places panel, providing a visible-by-default way to do this to complement the existing implementation that is only visible in the context menu. Also harmonized the label text so that it's consistent no matter how you create a saved search (button or context menu) Test Plan: Tested in KDE Neon. Works great: {F5449508} Reviewers: #dolphin, broulik, dfaure, markg, emateli, elvisangelaccio Reviewed By: #dolphin, markg, emateli, elvisangelaccio Subscribers: anthonyfieroni, markg, emateli, elvisangelaccio, cfeck, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D8454
2017-01-21DolphinSearchBox: Add a "More search tools..." menu buttonGregor Mi
Additionally, moves the "More/Fewer options" button from right to left to reduce the mouse travelling distance when the dolphin is maximized on a large screen (see screenshots) The current location url will be passed to the search tool to set the initial search root directory. REVIEW: 123883
2017-01-01[DolphinSearchBox] Stop search timer on hideAnthony Fieroni
REVIEW: 129705 Signed-off-by: Anthony Fieroni <[email protected]>
2015-02-26Revert "Use the Baloo Query Builder widget to add syntax-highlighting in ↵Emmanuel Pescosta
Dolphin search" The natural query parser is too unstable for the release atm, we'll readd the query parser when the code is mature enough. This reverts commit e3578ee3b770a1b8f359ed1a3cc6e3ac7f6c700e.
2014-11-11Fixed build error which was introduced by commit ↵Emmanuel Pescosta
7ed7cd97d084364d8ee61b35f5ffa3630c5277a4 CCMAIL: [email protected]
2014-11-03Q_DECL_OVERRIDELukáš Tinkl
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
2014-10-18Fix includesMontel Laurent
2014-09-10Use the Baloo Query Builder widget to add syntax-highlighting in Dolphin searchDenis Steckelmacher
REVIEW: 112589
2014-03-28When you open a new tab while the search mode is enabled, theEmmanuel Pescosta
newly opened tab also starts the same search (Because new tab is opened with the current view url), but the search box is in read-only mode. So you cannot close the search bar nor edit the search text. This patch fixes this by parsing the search url. The value of the "search" parameter is used as search text and the value of the "url" parameter is used for the search path ("root" folder for the search when "Search from here" mode is enabled). In case of Baloo search urls, we use Baloo::Query::fromSearchUrl. Removed everything related to read only mode in DolphinSearchBox, not needed anymore. REVIEW: 111968 BUG: 311950 FIXED-IN: 4.13.0
2014-02-06Port Dolphin to BalooVishesh Handa
Nepomuk is being replaced with Baloo
2013-09-05Fix Bug 296970 - split view wrong behavior with search tabEmmanuel Pescosta
Implemented setActive(bool active), isActive() and activated() signal for DolphinSearchBox - similar to the KUrlNavigator implementation. BUG: 296970 FIXED-IN: 4.11.2 REVIEW: 112534
2012-09-06Make the button that enables additional search options more obviousFrank Reininghaus
This is achieved by adding some descriptive text and by using a more appropriate icon. Thanks to Panos Kanavos for the patch! BUG: 300248 FIXED-IN: 4.10.0 REVIEW: 106325
2012-05-10Reimplement search-filtersPeter Penz
BUG: 270721 BUG: 280377 FIXED-IN: 4.9.0
2012-04-25Fix search-UI issues in combination with the new places entriesPeter Penz
The places-entries for searching revealed some serious issues in combination with the search-panel. Move the filtering away from QDockWidget and bring it back below the search-bar.
2011-07-07Use QToolButtons instead of QPushButtons for the searchbarPeter Penz
Thanks to Hugo Pereira Da Costa for the patch. BUG: 277227 FIXED-IN: 4.7.0
2011-04-20Search improvementsPeter Penz
Use Query::titleFromQueryUrl() to give a hint what kind of information is shown to the user.
2011-04-20Improve usability of Search PanelPeter Penz
If the Search Panel is shown outside the context of the "Find" mode it will be always enabled and does a global search. Only if the user is in the "Find" mode and the searching is restricted to the current directory the Search Panel might get disabled if the current directory is not indexed. This solves the major usability issue that it was not clear for the users whether a global or restricted search is done.
2011-02-05Provide a hook for externally triggered search queriesPeter Penz
In this case the "From Here"/"Everywhere" buttons and the "Filename"/"Content" buttons are useless. Currently they just get disabled but the plan is to provide a better visual indication of the current query and to remove them completely.
2011-02-04Add unittest for DolphinSearchBoxPeter Penz
A minor API cleanup in DolphinSearchBox has been done related to the test.
2011-02-04Don't clear the search-text when switching between tabsPeter Penz
The clearing of the search-text should only be done when opening the search-box.
2011-02-04Use capitalized KDE includesPeter Penz
2011-02-02Fix visibility- and enabled-issues for the filter-panelPeter Penz
The filter-panel should be disabled if the current folder is not indexed at all. Also when triggering a "Find" the filter-panel should stay invisible per default when the current folder is not indexed. CCBUG: 264969
2011-01-22SVN_SILENT: Coding style updatesPeter Penz
svn path=/trunk/KDE/kdebase/apps/; revision=1216293
2010-12-19Select the whole text in the filterbar and searchbox if the widget has lost ↵Peter Penz
the focus and gets focused again by the shortcut (this behavior is consistent to e.g. the behavior in Kate). CCBUG: 256160 svn path=/trunk/KDE/kdebase/apps/; revision=1207719
2010-11-25Don't offer the "Search everywhere" option for non-local URLs.Peter Penz
svn path=/trunk/KDE/kdebase/apps/; revision=1200741
2010-11-11Remove the filter-button as it has been replaced by the Filter Panel.Peter Penz
svn path=/trunk/KDE/kdebase/apps/; revision=1195671
2010-10-27- Automatically show the filter-panel when a searching is donePeter Penz
- Remove filter-prototypes that conflict with the filterpanel svn path=/trunk/KDE/kdebase/apps/; revision=1190445
2010-10-10Automatically start the searching if the user did not change the search-text ↵Peter Penz
for at least a second. svn path=/trunk/KDE/kdebase/apps/; revision=1184510
2010-07-24Unify the search interface for non-indexed and indexed foldersPeter Penz
svn path=/trunk/KDE/kdebase/apps/; revision=1154073
2010-07-10Fix forward declationLaurent Montel
svn path=/trunk/KDE/kdebase/apps/; revision=1148408
2010-01-26Don't show the search options again, if the user closed them and cleared the ↵Peter Penz
search box. BUG: 218880 svn path=/trunk/KDE/kdebase/apps/; revision=1080372
2009-11-21* show only a minimized set of search options per defaultPeter Penz
* remember the search options when closing Dolphin, so that the user can adjust his "default search template" svn path=/trunk/KDE/kdebase/apps/; revision=1052499