コード例 #1
0
ファイル: __main__.py プロジェクト: bjones1/enki
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)
コード例 #2
0
ファイル: __main__.py プロジェクト: hrnciar/enki
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)
コード例 #3
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
    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
コード例 #4
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
    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
コード例 #5
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
 def showFailMessage(self):
     QMessageBox.critical(None,
                          i18n("Network Error"),
                          i18n("Please check your network connections and try again."),
                          QMessageBox.Ok)
コード例 #6
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
 def showFailMessage(self):
     QMessageBox.critical(
         None, i18n("Network Error"), i18n("Please check your network connections and try again."), QMessageBox.Ok
     )