View Single Post
Old 06-01-2018, 11:54 AM   #1
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
User Interface plugins involving loops

I realise this is a long post but I hope at least someone will find the time to read and offer suggestions...

When writing a new User Interface plugin which involves looping around selected books or looping around files within a book container (or both) I have a decision to make. Should I:
  1. Code it in the main QDialog as simple python for x in y: do_something.
    Easiest to code but may tie up calibre when running if each do_something is lengthy.
  2. Code a standard QProgressDialog to loop around the do_something.
    Not too difficult to code. Ties up calibre when running but has the benefit of a Cancel button if the user gets impatient.
  3. Code a QProgressDialog to set up a queue of thread jobs of do_something to run in the background.
    Quite challenging to code (for me, at least. I've only done it once.) Has the benefit of running in the background, but a potential headache of dealing with what to do if the user changes something whilst the do_somethings are running.

Can anyone offer any general advice on how to go about deciding which option to choose?
jackie_w is offline   Reply With Quote