patch: Minor Enhancements

This commit is contained in:
Mr Finchum 2025-02-01 14:58:32 +00:00
parent 0c450328b3
commit 1bba7f8bbc
4 changed files with 27 additions and 13 deletions

View file

@ -1,6 +1,11 @@
# Changelog # Changelog
## 0.8.x ## 0.8.x
### 0.8.4: Minor Enhancements & Cleanup
- Updated window titles.
- Improved error handling for updater: now displays the specific error message instead of just **"error"** when an issue occurs during update checks.
- Ensured all child windows close when the main window is closed.
### 0.8.3: Fix OptimaLab35 Not Closing After Update ### 0.8.3: Fix OptimaLab35 Not Closing After Update
- Fixed an issue where **OptimaLab35** would not close properly when updating, resulting in an unresponsive instance and multiple running processes. - Fixed an issue where **OptimaLab35** would not close properly when updating, resulting in an unresponsive instance and multiple running processes.

View file

@ -53,7 +53,7 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
# Change UI elements # Change UI elements
self.change_statusbar(f"Using {self.o.name} v{self.o.version}", 5000) self.change_statusbar(f"Using {self.o.name} v{self.o.version}", 5000)
self.setWindowTitle(f"{self.name} v{self.version}") self.set_title()
self.default_ui_layout() self.default_ui_layout()
self.define_gui_interaction() self.define_gui_interaction()
@ -63,6 +63,13 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
self.ui.png_quality_Slider.setVisible(False) self.ui.png_quality_Slider.setVisible(False)
self.ui.quality_label_2.setVisible(False) self.ui.quality_label_2.setVisible(False)
def set_title(self):
if self.version == "0.0.1":
title = f"{self.name} DEV MODE"
else:
title = self.name
self.setWindowTitle(title)
def define_gui_interaction(self): def define_gui_interaction(self):
self.ui.input_folder_button.clicked.connect(self.browse_input_folder) self.ui.input_folder_button.clicked.connect(self.browse_input_folder)
self.ui.output_folder_button.clicked.connect(self.browse_output_folder) self.ui.output_folder_button.clicked.connect(self.browse_output_folder)
@ -108,7 +115,7 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
info_text = f""" info_text = f"""
<h3>{self.name} v{self.version}</h3> <h3>{self.name} v{self.version}</h3>
<p>(C) 2024-2025 Mr Finchum aka CodeByMrFinchum</p> <p>(C) 2024-2025 Mr Finchum aka CodeByMrFinchum</p>
<p>{self.name} is a GUI for {self.o.name} (v{self.o.version}), enhancing its functionality with a\nuser-friendly interface for efficient image and metadata management.</p> <p>{self.name} is a GUI for {self.o.name} (v{self.o.version}), enhancing its functionality with a user-friendly interface for efficient image and metadata management.</p>
<h4>Features:</h4> <h4>Features:</h4>
<ul> <ul>
@ -462,6 +469,10 @@ class OptimaLab35(QMainWindow, Ui_MainWindow):
elif do == "write": elif do == "write":
self.u.write_yaml(self.exif_file, self.available_exif_data) self.u.write_yaml(self.exif_file, self.available_exif_data)
def closeEvent(self, event):
QApplication.closeAllWindows()
event.accept()
class UpdaterWindow(QMainWindow, Ui_Updater_Window): class UpdaterWindow(QMainWindow, Ui_Updater_Window):
# Mixture of code by me, code/functions refactored by ChatGPT and code directly from ChatGPT # Mixture of code by me, code/functions refactored by ChatGPT and code directly from ChatGPT
def __init__(self, optimalab35_localversion, optima35_localversion): def __init__(self, optimalab35_localversion, optima35_localversion):
@ -490,7 +501,7 @@ class UpdaterWindow(QMainWindow, Ui_Updater_Window):
def define_gui_interaction(self): def define_gui_interaction(self):
"""Setup UI interactions.""" """Setup UI interactions."""
if self.optimalab35_localversion == "0.0.2": if self.optimalab35_localversion == "0.0.1":
self.dev_mode() self.dev_mode()
return return
else: else:
@ -524,7 +535,7 @@ class UpdaterWindow(QMainWindow, Ui_Updater_Window):
# Check OptimaLab35 update # Check OptimaLab35 update
is_newer_ol35, latest_version_ol35 = self.ppu_ol35.check_for_update(True) is_newer_ol35, latest_version_ol35 = self.ppu_ol35.check_for_update(True)
if is_newer_ol35 is None: if is_newer_ol35 is None:
self.ui.label_optimalab35_latestversion.setText("Error") self.ui.label_optimalab35_latestversion.setText(latest_version_ol35[0:13])
else: else:
self.ui.label_optimalab35_latestversion.setText(latest_version_ol35) self.ui.label_optimalab35_latestversion.setText(latest_version_ol35)
self.updates_available["OptimaLab35"] = is_newer_ol35 self.updates_available["OptimaLab35"] = is_newer_ol35
@ -532,7 +543,7 @@ class UpdaterWindow(QMainWindow, Ui_Updater_Window):
# Check optima35 update # Check optima35 update
is_newer_o35, latest_version_o35 = self.ppu_o35.check_for_update(True) is_newer_o35, latest_version_o35 = self.ppu_o35.check_for_update(True)
if is_newer_o35 is None: if is_newer_o35 is None:
self.ui.label_optima35_latestversion.setText("Error") self.ui.label_optima35_latestversion.setText(latest_version_o35[0:13])
else: else:
self.ui.label_optima35_latestversion.setText(latest_version_o35) self.ui.label_optima35_latestversion.setText(latest_version_o35)
self.updates_available["optima35"] = is_newer_o35 self.updates_available["optima35"] = is_newer_o35
@ -598,8 +609,6 @@ class UpdaterWindow(QMainWindow, Ui_Updater_Window):
python = sys.executable python = sys.executable
os.execl(python, python, *sys.argv) os.execl(python, python, *sys.argv)
class PreviewWindow(QMainWindow, Ui_Preview_Window): class PreviewWindow(QMainWindow, Ui_Preview_Window):
values_selected = Signal(int, int, bool) values_selected = Signal(int, int, bool)

