From c990a4eb361fe8e77b2d69dfed3a26718277af61 Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Sun, 29 Jun 2025 01:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 ++-- ui/main.py | 8 ++++---- utils/function.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index cbb8e20..646d592 100644 --- a/main.py +++ b/main.py @@ -4,10 +4,10 @@ import module.resources from PySide6.QtWidgets import QApplication from ui.main import MainWindow -from utils.function import DEVELOPMENT_ENV +from utils.function import RELEASE_ENV if __name__ == '__main__': - if DEVELOPMENT_ENV: + if RELEASE_ENV: import pyi_splash pyi_splash.update_text('正在启动...') diff --git a/ui/main.py b/ui/main.py index d60ccb3..d71bd46 100644 --- a/ui/main.py +++ b/ui/main.py @@ -7,7 +7,7 @@ from ui.pyui.achievement_ui import AchievementWidget from ui.pyui.defense_ui import DefenseWidget from ui.pyui.picker_ui import PickerWidget from ui.pyui.test_ui import TestWidget -from utils.function import DEVELOPMENT_ENV +from utils.function import RELEASE_ENV class MainWindow(MSFluentWindow): @@ -21,7 +21,7 @@ class MainWindow(MSFluentWindow): self.defenseInterface = DefenseWidget('Defense Interface', self) self.aboutInterface = AboutWidget('About Interface', self) self.pickerInterface = PickerWidget('Picker Interface', self) - if not DEVELOPMENT_ENV: + if not RELEASE_ENV: self.testInterface = TestWidget('Test Interface', self) self.achievementInterface.error.connect(self.showError) @@ -35,7 +35,7 @@ class MainWindow(MSFluentWindow): self.addSubInterface(self.achievementInterface, FluentIcon.SPEED_HIGH, '达成度') self.addSubInterface(self.defenseInterface, FluentIcon.FEEDBACK, '答辩题目') self.addSubInterface(self.pickerInterface, FluentIcon.PEOPLE, '提问') - if not DEVELOPMENT_ENV: + if not RELEASE_ENV: self.addSubInterface(self.testInterface, FluentIcon.VIEW, '测试') self.addSubInterface(self.aboutInterface, FluentIcon.INFO, '关于', position=NavigationItemPosition.BOTTOM) @@ -53,7 +53,7 @@ class MainWindow(MSFluentWindow): def showEvent(self, event: QShowEvent): super().showEvent(event) - if DEVELOPMENT_ENV: + if RELEASE_ENV: import pyi_splash pyi_splash.update_text('正在加载...') pyi_splash.close() diff --git a/utils/function.py b/utils/function.py index ce6f12d..009d37a 100644 --- a/utils/function.py +++ b/utils/function.py @@ -222,4 +222,4 @@ def open_template(file_name: str, widget: QWidget) -> None: ) -DEVELOPMENT_ENV = getattr(sys, 'frozen', False) +RELEASE_ENV = getattr(sys, 'frozen', False)