Few new checks and options, see changelog.
This commit is contained in:
parent
aea48c279a
commit
182b0f9fe0
4 changed files with 782 additions and 195 deletions
|
@ -57,10 +57,6 @@ class PreviewWindow(QMainWindow, Ui_Preview_Window):
|
|||
self.ui.image_path_lineEdit.setText(file[0])
|
||||
self._update_preview()
|
||||
|
||||
def _supdate_preview(self):
|
||||
self._update_preview()
|
||||
pass
|
||||
|
||||
def _update_preview(self):
|
||||
path = self.ui.image_path_lineEdit.text()
|
||||
if not os.path.isfile(path):
|
||||
|
@ -70,15 +66,13 @@ class PreviewWindow(QMainWindow, Ui_Preview_Window):
|
|||
save = False,
|
||||
image_input_file = path,
|
||||
image_output_file = "",
|
||||
quality = 50,
|
||||
optimize = True,
|
||||
grayscale = self.ui.grayscale_checkBox.isChecked(),
|
||||
brightness = int(self.ui.brightness_spinBox.text()),
|
||||
contrast = int(self.ui.contrast_spinBox.text()),
|
||||
)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
QMessageBox.warning(self, "Warning", "Error loading image...")
|
||||
print("Error loading image...")
|
||||
print(f"Error loading image...\n{e}")
|
||||
return
|
||||
# Create a QPixmap object from an image file
|
||||
|
||||
|
@ -99,6 +93,7 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
|
|||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
self.o = OptimaManager()
|
||||
self.check_version()
|
||||
self.u = Utilities()
|
||||
self.u.program_configs()
|
||||
self.exif_file = os.path.expanduser("~/.config/OptimaLab35/exif.yaml")
|
||||
|
@ -156,13 +151,14 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
|
|||
self.ui.progressBar.setValue(0)
|
||||
|
||||
def _info_window(self):
|
||||
# ChatGPT, mainly
|
||||
info_text = f"""
|
||||
<h3>{self.name} v{self.version}</h3>
|
||||
<p>{self.name} is a GUI for <b>{self.o.name}</b> (v{self.o.version}).</p>
|
||||
<p>For more details, visit:</p>
|
||||
<p> Both projects are in active development, for more details, visit:</p>
|
||||
<ul>
|
||||
<li><a href="https://gitlab.com/CodeByMrFinchum/OptimaLab35">OptimaLab35 GitLab</a></li>
|
||||
<li><a href="https://gitlab.com/CodeByMrFinchum/optima35">Optima35 GitLab</a></li>
|
||||
<li><a href="https://gitlab.com/CodeByMrFinchum/optima35">optima35 GitLab</a></li>
|
||||
</ul>
|
||||
"""
|
||||
|
||||
|
@ -278,9 +274,27 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
|
|||
elif index == 0: # Main Tab
|
||||
self._handle_exif_file("write")
|
||||
|
||||
def _sort_dict_of_lists(self, input_dict):
|
||||
# Partily ChatGPT
|
||||
sorted_dict = {}
|
||||
for key, lst in input_dict.items():
|
||||
# Sort alphabetically for strings, numerically for numbers
|
||||
if key == "iso":
|
||||
lst = [int(x) for x in lst]
|
||||
lst = sorted(lst)
|
||||
lst = [str(x) for x in lst]
|
||||
sorted_dict["iso"] = lst
|
||||
|
||||
elif all(isinstance(x, str) for x in lst):
|
||||
sorted_dict[key] = sorted(lst, key=str.lower) # Case-insensitive sort for strings
|
||||
|
||||
return sorted_dict
|
||||
|
||||
|
||||
def _handle_exif_file(self, do):
|
||||
if do == "read":
|
||||
self.available_exif_data = self.u.read_yaml(self.exif_file)
|
||||
file_dict = self.u.read_yaml(self.exif_file)
|
||||
self.available_exif_data = self._sort_dict_of_lists(file_dict)
|
||||
elif do == "write":
|
||||
self.u.write_yaml(self.exif_file, self.available_exif_data)
|
||||
|
||||
|
@ -297,6 +311,7 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
|
|||
"artist": self.ui.artist_comboBox,
|
||||
"copyright_info": self.ui.copyright_info_comboBox,
|
||||
}
|
||||
|
||||
self._populate_comboboxes(combo_mapping)
|
||||
|
||||
def _populate_comboboxes(self, combo_mapping):
|
||||
|
@ -400,7 +415,9 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
|
|||
self.settings["contrast"] = int(self.ui.contrast_spinBox.text()) if self.ui.contrast_spinBox.text() != "0" else None
|
||||
#self._get_spinbox_value(self.ui.contrast_spinBox) if self.ui.contrast_checkbox.isChecked() else None
|
||||
|
||||
self.settings["new_file_names"] = self._get_text_value(self.ui.filename, False) if self.ui.rename_checkbox.isChecked() else False
|
||||
new_name = self._get_text_value(self.ui.filename, False) if self.ui.rename_checkbox.isChecked() else False
|
||||
if isinstance(new_name, str): new_name = new_name.replace(" ", "_")
|
||||
self.settings["new_file_names"] = new_name
|
||||
self.settings["watermark"] = self.ui.watermark_lineEdit.text() if len(self.ui.watermark_lineEdit.text()) != 0 else None
|
||||
#self._get_text_value(self.ui.watermark_lineEdit) if self.ui.watermark_checkbox.isChecked() else None
|
||||
|
||||
|
@ -426,12 +443,27 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
|
|||
user_data["user_comment"] = self.ui.user_comment_comboBox.currentText()
|
||||
user_data["artist"] = self.ui.artist_comboBox.currentText()
|
||||
user_data["copyright_info"] = self.ui.copyright_info_comboBox.currentText()
|
||||
user_data["software"] = f"{self.o.name} {self.o.version}"
|
||||
user_data["software"] = f"{self.name} {self.version} with {self.o.name} {self.o.version}"
|
||||
return user_data
|
||||
|
||||
def closeEvent(self, event):
|
||||
self.preview_window.close()
|
||||
|
||||
def check_version(self, min_version="0.6.5-a1"):
|
||||
# Mainly ChatGPT
|
||||
from packaging import version # Use `packaging` for robust version comparison
|
||||
|
||||
current_version = self.o.version
|
||||
if version.parse(current_version) < version.parse(min_version):
|
||||
msg = (
|
||||
f"optima35 version {current_version} detected.\n"
|
||||
f"Minimum required version is {min_version}.\n"
|
||||
"Please update the core package to continue.\n"
|
||||
"https://pypi.org/project/optima35/"
|
||||
)
|
||||
QMessageBox.critical(None, "Version Error", msg)
|
||||
sys.exit(1)
|
||||
|
||||
def main():
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
window = OptimaLab35()
|
||||
|
|
|
@ -69,7 +69,7 @@ class ExifEditor(QMainWindow):
|
|||
self.list_widget.addItem(new_item)
|
||||
self.line_edit.clear()
|
||||
else:
|
||||
QMessageBox.warning(self, "Warning", "Cannot add an empty item.")
|
||||
QMessageBox.warning(self, "Warning", f"Cannot add an empty item.\nDelete {self.exif_file}...")
|
||||
|
||||
def delete_item(self):
|
||||
"""Delete the selected item from the list."""
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>450</width>
|
||||
<height>708</height>
|
||||
<width>440</width>
|
||||
<height>756</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
|
@ -18,7 +18,7 @@
|
|||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<width>1000</width>
|
||||
<height>1000</height>
|
||||
</size>
|
||||
</property>
|
||||
|
@ -52,6 +52,23 @@
|
|||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="input_folder_button">
|
||||
<property name="text">
|
||||
<string>input</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="output_path">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter output folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="input_path">
|
||||
<property name="text">
|
||||
|
@ -62,24 +79,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="output_path">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter output folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="input_folder_button">
|
||||
<property name="text">
|
||||
<string>input</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="output_folder_button">
|
||||
<property name="text">
|
||||
<string>output</string>
|
||||
|
@ -101,33 +101,83 @@
|
|||
<string>Essential group</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="resize_checkbox">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="quality_label_2">
|
||||
<property name="text">
|
||||
<string>Resize</string>
|
||||
<string>Quality</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="resize_spinBox">
|
||||
<item row="3" column="3">
|
||||
<widget class="QSpinBox" name="jpg_quality_spinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>90</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Export Format</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="optimize_checkBox">
|
||||
<property name="text">
|
||||
<string>optimize</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QSlider" name="png_quality_Slider">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="sliderPosition">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QSpinBox" name="png_quality_spinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>200</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>80</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="quality_label_1">
|
||||
<property name="text">
|
||||
<string>Quality</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="image_type">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -146,21 +196,47 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="jpg_quality_spinBox">
|
||||
<item row="3" column="2">
|
||||
<widget class="QSlider" name="jpg_quality_Slider">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>80</number>
|
||||
<property name="sliderPosition">
|
||||
<number>90</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QSpinBox" name="png_quality_spinBox">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Resize</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QSlider" name="resize_Slider">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>200</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QSpinBox" name="resize_spinBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -168,27 +244,17 @@
|
|||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9</number>
|
||||
<number>200</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="optimize_checkBox">
|
||||
<property name="text">
|
||||
<string>optimize</string>
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>png_quality_spinBox</zorder>
|
||||
<zorder>resize_checkbox</zorder>
|
||||
<zorder>resize_spinBox</zorder>
|
||||
<zorder>image_type</zorder>
|
||||
<zorder>jpg_quality_spinBox</zorder>
|
||||
<zorder>optimize_checkBox</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -199,14 +265,124 @@
|
|||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Extra stuff</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="3" column="0" colspan="3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Brightness</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="brightness_horizontalSlider">
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QSpinBox" name="brightness_spinBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QSpinBox" name="contrast_spinBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Contrast</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSlider" name="contrast_horizontalSlider">
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="grayscale_checkBox">
|
||||
<property name="text">
|
||||
<string>Turn image to Black and White</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="preview_Button">
|
||||
<property name="text">
|
||||
<string>Preview</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Watermark</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="watermark_lineEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
|
@ -216,67 +392,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="brightness_checkbox">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Brightness</string>
|
||||
<string>Size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="grayscale_checkBox">
|
||||
<property name="text">
|
||||
<string>Grayscale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="contrast_spinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="watermark_checkbox">
|
||||
<property name="text">
|
||||
<string>Watermark</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="brightness_spinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="contrast_checkbox">
|
||||
<property name="text">
|
||||
<string>Contrast</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item>
|
||||
<widget class="QComboBox" name="font_size_comboBox">
|
||||
<property name="currentText">
|
||||
<string>Normal</string>
|
||||
|
@ -671,90 +794,43 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>450</width>
|
||||
<width>440</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuInfo">
|
||||
<property name="title">
|
||||
<string>Info</string>
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<addaction name="actionInfo"/>
|
||||
<addaction name="actionPreview"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<addaction name="menuInfo"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<action name="actionInfo">
|
||||
<property name="text">
|
||||
<string>Info</string>
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPreview">
|
||||
<property name="text">
|
||||
<string>Preview image</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>resize_checkbox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>resize_spinBox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>75</x>
|
||||
<y>96</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>196</x>
|
||||
<y>118</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>brightness_checkbox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>brightness_spinBox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>83</x>
|
||||
<y>363</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>83</x>
|
||||
<y>399</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>contrast_checkbox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>contrast_spinBox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>185</x>
|
||||
<y>363</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>185</x>
|
||||
<y>399</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>watermark_checkbox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>watermark_lineEdit</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>83</x>
|
||||
<y>435</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>237</x>
|
||||
<y>435</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>rename_checkbox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
|
@ -915,5 +991,181 @@
|
|||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>brightness_horizontalSlider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>brightness_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>187</x>
|
||||
<y>393</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>378</x>
|
||||
<y>393</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>brightness_spinBox</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>brightness_horizontalSlider</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>378</x>
|
||||
<y>393</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>187</x>
|
||||
<y>393</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>contrast_horizontalSlider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>contrast_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>187</x>
|
||||
<y>458</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>378</x>
|
||||
<y>458</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>contrast_spinBox</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>contrast_horizontalSlider</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>378</x>
|
||||
<y>458</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>187</x>
|
||||
<y>458</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>resize_Slider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>resize_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>218</x>
|
||||
<y>252</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>380</x>
|
||||
<y>252</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>jpg_quality_Slider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>jpg_quality_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>218</x>
|
||||
<y>289</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>380</x>
|
||||
<y>289</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>jpg_quality_spinBox</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>jpg_quality_Slider</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>380</x>
|
||||
<y>289</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>218</x>
|
||||
<y>289</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>resize_spinBox</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>resize_Slider</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>380</x>
|
||||
<y>252</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>218</x>
|
||||
<y>252</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>resize_Slider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>resize_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>218</x>
|
||||
<y>252</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>380</x>
|
||||
<y>252</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>png_quality_Slider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>png_quality_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>218</x>
|
||||
<y>326</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>380</x>
|
||||
<y>326</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>png_quality_spinBox</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>png_quality_Slider</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>380</x>
|
||||
<y>326</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>218</x>
|
||||
<y>326</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
|
303
src/OptimaLab35/ui/preview_window.ui
Normal file
303
src/OptimaLab35/ui/preview_window.ui
Normal file
|
@ -0,0 +1,303 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Preview_Window</class>
|
||||
<widget class="QMainWindow" name="Preview_Window">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>803</width>
|
||||
<height>700</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>700</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>OptimaLab35 - Preview</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="QLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>628</width>
|
||||
<height>628</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>628</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="image_path_lineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Path to image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="load_Button">
|
||||
<property name="text">
|
||||
<string>Select image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Brightness</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="brightness_spinBox">
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="brightness_Slider">
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="reset_brightness_Button">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Contrast</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="contrast_spinBox">
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="contrast_Slider">
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="reset_contrast_Button">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="grayscale_checkBox">
|
||||
<property name="text">
|
||||
<string>Grayscale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="update_Button">
|
||||
<property name="text">
|
||||
<string>Update preview</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_4" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Copy values to main window when closing</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Copy Values</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="close_Button">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>803</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>brightness_Slider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>brightness_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>720</x>
|
||||
<y>311</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>706</x>
|
||||
<y>282</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>brightness_spinBox</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>brightness_Slider</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>706</x>
|
||||
<y>282</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>720</x>
|
||||
<y>311</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>contrast_Slider</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>contrast_spinBox</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>720</x>
|
||||
<y>454</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>699</x>
|
||||
<y>425</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>contrast_spinBox</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>contrast_Slider</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>699</x>
|
||||
<y>425</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>720</x>
|
||||
<y>454</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
Loading…
Add table
Add a link
Reference in a new issue