Skip to content

The only downloader you need. 下载器的集大成者。

fix(view): 修复 PopUpWindow 可能导致系统闪退的问题; 优化 GitHub Action 脚本

XiaoYouChRef09e30a52e4
diff --git a/.github/workflows/deploy-application.yml b/.github/workflows/deploy-application.yml
index 3e8babad..4db399ab 100644
--- a/.github/workflows/deploy-application.yml
+++ b/.github/workflows/deploy-application.yml
@@ -4,37 +4,37 @@ on:
workflow_dispatch:
jobs:
-# build-windows:
-# strategy:
-# matrix:
-# architecture: [x86_64, arm64]
-# runs-on: windows-latest
-# steps:
-# - name: Checkout code
-# uses: actions/checkout@v2
-#
-# - name: Set up Python 3.11
-# uses: actions/setup-python@v4
-# with:
-# python-version: '3.11'
-#
-# - name: Install dependencies
-# run: |
-# pip install --timeout=300 -r requirements.txt
-# pip install nuitka==2.5.4
-#
-# - name: Build with Nuitka
-# run: |
-# mv main.py Ghost-Downloader-3.py
-# nuitka --standalone --enable-plugin=pyside6 --show-memory --output-dir=output --windows-console-mode=disable --windows-icon-from-ico=resources/logo.ico --company-name=XiaoYouChR --product-name="Ghost Downloader" --file-description="Ghost Downloader" --copyright="Copyright(C) 2024 XiaoYouChR" --file-version=3.5.1 --product-version=3.5.1 Ghost-Downloader-3.py
-## nuitka --module plugins/jy_os_page.py
-## mv jy_os_page*.pyd output/
-#
-# - name: Upload artifacts
-# uses: actions/upload-artifact@v4
-# with:
-# name: Ghost-Downloader-v3.5.1-Windows-${{ matrix.architecture }}
-# path: output/Ghost-Downloader-3.dist
+ build-windows:
+ strategy:
+ matrix:
+ architecture: [x86_64, arm64]
+ runs-on: windows-2019
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Set up Python 3.11
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.11'
+
+ - name: Install dependencies
+ run: |
+ pip install --timeout=300 -r requirements.txt
+ pip install nuitka==2.5.4
+
+ - name: Build with Nuitka
+ run: |
+ mv main.py Ghost-Downloader-3.py
+ nuitka --standalone --enable-plugin=pyside6 --show-memory --output-dir=output --windows-console-mode=disable --windows-icon-from-ico=resources/logo.ico --company-name=XiaoYouChR --product-name="Ghost Downloader" --file-description="Ghost Downloader" --copyright="Copyright(C) 2024 XiaoYouChR" --file-version=3.5.1 --product-version=3.5.1 Ghost-Downloader-3.py
+# nuitka --module plugins/jy_os_page.py
+# mv jy_os_page*.pyd output/
+
+ - name: Upload artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: Ghost-Downloader-v3.5.1-Windows-${{ matrix.architecture }}
+ path: output/Ghost-Downloader-3.dist
build-macos-14-arm:
strategy:
@@ -112,41 +112,41 @@ jobs:
name: Ghost-Downloader-v${{ env.VERSION }}-macOS-${{ matrix.architecture }}
path: Ghost-Downloader-3.dmg
-# build-ubuntu:
-# strategy:
-# matrix:
-# architecture: [x86_64, arm64]
-# runs-on: ubuntu-20.04
-# steps:
-# - name: Checkout code
-# uses: actions/checkout@v2
-#
-# - name: Set up Python 3.11
-# uses: actions/setup-python@v4
-# with:
-# python-version: '3.11'
-#
-# - name: Install dependencies
-# run: |
-# sudo apt-get update
-# sudo apt-get install -y libegl1-mesa
-# pip install --timeout=300 -r requirements.txt
-# pip install nuitka
-#
-# - name: Build with Nuitka
-# run: |
-# mv main.py "Ghost-Downloader-3.py"
-# python -c "import sys; sys.path.append('./app/common'); import config; print(config.VERSION)" > version.txt
-# version=$(sed -n '4p' version.txt)
-# echo "VERSION=$version" >> "$GITHUB_ENV"
-# echo "VERSION=${{ env.VERSION }}"
-# nuitka --standalone --enable-plugin=pyside6 --show-memory --output-dir=output --disable-console --company-name=XiaoYouChR --product-name="Ghost-Downloader-3" --file-description="Ghost-Downloader-3" --copyright="Copyright(C) 2024 XiaoYouChR" --file-version=$version --product-version=$version "Ghost-Downloader-3.py"
-## nuitka --module plugins/jy_os_page.py
-## mkdir -p "output/Ghost-Downloader-3.dist/plugins/"
-## mv jy_os_page*.so "output/Ghost-Downloader-3.dist/plugins/"
-#
-# - name: Upload artifacts
-# uses: actions/upload-artifact@v4
-# with:
-# name: Ghost-Downloader-v${{ env.VERSION }}-Linux-${{ matrix.architecture }}
-# path: output/Ghost-Downloader-3.dist
+ build-ubuntu:
+ strategy:
+ matrix:
+ architecture: [x86_64, arm64]
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Set up Python 3.11
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.11'
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libegl1-mesa
+ pip install --timeout=300 -r requirements.txt
+ pip install nuitka
+
+ - name: Build with Nuitka
+ run: |
+ mv main.py "Ghost-Downloader-3.py"
+ python -c "import sys; sys.path.append('./app/common'); import config; print(config.VERSION)" > version.txt
+ version=$(sed -n '4p' version.txt)
+ echo "VERSION=$version" >> "$GITHUB_ENV"
+ echo "VERSION=${{ env.VERSION }}"
+ nuitka --standalone --enable-plugin=pyside6 --show-memory --output-dir=output --disable-console --company-name=XiaoYouChR --product-name="Ghost-Downloader-3" --file-description="Ghost-Downloader-3" --copyright="Copyright(C) 2024 XiaoYouChR" --file-version=$version --product-version=$version "Ghost-Downloader-3.py"
+# nuitka --module plugins/jy_os_page.py
+# mkdir -p "output/Ghost-Downloader-3.dist/plugins/"
+# mv jy_os_page*.so "output/Ghost-Downloader-3.dist/plugins/"
+
+ - name: Upload artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: Ghost-Downloader-v${{ env.VERSION }}-Linux-${{ matrix.architecture }}
+ path: output/Ghost-Downloader-3.dist
diff --git a/app/view/pop_up_window.py b/app/view/pop_up_window.py
index b9dca157..a5cf569e 100644
--- a/app/view/pop_up_window.py
+++ b/app/view/pop_up_window.py
@@ -33,6 +33,8 @@ class PopUpWindowBase(QWidget, Ui_PopUpWindow):
self.globalPath.lineTo(0, self.height())
self.globalPath.lineTo(0, 0)
+ self.geometryAnimation = QPropertyAnimation(self, b"geometry")
+
# 设置界面图标和文字
self.setStyleSheet(
"""
@@ -122,7 +124,6 @@ class PopUpWindowBase(QWidget, Ui_PopUpWindow):
def __moveIn(self):
self.__playSound()
# 动画
- self.geometryAnimation = QPropertyAnimation(self, b"geometry")
self.geometryAnimation.setDuration(500)
self.geometryAnimation.setStartValue(self.geometry())
self.geometryAnimation.setEndValue(QRect(self.screenGeometry.width() - self.width() - 13, self.y(), self.width(), self.height()))
diff --git a/tests/test_pop_up_window.py b/tests/test_pop_up_window.py
index 1d549b74..55bdb73c 100644
--- a/tests/test_pop_up_window.py
+++ b/tests/test_pop_up_window.py
@@ -1,17 +1,40 @@
import sys
from time import sleep
-from PySide6.QtWidgets import QApplication
+from PySide6.QtWidgets import QApplication, QPushButton, QVBoxLayout, QWidget
from app.view.pop_up_window import FinishedPopUpWindow, ReceivedPopUpWindow
# noinspection PyUnresolvedReferences
import Res_rc
-app = QApplication(sys.argv)
-for i in range(10):
- ReceivedPopUpWindow.showPopUpWindow(f"")
- FinishedPopUpWindow.showPopUpWindow(r"F:\Class-Widget\audio\attend_class.wav")
+class TestPopUpWindow(QWidget):
+ def __init__(self):
+ super().__init__()
+ self.initUI()
-app.exec()
+ def initUI(self):
+ layout = QVBoxLayout()
+
+ received_button = QPushButton("Show Received PopUp")
+ received_button.clicked.connect(self.show_received_pop_up)
+ layout.addWidget(received_button)
+
+ finished_button = QPushButton("Show Finished PopUp")
+ finished_button.clicked.connect(self.show_finished_pop_up)
+ layout.addWidget(finished_button)
+
+ self.setLayout(layout)
+
+ def show_received_pop_up(self):
+ ReceivedPopUpWindow.showPopUpWindow(f"")
+
+ def show_finished_pop_up(self):
+ FinishedPopUpWindow.showPopUpWindow(r"F:\Class-Widget\audio\attend_class.wav")
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ test_window = TestPopUpWindow()
+ test_window.show()
+ app.exec()
\ No newline at end of file