View Single Post
Old 02-03-2011, 06:28 PM   #1
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
config_widget doesn't allow early exit

When using config_widget to customize my plugin, I want to check if certain conditions are met (device connected) and if not show an error dialog and exit the routine. I can do the check and dialog and exit, but not cleanly.

I noticed in the source that I can return None or raise a NotImplemented error or a QWidget. I currently return None so that the customization_help routine runs with my error message. But this shows a text entry box under the text message I display. Using a QWidget is just as messy as it requires and shows an empty table. Raising the error causes an error message.

Any suggestions of code to use in config_widget to show just an error dialog and exit?

Is there a pre-validate method to match the validate method?
meme is offline   Reply With Quote