66 from qfluentwidgets import NavigationItemPosition , Theme , setTheme
77
88 from one_dragon .base .operation .one_dragon_context import ContextInstanceEventEnum
9- from one_dragon .utils import app_utils
9+ from one_dragon .utils import app_utils , os_utils
1010 from one_dragon .utils .i18_utils import gt
1111 from one_dragon_qt .overlay .overlay_manager import OverlayManager
1212 from one_dragon_qt .services .styles_manager import OdQtStyleSheet
@@ -43,7 +43,11 @@ def __init__(self, ctx: ZContext, parent=None):
4343 def run (self ):
4444 launcher_version = app_utils .get_launcher_version ()
4545 code_version = self .ctx .git_service .get_current_version ()
46- versions = (launcher_version , code_version )
46+
47+ # 区分启动器类型:集成启动器(exe 打包运行)与源码启动器
48+ launch_tag = '集成' if os_utils .run_in_exe () else '源码'
49+
50+ versions = (launcher_version , code_version , launch_tag )
4751 self .get .emit (versions )
4852
4953 # 定义应用程序的主窗口类
@@ -61,11 +65,8 @@ def __init__(self, ctx: ZContext, parent=None):
6165 MainAppWindowBase .__init__ (
6266 self ,
6367 ctx = ctx ,
64- win_title = "%s %s"
65- % (
66- gt (ctx .project_config .project_name ),
67- ctx .one_dragon_config .current_active_instance .name ,
68- ),
68+ win_title = f"{ gt (ctx .project_config .project_name )} "
69+ f"{ ctx .one_dragon_config .current_active_instance .name } " ,
6970 project_config = ctx .project_config ,
7071 app_icon = "logo.ico" ,
7172 parent = parent ,
@@ -123,15 +124,21 @@ def create_sub_interface(self):
123124 self .add_sub_interface (HomeInterface (self .ctx , parent = self ))
124125
125126 # 游戏助手
126- from zzz_od .gui .view .game_assistant .game_assistant_interface import GameAssistantInterface
127+ from zzz_od .gui .view .game_assistant .game_assistant_interface import (
128+ GameAssistantInterface ,
129+ )
127130 self .add_sub_interface (GameAssistantInterface (self .ctx , parent = self ))
128131
129132 # 一条龙
130- from zzz_od .gui .view .one_dragon .zzz_one_dragon_interface import ZOneDragonInterface
133+ from zzz_od .gui .view .one_dragon .zzz_one_dragon_interface import (
134+ ZOneDragonInterface ,
135+ )
131136 self .add_sub_interface (ZOneDragonInterface (self .ctx , parent = self ))
132137
133138 # 应用运行
134- from zzz_od .gui .view .standalone .zzz_standalone_app_interface import ZStandaloneAppInterface
139+ from zzz_od .gui .view .standalone .zzz_standalone_app_interface import (
140+ ZStandaloneAppInterface ,
141+ )
135142 self .add_sub_interface (ZStandaloneAppInterface (self .ctx , parent = self ))
136143
137144 # 画中画
@@ -147,7 +154,9 @@ def create_sub_interface(self):
147154 )
148155
149156 # 开发工具
150- from zzz_od .gui .view .devtools .app_devtools_interface import AppDevtoolsInterface
157+ from zzz_od .gui .view .devtools .app_devtools_interface import (
158+ AppDevtoolsInterface ,
159+ )
151160 self .add_sub_interface (
152161 AppDevtoolsInterface (self .ctx , parent = self ),
153162 position = NavigationItemPosition .BOTTOM ,
@@ -161,14 +170,18 @@ def create_sub_interface(self):
161170 )
162171
163172 # 多账号管理
164- from zzz_od .gui .view .accounts .app_accounts_interface import AccountsInterface
173+ from zzz_od .gui .view .accounts .app_accounts_interface import (
174+ AccountsInterface ,
175+ )
165176 self .add_sub_interface (
166177 AccountsInterface (self .ctx , parent = self ),
167178 position = NavigationItemPosition .BOTTOM ,
168179 )
169180
170181 # 设置
171- from zzz_od .gui .view .setting .app_setting_interface import AppSettingInterface
182+ from zzz_od .gui .view .setting .app_setting_interface import (
183+ AppSettingInterface ,
184+ )
172185 self .add_sub_interface (
173186 AppSettingInterface (self .ctx , parent = self ),
174187 position = NavigationItemPosition .BOTTOM ,
@@ -194,21 +207,19 @@ def _on_instance_active_signal(self) -> None:
194207 :return:
195208 """
196209 self .setWindowTitle (
197- "%s %s"
198- % (
199- gt (self .ctx .project_config .project_name ),
200- self .ctx .one_dragon_config .current_active_instance .name ,
201- )
210+ f"{ gt (self .ctx .project_config .project_name )} "
211+ f"{ self .ctx .one_dragon_config .current_active_instance .name } "
202212 )
203213
204- def _update_version (self , versions : tuple [str , str ]) -> None :
214+ def _update_version (self , versions : tuple [str , str , str ]) -> None :
205215 """
206216 更新版本显示
207- @param ver:
217+ @param versions: (启动器版本, 代码版本, 启动器类型tag)
208218 @return:
209219 """
210220 self .titleBar .setLauncherVersion (versions [0 ])
211221 self .titleBar .setCodeVersion (versions [1 ])
222+ self .titleBar .setLaunchTag (versions [2 ])
212223
213224 def _check_first_run (self ):
214225 """首次运行时显示防倒卖弹窗"""
0 commit comments