View Single Post
Old 04-19-2011, 08:20 AM   #109
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by chaley View Post
After some thought, I think you would be better served to hook into activated instead of currentIndexChanged. If the user chooses index 1 (current search), activated will fire and the restriction will change to the current search. However, currentIndexChanged will not fire, because the index didn't change.
Yeah I confess to finding that behaviour in search restrictions a bit quirky .

Say I do a search for "dragon", then choose "*Current search" in restriction dropdown.

In the dropdown my only options now are blank and "dragon" (plus any other saved searches obviously). The *Current search option has been replaced with dragon.

Now in the restriction dropdown if I choose "dragon" in actual fact that clears the restrictions and puts "*Current search" in it's place.

An alternative suggestion (since it is only fair if I say something I found unexpected is to suggest an alternative, however crap it may be) is:
(a) *Current search always stayed there
(b) a new entry of *dragon appeared below *Current search

So if a user chooses *dragon again in the dropdown, nothing happens.
If a user has typed another search and they want to immediately apply it, they can choose *Current search. They dont have to first drop the restriction and then retype the search (as will happen if they forgot the restriction was on)

My final comment - could the tooltip for the restriction dropdown show the full text of the current search when you have one selected. As it gets shortened in the non-resizable dropdown to illegibility

Just my 2p. I don't really care that much, honest
Quote:
I don't know if you should unhook/rehook, or if you should have an 'ignore' flag. By the latter I mean using a double-signal arrangement, something like:
Yes using a variable would work. Though I still need a disconnect method (I think) for invoking to allow the object to be garbage collected when I create a new instance by the user switching libraries. And obviously some connect code when the object gets created. So we'll see what I ens up with
kiwidude is offline   Reply With Quote