def _showErrorMessage(haveQt, header, html, plain): """Show error message with messagebox """ print(header, file=sys.stderr) print(plain, file=sys.stderr) if haveQt: from PyQt5.QtGui import QApplication, QMessageBox app = QApplication(sys.argv) QMessageBox.critical(None, header, html) else: try: import tkinter.messagebox except ImportError: return tkinter.messagebox.showwarning(header, plain)
def conflictCheckPasses(self, packages): (C, D, pkg_conflicts) = self.iface.getConflicts(packages, self.state) conflicts_within = list(D) if conflicts_within: text = i18n("Selected packages [%1] are in conflict with each other. These packages can not be installed together.", ", ".join(conflicts_within)) QMessageBox.critical(None, i18n("Conflict Error"), text, QMessageBox.Ok) return False if pkg_conflicts: text = i18n("The following packages conflicts:\n") for pkg in pkg_conflicts.keys(): text += i18n("%1 conflicts with: [%2]\n", pkg, ", ".join(pkg_conflicts[pkg])) text += i18n("\nRemove the conflicting packages from the system?") return QMessageBox.warning(None, i18n("Conflict Error"), text, QMessageBox.Yes, QMessageBox.No) == QMessageBox.Yes return True
def conflictCheckPasses(self, packages): (C, D, pkg_conflicts) = self.iface.getConflicts(packages, self.state) conflicts_within = list(D) if conflicts_within: text = i18n( "Selected packages [%1] are in conflict with each other. These packages can not be installed together.", ", ".join(conflicts_within), ) QMessageBox.critical(None, i18n("Conflict Error"), text, QMessageBox.Ok) return False if pkg_conflicts: text = i18n("The following packages conflicts:\n") for pkg in pkg_conflicts.keys(): text += i18n("%1 conflicts with: [%2]\n", pkg, ", ".join(pkg_conflicts[pkg])) text += i18n("\nRemove the conflicting packages from the system?") return ( QMessageBox.warning(None, i18n("Conflict Error"), text, QMessageBox.Yes, QMessageBox.No) == QMessageBox.Yes ) return True
def showFailMessage(self): QMessageBox.critical(None, i18n("Network Error"), i18n("Please check your network connections and try again."), QMessageBox.Ok)
def showFailMessage(self): QMessageBox.critical( None, i18n("Network Error"), i18n("Please check your network connections and try again."), QMessageBox.Ok )