def lockApp(self, state): if self.dialog is None: self.dialog = MessageDlg(self.views()[0]) self.dialog.setText(LicHelpers.SUBWINDOW_LOCKAPP_TEXT) if state: self.dialog.show() else: self.dialog.close() QCoreApplication.processEvents()