Bug 445934

Summary: kpdf preview is broken in kile
Product: [Fedora] Fedora Reporter: Jakub Hrozek <jhrozek>
Component: kileAssignee: Kevin Kofler <kevin>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: eloranta, peeter.as, rdieter, tdbtdb+bug
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.0.1-2.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-25 02:51:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Default to Okular for ViewDVI, ForwardDVI, ViewPDF, ViewPS
none
Default to xdg-open for ViewDVI, ForwardDVI, ViewPDF, ViewPS none

Description Jakub Hrozek 2008-05-09 22:15:02 UTC
Description of problem:
In F9, the kpdf preview doesn't work even with installed kdegraphics3 

Version-Release number of selected component (if applicable):
kile-2.0-4.fc9

How reproducible:
always

Steps to Reproduce:
1. install kile
2. write some latex code
3. hit preview
  
Actual results:
[ViewPDF}:  finished with exit status 127

Expected results:
PDF preview

Additional info:
Initially, I thought that this might be just a packaging bug (missing
Requires:), but after discussion on #fedora-kde, this might actually involve
fixing other things:

[23:57] <Kevin_Kofler> You can set it up by hand to launch an external Okular to
view DVI, PDF and PS files, it should probably default to that in F9.
[00:01] <Kevin_Kofler> The embedded preview at the bottom will probably have to
be disabled entirely in F9. We don't have the KDE 3 KParts to make that happen.
[00:01] <Kevin_Kofler> What we can do is fix the default configuration for
View{DVI,PS,PDF} to launch Okular (as a standalone app, we can't embed KDE 4
KParts into a KDE 3 app).

Comment 1 Kevin Kofler 2008-05-10 22:51:08 UTC
What I've figured out is:
* The embedded preview in the bottom tab uses no KParts, only QImage (it 
converts to PNG, then shows that with a QImage), so that should be working 
already.
* However, the default configuration is _not_ to use that embedded preview, but 
always launching the KParts or standalone executables configured in the View* 
actions.
In other words, fixing View{DVI,PS,PDF} will also fix the problem when hitting 
preview.

I also figured out how to do that, I'll have a patch shortly.

Comment 2 Kevin Kofler 2008-05-10 23:39:13 UTC
Created attachment 305042 [details]
Default to Okular for ViewDVI, ForwardDVI, ViewPDF, ViewPS

This patch makes Kile default to Okular (as an external process, can't embed
KDE 4 KParts into KDE 3 apps) for the ViewDVI, ForwardDVI, ViewPDF and ViewPS
actions. I'm not sure whether Okular will do the right thing for ForwardDVI
(it's supposed to point to the current editor location in the DVI file), but
calling a nonexistent KDVI isn't really a sensible default in any case. ;-)

WARNING: This patch is for F9+ only. Making Okular the default is not a good
idea on F8- for obvious reasons. ;-) If we want to add Okular as an option in
F8 for kde-redhat unstable users, we'd have to split the kconf_update script
into the part which adds the option and the part which makes it default and
only do the former in F8.

We may want to also add a Requires: kdegraphics to make the default
configuration "just work".

Comment 3 Rex Dieter 2008-05-11 00:51:20 UTC
Why not just use xdg-open (instead of hard-coding okular)?

Comment 4 Kevin Kofler 2008-05-11 00:59:44 UTC
Because we have no idea what app will end up as the default if you have 
multiple ones installed due to shared-mime-info? (Actually, I suspect I know 
the answer: evince... :-/)

Comment 5 Kevin Kofler 2008-05-11 04:28:27 UTC
Created attachment 305052 [details]
Default to xdg-open for ViewDVI, ForwardDVI, ViewPDF, ViewPS

Anyway, here's a version of the patch which uses xdg-open.

Comment 6 Fedora Update System 2008-05-12 23:54:27 UTC
kile-2.0.1-1.fc9 has been submitted as an update for Fedora 9

Comment 7 Fedora Update System 2008-05-13 15:27:12 UTC
kile-2.0.1-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kile'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-3596

Comment 8 Bug Zapper 2008-05-14 10:56:27 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Fedora Update System 2008-05-14 22:14:18 UTC
kile-2.0.1-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Kevin Kofler 2008-05-15 04:39:09 UTC
*** Bug 446569 has been marked as a duplicate of this bug. ***

Comment 11 Peeter Puusemp 2008-06-22 01:13:42 UTC
I have the latest Kile available from the updates.

The embedded preview at the bottom works, if to check the check boxes in
Tools-->Preview in the configuration dialog, but if they are not selected, then
Kile doesn't load externally DVI or PDF viewer with the preview.

I checked and xdg-open is default for ViewDVI, ForwardDVI, ViewPDF, ViewPS.

* If LaTeX-->DVI is selected there, then the log says:

...
[ViewDVI] kviewerpart teeki ei leitud.


It means that kviewerpart (library?) wasn't found.

* If PDFLaTeX-->PDF is selected, then the log says:

...
[Kile] Seadistuste andmebaasis ei leitud tööriista ViewPDF.


It means that the tool ViewPDF wasn't found in the settings database (or
something like that).



-----

I have one more remark.

The math group quick preview is by default noted (in Tools-->Preview in the
configuration dialog) to be always opened externally and the check box is
disabled. I accidentally figured out that if to install dvipng package then the
check box gets enabled and it is then possible to preview a math group with
embedded preview at the bottom. I think there should be a note that dvipng
package is needed to enable the possibility of embedded preview of math groups.
At the moment it is not clear.

