Opened 12 years ago

Last modified 2 years ago

#22 new enhancement

Open files in read mode and re-read the file after it has been changed

Reported by: julbts@… Owned by:
Priority: minor Milestone: Future
Component: Lucide Core Version:
Keywords: refresh, update, view, monitor Cc:

Description

Open the files in "read" mode, so they can also be accessed by other programs and it is allowed to write the file while it is already opened by Lucide. If the file has changed it has to be re-read! This is needed to use it as PDF-Viewer when someone creates PDF files with VTEX/2 (LaTeX).

You have to compare the last saved timestamp with the current timestamp when the Lucide window will be activated. If you have a background thread that will check the timestamps in the background this would be an option too. Look at the GSView source, which is supporting this feature since ages.

Change History (5)

comment:1 Changed 12 years ago by eros2

  • Milestone set to 2.0 and further

We use poppler library for reading pdf's, so we open files as poppler does it.

Moving to 2.0, we can think about that when we are bored.

comment:2 Changed 2 years ago by lewisr

  • Owner eros2 deleted

comment:3 Changed 2 years ago by lewisr

  • Milestone changed from 2.0 and further to Future

Milestone renamed

comment:4 follow-up: Changed 2 years ago by lewisr

  • Keywords refresh update view monitor added
  • Priority changed from trivial to minor

We still need to look at this.

In fact, Lucide itself still lacks even a Refresh function form the menu, and F5 is mapped to Presentation mode (might want to re-think that one).

Meanwhile, as a confirmation of this with lucide1.3.6GKYpoppler0.42.07-31-16a, I opened an existing PDF, then switched to SeaMonkey? 2.35, and printed a page to file, saving it over the already-opened PDF. Lucide continued to display the initial page, and paging down resulted in blank pages. Document | Recent files -> selecting the current file displayed the "new" PDF.

I agree your initial proposal, Juergen, to run a background task and check for updates to the opened file. (FWIW, qPDFView, which also uses poppler, requires a refresh to get the updated content.)

comment:5 in reply to: ↑ 4 Changed 2 years ago by aschn

Replying to lewisr:

Meanwhile, as a confirmation of this with lucide1.3.6GKYpoppler0.42.07-31-16a, I opened an existing PDF, then switched to SeaMonkey? 2.35, and printed a page to file, saving it over the already-opened PDF.

That doesn't seem to work here with 1.36 beta 2: I opened Lucide and then loaded a .pdf file into it (either via the mneu or via d'n'd). After that the .pdf file can't be renamed on disk. So, it seems that nothing has changed in the past 10 years, regarding this issue.

I agree your initial proposal, Juergen, to run a background task and check for updates to the opened file. (FWIW, qPDFView, which also uses poppler, requires a refresh to get the updated content.)

A background task would be nice to have, but is not required. Lucide could use GsView?'s method, which should be much easier to implement:

On file opening the timestamp and the size of a file should be stored. Whenever the Lucide window re-gets the input focus it should re-read timestamp and size of the file on disk which is displayed on top. If timestamp or size have changed it should refresh the viewed document.

That is, of course, only useful if files are not opened in deny-write mode. For filling forms in PDF documents, the file should be locked against write access only when the first change was made to it, not simply on loading.

Note: See TracTickets for help on using tickets.