View file

@ -23,7 +23,7 @@ class Ui_Updater_Window(object):
if not Updater_Window.objectName(): if not Updater_Window.objectName():
Updater_Window.setObjectName(u"Updater_Window") Updater_Window.setObjectName(u"Updater_Window")
Updater_Window.setEnabled(True) Updater_Window.setEnabled(True)
Updater_Window.resize(372, 224) Updater_Window.resize(372, 251)
self.centralwidget = QWidget(Updater_Window) self.centralwidget = QWidget(Updater_Window)
self.centralwidget.setObjectName(u"centralwidget") self.centralwidget.setObjectName(u"centralwidget")
self.gridLayout_2 = QGridLayout(self.centralwidget) self.gridLayout_2 = QGridLayout(self.centralwidget)
@ -128,8 +128,8 @@ class Ui_Updater_Window(object):
# setupUi # setupUi
def retranslateUi(self, Updater_Window): def retranslateUi(self, Updater_Window):
Updater_Window.setWindowTitle(QCoreApplication.translate("Updater_Window", u"OptimaLab35 - Updater", None)) Updater_Window.setWindowTitle(QCoreApplication.translate("Updater_Window", u"Updater", None))
self.label_last_check.setText(QCoreApplication.translate("Updater_Window", u"Last update check ago:", None)) self.label_last_check.setText(QCoreApplication.translate("Updater_Window", u"Last update check:", None))
self.label_last_check_2.setText(QCoreApplication.translate("Updater_Window", u"TextLabel", None)) self.label_last_check_2.setText(QCoreApplication.translate("Updater_Window", u"TextLabel", None))
self.label_6.setText(QCoreApplication.translate("Updater_Window", u"Local Version", None)) self.label_6.setText(QCoreApplication.translate("Updater_Window", u"Local Version", None))
self.label_optimalab35_latestversion.setText(QCoreApplication.translate("Updater_Window", u"unknown", None)) self.label_optimalab35_latestversion.setText(QCoreApplication.translate("Updater_Window", u"unknown", None))

View file

@ -10,18 +10,18 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>372</width> <width>372</width>
<height>224</height> <height>251</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>OptimaLab35 - Updater</string> <string>Updater</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_last_check"> <widget class="QLabel" name="label_last_check">
<property name="text"> <property name="text">
<string>Last update check ago:</string> <string>Last update check:</string>
</property> </property>
</widget> </widget>
</item> </item>