View Single Post
Old 01-02-2012, 06:42 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Dopedangel View Post
I have a two state yes no column that I use to mark books read or unread. Is it possible to make another custom that sets the date when I change the first column to yes.
The date should be editable so I can set the dates for books I have already marked read.
There isn't an easy way to do it. Calibre does not support the notion of change triggers on custom columns, and the template language does not support assignment to fields. Something like the coloring rules as triggers is imaginable, but it would not be particularly easy to do. I would be particularly concerned about ordering and circularity.

Beyond getting into calibre's code and hacking it to implement the trigger, I think the only way to accomplish this is to write a plugin that manages the boolean column. Instead of setting the bool column directly you would talk to the plugin using keyboard shortcuts. The plugin would change the value of the bool column, and if appropriate set the value of the date column.
chaley is offline   Reply With Quote