Example #1
0
    def __getSourceInfo(self, src):
        if QtCore.QString(src).isEmpty():
            self.warningDialog(self.tr("CD Image is Invalid"),
                               self.tr("Please set an CD image path."))

            return False

        if not os.path.isfile(src):
            self.warningDialog(self.tr("CD Image is Invalid"),
                               self.tr("Please check the CD image path."))

            return False

        iso_size = getIsoSize(src)
        iso_size_progress = iso_size / increment_value

        check_iso = ProgressBar(
            title=self.tr("Verify Checksum"),
            message=self.tr("The checksum of the source is checking now..."),
            max_value=iso_size_progress)
        pi = ProgressIncrementChecksum(check_iso, src)

        # FIX ME: Why is it in here?
        def closeDialog():
            pi.quit()
            check_iso.close()

        QtCore.QObject.connect(pi, QtCore.SIGNAL("incrementProgress()"),
                               check_iso.incrementProgress)
        QtCore.QObject.connect(pi, QtCore.SIGNAL("closeProgressDialog()"),
                               closeDialog)

        pi.start()
        check_iso.exec_()

        if not pi.checksum():
            message = """The checksum of the source cannot be validated.
Please specify a correct source or be sure that
you have downloaded the source correctly."""

            self.warningDialog(self.tr("Checksum invalid"), self.tr(message))

            return False

        return pi.checksum()
Example #2
0
    def __getSourceInfo(self, src):
        if QtCore.QString(src).isEmpty():
            self.warningDialog(self.tr("CD Image is Invalid"), self.tr("Please set an CD image path."))

            return False

        if not os.path.isfile(src):
            self.warningDialog(self.tr("CD Image is Invalid"), self.tr("Please check the CD image path."))

            return False

        iso_size = getIsoSize(src)
        iso_size_progress = iso_size / increment_value

        check_iso = ProgressBar(title = self.tr("Verify Checksum"),
                                message = self.tr("The checksum of the source is checking now..."),
                                max_value = iso_size_progress)
        pi = ProgressIncrementChecksum(check_iso, src)

        # FIX ME: Why is it in here?
        def closeDialog():
            pi.quit()
            check_iso.close()

        QtCore.QObject.connect(pi, QtCore.SIGNAL("incrementProgress()"), check_iso.incrementProgress)
        QtCore.QObject.connect(pi, QtCore.SIGNAL("closeProgressDialog()"), closeDialog)

        pi.start()
        check_iso.exec_()

        if not pi.checksum():
            message = """The checksum of the source cannot be validated.
Please specify a correct source or be sure that
you have downloaded the source correctly."""

            self.warningDialog(self.tr("Checksum invalid"), self.tr(message))

            return False

        return pi.checksum()
Example #3
0
 def __init__(self, src):
     self.wheel = ("\\", "|", "/", "-")
     self.tour = 52 - 2
     iso_size = getIsoSize(src)
     self.bytes = iso_size / 50
Example #4
0
 def __init__(self, src):
     self.wheel = ("\\", "|", "/", "-")
     self.tour = 52 - 2
     iso_size = getIsoSize(src)
     self.bytes = iso_size / 50