+class LoadingDialog(QProgressDialog):
+ def __init__(self, parent):
+ QProgressDialog.__init__(self, parent)
+ self.setWindowModality(Qt.WindowModal);
+ self.setWindowTitle("Loading disc")
+ self.setLabelText("Loading BluRay disc. Please wait...")
+ self.setCancelButtonText("Exit")
+ self.setMinimum(0)
+ self.setMaximum(0)
+
+class ErrorDialog(QMessageBox):
+ fatal_error = pyqtSignal(str, str)
+
+ def __init__(self, parent):
+ QMessageBox.__init__(self, parent)
+ self.setStandardButtons(QMessageBox.Ok)
+ self.setDefaultButton(QMessageBox.Ok)
+ self.fatal_error.connect(self.configure_popup)
+ self.setWindowTitle("Fatal error")
+ self.has_run = False
+
+ def configure_popup(self, text, detail):
+ if self.has_run:
+ return
+ self.has_run = True
+ self.setText(text)
+ self.setInformativeText(detail)
+ QTimer.singleShot(0, self.show_and_exit)
+
+ def show_and_exit(self):
+ logging.info("showing and exiting")
+ self.exec_()
+ qApp.quit()