Bug 362038 - feature request for "find" functionality from console startup (CLI)
Summary: feature request for "find" functionality from console startup (CLI)
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: junior-jobs
: 311045 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-04-21 14:45 UTC by nicholas
Modified: 2019-03-16 00:08 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.04.0


Attachments
attachment-20162-0.html (4.05 KB, text/html)
2016-09-17 13:32 UTC, nicholas
Details
attachment-2773-0.html (881 bytes, text/html)
2016-09-17 18:32 UTC, nicholas
Details
read find argument from CLI (12.23 KB, patch)
2016-12-10 10:41 UTC, Ahmed Hussein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nicholas 2016-04-21 14:45:08 UTC
please add "find" option to command line interface such that it can be used with library search packages i.e. recoll. for example "evince --page-index=%p --find=%s %f" allows recoll to open on the matching page and highlight/find the requested string. 

Reproducible: Always

Steps to Reproduce:
1. feature request
2.
3.
Comment 1 Ahmed Hussein 2016-09-17 12:01:32 UTC
This is my first Bug. I want more info for this bug. 
1. I implement find Arg and read it "--find <string>". What do you mean with --page-index?
2. I don't understand what should i do with page Arg. Should I highlight search only or force to first selected word.
Comment 2 nicholas 2016-09-17 13:32:44 UTC
Created attachment 101141 [details]
attachment-20162-0.html

so the command instructs evince to open on the specified page and
highlight/move to the first occurrence of the word

from http://manpages.ubuntu.com/manpages/wily/man1/evince.1.html

*--page-index=NUMBER*
              Open the document on the page  with  the  specified  page  index
              (this is the exact page number, not a page label).

*--find=string*
              You  can  pass  a word or phrase here. If it exists, evince will
              display the document and the first match.


the actual command "evince --page-index=%p --find=%s %f" is copied from
recoll (http://www.lesbonscomptes.com/recoll/)
in "user preferences"-> "choose editor applications" i can use okular here,
but cannot get the same functionality which is very important (i have had
to install evince for this single use case!)

since you have documentation and application (evince) to benchmark, I
assume this is clear?

Nicholas

On 17 September 2016 at 14:01, Ahmed Hussein via KDE Bugzilla <
bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=362038
>
> Ahmed Hussein <thelastrealdevil@gmail.com> changed:
>
>            What    |Removed                     |Added
> ------------------------------------------------------------
> ----------------
>                  CC|                            |
> thelastrealdevil@gmail.com
>
> --- Comment #1 from Ahmed Hussein <thelastrealdevil@gmail.com> ---
> This is my first Bug. I want more info for this bug.
> 1. I implement find Arg and read it "--find <string>". What do you mean
> with
> --page-index?
> 2. I don't understand what should i do with page Arg. Should I highlight
> search
> only or force to first selected word.
>
> --
> You are receiving this mail because:
> You reported the bug.
>
Comment 3 Ahmed Hussein 2016-09-17 18:28:36 UTC
Great thank you. I will continue and if I have question I will ask here. Is it ok?!
Comment 4 nicholas 2016-09-17 18:32:21 UTC
Created attachment 101151 [details]
attachment-2773-0.html

Sure, here to help, good luck with your first bug!

On 17 Sep 2016 8:28 p.m., "Ahmed Hussein via KDE Bugzilla" <
bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=362038
>
> --- Comment #3 from Ahmed Hussein <thelastrealdevil@gmail.com> ---
> Great thank you. I will continue and if I have question I will ask here.
> Is it
> ok?!
>
> --
> You are receiving this mail because:
> You reported the bug.
>
Comment 5 Ahmed Hussein 2016-09-24 14:00:29 UTC
Sorry, It just work Friday and Saturday. While I was working on this project I use Shell project as start project and parse argument to get search string. Then I pass QString to Shell::openDocument - I override openDocument to take two arguments. Now I want to pass search text to Okular::Document after opening url. I am stuck here. Should I access Okular::part using singal same as "enableStartWithPrint" then use m_document or that is wrong?!
Comment 6 nicholas 2016-09-24 14:05:55 UTC
sorry, all this framework stuff outside of my scope of expertise.

On 24 September 2016 at 15:00, Ahmed Hussein via KDE Bugzilla
<bugzilla_noreply@kde.org> wrote:
> https://bugs.kde.org/show_bug.cgi?id=362038
>
> --- Comment #5 from Ahmed Hussein <thelastrealdevil@gmail.com> ---
> Sorry, It just work Friday and Saturday. While I was working on this project I
> use Shell project as start project and parse argument to get search string.
> Then I pass QString to Shell::openDocument - I override openDocument to take
> two arguments. Now I want to pass search text to Okular::Document after opening
> url. I am stuck here. Should I access Okular::part using singal same as
> "enableStartWithPrint" then use m_document or that is wrong?!
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 7 Ahmed Hussein 2016-09-24 14:08:08 UTC
Could you recommend someone to help me?!
Comment 8 Yuri Chornoivan 2016-09-24 14:17:16 UTC
(In reply to Ahmed Hussein from comment #7)
> Could you recommend someone to help me?!

The replies to this bug report are in the okular-devel@ mailing list. So all current developers are informed about this question. Just wait until somebody of them answer it.

There are also IRC channels on freenode, #okular and #kde-devel to discuss development questions.
Comment 9 Ahmed Hussein 2016-09-24 14:21:27 UTC
Thank you, I will wait.
I ask that question at IRC yesterday and today and no answer :D
Comment 10 Albert Astals Cid 2016-10-02 21:56:12 UTC
(In reply to Ahmed Hussein from comment #9)
> Thank you, I will wait.
> I ask that question at IRC yesterday and today and no answer :D

Maybe you can show the code you have? 

I could not understand the problem you have by reading your previous question.
Comment 11 Ahmed Hussein 2016-12-10 10:41:18 UTC
Created attachment 102715 [details]
read find argument from CLI
Comment 12 Ahmed Hussein 2016-12-10 10:41:59 UTC
(In reply to Ahmed Hussein from comment #11)
> Created attachment 102715 [details]
> read find argument from CLI

What Should I do next?!
Comment 13 Albert Astals Cid 2016-12-11 22:43:39 UTC
Use reviewboard.kde.org for patches instead of  not bugzilla
Comment 14 Albert Astals Cid 2019-02-13 22:59:59 UTC
Git commit 716b234100ca260f97a3891c23e8385c94c06744 by Albert Astals Cid, on behalf of Joao Netto.
Committed on 13/02/2019 at 22:59.
Pushed by aacid into branch 'master'.

Implemented find function from console

Summary:
Implemented feature request to find from console.

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: ngraham, aacid, yurchor, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18144

M  +47   -32   autotests/mainshelltest.cpp
M  +1    -1    core/document.cpp
M  +1    -1    generators/poppler/generator_pdf.cpp
M  +14   -1    part.cpp
M  +4    -0    part.h
M  +2    -1    shell/main.cpp
M  +7    -1    shell/okular_main.cpp
M  +3    -0    shell/shell.cpp
M  +24   -13   shell/shellutils.cpp
M  +2    -1    shell/shellutils.h
M  +6    -0    ui/findbar.cpp
M  +1    -0    ui/findbar.h

https://commits.kde.org/okular/716b234100ca260f97a3891c23e8385c94c06744
Comment 15 Albert Astals Cid 2019-03-16 00:08:15 UTC
*** Bug 311045 has been marked as a duplicate of this bug. ***