FreeLanguageTools / vocabsieve

Simple sentence mining tool for language learning
GNU General Public License v3.0
392 stars 30 forks source link

Select all checkbox #150

Closed artjomsR closed 6 months ago

artjomsR commented 7 months ago

simple checkbox to make it easier to extract new words when reading multiple books

https://github.com/FreeLanguageTools/vocabsieve/assets/6875790/72dd5dec-323b-4a6d-a597-320b4081f0e0

1over137 commented 7 months ago

Personally I would like it to not be a checkbox like all the other normal ones. Maybe a button, next to the "Select books" label would be better. I wonder if it is a common use case. I actually haven't really used it like that at all, except in testing, since I am never actively reading more than more than one book at the same time.

artjomsR commented 7 months ago

I wanted to do a "toggle all" button to begin with but the logic could be complicated when only some checkboxes are ticked, so it'd be cleaner to just have 2 separate buttons

https://github.com/FreeLanguageTools/vocabsieve/assets/6875790/9f392367-f1d2-48f6-aca9-055b1249634c

1over137 commented 7 months ago

I wanted to do a "toggle all" button to begin with but the logic could be complicated when only some checkboxes are ticked, so it'd be cleaner to just have 2 separate buttons

Would this not work?

checkbox.setChecked(not checkbox.isChecked())

Again my concern is that the buttons take up space for the selections

Honestly I'm not sure this is a good idea How about instead of this, we can let the importer remember last selected options just like the dates? You should only have to change it infrequently The idea is set a setting when an import succeeds, recording the books users selected, and auto-populate it when the user presses "repeat last import" (this will only trigger either kindle or koreader, not others).

artjomsR commented 6 months ago

Ok, now there's no new UI elements, the checkboxes simply keep their checked status after an import

1over137 commented 6 months ago

don't actually store the python list in the settings, since it would be written as some QVariant binary thing. Store them with json strings (json.dumps, loads) and read them out

1over137 commented 6 months ago

also let's just get rid of all the truncate_middle calls, because I think they cause issues with the filtering and don't really have benefits anyways (the viewport can scroll).