Quote:
Originally Posted by Riva3000
I know I know BetterRed. Thanks for the tip!
..or I might copy and edit Calibre code for the Fixed set column.
Will Kovid kill me ?! 
|
It won't be easy to have happiness.
You must be talking about sorting the column, not sorting the values in the edit combobox, because the order of the values in the box is the same as in the column declaration. Thus, for you to be happy you would need to change calibre's column sort, detecting (somehow) that this particular text column is to be sorted by something other than text. This is possible to do, but not trivial. You would need to generate a sort value ("key" in calibre) that is related to the order in the column declaration. And you would need to do this in a way that preserves performance.
Another option that is more elegant but quite different: use an integer column and column icons. The integer would map to your categories. The icon would give you a human-understandable visual representation. You could go so far as to add icons for the letters of the alphabet and use the multiple-icon feature in today's calibre release (1.4) to spell out what you want it to say. Of course, this works only on calibre's spreadsheet. It wouldn't show the icons in book details or elsewhere.
EDIT: The letters idea won't work with basic rules because you cannot specify the order of the icons. It would work if you used an advanced template, because there you are in charge of their order.
A third option: use an integer column, then add a column built from other columns to display the correct text. This has the advantage that the text will be visible in book details, etc. It has the disadvantage of requiring two columns.