Quote:
Originally Posted by igorius
I want to change a plugin which has a setting "reading status" which is set to "text".
I want to change this setting to "bool", "boolean", "yes/no".
I tried any of this settings but none works. What is the right thing to get this done?
|
First, you can't change the type of an existing column. You must delete the column, restart calibre, then re-add the column with the new type.
Quote:
Here is the relevant thing: (taken from koreader plugin)
{
'name': 'column_status',
'label': 'Reading status column:',
'tooltip': 'A regular “text” column to store the reading status of the\n'
'book, as entered on the book status page (“Finished”,\n'
'“Reading”, “On hold”).',
'type': 'text', (*1)
'sidecar_property': ['summary', 'status'],
}
(*1): Changed 'type': 'text', to 'type': 'bool', and the other above mentioned types.
available_columns = {
'comments': self.get_custom_columns(['comments']),
'datetime': self.get_custom_columns(['datetime']),
'float': self.get_custom_columns(['float']),
'int': self.get_custom_columns(['int']),
'rating': self.get_rating_columns(), # Includes built-in
'text': self.get_custom_columns(['text']),
'bool': self.get_custom_columns(['bool']), (*2)
}
(*2): added this line with the different types as mentioned above.
What types do i have for changing columns? Where is that documented? I didnt find anything in help/plugins or plugin API...
|
I don't know what this is really asking for.
As I said above, there is no API for changing column types because you can't do that.
If you are looking for documentation of the API to prompt the user to create new columns, see CreateNewCustomColumn in src/calibre/gui2/preferences/create_custom_column.py. However, I think you already are looking at that.