Ejemplo n.º 1
0
    def __get_source_info(self, src):
        if QtCore.QString(src).isEmpty():
            self.warning_dialog(self.tr("CD Image is Invalid"), self.tr("Please set an CD image path."))

            return False

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

            return False

        iso_size = get_iso_size(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 close_dialog():
            pi.quit()
            check_iso.close()

        QtCore.QObject.connect(pi, QtCore.SIGNAL("increment_progress()"), check_iso.increment_progress)
        QtCore.QObject.connect(pi, QtCore.SIGNAL("closeProgressDialog()"), close_dialog)

        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.warning_dialog(self.tr("Checksum invalid"), self.tr(message))

            return False

        return pi.checksum()
Ejemplo n.º 2
0
    def __get_source_info(self, src):
        if QtCore.QString(src).isEmpty():
            self.warning_dialog(self.tr("CD Image is Invalid"), self.tr("Please set an CD image path."))

            return False

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

            return False

        iso_size = get_iso_size(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 close_dialog():
            pi.quit()
            check_iso.close()

        QtCore.QObject.connect(pi, QtCore.SIGNAL("increment_progress()"), check_iso.increment_progress)
        QtCore.QObject.connect(pi, QtCore.SIGNAL("closeProgressDialog()"), close_dialog)

        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.warning_dialog(self.tr("Checksum invalid"), self.tr(message))

            return False

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