Comment 12 Kevin Kofler 2008-06-22 02:34:12 UTC
There are 3 types of preview:
1. embedded in the bottom pane: that uses dvipng and should work fine
2. embedded viewer in a separate window in Kile: that uses KParts and will NOT 
work in Fedora 9 because the KDE 3 KParts for DVI, PS and PDF are no longer 
available
3. standalone viewer: that should work, using xdg-open
Your error message for ViewDVI says that it's trying to use 2., which doesn't 
work. I'm not sure what's wrong with ViewPDF.

Comment 13 Kevin Kofler 2008-06-22 03:21:50 UTC
OK, I see where the problem is, quickpreview.cpp hardcodes the "Embedded 
Viewer" configuration instead of using the default. I'm patching this.

Comment 14 Kevin Kofler 2008-06-22 03:41:16 UTC
QuickPreview patched to use xdg-open instead of the embedded viewer.
F9 build here: http://koji.fedoraproject.org/koji/taskinfo?taskID=674671

Comment 15 Fedora Update System 2008-06-22 04:14:51 UTC
kile-2.0.1-2.fc9 has been submitted as an update for Fedora 9

Comment 16 Peeter Puusemp 2008-06-22 09:41:35 UTC
OK, I didn't read it out so well before. Now I see. At least it led to one small
bug. :)

Isn't it then better to enable the embedded preview in the bottom pane by
default as at the moment the default action is broken? Then also gray out
options that are broken in the configuration dialog...

You said the embedded preview in the bottom pane uses dvipng, but actually it
isn't installed as dependency. All, but math group embedded preview in the
bottom pane, works without dvipng and if to install dvipng package then the math
group check box in the configuration dialog gets also enabled and so math groups
can be previewed in the bottom pane too. So if you like the idea to make the
embedded preview in the bottom pane as default then it would be good to add
dvipng package as dependency.

Comment 17 Kevin Kofler 2008-06-22 16:49:22 UTC
I've just fixed the default action in 2.0.1-2.fc9, so there's no need to change 
the default.

Comment 18 Fedora Update System 2008-06-22 20:43:52 UTC
kile-2.0.1-2.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kile'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-5593

Comment 19 Peeter Puusemp 2008-06-23 10:50:36 UTC
(In reply to comment #17)
> I've just fixed the default action in 2.0.1-2.fc9, so there's no need to change 
> the default.

Sorry, yes. I didn't think about it so much with tired head and as I hadn't
tried the update I didn't realize that it was fixed and working.

After your post I downloaded the update from koji and there are no errors any
more. Thank you!

(Only one more remark. Maybe instead of forcing xdg-open, use the one that user
set in ViewPDF/ViewDVI in the configuration dialog. In Gnome the default PDF
opener is Evince, but for example I want that Kile uses Okular instead of
Evince. Therefore I have set ViewPDF to Okular instead of xdg-open.)

Comment 20 Kevin Kofler 2008-06-23 14:24:34 UTC
Well, previously Embedded Viewer was hardcoded, so it was easier to change it 
that way, I guess we could indeed look up the default though.

But you can change your file associations.

Comment 21 Peeter Puusemp 2008-06-23 15:13:42 UTC
Actually it is just so called eye-candy thing. So not very important.

Explanation:
---------
I use Okular as PDF file viewer in Kile when I review the whole document,
because it refreshes the file automatically when the pdf file has changed.

The quick preview feature uses xdg-open, it means the default viewer in the
desktop environment. It is Evince in GNOME. I don't want to change it to Okular
as I use GNOME and want to use otherwise GNOME applications.

Since one feature uses Okular and the other Evince then it is a little bit
cluttered now.
---------

It's just me of course, but I thought maybe some other people would like to use
custom one too.

But thanks for the fix!

With best wishes,
Peeter Puusemp

Comment 22 Rex Dieter 2008-06-23 15:18:58 UTC
Interesting, gnome/kde now share the same mime system, the "default" app should
be the same in both (in most cases).

Comment 23 Peeter Puusemp 2008-06-23 15:26:15 UTC
I set Okular myself in the configuration dialog. So I don't use the default one,
because of the reason I said before.


(ViewPDF --> Okular)

Comment 24 Rex Dieter 2008-06-23 15:34:04 UTC
regardless, imo, future changes/enhancements discussed here really need to
happen upstream, not here.

Comment 25 Peeter Puusemp 2008-06-23 16:06:30 UTC
(In reply to comment #24)
> regardless, imo, future changes/enhancements discussed here really need to
> happen upstream, not here.

My future comments were connected to the fix that Kevin Kofler made.

I report the whole problem upstream near future, since isn't it overall problem?

Comment 26 Rex Dieter 2008-06-23 16:21:04 UTC
yep

Comment 27 Fedora Update System 2008-06-25 02:51:07 UTC
kile-2.0.1-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 28 tdbtdb+bug 2009-02-04 22:42:59 UTC
kile-2.0.3-1.fc9.x86_64 still has problem of kile can't find kdvi. Reproduced by choosing settings/system check.

As a newbie, wouldn't it be nice if there was an easy way to find the workaround rather than dredging through 27 comments?

Comment 29 Kevin Kofler 2009-02-04 22:50:47 UTC
* Ignore the system check, just go with the default (xdg-open).
* Make sure you have at least one DVI viewer installed (kdegraphics (Okular), evince or xdvi).