Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-13-2013, 09:54 AM   #61
chaley
"chaley", not "charley"
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: 5,783
Karma: 1212746
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by davidfor View Post
While fixing that, I realised I could have multiple conditions. But, they all have to be true. Is there any way to do an OR? I suppose that's really an enhancement request.
You do an OR by creating more than one rule for the same column/icon. Order is important: the first rule that evaluates to TRUE is used and the rest are not evaluated. To get a true OR, the rules must have the same setup (column, text, icon).
chaley is offline   Reply With Quote
Old 03-14-2013, 01:08 AM   #62
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,878
Karma: 5704347
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo Touch, Kobo Glo
Quote:
Originally Posted by chaley View Post
You do an OR by creating more than one rule for the same column/icon. Order is important: the first rule that evaluates to TRUE is used and the rest are not evaluated. To get a true OR, the rules must have the same setup (column, text, icon).
That's what I had done as I hadn't even noticed I could have multiple conditions. But as I had managed to use different options, I was thinking it would be nice to group them together.
davidfor is offline   Reply With Quote
 
Advertisement
Old 03-30-2013, 04:35 PM   #63
icarine
Member
icarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheese
 
Posts: 12
Karma: 1034
Join Date: Mar 2010
Location: NC
Device: PB 360
This is a really cool feature! Is there anyway to allow wider icons though?

I had an idea for using these custom icons to implement half-star ratings, by using different images of each star rating. But when I tried it, the icons got shrunk down so I could barely see the stars.

This would just be a really nice way to do custom half-star ratings. I'm using a custom float column now, but the numbers don't have the same immediate visual impact that seeing the stars do.
icarine is offline   Reply With Quote
Old 03-31-2013, 08:03 AM   #64
chaley
"chaley", not "charley"
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: 5,783
Karma: 1212746
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by icarine View Post
This is a really cool feature! Is there anyway to allow wider icons though?

I had an idea for using these custom icons to implement half-star ratings, by using different images of each star rating. But when I tried it, the icons got shrunk down so I could barely see the stars.

This would just be a really nice way to do custom half-star ratings. I'm using a custom float column now, but the numbers don't have the same immediate visual impact that seeing the stars do.
Currently, no, all images are forced into a square icon-sized bounding box. However ...

The next release (it is available in source now) will display an image non-square if the image's width is more than 1.5 times the image's height. The bounding box will be (row_height by min(image_width, 128)). If the image width is more than 128 it will be resized to 128, preserving aspect ratio. If after resizing the image height is more than row height it will be center-clipped.

Why these rules? To preserve existing behavior while allowing what you trying to do.

This should work for you as you are clearly prepared to make the images. Assuming 1/2 stars you would need 11 images, 1 for empty and one for each 1/2 star increment; and 11 rules to select the correct image. My guess is that the images should have a height of around 20 to 24 pixels, but you should experiment a bit to find the best shape for your display.
chaley is offline   Reply With Quote
Old 03-31-2013, 11:23 AM   #65
icarine
Member
icarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheeseicarine can extract oil from cheese
 
Posts: 12
Karma: 1034
Join Date: Mar 2010
Location: NC
Device: PB 360
Ah, awesome! Thank you for adding support for this! I love the column icons and how visually attractive they are, it's a nice way to highlight certain metadata.
icarine is offline   Reply With Quote
Old 04-18-2013, 06:43 PM   #66
rifka
Enthusiast
rifka began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2013
Location: Canada
Device: iPhone, iPad, Sony, Kobo
Hi Chaley. I am attempting to use the icons but running into trouble trying to get the text to show. I have read through your comments and the only thing I am having an issue with is that when I select "text with a fixed set of values" it doesn't permit me to leave values empty it requires at least one entry.

I use the icons a little different. I have a column titled Read. It is set to show one of three icons based on the Shelves column that I use with the Goodreads plugin. (it works great just no text).

This shows the two columns:

Click image for larger version

Name:	c-pic1.jpg
Views:	72
Size:	14.8 KB
ID:	104565

This shows the rules:

Click image for larger version

Name:	c-pic2.jpg
Views:	62
Size:	33.9 KB
ID:	104566

And this is the column setup

Click image for larger version

Name:	c-pic3.jpg
Views:	64
Size:	43.8 KB
ID:	104567


Icons show. No text. My only reason for doing this is I would like to be able to set up a few more complicated rules but I want to be able to filter on them, which I can't right now. Any ideas? Thanks for your help.
rifka is offline   Reply With Quote
Old 04-18-2013, 06:59 PM   #67
chaley
"chaley", not "charley"
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: 5,783
Karma: 1212746
Join Date: Jan 2010
Location: France
Device: Many android devices
@rifka: sorry but I dont understand exactly what you are asking.

Columns with a fixed set of values always include the empty value. You don't need to specify it and you can't remove it.

The text that shows in a column is the text in that column, not the text in columns referenced in the rule. If you want text from another column you will need to use something like a 'column built from other columns'.

I hope I answered at least one of your questions.
chaley is offline   Reply With Quote
Old 04-23-2013, 02:16 PM   #68
rifka
Enthusiast
rifka began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2013
Location: Canada
Device: iPhone, iPad, Sony, Kobo
Actually Chaley you answered my question perfectly. One more question:

How do I get the Icons field to recognize greater than, less than, and equal to. I have discover that:

if the NUMBER column IS <1 doesn't work.

