From 69d028c286027531e9b15cdaacb824e2b6cd5085 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Tue, 11 Jan 2022 17:15:46 +0100 Subject: [PATCH] add icc edit button and label (not working yet) --- .../fablabchemnitz/output_pro/output_pro.py | 28 ++++++++++++++++-- .../fablabchemnitz/output_pro/result-imp.jpeg | Bin 12581 -> 81305 bytes 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/extensions/fablabchemnitz/output_pro/output_pro.py b/extensions/fablabchemnitz/output_pro/output_pro.py index cd73fc2e..799e7848 100644 --- a/extensions/fablabchemnitz/output_pro/output_pro.py +++ b/extensions/fablabchemnitz/output_pro/output_pro.py @@ -223,6 +223,26 @@ class OutputPro(inkex.EffectExtension): self.general_options_panel_jpeg = QtWidgets.QWidget(parent=self.general_options_panel) self.general_options_panel_jpeg.setVisible(False) + self.icc_dir_textbox_label = QtWidgets.QLabel(parent=self.general_options_panel_jpeg) + self.icc_dir_textbox_label.setText(_(u"ICC profile folder")) + self.icc_dir_textbox_label.setGeometry(10, 280, 120, 25) + + self.icc_dir_textbox = QtWidgets.QLineEdit(parent=self.general_options_panel_jpeg) + self.icc_dir_textbox.setReadOnly(True) + self.icc_dir_textbox.setGeometry(130, 280, 140, 25) + self.icc_dir_textbox.setText(icc_dir) + + self.icc_dir_button = QtWidgets.QPushButton(_("Change"), parent=self.general_options_panel_jpeg) + self.icc_dir_button.setGeometry(283, 280, 50, 25) + self.icc_dir_button.clicked.connect(self.change_icc_dir) + + + #self.icc_select = QtWidgets.QFileDialog() + #self.icc_select.setFileMode(QtGui.QFileDialog.DirectoryOnly) + #self.icc_select.setSidebarUrls([QtCore.QUrl.fromLocalFile(place)]) + #icc_dir = self.icc_select.getExistingDirectory(self, 'ICC profile folder') + #inkex.utils.debug(icc_dir) + self.color_mode_title_jpeg = QtWidgets.QLabel(parent=self.general_options_panel_jpeg) self.color_mode_title_jpeg.setText(_(u"Color mode").upper()) self.color_mode_title_jpeg.setGeometry(10, 10, 260, 15) @@ -243,8 +263,9 @@ class OutputPro(inkex.EffectExtension): self.quality_title_jpeg.setGeometry(285, 10, 100, 15) self.quality_title_jpeg.setFont(QtGui.QFont('Ubuntu', 8)) + jpeg_quality = 90 self.quality_percent_title_jpeg = QtWidgets.QLabel(parent=self.general_options_panel_jpeg) - self.quality_percent_title_jpeg.setText('50%') + self.quality_percent_title_jpeg.setText('{}%'.format(jpeg_quality)) self.quality_percent_title_jpeg.setGeometry(505, 10, 100, 40) self.quality_percent_title_jpeg.setFont(QtGui.QFont('Ubuntu', 12, 75)) self.quality_percent_title_jpeg.setAlignment(QtCore.Qt.AlignRight) @@ -265,7 +286,7 @@ class OutputPro(inkex.EffectExtension): self.quality_choice_dial_jpeg.setRange(1,100) self.quality_choice_dial_jpeg.setGeometry(415, 10, 60, 60) self.quality_choice_dial_jpeg.setNotchesVisible(True) - self.quality_choice_dial_jpeg.setValue(50) + self.quality_choice_dial_jpeg.setValue(jpeg_quality) self.quality_choice_dial_jpeg.sliderReleased.connect(self.generate_preview) self.quality_choice_dial_jpeg.valueChanged.connect(self.change_quality_live_jpeg) @@ -1060,6 +1081,9 @@ class OutputPro(inkex.EffectExtension): else: shutil.copy2(result_imp, target_imp) + def change_icc_dir(self): + inkex.utils.debug("change_icc_dir") + app = QtWidgets.QApplication(sys.argv) app.main = mainWindow() getattr(app.main, "raise")() diff --git a/extensions/fablabchemnitz/output_pro/result-imp.jpeg b/extensions/fablabchemnitz/output_pro/result-imp.jpeg index 63415c9c675a8fb8c22b78132a434f7a17e79679..d81d6990fbed9c0774b28cfb5ee31544df516807 100644 GIT binary patch delta 49 kcmZ3QH1jvhgv~7M9Ne}Wx91pac3^z0kAq;9W%_>;0P0y2Pyhe` delta 19 bcmbRFn`LRzgv~50GE6TvZqG4b`hODuRs9Ih