Thread: Exit GUI Plugin
View Single Post
Old 05-01-2024, 01:03 PM   #3
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 945
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by feuille View Post
Code:
d = error_dialog(self.gui, 'MyGuiPlugin', _('No book selected!'))
d.exec()
I usually do it like this:

Code:
from calibre.gui2 import error_dialog

def some_function():
      do_stuff
      if some_condition:
            return error_dialog(self.gui, 'MyGuiPlugin', _('No book selected!'), show_copy_button=False, show=True)
This will exit some_function.
thiago.eec is offline   Reply With Quote