1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-18 07:23:03 +08:00

refactor(ALAboutDialog): replace hide/show methods with 'exec()' for dialog modal handling

This commit is contained in:
2025-12-09 08:19:25 +08:00
parent 7d064fc8e7
commit 069429be71
3 changed files with 68 additions and 35 deletions
+10 -10
View File
@@ -30,7 +30,7 @@ class ALAboutDialog(QDialog, Ui_ALAboutDialog):
def __init__( def __init__(
self, self,
parent=None parent = None
): ):
super().__init__(parent) super().__init__(parent)
@@ -67,21 +67,21 @@ Version: {AL_VERSION}<br>
Python version: {platform.python_version()}<br> Python version: {platform.python_version()}<br>
Qt version: {self.getQtVersion()}<br> Qt version: {self.getQtVersion()}<br>
<h4>Author Information:</h4> <h4>System Information:</h4>
Developer: KenanZhu<br> Processor: {platform.processor()}<br>
Contact: nanoki_zh@163.com<br> Operating system: {os_info['system']}<br>
GitHub: <a href="https://www.github.com/KenanZhu" style="text-decoration: none;">https://www.github.com/KenanZhu</a><br> System version: {os_info['version']}<br>
System architecture: {os_info['architecture']}<br>
<h4>Project Information:</h4> <h4>Project Information:</h4>
License: MIT License<br> License: MIT License<br>
Project repository: <a href="https://www.github.com/KenanZhu/AutoLibrary" style="text-decoration: none;">https://www.github.com/KenanZhu/AutoLibrary</a><br> Project repository: <a href="https://www.github.com/KenanZhu/AutoLibrary" style="text-decoration: none;">https://www.github.com/KenanZhu/AutoLibrary</a><br>
Project website: <a href="https://www.autolibrary.cv/" style="text-decoration: none;">https://www.autolibrary.cv/</a><br> Project website: <a href="https://www.autolibrary.cv/" style="text-decoration: none;">https://www.autolibrary.cv/</a><br>
<h4>System Information:</h4> <h4>Author Information:</h4>
Processor: {platform.processor()}<br> Developer: KenanZhu<br>
Operating system: {os_info['system']}<br> Contact: nanoki_zh@163.com<br>
System version: {os_info['version']}<br> GitHub: <a href="https://www.github.com/KenanZhu" style="text-decoration: none;">https://www.github.com/KenanZhu</a><br>
System architecture: {os_info['architecture']}<br>
""" """
return about_text return about_text
+56 -21
View File
@@ -6,25 +6,28 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>300</width> <width>400</width>
<height>300</height> <height>400</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>300</width> <width>400</width>
<height>300</height> <height>400</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>800</width> <width>800</width>
<height>300</height> <height>400</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>关于 - AutoLibrary</string> <string>关于 - AutoLibrary</string>
</property> </property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="ALAboutDialogLayout"> <layout class="QVBoxLayout" name="ALAboutDialogLayout">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
@@ -96,23 +99,55 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="AboutInfoEdit"> <layout class="QHBoxLayout" name="AboutInfoLayout">
<property name="font"> <property name="spacing">
<font> <number>0</number>
<family>Courier New</family>
<bold>false</bold>
</font>
</property> </property>
<property name="lineWrapMode"> <item>
<enum>QTextEdit::LineWrapMode::NoWrap</enum> <widget class="QFrame" name="frame">
</property> <property name="minimumSize">
<property name="readOnly"> <size>
<bool>true</bool> <width>56</width>
</property> <height>0</height>
<property name="textInteractionFlags"> </size>
<set>Qt::TextInteractionFlag::TextBrowserInteraction</set> </property>
</property> <property name="maximumSize">
</widget> <size>
<width>56</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="AboutInfoEdit">
<property name="font">
<font>
<family>Courier New</family>
<bold>false</bold>
</font>
</property>
<property name="lineWrapMode">
<enum>QTextEdit::LineWrapMode::NoWrap</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextInteractionFlag::TextBrowserInteraction</set>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QPushButton" name="CopyButton"> <widget class="QPushButton" name="CopyButton">
+2 -4
View File
@@ -58,7 +58,6 @@ class ALMainWindow(QMainWindow, Ui_ALMainWindow):
} }
self.__alTimerTaskWidget = None self.__alTimerTaskWidget = None
self.__alConfigWidget = None self.__alConfigWidget = None
self.__alAboutDialog = None
self.__auto_lib_thread = None self.__auto_lib_thread = None
self.__current_timer_task_thread = None self.__current_timer_task_thread = None
self.__is_running_timer_task = False self.__is_running_timer_task = False
@@ -85,9 +84,8 @@ class ALMainWindow(QMainWindow, Ui_ALMainWindow):
self self
): ):
if self.__alAboutDialog is None: about_dialog = ALAboutDialog(self)
self.__alAboutDialog = ALAboutDialog(self) about_dialog.exec()
self.__alAboutDialog.show()
def onManualActionTriggered( def onManualActionTriggered(