~nora/qt-sandbox

b8e5fa5c5955cbc1f1a1aac8670608bebf62d515 — nora 1 year, 7 months ago bbf1171
Fix converter application
1 files changed, 4 insertions(+), 5 deletions(-)

M converter/package/main_window.py
M converter/package/main_window.py => converter/package/main_window.py +4 -5
@@ 19,10 19,9 @@ class Worker(QtCore.QObject):

    def convert_images(self):
        for item in self.images:
            if self.run and not item.processe:
            if self.run and not item.processed:
                image = CustomImage(path=item.text(), folder=self.folder)
                success = image.reduce(size=self.size, quality=self.quality)
                time.sleep(2)
                self.image_converted.emit(item, success)

        self.finished.emit()


@@ 106,7 105,7 @@ class MainWindow(QtWidgets.QWidget):
        folder = self.le_dir.text()

        lw_items = [self.lw_files.item(i) for i in range(self.lw_files.count())]
        img_to_convert = [1 for i in lw_items if not i.processe]
        img_to_convert = [1 for i in lw_items if not i.processed]
        if not img_to_convert:
            msg = QtWidgets.QMessageBox(QtWidgets.QMessageBox.Warning,
                                        "Aucune image à convertir",


@@ 134,7 133,7 @@ class MainWindow(QtWidgets.QWidget):
    def image_converted(self, lw_item, success):
        if success:
            lw_item.setIcon(self.ico_checked)
            lw_item.processe = True
            lw_item.processed = True
            self.prg_dialog.setValue(self.prg_dialog.value() + 1)

    def delete_selected_items(self):


@@ 159,5 158,5 @@ class MainWindow(QtWidgets.QWidget):
        if path not in items:
            lw_item = QtWidgets.QListWidgetItem(path)
            lw_item.setIcon(self.ico_unchecked)
            lw_item.processe = False
            lw_item.processed = False
            self.lw_files.addItem(lw_item)