View Single Post
Old Yesterday, 01:16 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,911
Karma: 29228280
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Here is the code for a python template:
Code:
python:
def evaluate(book, context):
        from calibre.gui2.ui import get_gui
        v = get_gui().library_view
        row = v.currentIndex().row()
        if row < 0:
            return 'no'
        try:
            return 'yes' if v.model().db.data.index_to_id(row) == book.id else 'no'
        except Exception:
            return 'no'
Then in the emblem rule simply check if the column base don this template is yes. Note I havent actually tested this, but I see no reason why it wont work.

Last edited by kovidgoyal; Yesterday at 04:19 AM.
kovidgoyal is offline   Reply With Quote