Thanks again for your help
rifka is offline   Reply With Quote
Old 04-23-2013, 04:03 PM   #69
chaley
"chaley", not "charley"
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: 5,783
Karma: 1212746
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by rifka View Post
Actually Chaley you answered my question perfectly. One more question:

How do I get the Icons field to recognize greater than, less than, and equal to. I have discover that:

if the NUMBER column IS <1 doesn't work.

Thanks again for your help
Assuming that the NUMBER column is a composite custom column (made from other columns), then relational operations are not supported. They are supported only on the "real" numeric columns, float and int.

I have no time for several weeks to look at whether relational ops can be added without breaking much. I might forget so if you feel like it and still need it, remind me.
chaley is offline   Reply With Quote
Old 04-25-2013, 06:33 PM   #70
rifka
Enthusiast
rifka began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2013
Location: Canada
Device: iPhone, iPad, Sony, Kobo
You created it. NUMBER is {#releasedate:'days_between($, today())'}. I'll make a note to remind you in a couple of weeks.

Meanwhile can you make this work: {#number_index: ifempty(na),>=1, calendar, star}
So if NUMBER is empty then "NA". if NUMBER is greater than or equal to 1 then "calendar", otherwise "star".

Am I even close?

Tx
rifka is offline   Reply With Quote
Old 04-26-2013, 06:57 PM   #71
chaley
"chaley", not "charley"
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: 5,783
Karma: 1212746
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by rifka View Post
You created it. NUMBER is {#releasedate:'days_between($, today())'}. I'll make a note to remind you in a couple of weeks.

Meanwhile can you make this work: {#number_index: ifempty(na),>=1, calendar, star}
So if NUMBER is empty then "NA". if NUMBER is greater than or equal to 1 then "calendar", otherwise "star".

Am I even close?

Tx
you have the right idea but the details are not right.

I am not near a real computer so typing programs isn't straightforward. That said, the template would look something like
Code:
program:
n = field('#number_index');
test(n, cmp(n, 1, 'star', 'calendar', 'calendar'), 'n/a')
chaley is offline   Reply With Quote
Old 05-06-2013, 03:49 PM   #72
rifka
Enthusiast
rifka began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2013
Location: Canada
Device: iPhone, iPad, Sony, Kobo
I'm not sure what to do with what you gave me. The formula I gave you went into the template field for a new column.

Basically what I want is:
if the NUMBER field is blank then "NA"
if the NUMBER field is greater than 0 then "calendar"
if the NUMBER field is less than 0 then "star"

Thanks

Last edited by rifka; 05-06-2013 at 03:49 PM. Reason: error
rifka is offline   Reply With Quote
Old 05-06-2013, 04:46 PM   #73
chaley
"chaley", not "charley"
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: 5,783
Karma: 1212746
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by rifka View Post
I'm not sure what to do with what you gave me. The formula I gave you went into the template field for a new column.

Basically what I want is:
if the NUMBER field is blank then "NA"
if the NUMBER field is greater than 0 then "calendar"
if the NUMBER field is less than 0 then "star"

Thanks
what I gave you is a template in general program mode. Just copy and paste it into the template box. If you have already created the new column then click on any cell in the column and press F2 to open the template editor, then paste it there.
chaley is offline   Reply With Quote
Old 05-14-2013, 12:05 PM   #74
chaley
"chaley", not "charley"
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: 5,783
Karma: 1212746
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by rifka View Post
How do I get the Icons field to recognize greater than, less than, and equal to. I have discover that:

if the NUMBER column IS <1 doesn't work.
Finally had some time to look at this.

Rather than continuing to add special purpose rule types, I bit the bullet and added "advanced rules" for column icons. This kind of rule already existed for column colors. An advanced rule is a general program mode template that should return the name of the icon file to use or the empty string if no icon is to be used. This kind of rule allows arbitrary rules, subject to the ability to express the rule in the template language.

The following is an example of a (rather silly) rule that chooses between two icons based on whether the author's name contains the word "weber".
Code:
program:
	a = field('authors');
	contains(a, 'weber', 'arrow-down.png', 'catalog.png')
One can write a rule that chooses between three icons based on whether a value is less than something, equal to that something, or greater than that something. Assuming that the "something" is 2, then an example of the rule would be
Code:
program:
	a = field('#myNumber');
	cmp(a, 2, 'arrow-down.png', 'catalog.png', 'debug.png')
chaley is offline   Reply With Quote
Old 06-17-2013, 04:56 PM   #75
djrm
Enthusiast
djrm began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Aug 2010
Location: NJ, USA
Device: iPad Air, Nook HD, iPod touch 4g
Hello. I have a question about using custom icons. How do I delete an icon from the drop-down on the Add rule screen? Even if I delete the icon from the resources\images folder in Calibre Settings or if I add a revised icon with the same name, Calibre doesn't seem to pick up the change.

Thanks.
DJRM
djrm is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to move value(s) of tag column to a custom made column zoorakhan Library Management 0 12-08-2012 04:53 AM
custom date column from two state column Dopedangel Library Management 7 01-03-2012 09:20 AM
Can custom book data be displayed in a custom column? kiwidude Development 9 03-02-2011 06:35 AM
Custom Icons not Honored in 0.7.18 edbro Calibre 1 09-10-2010 10:15 PM
Custom Icons for Your ePub Files Zero9 ePub 1 06-09-2009 08:45 PM


All times are GMT -4. The time now is 02:00 AM.


MobileRead.com is a privately owned, operated and funded community.