Add "find in this document" to selection context menu
ClosedPublic

Authored by andisa on Aug 25 2019, 10:20 AM.

Details

Reviewers
ngraham
Group Reviewers
Okular
Summary

This change adds a new option for searching the selected text inside the document. The following image explains the proposed solution:

In this short video, we can see the proposed solution:

BUG: 408355

Diff Detail

Repository
R223 Okular
Branch
search_withing_document (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16150
Build 16168: arc lint + arc unit
andisa created this revision.Aug 25 2019, 10:20 AM
Restricted Application added a project: Okular. · View Herald TranscriptAug 25 2019, 10:20 AM
Restricted Application added a subscriber: okular-devel. · View Herald Transcript
andisa requested review of this revision.Aug 25 2019, 10:20 AM
andisa edited the summary of this revision. (Show Details)Aug 25 2019, 10:25 AM
andisa edited the summary of this revision. (Show Details)
andisa edited the summary of this revision. (Show Details)Aug 25 2019, 1:51 PM
ngraham retitled this revision from Fixing: Bug 408355 - Selection context menu missing find in this document to Add "find in this document" to selection context menu.Aug 25 2019, 4:34 PM
ngraham edited the summary of this revision. (Show Details)
andisa edited the summary of this revision. (Show Details)Aug 25 2019, 6:13 PM

Works great. I have some UI suggestions below:

ui/pageview.cpp
4373

This grammar change makes it wrong for all the other entries.

Maybe the new "Search for <text> in open document" menu item should be in the base level of the context menu, and not inside the sub-menu.

4376

The icon should be document-preview (document-open is used for actions that open documents)

andisa removed a reviewer: Okular.Aug 27 2019, 4:26 PM
andisa added inline comments.
ui/pageview.cpp
4373

I was thinking about that because even if you don't have any external provider, you should have the option to search within the document. I didn't want to change to much the existing code, my fault.

I will update taking into consideration your suggestion.

andisa updated this revision to Diff 64762.Aug 27 2019, 7:18 PM

Adding the "Search for <text> in open document" action in the top level menu.

andisa marked 2 inline comments as done.Aug 27 2019, 7:19 PM
andisa marked an inline comment as done.
andisa edited the summary of this revision. (Show Details)Aug 27 2019, 7:24 PM
andisa updated this revision to Diff 65479.Sep 5 2019, 7:44 PM

Small change in the function PageView::addSearchWithinDocumentAction.

ngraham added inline comments.Sep 5 2019, 7:47 PM
part.cpp
526

You could probably use a lambda here too, to avoid creating a single-use function

2250

ditto

part.h
227

Typo: serchText -> searchText

andisa updated this revision to Diff 65481.Sep 5 2019, 8:02 PM

Moving the function Part::slotShowFindBarWithInitialText to a lambda.

andisa marked 2 inline comments as done.Sep 5 2019, 8:03 PM
ngraham accepted this revision.Sep 5 2019, 8:31 PM

LGTM. Okular people, any comments?

This revision is now accepted and ready to land.Sep 5 2019, 8:31 PM

Anything new about this one?

It's possible the Okular people are all looking only at GitLab merge requests since Okular has migrated to GitLab.. It's possible you'll get more eyeballs on it if you re-submit this at https://invent.kde.org/kde/okular/merge_requests