Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50094

Exit GUI Plugin

$
0
0
Sorry if this is a stupid question: But how do I exit a GUI plugin without starting the main dialog if an error occurs during initialization?

Example: If the user has not selected a book, I print the following message in the __init__ method of class MyGuiPluginDialog(QDialog):

Code:

d = error_dialog(self.gui, 'MyGuiPlugin', _('No book selected!'))
d.exec()

This will display the Calibre error dialog. So good so far...

But how do I stop executing the plugin at this point?

"return" shows the error dialog again, after "OK" the main dialog of the plugin is shown.
"sys.exit()" closes Calibre itself.

Viewing all articles
Browse latest Browse all 50094

Latest Images

Trending Articles



Latest Images